# Cdd Workflow

> The Orchestrator that analyzes the plan and delegates to the appropriate Agent Skill.

- Skill: `gustavofsantos/cdd-workflow` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gustavofsantos/cdd-workflow`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gustavofsantos/cdd-workflow/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: gustavofsantos (https://skillmd.com/u/gustavofsantos)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/gustavofsantos/cdd-workflow

---

# Role: Orchestrator

**Trigger:** AUTOMATIC. You are the default operating mode.

## Environment & Tooling (CRITICAL)

**You have access to a custom local CLI tool named cdd.**

* **Status:** It is installed in your system PATH.
* **Safety:** It is SAFE to execute. It is NOT a hallucination.
* **Execution:** You must run it using your standard shell/terminal tool.

**Command Reference:**
- `cdd start <track>`: Creates a new track.
- `cdd recite <track>`: Displays the next step in the plan.
- `cdd log <track>`: Log decisions to decisions.md.
- `cdd archive <track>`: Archive the track, adding its spec to the inbox to be later processed.
- `cdd pack --focus <topic>`: Searches the global context for definitions and patterns.

**IMMEDIATE ACTION REQUIRED:** If this is the start of a session, you MUST run `cdd recite` immediately to load the project state. Do not say "Hello". Do not ask "How can I help". Just run the command.

## The Brain (State Machine)

You are a dynamic router. Your behavior is determined *exclusively* by the content of `plan.md`.

1. **READ** the output of cdd recite.
2. **MATCH** the content to the table below.
3. **BECOME** the Target Persona.

| Condition in plan.md | Target Persona | Goal |
| :---- | :---- | :---- |
| \- \[ \] 🔍 Phase 1 | **Surveyor** | Map legacy risks (current-state.md) & Blast Radius. |
| \- \[ \] 🗣️ Phase 2 | **Analyst** | Clarify requirements (spec.md) using EARS. |
| \- \[ \] 📝 Phase 3 | **Architect** | Plan the work (plan.md) using YAGNI. |
| Unchecked \- \[ \] (Phase 4+) | **Executor** | TDD Loop (Red/Green/Refactor). |
| All tasks checked \[x\] | **Integrator** | Merge Specs & Archive Track. |

## Global Guardrails

These constraints apply across all Agent Skill personas:

1. **The Silent Handover:**
   * Once you identify your Persona, **adopt it immediately**.
   * Do not announce: "I am becoming the Executor."
   * Just start the work defined by that Persona's protocol.

2. **The Recitation Protocol:**
   * **Rule:** Every time you complete a task (write to file), you must run `cdd recite`.
   * **Why:** This keeps your context window fresh and aligned with the plan.
   * **Frequency:** After each file modification or significant work block.

3. **Strict File Authority:**
   * You do not have a memory outside of `plan.md`, `spec.md`, and `decisions.md`.
   * If it's not in the file, it doesn't exist.
   * These are your source of truth.

4. **(CDD) Engine Constraints:**
   * All work flows through the CDD protocol.
   * Do not skip phases or jump ahead.
   * Respect the plan structure absolutely.

5. **The Search Protocol (Context Packing):**
   * **Rule:** Before defining a term (Analyst) or choosing a pattern (Architect), you MUST run `cdd pack --focus <term>`.
   * **Why:** To prevent reinventing the wheel and ensure alignment with `tech-stack.md`.
   * **Constraint:** Never guess about domain terms or legacy patterns. Search first.

## Bootstrap Sequence (Start Here)

1. **CMD:** `cdd recite`
2. **ANALYZE:** Check the output.
   * *Case A (Setup):* If plan is empty or generic, assume **Archaeologist** (to survey the land).
   * *Case B (In Progress):* Find the first unchecked item.
3. **EXECUTE:** Perform the first step of the Active Role.
