Expert knowledge of SpecWeave framework structure, rules, conventions, and increment lifecycle. Deep understanding of source-of-truth discipline, increment naming, living docs sync. Covers SpecWeave-specific hooks (post-task-completion), and increment discipline. Activates for specweave rules, increment lifecycle, source of truth, increment naming, tasks.md format, spec.md structure, living docs sync, specweave hooks, where do files go, how to use specweave, specweave best practices, specweave conventions.
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
test-cases/test-1-increment-naming.yamltest-cases/test-2-source-of-truth.yamltest-cases/test-3-increment-discipline.yamltest-cases/test-4-file-placement.yamlI am an expert on the SpecWeave framework - a spec-driven development framework for Claude Code (and other AI coding assistants). I have deep knowledge of its structure, rules, conventions, and best practices.
SpecWeave follows spec-driven development with increment-based workflows:
An increment = a complete feature with:
spec.md - Product requirements (WHAT and WHY) — requiredplan.md - Technical architecture (HOW to implement) — optional, for complex features onlytasks.md - Task breakdown (WORK to do) — requiredmetadata.json - State tracking — requiredWhen to skip plan.md: Bug fixes, simple migrations, hotfixes, and straightforward tasks where spec.md already describes the approach.
CRITICAL: spec.md YAML frontmatter MUST include project (and board for 2-level structures):
# 1-level structure (single-project or multiProject):
---
increment: 0001-feature-name
project: my-project # REQUIRED
---
# 2-level structure (ADO area paths, JIRA boards, umbrella teams):
---
increment: 0001-feature-name
project: acme-corp # REQUIRED
board: digital-operations # REQUIRED for 2-level
---
Why? Ensures increment syncs to correct location in living docs. Without explicit project/board, sync-specs may fail or place specs in wrong folder.
Detection: Use src/utils/structure-level-detector.ts to determine if 1-level or 2-level structure is needed.
See: ADR-0190
CRITICAL RULE: All increments MUST use descriptive names, not just numbers!
Format: ####-descriptive-kebab-case-name
Examples:
0001-core-framework0002-core-enhancements0003-intelligent-model-selection0004-plugin-architecture0006-llm-native-i18n0003 (too generic, rejected!)0004 (no description, rejected!)Rationale:
1. Plan → /sw:inc "feature-name"
↓ PM agent creates spec.md, plan.md, tasks.md, tests.md
2. Execute → /sw:do
↓ Selects next task, executes, marks complete
3. Validate → /sw:validate 0001
↓ Checks spec compliance, test coverage
4. Close → /sw:done 0001
↓ Creates COMPLETION-SUMMARY.md, archives
THE IRON RULE: Cannot start increment N+1 until increment N is DONE!
Enforcement:
/sw:inc blocks if previous increments incomplete/sw:status to check all increments/sw:close to close incomplete work--force flag for emergencies (logged, should be rare)What "DONE" Means:
tasks.md marked [x] Completed, ORCOMPLETION-SUMMARY.md exists with "✅ COMPLETE" status, OR/sw:closeThree Options for Closing:
Example:
# Check status
/sw:status
# Shows: 0002 (73% complete), 0003 (50% complete)
# Try to start new increment
/sw:inc "0004-new-feature"
# ❌ Blocked! "Close 0002 and 0003 first"
# Close previous work
/sw:close
# Interactive: Choose force-complete, move tasks, or reduce scope
# Now can proceed
/sw:inc "0004-new-feature"
# ✅ Works! Clean slate
CRITICAL ARCHITECTURE RULE: SpecWeave ONLY supports root-level .specweave/ folders.
Correct Structure:
my-project/
├── .specweave/ ← ONE source of truth (root-level)
│ ├── increments/
│ │ ├── 0001-core-framework/
│ │ │ ├── spec.md
│ │ │ ├── plan.md
│ │ │ ├── tasks.md
│ │ │ ├── tests.md
│ │ │ ├── logs/ ← Session logs
│ │ │ ├── scripts/ ← Helper scripts
│ │ │ └── reports/ ← Analysis files
│ │ └── _backlog/
│ ├── docs/
│ │ ├── internal/ ← Strategic docs (NEVER published)
│ │ │ ├── strategy/ ← Business strategy
│ │ │ ├── architecture/ ← ADRs, RFCs, diagrams
│ │ │ └── delivery/ ← Implementation notes
│ │ └── public/ ← User-facing docs (can publish)
│ └── logs/
├── frontend/
├── backend/
└── infrastructure/
WRONG (nested .specweave/ folders - NOT SUPPORTED):
my-project/
├── .specweave/ ← Root level
├── backend/
│ └── .specweave/ ← ❌ NESTED - PREVENTS THIS!
└── frontend/
└── .specweave/ ← ❌ NESTED - PREVENTS THIS!
Why Root-Level Only?
Multi-Repo Solution: For huge projects with multiple repos, create a parent folder:
my-big-project/ ← Create parent folder
├── .specweave/ ← ONE source of truth for ALL repos
├── auth-service/ ← Separate git repo
├── payment-service/ ← Separate git repo
├── frontend/ ← Separate git repo
└── infrastructure/ ← Separate git repo
CRITICAL PRINCIPLE: SpecWeave has strict source-of-truth rules!
src/ ← SOURCE OF TRUTH (version controlled)
├── skills/ ← Source for skills
├── agents/ ← Source for agents
├── commands/ ← Source for slash commands
├── hooks/ ← Source for hooks
├── adapters/ ← Tool adapters (Claude/Cursor/Copilot/Generic)
└── templates/ ← Templates for user projects
.claude/ ← INSTALLED (gitignored in user projects)
├── skills/ ← Installed from src/skills/
├── agents/ ← Installed from src/agents/
├── commands/ ← Installed from src/commands/
└── hooks/ ← Installed from src/hooks/
.specweave/ ← FRAMEWORK DATA (always present)
├── increments/ ← Feature development
├── docs/ ← Strategic documentation
└── logs/ ← Logs and execution history
src/ (source of truth).claude/.claude/ directly (they get overwritten)Example Workflow:
# CORRECT: Edit source
vim src/skills/increment-planner/SKILL.md
# Sync to .claude/
npm run install:skills
# Test (skill activates from .claude/)
/sw:inc "test feature"
# WRONG: Edit installed file
vim .claude/skills/increment-planner/SKILL.md # ❌ Gets overwritten!
✅ ALLOWED in Root:
CLAUDE.md (this file)README.md, CHANGELOG.md, LICENSEpackage.json, tsconfig.json, .gitignore)dist/, only if needed temporarily)❌ NEVER Create in Root (pollutes repository): All AI-generated files MUST go into increment folders:
❌ WRONG:
/SESSION-SUMMARY-2025-10-28.md # NO!
/ADR-006-DEEP-ANALYSIS.md # NO!
/ANALYSIS-MULTI-TOOL-COMPARISON.md # NO!
✅ CORRECT:
.specweave/increments/0002-core-enhancements/
├── reports/
│ ├── SESSION-SUMMARY-2025-10-28.md
│ ├── ADR-006-DEEP-ANALYSIS.md
│ └── ANALYSIS-MULTI-TOOL-COMPARISON.md
├── logs/
│ └── execution-2025-10-28.log
└── scripts/
└── migration-helper.sh
Why?
Hooks are shell scripts that fire automatically on SpecWeave events:
post-task-completion - After EVERY task completion via TodoWritepre-task-plugin-detect - Before task execution (plugin detection)post-increment-plugin-detect - After increment creationpre-implementation - Before implementation startsFires: After EVERY TodoWrite call Purpose: Notify when work completes
What it does (v2.0):
.specweave/logs/hooks-debug.logWhat it does NOT do yet (planned for v0.6.1):
tasks.md completion statusSmart Session-End Detection:
Problem: Claude creates multiple todo lists → sound plays multiple times
Solution: Track inactivity gaps between TodoWrite calls
- Rapid completions (< 15s gap) = Claude still working → skip sound
- Long gap (> 15s) + all done = Session ending → play sound!
File: .specweave/config.json
{
"hooks": {
"post_task_completion": {
"enabled": true,
"update_tasks_md": false, // TODO: v0.6.1
"sync_living_docs": false, // TODO: v0.6.1
"play_sound": true,
"show_message": true
}
}
}
Until hooks are fully automated, YOU MUST:
CLAUDE.md when structure changesREADME.md for user-facing changesCHANGELOG.md for API changestasks.md completion status manually (or use TodoWrite carefully)Core Framework (always loaded):
Plugins (opt-in):
specweave-github - GitHub integration (issue sync, PR creation)specweave-jira - Jira integration (task sync)specweave-kubernetes - K8s deployment (planned)specweave-frontend-stack - React/Vue/Angular (planned)specweave-ml-ops - Machine learning (planned)Before plugins (v0.3.7):
After plugins (v0.4.0+):
Init-Time (during specweave init):
First Increment (during /sw:inc):
Pre-Task (before task execution):
Post-Increment (after completion):
SpecWeave plugins support dual distribution:
NPM Package (SpecWeave CLI):
npm install -g specweavespecweave plugin install githubClaude Code Marketplace (Native /plugin):
/plugin marketplace add https://github.com/anton-abyzov/specweave/plugin install specweave-githubPlugin Manifests (both required):
plugin.json - Claude Code native formatmanifest.json - SpecWeave custom format (richer metadata)SpecWeave works with multiple AI coding assistants:
.claude/ installationAGENTS.md compilation@context shortcuts.github/copilot/instructions.md compilationSPECWEAVE-MANUAL.md for copy-pasteRecommendation: Use Claude Code for SpecWeave. Other tools work, but you'll miss the magic.
/sw:inc "feature-name" - Plan new increment (PM-led process)/sw:do - Execute next task (smart resume)/sw:progress - Show progress, PM gate status, next action/sw:validate 0001 - Validate spec, tests, quality/sw:done 0001 - Close increment (PM validation)/sw:next - Auto-close if ready, suggest next work/sw:status - Show all increments and completion status/sw:close - Interactive closure of incomplete increments/sw:sync-docs review - Review strategic docs before implementation/sw:sync-docs update - Update living docs from completed increments/sw:sync-github - Bidirectional GitHub sync/sw:sync-jira - Bidirectional Jira syncA: Use /sw:inc "####-descriptive-name". It creates:
.specweave/increments/####-descriptive-name/
├── spec.md
├── plan.md
├── tasks.md
└── tests.md
A: In the increment's reports/ folder:
.specweave/increments/0002-core-enhancements/reports/
└── ANALYSIS-XYZ.md
A: Use /sw:progress or read .specweave/increments/####/tasks.md
A: NO! (v0.6.0+) The framework blocks you. Use /sw:status to check, /sw:close to close.
A: Edit in src/ (source of truth), then run npm run install:all to sync to .claude/
A: SpecWeave auto-detects! It will suggest plugins during init or increment creation.
A: Session-end detection! If all tasks complete AND you've been idle > 15s, it assumes you're done. Configurable in .specweave/config.json.
A: Edit hooks/hooks.json and set "enabled": false for that hook.
I activate when you ask about:
I focus on framework knowledge. For increment execution, use the PM agent and commands!
Let me help you understand and use SpecWeave correctly! 🚀