🔒 Prerequisites (Mandatory)
This skill operates as the central brain for the SDD framework. Before any technical execution:
0. Mode Check: Verify .hub-mode and apply token-distiller guidelines.
- Context Check: Rehydrate state by reading
STATE.md, MEMORY.md, and LEARNINGS.md.
- Knowledge Check: Follow the Knowledge Verification Chain (see below).
SDD: Modular & Adaptive Workflow (v2.3.0)
Precision at scale. Rigor when needed, speed when possible.
🧩 Delegation Matrix
The SDD workflow delegates heavy lifting to specialized sub-skills to maintain a clean context window:
| Phase |
Sub-Skill |
Primary Artifact |
Purpose |
| DISCOVERY |
sdd-explorer |
TECHNICAL-MAP.md |
Read-only mapping of stack, architecture, and risks. |
| SPECIFY |
sdd-orchestrator, grill-with-docs |
spec.md, plan.md, CONTEXT.md, ADRs |
Domain glossary alignment (Sabatina/Grilling), requirement analysis, and architectural decisions. |
| IMPLEMENT |
sdd-implementer |
Tested Code |
Surgical implementation with TDD and atomic commits. |
| VERIFY |
sdd-reviewer |
validation-report.md |
Evidence-based audit against Acceptance Criteria. |
🔄 4-Phase Workflow
The SDD follows a rigorous cycle to ensure integrity and traceability:
1. DISCOVERY
- Goal: Understand the terrain and align with the project vision.
- Action: Use
sdd-planner to read PROJECT.md and ROADMAP.md. Use sdd-explorer to map stack and architecture.
- Output: Updated
TECHNICAL-MAP.md and "rehydrated" context via STATE.md.
- Handoff: Follow Handoff Protocol Section 1.
- Trigger: Session start or new complex feature.
2. SPECIFY
- Goal: Define "what", "how", refine terminology and record technical decisions.
- Action:
- Grilling Session: Challenge the plan relentlessly against the existing domain model. Sharpen vague language and update
CONTEXT.md (Domain Glossary) inline.
- Specification & Plan: Use
sdd-orchestrator to generate spec.md, plan.md, tasks.md, and contract.md. Use adversarial review (GAN concept) for critical architectures.
- ADRs Logging: Create Architectural Decision Records (ADRs) under
.specs/architecture/ (or docs/adr/) only for hard-to-reverse, surprising, or trade-off-heavy decisions.
- Outputs:
spec.md, plan.md, tasks.md, contract.md, CONTEXT.md + new ADRs (if applicable).
- Handoff: Follow Handoff Protocol Section 2.
- Trigger: Before any implementation (Small+).
3. IMPLEMENT
- Goal: Technical execution. If resolving an issue, reproduce the bug first before coding.
- Action: Create a feature branch (refer to
git-workflow). Use sdd-implementer for code/tests. Update STATE.md continuously.
- Output: Verified code on a dedicated branch and updated
tasks.md.
- Handoff: Follow Handoff Protocol Section 3.
- Trigger: After Phase 2 is approved.
4. VERIFY
- Goal: Validate delivery and capture learnings.
- Action: Drive app to verify (boot application and test functionality/UI). Use
sdd-reviewer for audit, open a Pull Request, and use sdd-planner to capture discovered patterns.
- Output: PR created,
validation-report.md, LEARNINGS.md, and MEMORY.md updated. State finalization in STATE.md and PR opened and submitted for human review.
- Handoff: Follow Handoff Protocol Section 4.
- Trigger: Technical completion of Phase 3 tasks.
🛠️ Operational Protocols
1. The Gated Workflow Mandate (Gated Transition)
Progress between phases is strictly sequential and permission-gated:
- Rule: You CANNOT set
phase: [NEXT_PHASE] in STATE.md if the current tasks.md does not have 100% test coverage and status and verifiable evidence for the current phase.
- Initial State: New feature artifacts (
spec.md, plan.md, tasks.md) MUST start with status: IN_PROGRESS.
- Completion Hook: An artifact only moves to
status: COMPLETED when its specific content is frozen and approved for the next phase.
2. State Machine Integrity
Every agent interaction must validate the "State Triad":
- STATE.md
phase must match the current focus.
- tasks.md must have at least one open task for the current phase.
- Artifact Metadata must show
status: IN_PROGRESS for files currently being edited.
3. The Safety Valve (Automatic Escalation)
Every implementation task must be continuously monitored for complexity drift.
- Trigger: If a task reveals unexpected structural changes, touches >3 files, or modifies components.
- Action: STOP execution. Notify the user: "Task complexity has escalated beyond initial sizing. Re-evaluating the plan."
- Outcome: Re-invoke
sdd-orchestrator to update plan.md or tasks.md.
2. Knowledge Verification Chain
To prevent hallucinations and pattern drift, follow this strict hierarchy:
- Existing Code: Scan for established patterns. Managing Entropy: Do not blindly replicate technical debt. If existing code violates
CONVENTIONS.md, initiate a "Garbage Collection" refactor instead of perpetuating bad patterns.
- Internal Specs: Consult
TECHNICAL-MAP.md, CONVENTIONS.md, and STATE.md.
- Project Documentation: Check READMEs and official internal docs.
- MCP/External Tools: Query
context-graph or perform targeted web searches.
- Flag Uncertainty: If Steps 1-4 yield no proof, flag as "Uncertain" to the user. Never assume.
3. Context Budget Management
- Base Context: Always load
STATE.md (current progress) and MEMORY.md (preferences).
- On-Demand: Only load sub-skill definitions and specific feature specs when active in that phase.
- Limit: Target <30k tokens for the base environment to leave maximum room for reasoning.
4. Manual Progress Tracking
- Atomicity: Every task must be mapped to a specific commit.
- State Check: Update
tasks.md and STATE.md immediately after every significant milestone.
- Traceability: If it's not in the Markdown logs, it didn't happen.
5. Swarm & Multi-Agent Execution
When working with multiple parallel agents or personas:
- Infrastructure: Utilize Tmux or iTerm2 for session persistence and visual tracking.
- Security: Propagate
DANGEROUS_BASH_PATTERNS to all swarm members.
- GAN Pattern: Implement Generative Adversarial loops where agents alternate between creating (Generator) and auditing (Discriminator) to maximize quality.
- Protocol: Follow the Swarm Execution Guide.
🏗️ Production Patterns
Explore-Plan-Act Loop
Strict permission-gated flow:
- EXPLORE: No code modifications allowed.
- PLAN: Design validation via Plan-Validate-Execute (PVE).
- ACT: Atomic execution on feature branches.
Agent-First Legibility & Observability
- Bootable Environments: The project must offer standardized, agent-friendly commands to easily boot and test the application per worktree.
- Legible Failures: Expose structured logs, metrics, and traces so the agent can query and reason about isolated test/execution failures autonomously.
The Autonomy PR Loop (Mandatory)
- Branch First: Before writing any code in
IMPLEMENT, you MUST create a branch following the git-workflow skill (e.g., feat/FEAT-ID-...). Never commit directly to main or master.
- Verify then PR: After successful
VERIFY ("Drive app to verify" + sensors passed), you MUST open a Pull Request. The PR description must link to the validation-report.md as evidence.
Visual-First Mandate
All technical plans (plan.md) MUST include Mermaid diagrams to visualize data flow and component relationships.
🚫 Prohibited
- NEVER skip the DISCOVERY phase for unknown codebases.
- NEVER mark a task as complete without an atomic Git commit AND explicit proof that the application builds, passes linting, and passes tests.
- NEVER use placeholders in
spec.md or plan.md.
- NEVER ignore "Fragile" warnings in
TECHNICAL-MAP.md.
- NEVER force a phase transition if the current
tasks.md does not have 100% status coverage and verifiable evidence for the current phase.
- NEVER exit the implementation cycle without pushing to the branch.
- NEVER submit a PR without tests.
- NEVER ignore the modification of 3 or more files without going through an adversarial review.
- NEVER modify a file without assessing the impact.
- NEVER ignore adversarial critique.
- NEVER ignore the safety valve.
5. State & Memory Management
Persistence Protocol (via sdd-planner)
Always update STATE.md at the end of every session or after major decisions.
- Operational Memory (
STATE.md): Tasks, session status, and blockers.
- Persistent Knowledge (
MEMORY.md): Enduring facts, style guides, and preferences.
- Incremental Wisdom (
LEARNINGS.md): Bug solutions and discovered patterns.
6. Directory Structure (Mandatory)
Feature-Specific (spec/ or .specs/features/[name]/)
spec.md: Traceable requirements (FR-X) and Acceptance Criteria (ACs).
plan.md: Technical design and schemas.
tasks.md: Atomic task list with status.
contract.md: Delivery agreement and validation sensors.
Project-Wide (.specs/project/ or Root)
PROJECT.md: Core vision and "North Star".
ROADMAP.md: Milestones and feature status.
STATE.md: Operational memory (current status, blockers).
MEMORY.md: Persistent knowledge (patterns, preferences).
LEARNINGS.md: Incremental wisdom (solved bugs, tricks).
DECISIONS.md: Log of architectural and design decisions.
CONTEXT.md: Domain Glossary: Centralized list of precise terms and vocabulary unique to this domain (totally devoid of implementation details).
Codebase Mapping & Architecture (.specs/codebase/ and .specs/architecture/)
TECHNICAL-MAP.md: Mapping of stack and dependencies.
CONVENTIONS.md: Coding patterns and linting.
ARCHITECTURE.md: High-level structural view.
.specs/architecture/[0001-slug].md (or docs/adr/): Architectural Decision Records (ADRs): Concise records of critical design choices and their trade-offs.
7. Observable Governance (Mandatory v2.3.0)
To enable real-time monitoring and automated auditing, every artifact generated MUST include a structured metadata block.
Metadata Protocol
At the end of every .md artifact, append the following block:
<!-- @sdd-state -->
```yaml
version: "2.3.0"
feature_id: "FEAT-ID"
phase: "DISCOVERY | SPECIFY | IMPLEMENT | VERIFY"
status: "IN_PROGRESS | COMPLETED | BLOCKED"
last_update: "ISO-TIMESTAMP"
evidence_checksum: "GIT-HASH | LOG-PATH | NONE"
#### Evidence Mandate
Tasks in `tasks.md` MUST NOT be marked as complete without a valid entry in the `Evidence` column (e.g., a commit hash or a link to a test log). Furthermore, a task CANNOT be marked as completed unless the application builds successfully, passes the linting, and passes all tests. This is a mandatory requirement.
---
> **Law of SDD**: If it's not in the spec, it doesn't exist. If it's not verified, it's not done.
---
## References
- [Brownfield Mapping Guide](references/brownfield-mapping.md)
- [Coding Principles](references/coding-principles.md)
- [Operational Guidelines](references/operational-guidelines.md)
- [BDD Standard](references/bdd-guide.md)
- [Handoff Protocol](references/handoff-protocol.md)
- [Swarm Execution Guide](references/swarm-execution.md)
- [Grilling Session Guide](references/grilling-session.md)
---
<!-- @sdd-state -->
```yaml
version: "2.3.0"
feature_id: "SDD-CORE-ALIGNMENT"
phase: "VERIFY"
status: "COMPLETED"
last_update: "2026-05-22T14:23:00Z"
evidence_checksum: "8e52f6a"
1---2name: sdd3description: Spec-Driven Development. High-performance modular workflow with Explore-Plan-Act Loop and Safety-Valve protocols. Orchestrates specialized sub-skills. [TLC Spec Driven](https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(development)/tlc-spec-driven)4---56## 🔒 Prerequisites (Mandatory)7This skill operates as the central brain for the **SDD** framework. Before any technical execution:80. **Mode Check**: Verify `.hub-mode` and apply `token-distiller` guidelines.91. **Context Check**: Rehydrate state by reading `STATE.md`, `MEMORY.md`, and `LEARNINGS.md`.102. **Knowledge Check**: Follow the **Knowledge Verification Chain** (see below).1112---1314# SDD: Modular & Adaptive Workflow (v2.3.0)1516> Precision at scale. Rigor when needed, speed when possible.1718---1920## 🧩 Delegation Matrix21The SDD workflow delegates heavy lifting to specialized sub-skills to maintain a clean context window:2223| Phase | Sub-Skill | Primary Artifact | Purpose |24|---|---|---|---|25| **DISCOVERY** | `sdd-explorer` | `TECHNICAL-MAP.md` | Read-only mapping of stack, architecture, and risks. |26| **SPECIFY** | `sdd-orchestrator`, `grill-with-docs` | `spec.md`, `plan.md`, `CONTEXT.md`, `ADRs` | Domain glossary alignment (Sabatina/Grilling), requirement analysis, and architectural decisions. |27| **IMPLEMENT** | `sdd-implementer` | Tested Code | Surgical implementation with TDD and atomic commits. |28| **VERIFY** | `sdd-reviewer` | `validation-report.md` | Evidence-based audit against Acceptance Criteria. |2930---3132## 🔄 4-Phase Workflow3334The SDD follows a rigorous cycle to ensure integrity and traceability:3536### 1. DISCOVERY37* **Goal**: Understand the terrain and align with the project vision.38* **Action**: Use `sdd-planner` to read `PROJECT.md` and `ROADMAP.md`. Use `sdd-explorer` to map stack and architecture.39* **Output**: Updated `TECHNICAL-MAP.md` and "rehydrated" context via `STATE.md`.40* **Handoff**: Follow [Handoff Protocol](references/handoff-protocol.md) Section 1.41* **Trigger**: Session start or new complex feature.4243### 2. SPECIFY44* **Goal**: Define "what", "how", refine terminology and record technical decisions.45* **Action**: 46 1. **Grilling Session**: Challenge the plan relentlessly against the existing domain model. Sharpen vague language and update `CONTEXT.md` (Domain Glossary) inline.47 2. **Specification & Plan**: Use `sdd-orchestrator` to generate `spec.md`, `plan.md`, `tasks.md`, and `contract.md`. Use adversarial review (GAN concept) for critical architectures.48 3. **ADRs Logging**: Create Architectural Decision Records (ADRs) under `.specs/architecture/` (or `docs/adr/`) only for hard-to-reverse, surprising, or trade-off-heavy decisions.49* **Outputs**: `spec.md`, `plan.md`, `tasks.md`, `contract.md`, `CONTEXT.md` + new ADRs (if applicable).50* **Handoff**: Follow [Handoff Protocol](references/handoff-protocol.md) Section 2.51* **Trigger**: Before any implementation (**Small+**).5253### 3. IMPLEMENT54* **Goal**: Technical execution. If resolving an issue, **reproduce the bug first** before coding.55* **Action**: **Create a feature branch** (refer to `git-workflow`). Use `sdd-implementer` for code/tests. Update `STATE.md` continuously.56* **Output**: Verified code on a dedicated branch and updated `tasks.md`.57* **Handoff**: Follow [Handoff Protocol](references/handoff-protocol.md) Section 3.58* **Trigger**: After Phase 2 is approved.5960### 4. VERIFY61* **Goal**: Validate delivery and capture learnings.62* **Action**: **Drive app to verify** (boot application and test functionality/UI). Use `sdd-reviewer` for audit, **open a Pull Request**, and use `sdd-planner` to capture discovered patterns.63* **Output**: PR created, `validation-report.md`, `LEARNINGS.md`, and `MEMORY.md` updated. State finalization in `STATE.md` and PR opened and submitted for human review.64* **Handoff**: Follow [Handoff Protocol](references/handoff-protocol.md) Section 4.65* **Trigger**: Technical completion of Phase 3 tasks.6667---6869## 🛠️ Operational Protocols7071### 1. The Gated Workflow Mandate (Gated Transition)72Progress between phases is strictly sequential and permission-gated:73- **Rule**: You CANNOT set `phase: [NEXT_PHASE]` in `STATE.md` if the current `tasks.md` does not have 100% test coverage and status and verifiable evidence for the current phase.74- **Initial State**: New feature artifacts (`spec.md`, `plan.md`, `tasks.md`) MUST start with `status: IN_PROGRESS`.75- **Completion Hook**: An artifact only moves to `status: COMPLETED` when its specific content is frozen and approved for the next phase.7677### 2. State Machine Integrity78Every agent interaction must validate the "State Triad":791. **STATE.md** `phase` must match the current focus.802. **tasks.md** must have at least one open task for the current phase.813. **Artifact Metadata** must show `status: IN_PROGRESS` for files currently being edited.8283### 3. The Safety Valve (Automatic Escalation)84Every implementation task must be continuously monitored for complexity drift.85- **Trigger**: If a task reveals unexpected structural changes, touches >3 files, or modifies components.86- **Action**: **STOP** execution. Notify the user: *"Task complexity has escalated beyond initial sizing. Re-evaluating the plan."*87- **Outcome**: Re-invoke `sdd-orchestrator` to update `plan.md` or `tasks.md`.8889### 2. Knowledge Verification Chain90To prevent hallucinations and pattern drift, follow this strict hierarchy:911. **Existing Code**: Scan for established patterns. **Managing Entropy**: Do not blindly replicate technical debt. If existing code violates `CONVENTIONS.md`, initiate a "Garbage Collection" refactor instead of perpetuating bad patterns.922. **Internal Specs**: Consult `TECHNICAL-MAP.md`, `CONVENTIONS.md`, and `STATE.md`.933. **Project Documentation**: Check READMEs and official internal docs.944. **MCP/External Tools**: Query `context-graph` or perform targeted web searches.955. **Flag Uncertainty**: If Steps 1-4 yield no proof, flag as "Uncertain" to the user. **Never assume.**9697### 3. Context Budget Management98- **Base Context**: Always load `STATE.md` (current progress) and `MEMORY.md` (preferences).99- **On-Demand**: Only load sub-skill definitions and specific feature specs when active in that phase.100- **Limit**: Target <30k tokens for the base environment to leave maximum room for reasoning.101102### 4. Manual Progress Tracking103- **Atomicity**: Every task must be mapped to a specific commit.104- **State Check**: Update `tasks.md` and `STATE.md` immediately after every significant milestone.105- **Traceability**: If it's not in the Markdown logs, it didn't happen.106107### 5. Swarm & Multi-Agent Execution108When working with multiple parallel agents or personas:109- **Infrastructure**: Utilize Tmux or iTerm2 for session persistence and visual tracking.110- **Security**: Propagate `DANGEROUS_BASH_PATTERNS` to all swarm members.111- **GAN Pattern**: Implement **Generative Adversarial** loops where agents alternate between creating (Generator) and auditing (Discriminator) to maximize quality.112- **Protocol**: Follow the [Swarm Execution Guide](references/swarm-execution.md).113114---115116## 🏗️ Production Patterns117118### Explore-Plan-Act Loop119Strict permission-gated flow:120- **EXPLORE**: No code modifications allowed.121- **PLAN**: Design validation via **Plan-Validate-Execute (PVE)**.122- **ACT**: Atomic execution on feature branches.123124### Agent-First Legibility & Observability125- **Bootable Environments**: The project must offer standardized, agent-friendly commands to easily boot and test the application per worktree.126- **Legible Failures**: Expose structured logs, metrics, and traces so the agent can query and reason about isolated test/execution failures autonomously.127128### The Autonomy PR Loop (Mandatory)129- **Branch First**: Before writing any code in `IMPLEMENT`, you MUST create a branch following the `git-workflow` skill (e.g., `feat/FEAT-ID-...`). **Never commit directly to `main` or `master`.**130- **Verify then PR**: After successful `VERIFY` ("Drive app to verify" + sensors passed), you MUST open a Pull Request. The PR description must link to the `validation-report.md` as evidence.131132### Visual-First Mandate133All technical plans (`plan.md`) MUST include **Mermaid** diagrams to visualize data flow and component relationships.134135---136137## 🚫 Prohibited138139- NEVER skip the **DISCOVERY** phase for unknown codebases.140- NEVER mark a task as complete without an atomic Git commit AND explicit proof that the application builds, passes linting, and passes tests.141- NEVER use placeholders in `spec.md` or `plan.md`.142- NEVER ignore "Fragile" warnings in `TECHNICAL-MAP.md`.143- NEVER force a phase transition if the current `tasks.md` does not have 100% status coverage and verifiable evidence for the current phase.144- NEVER exit the implementation cycle without pushing to the branch.145- NEVER submit a PR without tests.146- NEVER ignore the modification of 3 or more files without going through an adversarial review.147- NEVER modify a file without assessing the impact.148- NEVER ignore adversarial critique.149- NEVER ignore the safety valve.150151---152153## 5. State & Memory Management154155### Persistence Protocol (via `sdd-planner`)156Always update `STATE.md` at the end of every session or after major decisions.1571. **Operational Memory (`STATE.md`)**: Tasks, session status, and blockers.1582. **Persistent Knowledge (`MEMORY.md`)**: Enduring facts, style guides, and preferences.1593. **Incremental Wisdom (`LEARNINGS.md`)**: Bug solutions and discovered patterns.160161---162163## 6. Directory Structure (Mandatory)164165### Feature-Specific (`spec/` or `.specs/features/[name]/`)166- `spec.md`: Traceable requirements (FR-X) and Acceptance Criteria (ACs).167- `plan.md`: Technical design and schemas.168- `tasks.md`: Atomic task list with status.169- `contract.md`: Delivery agreement and validation sensors.170171### Project-Wide (`.specs/project/` or Root)172- `PROJECT.md`: Core vision and "North Star".173- `ROADMAP.md`: Milestones and feature status.174- `STATE.md`: Operational memory (current status, blockers).175- `MEMORY.md`: Persistent knowledge (patterns, preferences).176- `LEARNINGS.md`: Incremental wisdom (solved bugs, tricks).177- `DECISIONS.md`: Log of architectural and design decisions.178- `CONTEXT.md`: **Domain Glossary**: Centralized list of precise terms and vocabulary unique to this domain (totally devoid of implementation details).179180### Codebase Mapping & Architecture (`.specs/codebase/` and `.specs/architecture/`)181- `TECHNICAL-MAP.md`: Mapping of stack and dependencies.182- `CONVENTIONS.md`: Coding patterns and linting.183- `ARCHITECTURE.md`: High-level structural view.184- `.specs/architecture/[0001-slug].md` (or `docs/adr/`): **Architectural Decision Records (ADRs)**: Concise records of critical design choices and their trade-offs.185186### 7. Observable Governance (Mandatory v2.3.0)187To enable real-time monitoring and automated auditing, every artifact generated MUST include a structured metadata block.188189#### Metadata Protocol190At the end of every `.md` artifact, append the following block:191```markdown192<!-- @sdd-state -->193```yaml194version: "2.3.0"195feature_id: "FEAT-ID"196phase: "DISCOVERY | SPECIFY | IMPLEMENT | VERIFY"197status: "IN_PROGRESS | COMPLETED | BLOCKED"198last_update: "ISO-TIMESTAMP"199evidence_checksum: "GIT-HASH | LOG-PATH | NONE"200```201```202203#### Evidence Mandate204Tasks in `tasks.md` MUST NOT be marked as complete without a valid entry in the `Evidence` column (e.g., a commit hash or a link to a test log). Furthermore, a task CANNOT be marked as completed unless the application builds successfully, passes the linting, and passes all tests. This is a mandatory requirement.205206---207208209> **Law of SDD**: If it's not in the spec, it doesn't exist. If it's not verified, it's not done.210211---212213## References214- [Brownfield Mapping Guide](references/brownfield-mapping.md)215- [Coding Principles](references/coding-principles.md)216- [Operational Guidelines](references/operational-guidelines.md)217- [BDD Standard](references/bdd-guide.md)218- [Handoff Protocol](references/handoff-protocol.md)219- [Swarm Execution Guide](references/swarm-execution.md)220- [Grilling Session Guide](references/grilling-session.md)221222---223224<!-- @sdd-state -->225```yaml226version: "2.3.0"227feature_id: "SDD-CORE-ALIGNMENT"228phase: "VERIFY"229status: "COMPLETED"230last_update: "2026-05-22T14:23:00Z"231evidence_checksum: "8e52f6a"232```233