Skip to main content

Commands Overview

SpecWeave provides slash commands for every stage of your development workflow. This page covers the main workflow commands you'll use daily.

No Shortcuts

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:

  1. Clarity (18% weight)
  2. Testability (22% weight)
  3. Completeness (18% weight)
  4. Feasibility (13% weight)
  5. Maintainability (9% weight)
  6. Edge Cases (9% weight)
  7. 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 incrementCloses AND suggests next
Requires increment IDAuto-detects active increment
Manual next stepIntelligent recommendations
Single actionComplete 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โ€‹

SpecWeave provides intuitive git-style commands for external tool synchronization:

PlatformPullPushSync
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:

  1. /sw:increment - Plan (START HERE)
  2. /sw:do - Implement (MAIN WORK)
  3. /sw:progress - Check status (VISIBILITY)
  4. /sw:qa - Validate quality (QUALITY GATE)
  5. /sw:done - Close (FINISH)
  6. /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
}
}

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:

View full glossary โ†’


Next Stepsโ€‹


Philosophy:

SpecWeave commands are designed for intelligent automation. The system detects intent, suggests actions, and handles workflow management - you focus on building.