Commands Overview
SpecWeave provides slash commands for every stage of your development workflow. This page covers the main workflow commands you'll use daily.
All commands MUST use the /sw:* namespace prefix. Shortcuts like /inc, /do, /pause, /resume (without the namespace) conflict with Claude Code's native commands and other repositories.
The Core Workflowโ
Pro tip: Use /sw:next instead of /sw:done โ it auto-closes and suggests next work!
1. Planning Commandsโ
/sw:increment - Create New Incrementโ
Most frequently used command - Start every new feature here.
/sw:increment "User authentication with JWT"
/sw:increment "Payment processing with Stripe"
/sw:increment "Real-time notifications"
What it does:
- ๐ Detects tech stack automatically
- ๐ PM-led planning (market research, spec.md, plan)
- โ Auto-generates tasks.md from plan
- ๐งช Creates test strategy
- ๐ฅ Strategic agent review (Architect, Security, QA, Tech Lead)
See: ADR (Architecture Decision Records) for design decisions made during planning.
Reference: Command Decision Tree for workflow guidance.
2. Implementation Commandsโ
/sw:do - Execute Tasksโ
Smart auto-resume - Continue from where you left off.
/sw:do # Auto-finds active increment
/sw:do 0007 # Specific increment
What it does:
- ๐ฏ Resumes from last incomplete task
- ๐ Plays sound after each task (via hooks)
- ๐ Updates docs inline (CLAUDE.md, README.md, CHANGELOG)
- ๐ Syncs to GitHub (if plugin enabled)
- ๐งช Runs tests continuously
Key Features:
- Cost optimization: Uses Haiku for simple tasks (3x faster, 20x cheaper)
- Automatic hooks: Runs after EVERY task completion
- Living docs sync: Updates
.specweave/docs/after all tasks complete
/sw:context - Load Living Docs Context โญ NEWโ
Load relevant context before implementing - Uses progressive disclosure.
/sw:context authentication # Load auth-related docs
/sw:context "payment flow" # Load payment-related docs
/sw:context # Show available topics
What it does:
- ๐ Searches living docs in
.specweave/docs/internal/ - ๐ Loads relevant specs, ADRs, and architecture docs
- ๐ก Injects context into current conversation
- ๐ฏ No RAG needed - uses Claude's native file reading
Use cases:
- Before implementing a feature (check existing patterns)
- When making architecture decisions (check existing ADRs)
- When onboarding (understand current system)
How it works:
# Internally runs:
grep -ril "auth" .specweave/docs/internal/
# Finds relevant files, reads them, synthesizes context
See also: Who Benefits from Living Docs
3. Quality Assurance Commandsโ
/sw:validate - Rule-Based Validationโ
120+ checks - Fast, free validation.
/sw:validate 0007
/sw:validate 0007 --quality # Include AI assessment
/sw:validate 0007 --export # Export suggestions to tasks.md
What it validates:
- โ Consistency (spec โ plan โ tasks)
- โ Completeness (all required sections)
- โ Quality (testable criteria, actionable tasks)
- โ Traceability (AC-IDs, ADR references)
/sw:qa - Quality Assessment with Risk Scoringโ
Comprehensive quality gate - AI-powered assessment with quantitative risk scoring (Probability ร Impact).
/sw:qa 0007 # Quick mode (default)
/sw:qa 0007 --pre # Before starting work
/sw:qa 0007 --gate # Before closing increment
/sw:qa 0007 --export # Export blockers to tasks.md
7 Quality Dimensions:
- Clarity (18% weight)
- Testability (22% weight)
- Completeness (18% weight)
- Feasibility (13% weight)
- Maintainability (9% weight)
- Edge Cases (9% weight)
- Risk Assessment (11% weight)
Quality Gate Decisions:
- ๐ข PASS - Ready to proceed
- ๐ก CONCERNS - Should fix before release
- ๐ด FAIL - Must fix before proceeding
Risk Scoring (Probability ร Impact method):
- CRITICAL (โฅ9.0) - Immediate action required
- HIGH (6.0-8.9) - Address before release
- MEDIUM (3.0-5.9) - Monitor
- LOW (<3.0) - Acceptable
/sw:check-tests - Test Coverage Checkโ
/sw:check-tests 0007
What it checks:
- ๐ Per-task coverage (unit, integration, E2E)
- โ AC-ID coverage (all acceptance criteria tested)
- ๐ฏ Overall coverage vs target (80-90%)
- ๐ Missing tests and recommendations
4. Completion Commandsโ
/sw:next - Smart Workflow Transitionโ
The flow command - Auto-close current work, suggest next.
/sw:next
What it does:
- ๐ Validates current increment (3 gates: tasks, tests, docs)
- ๐ฏ Auto-closes if all gates pass
- ๐ Runs post-closure quality assessment
- ๐ก Suggests next work (backlog or new feature)
Why use /sw:next instead of /sw:done:
/sw:done | /sw:next |
|---|---|
| Closes increment | Closes AND suggests next |
| Requires increment ID | Auto-detects active increment |
| Manual next step | Intelligent recommendations |
| Single action | Complete workflow transition |
Example:
/sw:next
๐ Checking current increment...
Active: 0007-user-authentication
๐ PM Validation:
โ
Gate 1: All tasks complete (15/15)
โ
Gate 2: Tests passing (87% coverage)
โ
Gate 3: Docs updated
๐ฏ Auto-closing increment 0007...
โ Quality score: 87/100 (GOOD)
๐ Increment 0007 closed!
๐ฏ Next: 0008-payment-processing (P1, ready to start)
Run: /sw:do 0008
/sw:done - Close Incrementโ
PM validation before closing - Ensures quality gates pass.
/sw:done 0007
What it does:
- โ Validates all tasks complete
- โ
Runs
/sw:qa --gate(quality gate check) - โ PM agent validates completion
- โ Creates completion report
- ๐ Closes GitHub issues (if plugin enabled)
/sw:sync-docs - Synchronize Living Documentationโ
Strategic docs sync - Review before implementation, export learnings after.
/sw:sync-docs review # Before implementation (review strategic docs)
/sw:sync-docs update # After implementation (update with learnings)
What it syncs:
- ๐ ADRs (Proposed โ Accepted)
- ๐๏ธ Architecture diagrams (planned โ actual)
- ๐ API documentation (contracts โ endpoints)
- ๐ Feature lists (planned โ completed)
5. Sync & Repository Commandsโ
/sw:save - Save Changes Across Repositoriesโ
One command for git operations - Works for single repos and multi-repo umbrella setups.
# Auto-generate commit message
/sw:save
# With explicit message
/sw:save "feat: Add user authentication"
# Dry run (preview)
/sw:save --dry-run
What it does:
- ๐ Analyzes changes to auto-generate commit message
- ๐ Detects all repos (umbrella or single)
- โก Commits and pushes to all repos with one command
- ๐ง Sets up remotes if missing
Options:
--dry-run- Preview without executing--repos <list>- Specific repos only--yes/-y- Accept auto-message without prompt--no-push- Commit only, don't push
/sw:sync-specs - Sync Specs to Living Docsโ
Quick specs-only sync - Updates user stories and features only.
/sw:sync-specs 0007
/sw:sync-specs --dry-run
What it syncs:
- User stories to
.specweave/docs/internal/specs/ - Feature documentation
- Bidirectional task links
When to use: After making changes to spec.md and wanting quick sync.
/sw:sync-progress - Sync to External Toolsโ
Full external sync - Updates all connected platforms.
/sw:sync-progress
/sw:sync-progress 0007
What it syncs:
- Living docs (user stories, features)
- GitHub Issues (checkboxes, comments)
- JIRA (if configured)
- Azure DevOps (if configured)
/sw:validate-status - Fix Status Lineโ
Validate and auto-fix status line desync.
/sw:validate-status
What it checks:
- Task count matches frontmatter
- Cache matches tasks.md reality
- Percentage calculations correct
When to use: Status line shows wrong percentage, after manual edits, after git conflicts.
/sw:workflow - Dashboard Viewโ
Complete workflow navigator - Shows phase, status, and next steps.
/sw:workflow
/sw:workflow 0007
What it shows:
- Current phase (Planning, Implementing, Review, etc.)
- Task and AC completion
- External tools status
- Living docs status
- Suggested next actions
6. Monitoring Commandsโ
/sw:progress - Check Increment Progressโ
/sw:progress
/sw:progress 0007
What it shows:
- ๐ Task completion (15/42 tasks, 36%)
- โฑ๏ธ Time tracking (1.2 weeks elapsed, 2.1 weeks remaining)
- ๐ฏ Current phase and next phase
- โ Recent completions
- ๐ Upcoming tasks
All Available Commandsโ
Essential Workflow (Use These!)โ
/sw:increment- Plan new increment โญ START HERE/sw:context- Load living docs context โญ CONTEXT (NEW)/sw:do- Execute tasks โญ MAIN WORK/sw:next- Smart workflow transition โญ FLOW COMMAND (auto-close + suggest next)/sw:progress- Check status โญ VISIBILITY/sw:validate- Quick validation โญ PRE-CHECK/sw:qa- Quality assessment โญ QUALITY GATE/sw:check-tests- Test coverage check โญ TEST VALIDATION/sw:done- Close increment โญ FINISH/sw:sync-docs- Synchronize living docs โญ KEEP DOCS CURRENT/sw:sync-specs- Sync specs only โญ QUICK SPEC SYNC/sw:sync-progress- Sync to external tools โญ EXTERNAL SYNC/sw:save- Save & push to all repos โญ MULTI-REPO GIT/sw:workflow- Dashboard view โญ NAVIGATION
State Managementโ
/sw:pause- Pause active increment/sw:resume- Resume paused/backlog increment/sw:abandon- Abandon incomplete increment/sw:backlog- Move increment to backlog/sw:reopen- Reopen completed increment
Status & Monitoringโ
/sw:status- Show all increments overview/sw:jobs- Show background jobs and increment status/sw:sync-monitor- Sync orchestration dashboard/sw:sync-logs- Query sync audit logs/sw:notifications- View sync notifications/sw:sync-status- Fix metadata/spec status desyncs/sw:update-status- Force-update status line cache
TDD Workflowโ
/sw:tdd-red- Write failing tests (TDD red phase)/sw:tdd-green- Make tests pass (TDD green phase)/sw:tdd-refactor- Refactor with test safety net/sw:tdd-cycle- Full TDD red-green-refactor cycle
Brownfield & Documentationโ
/sw:discrepancies- View code-to-spec discrepancies/sw:discrepancy-to-increment- Convert discrepancy to increment/sw:import-docs- Import brownfield documentation/sw:import-external- Import external work items/sw:living-docs- Launch Living Docs Builder/sw:organize-docs- Smart documentation organization/sw:validate-features- Validate feature folder consistency
Archiving & Cleanupโ
/sw:archive- Archive completed increments/sw:restore- Restore archived increments/sw:archive-features- Archive features/epics/sw:restore-feature- Restore features/epics/sw:fix-duplicates- Resolve duplicate increments
Advanced Commandsโ
/sw:judge-llm- Ultrathink LLM-as-Judge validation/sw:check-hooks- Health check for hooks/sw:embed-acs- Embed ACs from living docs into spec.md/sw:plan- Generate plan.md using Architect Agent/sw:translate- Batch translation/sw:migrate-config- Migrate config format
External Tool Sync (Git-Style)โ
/sw-github:pull- Pull changes from GitHub โญ GIT-STYLE/sw-github:push- Push progress to GitHub โญ GIT-STYLE/sw-github:sync- Two-way sync with GitHub/sw-github:create- Create GitHub issue from increment/sw-github:close- Close GitHub issue when done/sw-github:status- Check GitHub sync status/sw-ado:pull- Pull changes from Azure DevOps โญ GIT-STYLE/sw-ado:push- Push progress to Azure DevOps โญ GIT-STYLE/sw-ado:sync- Two-way sync with Azure DevOps/sw-jira:pull- Pull changes from JIRA โญ GIT-STYLE/sw-jira:push- Push progress to JIRA โญ GIT-STYLE/sw-jira:sync- Two-way sync with JIRA
Workflow Example: Standard Feature Developmentโ
# 1. Plan new feature
/sw:increment "User authentication"
# โ Creates: spec.md, plan.md, tasks.md
# 2. Load context (recommended)
/sw:context authentication
# โ Loads existing auth specs, ADRs, patterns
# 3. Review docs (optional)
/sw:sync-docs review
# โ Review strategic docs before starting
# 4. Pre-check quality (optional)
/sw:qa 0007 --pre
# โ Pre-implementation quality check
# 5. Implement tasks
/sw:do 0007
# โ Auto-resumes from last task, hooks fire after each completion
# 6. Check progress
/sw:progress 0007
# โ See completion status
# 7. Validate quality
/sw:qa 0007 --gate
# โ Comprehensive quality gate check
# 8. Check test coverage
/sw:check-tests 0007
# โ Validate all AC-IDs are tested
# 9. Close increment
/sw:done 0007
# โ PM validates and closes
# 10. Update living docs
/sw:sync-docs update
# โ Sync learnings to strategic docs
Integration with External Toolsโ
Git-Style Commands (Recommended)โ
SpecWeave provides intuitive git-style commands for external tool synchronization:
| Platform | Pull | Push | Sync |
|---|---|---|---|
| GitHub | /sw-github:pull | /sw-github:push | /sw-github:sync |
| Azure DevOps | /sw-ado:pull | /sw-ado:push | /sw-ado:sync |
| JIRA | /sw-jira:pull | /sw-jira:push | /sw-jira:sync |
Basic Usageโ
# Pull latest changes from external tool
/sw-github:pull
/sw-ado:pull
/sw-jira:pull
# Push your progress to external tool
/sw-github:push
/sw-ado:push
/sw-jira:push
# Two-way sync (both directions)
/sw-github:sync 0007
/sw-ado:sync 0007
/sw-jira:sync 0007
Multi-Project Sync Optionsโ
# Pull ALL specs across ALL projects (living docs sync)
/sw-github:pull --all
/sw-ado:pull --all
/sw-jira:pull --all
# Pull specific project only
/sw-ado:pull --project clinical-insights
/sw-jira:pull --project BACKEND
# Pull specific feature hierarchy
/sw-github:pull --feature FS-042
/sw-ado:pull --feature FS-042
Sync Brief Outputโ
After every sync operation, you'll see a compact summary:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PULL COMPLETE โ ADO โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Scanned: 47 specs across 3 projects โ
โ Updated: 7 specs โ
โ Conflicts: 2 (resolved: external wins) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ CHANGES APPLIED โ
โ โ Status changes: 4 โ
โ โ Priority changes: 2 โ
โ + Comments imported: 8 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Symbols: โ = pulled (incoming), โ = pushed (outgoing), โ = success
Other GitHub Commandsโ
# Create GitHub issue from increment
/sw-github:create 0007
# Check sync status
/sw-github:status 0007
# Close GitHub issue when done
/sw-github:close 0007
Other Azure DevOps Commandsโ
# Create ADO work item from increment
/sw-ado:create 0007
# Check sync status
/sw-ado:status 0007
# Close work item when done
/sw-ado:close 0007
Automatic sync: When external tool plugins are enabled, /sw:do and /sw:done automatically sync to the configured platforms.
Best Practicesโ
1. Follow the Core Flowโ
Always use the standard workflow for best results:
/sw:increment- Plan (START HERE)/sw:do- Implement (MAIN WORK)/sw:progress- Check status (VISIBILITY)/sw:qa- Validate quality (QUALITY GATE)/sw:done- Close (FINISH)/sw:sync-docs- Update docs (KEEP CURRENT)
2. Validate Early and Oftenโ
# Before starting work
/sw:qa 0007 --pre
# Before closing
/sw:qa 0007 --gate
3. Check Test Coverageโ
# Always validate tests before closing
/sw:check-tests 0007
4. Keep Living Docs Currentโ
# After completing increment
/sw:sync-docs update
Configurationโ
All commands respect .specweave/config.json:
{
"limits": {
"maxActiveIncrements": 1,
"hardCap": 2
},
"validation": {
"quality_judge": {
"enabled": true,
"always_run": false
}
},
"language": "en",
"translation": {
"enabled": true,
"autoTranslateInternalDocs": true
}
}
Glossary Linksโ
Understanding SpecWeave terminology (see full glossary):
- ADR - Architecture Decision Records
- RFC - Request for Comments (specification format)
- API - Application Programming Interface
- E2E - End-to-End Testing
- Node.js - JavaScript runtime
- REST - RESTful API pattern
- GraphQL - Query language for APIs
- Microservices - Distributed architecture pattern
- IaC - Infrastructure as Code
SpecWeave-Specific Terms:
- Increments - Work units in SpecWeave
- spec.md - Specification file format
- plan.md - Architecture plan format
- tasks.md - Task tracking format
- PM Agent - Product Manager agent
- Architect Agent - System design agent
- Quality Gate - Validation checkpoints
- WIP Limits - Work-in-progress limits
Next Stepsโ
- Getting Started: Quick Start Guide
- Workflow Guide: Complete Development Workflow
- Quality Gates: Quality Assurance Guide
- GitHub Integration: GitHub Sync Guide
Philosophy:
SpecWeave commands are designed for intelligent automation. The system detects intent, suggests actions, and handles workflow management - you focus on building.