This document is the single source of truth for Shep AI’s spec-driven development workflow. All contributors (human and AI) must follow this workflow for feature development.
Shep-kit is our spec-driven development toolkit inspired by GitHub’s SpecKit. Every feature begins with a specification before any implementation code is written.
/shep-kit:new-feature → /shep-kit:research → /shep-kit:plan → /shep-kit:implement → /shep-kit:commit-pr
Starting with spec 011, YAML files are the source of truth for all spec artifacts. Markdown files are auto-generated from YAML and should not be edited manually.
| Source of Truth (edit these) | Generated (do not edit) |
|---|---|
spec.yaml |
spec.md |
research.yaml |
research.md |
plan.yaml |
plan.md |
tasks.yaml |
tasks.md |
feature.yaml |
(not generated) |
Each YAML file uses a content + metadata hybrid structure:
name, summary, technologies, openQuestions, etc.) that skills and scripts can read programmatically without parsing Markdown.content field — Raw Markdown body containing the human-written spec content. This preserves the full expressiveness of Markdown (tables, diagrams, code blocks).Example structure of a spec.yaml:
name: my-feature
number: 12
branch: feat/012-my-feature
oneLiner: Short description of the feature
summary: >
Longer summary spanning multiple lines.
phase: Research
sizeEstimate: M
technologies:
- TypeSpec
- Node.js
relatedFeatures:
- 008-agent-configuration
openQuestions: []
content: |
## Problem Statement
Description of the problem...
## Success Criteria
- Criterion one
- Criterion two
Two pnpm scripts support the YAML-first workflow:
pnpm spec:generate-md <feature-dir> — Reads all YAML spec files in a feature directory and generates corresponding Markdown files with YAML front matter + the content field body. Generated Markdown is committed to git for human readability in PRs.pnpm spec:validate <feature-dir> — Validates spec quality gates against YAML data: completeness (required files/keys, open questions resolved), architecture compliance (TDD phases, TypeSpec references), and cross-document consistency (task counts, dependency validation).Note: Specs 001-010 remain in their original Markdown format. Only specs 011+ use the YAML-first approach.
specs/ # Root-level spec directory
├── 001-feature-name/ # Legacy (Markdown-first, specs 001-010)
│ ├── spec.md # Requirements & scope
│ ├── research.md # Technical decisions
│ ├── plan.md # Implementation strategy
│ ├── tasks.md # Task breakdown
│ ├── feature.yaml # Status tracking
│ ├── data-model.md # Entity changes (if needed)
│ └── contracts/ # API specs (if needed)
├── 011-feature-name/ # YAML-first (specs 011+)
│ ├── spec.yaml # Requirements & scope (SOURCE OF TRUTH)
│ ├── research.yaml # Technical decisions (SOURCE OF TRUTH)
│ ├── plan.yaml # Implementation strategy (SOURCE OF TRUTH)
│ ├── tasks.yaml # Task breakdown (SOURCE OF TRUTH)
│ ├── feature.yaml # Status tracking
│ ├── spec.md # Auto-generated from spec.yaml
│ ├── research.md # Auto-generated from research.yaml
│ ├── plan.md # Auto-generated from plan.yaml
│ ├── tasks.md # Auto-generated from tasks.yaml
│ ├── data-model.md # Entity changes (if needed)
│ └── contracts/ # API specs (if needed)
└── ...
/shep-kit:new-feature)Trigger: Starting any new feature, functionality, or enhancement.
What happens:
feat/NNN-feature-name created from mainpnpm spec:generate-mdOutput: specs/NNN-feature-name/spec.yaml (source of truth) + spec.md (auto-generated)
/shep-kit:research)Trigger: After spec.yaml is complete, before planning.
What happens:
spec.yaml to understand requirements (metadata fields + content)research.yamlOutput: specs/NNN-feature-name/research.yaml (source of truth) + research.md (auto-generated)
/shep-kit:plan)Trigger: After research is complete, before implementation.
CRITICAL TDD REQUIREMENT: Plans MUST follow Test-Driven Development with RED-GREEN-REFACTOR cycles for all implementation phases.
What happens:
spec.yaml and research.yamltasks.yamlOutput:
specs/NNN-feature-name/plan.yaml - Architecture and TDD-compliant strategy (source of truth)specs/NNN-feature-name/tasks.yaml - TDD task breakdown (source of truth)specs/NNN-feature-name/plan.md + tasks.md - Auto-generated Markdownspecs/NNN-feature-name/data-model.md - Entity changes (if needed)/shep-kit:implement)Trigger: After plan and tasks are complete, ready to write code.
What happens:
Pre-Implementation Validation Gate (automatic):
pnpm spec:validate against the YAML spec filesopenQuestions resolved)plan.yaml)plan.yaml and tasks.yaml, no contradictions)Smart Session Resumption:
feature.yaml to determine current stateAutonomous Task Execution:
tasks.yaml sequentiallyfeature.yaml after each task completionError Handling:
feature.yaml with error stateCompletion:
feature.yaml (phase: “ready-for-review”)Output:
feature.yaml with progress trackingStatus Tracking: feature.yaml is updated continuously throughout implementation. See feature.yaml Protocol for details.
Full Guide: See Implementation Guide for detailed manual implementation instructions (if not using :implement skill).
/shep-kit:commit-pr)Trigger: After implementation is complete, ready to submit for review.
What happens:
gh pr createfeature.yaml (phase: “in-review”, add PR URL)gh run watch --exit-statusgh apiNote: After CI passes, the skill autonomously watches for Claude Code bot and human reviewer comments. It fetches reviews from all GitHub API sources, classifies comments as actionable or non-actionable, applies fixes, and loops until the PR is approved or no actionable feedback remains. See the feature.yaml Protocol for review loop state tracking.
Output: Pull request approved (or ready for manual review if max iterations reached)
/shep-kit:merged)Trigger: After PR is merged to main.
What happens:
feature.yaml (phase: “complete”, add merge timestamp)Output: Clean workspace, feature marked as complete
All spec artifacts (except feature.yaml and data-model.md) use the content + metadata hybrid YAML format. Each YAML file contains:
openQuestions, technologies, tasks)content field — a raw Markdown string containing the human-written spec bodyWhen Markdown is generated (via pnpm spec:generate-md), the metadata fields become YAML front matter and the content field becomes the Markdown body.
Core requirements document. Metadata fields:
name, number, branch, oneLiner, summaryphase (current SDLC lifecycle phase)sizeEstimate (S/M/L/XL)technologies, relatedFeatures, relatedLinksopenQuestions (array of {question, resolved, answer?})The content field contains: problem statement, success criteria, affected areas, dependencies.
Technical decisions document. Metadata fields:
name, summarydecisions (array of {title, chosen, rejected[], rationale})technologies, relatedFeatures, relatedLinksopenQuestionsThe content field contains: detailed analysis, library comparisons, security/performance considerations.
Implementation strategy. Metadata fields:
name, summaryphases (array of {id, name, parallel, taskIds[]})filesToCreate, filesToModifytechnologies, relatedFeatures, relatedLinksopenQuestionsThe content field contains: architecture diagrams, phase descriptions with TDD cycles, risk mitigation, rollback plan.
Actionable task list. Metadata fields:
name, summary, totalEstimatetasks (array of structured task objects, each with):
id, title, description, state, dependencies[]acceptanceCriteria[]tdd: {red[], green[], refactor[]} — explicit TDD cycle stepsestimatedEfforttechnologies, relatedFeatures, relatedLinksopenQuestionsThe content field contains: task descriptions grouped by phase with TDD structure, parallelization markers [P], acceptance checklist.
Note: tasks.yaml is the source of truth for task definitions. feature.yaml tracks execution status only.
Machine-readable status tracking containing:
Updated by ALL shep-kit skills as work progresses. See feature.yaml Protocol.
Note: feature.yaml does NOT use the content + metadata hybrid pattern. It is purely structured YAML for status tracking.
Entity changes (when needed) containing:
feat/NNN-feature-namespecs/NNN-feature-name/user-authentication, payment-integration)The next number is determined by scanning existing specs/ directories.
When creating a new spec, the agent scans all existing spec files (specs/*/spec.yaml for YAML-first specs, specs/*/spec.md for legacy specs) to:
relatedFeatures metadata in YAML specs)/shep-kit:new-featurespec.yaml, research.yaml, etc.) — never edit auto-generated Markdownpnpm spec:generate-md after editing YAML to regenerate Markdownpnpm spec:validate before implementation to catch issues earlySpec-driven development integrates with our existing practices:
| Existing Practice | Integration |
|---|---|
| TDD (MANDATORY) | Plan phase MANDATES RED-GREEN-REFACTOR cycles; tasks.yaml breaks down TDD phases explicitly |
| Clean Architecture | Spec identifies which layers are affected; each layer has TDD cycle |
| TypeSpec models | Spec artifacts are defined as TypeSpec entities; data-model.md defines entity changes for tsp/ |
| Conventional Commits | Spec commits: feat(specs): add NNN-feature-name specification |
| PR Process | PRs reference their spec directory; auto-generated Markdown ensures readability in GitHub |
| YAML-first | YAML is source of truth; pnpm spec:validate replaces fragile grep/awk validation in skill prompts |
Skills are located at:
.claude/skills/
├── shep-kit:new-feature/
│ ├── SKILL.md
│ ├── templates/
│ ├── examples/
│ └── scripts/
├── shep-kit:research/
│ ├── SKILL.md
│ ├── templates/
│ └── examples/
├── shep-kit:plan/
│ ├── SKILL.md
│ ├── templates/
│ └── examples/
├── shep-kit:implement/ # NEW
│ ├── SKILL.md
│ ├── validation/
│ └── examples/
├── shep-kit:commit-pr/
│ └── SKILL.md
└── shep-kit:merged/
└── SKILL.md
| Command | Purpose | Output (YAML source + generated MD) |
|---|---|---|
/shep-kit:new-feature |
Start new feature | Branch + spec.yaml + spec.md |
/shep-kit:research |
Technical analysis | research.yaml + research.md |
/shep-kit:plan |
Implementation plan | plan.yaml + tasks.yaml + generated .md files |
/shep-kit:implement |
Autonomous implementation | Code + passing tests + updated feature.yaml |
/shep-kit:commit-pr |
Commit, push, PR, watch CI | Pull request (CI green) |
/shep-kit:merged |
Post-merge cleanup | Clean workspace |
| Script | Purpose |
|---|---|
pnpm spec:generate-md |
Generate Markdown from YAML spec files |
pnpm spec:validate |
Validate spec quality gates against YAML data |
Update when:
Related docs: