Philosophy
SpecWeave is built on a set of core principles that guide every design decision. Understanding these principles will help you get the most out of the framework.
Core Principlesβ
1. Specification Before Implementationβ
Define WHAT and WHY before HOW.
Traditional development often jumps straight to implementation without clear specifications. This leads to:
- Unclear requirements
- Scope creep
- Missing features
- Undocumented systems
SpecWeave enforces specification-first development:
``` Specification β Architecture β Implementation β Testing ```
2. Append-Only Snapshots + Living Documentationβ
Historical audit trails + current state = complete context.
SpecWeave's revolutionary approach: Most documentation systems force you to choose between historical context (version control) or current documentation (wikis). SpecWeave gives you BOTH simultaneously.
The Dual-Documentation Systemβ
Append-Only Increments (Never Modified)
- Each increment is an immutable snapshot of a feature
- Contains: spec, plan, tasks, tests, logs, reports
- Provides complete audit trail and historical context
- Like Git commits for specifications
Living Documentation (Always Current)
- Auto-updated by Claude hooks after each task
- Reflects actual code state
- Organized by purpose (strategy, architecture, operations)
- Single source of truth for current system
Why Both Are Essentialβ
| Need | Source | Example |
|---|---|---|
| "Why was this built?" | Increment snapshot | .specweave/increments/0001-feature/spec.md |
| "What's the current state?" | Living docs | .specweave/docs/internal/strategy/feature.md |
| "How did it evolve?" | All related increments | Search increments 0001, 0005, 0012 |
| "Compliance proof?" | Increment audit trail | Complete snapshots with timestamps |
Key Propertiesβ
- Append-only increments: Never modified after completion (like event sourcing)
- Auto-updated docs: Hooks maintain current state automatically
- Version controlled: Both stored in Git
- Searchable: Find historical context or current state
- Audit-ready: Complete paper trail for compliance (SOC 2, HIPAA, FDA)
- Context recovery: Understand decisions from months/years ago
Think of it as "Git for Specifications":
- Increments = commits (snapshots in time)
- Living docs = working directory (current state)
- Both essential for different purposes
3. Context Precisionβ
Load only what's needed (70%+ token reduction).
Loading entire specifications wastes tokens and money. SpecWeave uses:
- Selective loading: Load specific sections
- Context manifests: Declare required context
- Cache-friendly: Reuse frequently-loaded context
- Scalable: Works with 10 pages or 1000+ pages
4. Test-Validated Featuresβ
Every feature proven through automated tests.
Four levels of testing ensure quality:
- Specification acceptance criteria (AC-IDs like AC-US1-01)
- Feature test strategy (embedded in tasks.md, v0.7.0+)
- Skill test cases (YAML)
- Code tests (E2E, unit, integration)
Truth-telling requirement: E2E tests MUST tell the truthβno false positives.
5. Regression Preventionβ
Document existing code before modification.
Modifying brownfield code without documentation is dangerous. SpecWeave enforces:
- Analyze current implementation
- Generate retroactive documentation
- Create baseline tests
- User reviews and approves
- Implement modifications safely
6. Scalable from Solo to Enterpriseβ
Modular structure that grows with project size.
Whether you're a solo developer or a 100-person team, SpecWeave scales:
- Solo/Startup: Start with 10-20 pages, grow incrementally
- Enterprise: Create 500-600+ pages upfront
- Both approaches supported: Comprehensive or incremental
7. Auto-Role Routingβ
Skills detect expertise automatically.
No manual agent selectionβSpecWeave routes intelligently:
``` User: "Create payment integration" β specweave-detector activates β Routes to increment-planner β Invokes PM, Architect, Security agents β Generates complete specification ```
90% routing accuracy.
8. Closed-Loop Validationβ
E2E tests must tell the truth (no false positives).
Test validation is not enoughβtests must be truthful:
- β If test passes β feature actually works
- β If test fails β exactly what failed
- β No masking failures
- β No assuming success without verification
Design Decisionsβ
Why Markdown?β
Human-readable, version-controllable, AI-friendly.
- Git-friendly (easy diffs)
- Tooling-agnostic (works anywhere)
- Readable without rendering
- AI can parse and generate
- Supports Mermaid diagrams
- No vendor lock-in
Why Mermaid Diagrams?β
Diagrams-as-code, version controlled, maintainable.
- Text-based (git-friendly)
- No binary files
- Easy to update
- Renders beautifully
- C4 Model support
- No external tools required
Why C4 Model?β
Industry-standard architecture visualization.
- Clear hierarchy (Context β Container β Component β Code)
- Scales to enterprise systems
- Well-documented methodology
- Tool support (Mermaid, PlantUML, Structurizr)
- Familiar to architects
Why Auto-Numbering?β
Prevents merge conflicts, maintains order.
- Increments:
0001-feature-name - ADRs:
0001-decision-title.md - RFCs:
0001-proposal-title.md - Test cases:
TC-0001
No manual numbering = no conflicts.
Why Framework-Agnostic?β
Works with ANY tech stack.
SpecWeave doesn't impose technology choices:
- Detects your stack (TypeScript, Python, Go, etc.)
- Adapts commands to your framework
- Generates stack-specific examples
- No vendor lock-in
Why Claude Code?β
Best AI coding assistant for production software.
- Opus 4.5: Best-in-class for coding and complex agents
- Agentic workflows: Multi-agent orchestration
- Tool use: Read, Write, Edit, Bash, etc.
- Context awareness: Large context window
- Production-ready: Not a toy
Documentation Approachesβ
SpecWeave supports TWO valid approaches:
Approach 1: Comprehensive Upfront (Enterprise)β
When to use:
- Enterprise systems with complex requirements
- Regulated industries (healthcare, finance, government)
- Large teams (10+ developers)
- Production systems requiring complete spec before implementation
Characteristics:
- 500-600+ page specifications created before development
- Complete architecture documentation upfront
- All ADRs documented in advance
Benefits:
- Complete clarity before code is written
- Easier team coordination
- Better for regulated environments
Approach 2: Incremental/Evolutionary (Startup)β
When to use:
- Startups with evolving requirements
- Exploratory projects
- Small teams (1-5 developers)
- MVPs and prototypes
Characteristics:
- Start with high-level overview (10-20 pages)
- Build documentation as you go (like Microsoft)
- Add modules/specs as features are planned
Benefits:
- Faster time-to-first-code
- Adapts to changing requirements
- Less documentation maintenance
Both approaches are equally valid! Choose based on your project needs.
Workflow Philosophyβ
Greenfield Projectsβ
- Choose documentation approach (comprehensive or incremental)
- Create specifications (strategy docs)
- Design architecture (ADRs, system design)
- Plan increments
- Implement with context precision
- Tests validate automatically
Brownfield Projectsβ
- Step 0: Merge existing CLAUDE.md (if exists)
- Step 1: Analyze existing code
- Step 2: Document related modules
- Step 3: Create tests for current behavior
- Step 4: Plan modifications
- Step 5: Implement with regression monitoring
Anti-Patternsβ
β What SpecWeave Preventsβ
- Vibe Coding: Implementing without specifications
- Documentation Divergence: Code and docs out of sync
- Context Bloat: Loading entire specs unnecessarily
- Regression Bugs: Modifying code without tests
- Tech Debt: Missing architecture decisions
- False Confidence: Tests that lie about functionality
β What SpecWeave Enforcesβ
- Specification-First: Always define before implementing
- Living Documentation: Auto-update via hooks
- Context Precision: Load only what's needed
- Regression Prevention: Baseline tests + living docs
- Architecture Clarity: ADRs for all major decisions
- Truth-Telling Tests: E2E tests must be honest
Success Metricsβ
How do you know SpecWeave is working?
Code Qualityβ
- β >80% test coverage for critical paths
- β All P1 tasks have specifications
- β All ADRs documented
- β 0% false positive tests
Efficiencyβ
- β 70%+ token reduction (context precision)
- β >90% routing accuracy
- β <5 minutes to find relevant specs
- β Auto-documentation updates
Team Collaborationβ
- β New developers onboard in <1 day
- β Specifications are single source of truth
- β No "tribal knowledge" silos
- β Clear decision history (ADRs)
Production Readinessβ
- β All features have specifications
- β All features have tests
- β All features have documentation
- β Regression tests before modifications
Ready to get started?
- Quickstart Guide - Get up and running in 5 minutes
- Core Concepts - Understand the fundamentals
Previous: Key Features β