From rust-agents
Spec-Driven Development workflow. Use when the user wants to create a specification, write requirements, design a feature, plan implementation, break work into tasks, or review spec quality. Also trigger when the user says 'I want to build X', 'let's spec this out', 'create a spec', 'write requirements', or asks to prepare work for a coding agent.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rust-agents:sddThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Help users compose structured specifications that AI coding agents can reliably
Help users compose structured specifications that AI coding agents can reliably execute. The core principle: the quality of AI-generated code is directly proportional to the quality of the specification.
All SDD artifacts use Obsidian-flavored Markdown. Read the obsidian-zettelkasten
skill references for syntax and formatting rules before writing any artifact.
This skill accepts a phase argument via $ARGUMENTS:
/sdd init — bootstrap SDD structure in the project/sdd specify <description> — create a specification (Phase 1)/sdd plan [feature-dir] — create a technical plan (Phase 2)/sdd tasks [feature-dir] — break into implementation tasks (Phase 3)/sdd review [feature-dir] — validate spec quality/sdd (no args) — ask the user what they needParse the first word of $ARGUMENTS to determine the phase. Everything after
the phase keyword is the feature description or path.
You are an interactive dialog partner, not a template filler.
[NEEDS CLARIFICATION: ...]All spec artifacts live under .local/specs/:
.local/specs/
├── MOC-specs.md (Map of Content — index of all specs)
├── constitution.md (project principles, created by init)
├── 001-feature-name/
│ ├── spec.md (Phase 1 output)
│ ├── plan.md (Phase 2 output)
│ └── tasks.md (Phase 3 output)
└── 002-another-feature/
└── ...
Templates are embedded in this skill (see Templates section below). Read the relevant template before generating any artifact.
Bootstrap SDD in the current project.
.local/specs/ exists. If yes, report state and ask what to do..local/specs/ directory..local/specs/constitution.md:
.local/specs/MOC-specs.md using the MOC Template below./sdd specify <description> to create
your first spec."Create a feature specification. Focus on WHAT and WHY — no implementation.
Steps:
.local/specs/constitution.md if it exists..local/specs/ directories.WHEN <condition> THE SYSTEM SHALL <behavior>
[NEEDS CLARIFICATION: specific question].local/specs/<NNN>-<feature-name>/spec.md.local/specs/MOC-specs.md under the appropriate section./sdd plan to create the technical plan?"Create a technical plan. Focus on HOW.
Steps:
spec.md. If no feature specified, use the most recent..local/specs/constitution.md if it exists.[NEEDS CLARIFICATION] markers. Resolve with user first..local/specs/<feature>/plan.md/sdd tasks to break this into implementation tasks?"Break the plan into discrete implementation tasks.
Steps:
Read both spec.md and plan.md for the feature.
Read .local/specs/constitution.md if it exists.
Use the Tasks Template below for structure.
Create ordered tasks. Each task must be:
Task format:
### T001: <title>
**Context**: Why this task exists
**Spec reference**: [[spec#FR-XXX]] / [[spec#US-XXX]]
**Acceptance criteria**:
- [ ] <criterion>
- [ ] <criterion>
**Dependencies**: none | T000
**Files**: <paths>
**Complexity**: low | medium | high
Include T000 for scaffolding/setup if needed.
Present tasks for review. Ask:
Save to .local/specs/<feature>/tasks.md
Update the feature entry in .local/specs/MOC-specs.md to show tasks are ready.
Suggest: "Spec complete. Start implementing with:
Implement T001 from .local/specs/<feature>/tasks.md following the spec and plan."
Validate specification quality.
Read all artifacts for the feature (spec.md, plan.md, tasks.md).
Read .local/specs/constitution.md if it exists.
Run quality checklist:
Completeness:
[NEEDS CLARIFICATION] markersClarity:
Consistency:
Implementability:
Obsidian format:
obsidian-zettelkasten quality checklistReport as:
## Spec Review: <feature>
### Score: X/10
### Strengths
### Issues Found
### Recommended Actions
Offer to fix issues interactively.
Match spec depth to task complexity. Not everything needs the full workflow.
| Size | Approach |
|---|---|
| Typo / one-liner | No spec needed |
| Small bug / single function | 3-5 sentences + acceptance criteria |
| Feature (1-3 files) | Phase 1 only |
| Multi-component feature | Phase 1 + 2 + 3 |
| New system / architecture | Full workflow with constitution |
Every spec must define agent boundaries:
### Always (without asking)
- Run tests after changes
- Follow existing code style
### Ask First
- Adding new dependencies
- Changing database schema
### Never
- Commit secrets or credentials
- Delete user data without backup
Ask: "Are there things the agent should absolutely never touch?"
---
aliases:
- Specifications Index
- Specs Overview
tags:
- moc
- sdd
created: YYYY-MM-DD
status: moc
---
# Specifications
> [!abstract]
> Map of Content for all project specifications. Each entry links to
> a feature spec with its current phase and status.
## Active Specs
| ID | Feature | Phase | Status |
|----|---------|-------|--------|
| 001 | [[001-feature-name/spec\|Feature Name]] | specify | draft |
## Completed Specs
(none yet)
## Project Foundation
- [[constitution]] — non-negotiable project principles
---
aliases:
- Project Principles
tags:
- sdd
- constitution
created: YYYY-MM-DD
status: permanent
---
# Project Constitution
> [!important]
> Non-negotiable principles governing ALL development in this project.
> Every specification, plan, and task MUST comply with this document.
> Update this file only through explicit team decision.
## I. Architecture
[Define your architectural patterns and constraints]
- Example: "Modular monolith with clear module boundaries"
- Example: "All modules communicate through public API only, no direct DB access"
## II. Technology Stack
[Lock down the core stack to prevent drift]
- Language: [e.g., Rust 1.80+]
- Framework: [e.g., Axum]
- Database: [e.g., PostgreSQL 16]
- Additional: [libraries, tools]
## III. Testing (NON-NEGOTIABLE)
[Define minimum testing standards]
- All features must have tests that pass before merge
- Prefer integration tests with real dependencies over mocks
- Coverage target: [e.g., > 80% for new code]
- Framework: [e.g., cargo test + nextest]
## IV. Code Style
[Reference existing conventions or define them]
- Follow existing patterns in the codebase
- [e.g., No unwrap() in production code — use proper error handling]
- [e.g., All public APIs must have doc comments]
## V. Security
- Never commit secrets, keys, or credentials
- All user input must be validated and sanitized
- [Additional security requirements]
## VI. Performance
- [e.g., API endpoints must respond within 200ms at p95]
- [e.g., Memory usage must stay under X for the main process]
## VII. Simplicity
- Prefer standard library and framework features over third-party alternatives
- New dependencies require justification
- Maximum [N] external dependencies per module
## VIII. Git Workflow
- Branch naming: [e.g., feat/<NNN>-<name>, fix/<NNN>-<name>]
- Commit messages: [e.g., conventional commits]
- One logical change per commit
---
aliases:
- [Feature short name or acronym]
tags:
- sdd
- spec
- [domain-tag]
created: YYYY-MM-DD
status: draft
related:
- "[[constitution]]"
---
# Feature: [Name]
> [!info] Metadata
> **Author**: [name]
> **Branch**: [branch-name]
## 1. Overview
### Problem Statement
[What problem does this solve? Why does it matter?]
### Goal
[One sentence: what will be true when this is done?]
### Out of Scope
[Explicitly list what this feature does NOT include]
## 2. User Stories
### US-001: [Title]
AS A [role]
I WANT [capability]
SO THAT [benefit]
**Acceptance criteria:**
GIVEN [precondition] WHEN [action] THEN [expected result]
### US-002: [Title]
...
## 3. Functional Requirements
Use EARS notation. Prefix with FR-NNN.
| ID | Requirement | Priority |
|----|------------|----------|
| FR-001 | WHEN [condition] THE SYSTEM SHALL [behavior] | must |
| FR-002 | ... | should |
## 4. Non-Functional Requirements
| ID | Category | Requirement |
|----|----------|-------------|
| NFR-001 | Performance | [e.g., Response time < 200ms at p95] |
| NFR-002 | Security | [e.g., All inputs sanitized, auth required] |
| NFR-003 | Accessibility | [e.g., WCAG 2.1 AA compliance] |
## 5. Data Model
[Entity descriptions. Key attributes and relationships. No implementation details — describe WHAT data exists, not HOW it's stored.]
| Entity | Description | Key Attributes |
|--------|-------------|----------------|
| [Name] | [What it represents] | [Important fields] |
## 6. Edge Cases and Error Handling
| Scenario | Expected Behavior |
|----------|-------------------|
| [Input is empty] | [System responds with...] |
| [Concurrent access] | [System handles by...] |
| [External service unavailable] | [System degrades to...] |
## 7. Success Criteria
Measurable metrics that prove the feature works:
| ID | Metric | Target |
|----|--------|--------|
| SC-001 | [e.g., Task completion rate] | [e.g., > 95%] |
| SC-002 | [e.g., Error rate] | [e.g., < 0.1%] |
## 8. Agent Boundaries
### Always (without asking)
- [e.g., Run tests after changes]
- [e.g., Follow existing code patterns]
### Ask First
- [e.g., Adding new dependencies]
- [e.g., Changing public API]
### Never
- [e.g., Commit secrets]
- [e.g., Modify unrelated code]
## 9. Open Questions
- [NEEDS CLARIFICATION: ...]
## 10. See Also
- [[constitution]] — project principles
- [[MOC-specs]] — all specifications
- [Links to related specs, docs, designs, discussions]
---
aliases:
- [Feature Name] Plan
tags:
- sdd
- plan
- [domain-tag]
created: YYYY-MM-DD
status: draft
related:
- "[[spec]]"
- "[[constitution]]"
---
# Technical Plan: [Feature Name]
> [!info] References
> **Spec**: [[spec]]
## 1. Architecture
### Approach
[High-level description of the technical approach. Why this approach over alternatives?]
### Component Diagram
```mermaid
graph TD
A[Component A] --> B[Component B]
B --> C[Component C]
| Decision | Choice | Rationale | Alternatives Considered |
|---|---|---|---|
| [e.g., Storage] | [e.g., PostgreSQL] | [why] | [what else was considered] |
[Show where new/modified files will live in the project tree]
src/
├── new-module/
│ ├── ...
[Concrete schema, types, or interfaces — now we define HOW]
[Code block with types/schema in the project's language]
[Database changes needed, if any]
[If applicable — endpoints, signatures, message formats]
| Method | Path | Description | Request | Response |
|---|---|---|---|---|
| POST | /api/... | ... | {...} | {...} |
| System | Direction | Protocol | Notes |
|---|---|---|---|
| [e.g., Auth service] | outbound | [e.g., gRPC] | [details] |
| Level | Framework | What to Test | Coverage Target |
|---|---|---|---|
| Unit | [e.g., pytest] | Business logic | [e.g., > 80%] |
| Integration | [e.g., testcontainers] | API + DB | Key paths |
| Contract | [e.g., pact] | Service boundaries | All endpoints |
[How will this be deployed? Feature flags? Phased rollout?]
[If [[constitution]] exists, confirm compliance with each principle]
| Principle | Status | Notes |
|---|---|---|
| [e.g., Test coverage > 80%] | Compliant | [details] |
| Risk | Impact | Probability | Mitigation |
|---|---|---|---|
| [risk] | high/med/low | high/med/low | [plan] |
---
### Tasks Template
```markdown
---
aliases:
- [Feature Name] Tasks
tags:
- sdd
- tasks
- [domain-tag]
created: YYYY-MM-DD
status: draft
related:
- "[[spec]]"
- "[[plan]]"
---
# Implementation Tasks: [Feature Name]
> [!info] References
> **Spec**: [[spec]]
> **Plan**: [[plan]]
> **Total tasks**: [N]
## Progress
- [ ] T000: Project scaffolding
- [ ] T001: ...
- [ ] T002: ...
---
## Dependency Graph
```mermaid
graph TD
T000[T000: scaffolding] --> T001[T001: data model]
T001 --> T002[T002: core logic]
T001 --> T003[T003: API layer]
T003 --> T004[T004: integration tests]
T000 --> T005[T005: UI components]
T005 --> T006[T006: E2E tests]
Context: Set up the foundation — directories, configs, dependencies — so subsequent tasks can focus on logic. Spec reference: N/A (infrastructure) Acceptance criteria:
Context: [Why this task exists, what it enables for later tasks] Spec reference: [[spec#FR-XXX]], [[spec#US-XXX]] Acceptance criteria:
[Continue for all tasks...]
[Any notes about optimal task ordering, parallelization opportunities]
[Reference existing code patterns the agent should follow]
[Known pitfalls, things the agent should watch out for]
npx claudepluginhub bug-ops/claude-plugins --plugin rust-agentsCreates structured specifications before coding. Use when starting new projects, features, or significant changes with ambiguous requirements.
Orchestrates spec-driven development workflow (Requirements → Design → Tasks → Implementation) with approval gates. Activates for structured feature planning or 'use spec-driven'.
Creates structured specifications before coding to clarify requirements and reduce ambiguity. Useful when starting new projects, features, or significant changes.