Skip to main content
ClaudeWave
Slash Command215 repo starsupdated 3mo ago

speckit.implement

Execute the implementation plan by processing and executing all tasks defined in tasks.md

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/maslennikov-ig/claude-code-orchestrator-kit/HEAD/.claude/commands/speckit.implement.md -o ~/.claude/commands/speckit.implement.md
Then start a new Claude Code session; the slash command loads automatically.

speckit.implement.md

> **ORCHESTRATION REMINDER**: You are the orchestrator, not the implementer. Delegate all complex tasks to subagents with complete context. Gather full context before delegation (read code, search patterns, review docs, check commits). Verify results thoroughly (read files, run type-check). Re-delegate with corrections if validation fails. Execute directly only for trivial tasks (1-2 line fixes, imports, single npm install).

## User Input

```text
$ARGUMENTS
```

You **MUST** consider the user input before proceeding (if not empty).

## Outline

1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").

2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
   - Scan all checklist files in the checklists/ directory
   - For each checklist, count:
     - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
     - Completed items: Lines matching `- [X]` or `- [x]`
     - Incomplete items: Lines matching `- [ ]`
   - Create a status table:

     ```text
     | Checklist | Total | Completed | Incomplete | Status |
     |-----------|-------|-----------|------------|--------|
     | ux.md     | 12    | 12        | 0          | ✓ PASS |
     | test.md   | 8     | 5         | 3          | ✗ FAIL |
     | security.md | 6   | 6         | 0          | ✓ PASS |
     ```

   - Calculate overall status:
     - **PASS**: All checklists have 0 incomplete items
     - **FAIL**: One or more checklists have incomplete items

   - **If any checklist is incomplete**:
     - Display the table with incomplete item counts
     - **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
     - Wait for user response before continuing
     - If user says "no" or "wait" or "stop", halt execution
     - If user says "yes" or "proceed" or "continue", proceed to step 3

   - **If all checklists are complete**:
     - Display the table showing all checklists passed
     - Automatically proceed to step 3

3. Load and analyze the implementation context:
   - **REQUIRED**: Read `.specify/memory/constitution.md` for project principles, security requirements, and quality gates
   - **REQUIRED**: Read tasks.md for the complete task list and execution plan
   - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
   - **IF EXISTS**: Read data-model.md for entities and relationships
   - **IF EXISTS**: Read contracts/ for API specifications and test requirements
   - **IF EXISTS**: Read research.md for technical decisions and constraints
   - **IF EXISTS**: Read research/ for complex research findings and decisions
   - **IF EXISTS**: Read quickstart.md for integration scenarios

4. **PLANNING PHASE** (Execute Before Implementation):
   - Review all tasks and classify execution model (parallel vs sequential)
   - **Step 1: Task Analysis**:
     * Analyze all tasks and identify required agent capabilities
     * Determine which tasks need MAIN (trivial only), existing agents, or new agents
     * Create list of missing agent types with specifications
   - **Step 2: Agent Creation** (if needed):
     * Launch N meta-agent-v3 calls in single message (1 call per missing agent)
     * After agent creation: ask user to restart claude-code
     * After restart: verify new agents exist before proceeding
   - **Step 3: Executor Assignment**:
     * [EXECUTOR: MAIN] - ONLY for trivial tasks (1-2 line fixes, simple imports, single dependency install)
     * [EXECUTOR: existing-agent] - ONLY if 100% capability match after thorough examination
     * [EXECUTOR: specific-agent-name] - For all other tasks using existing or newly created agents
     * Annotate all tasks with `[EXECUTOR: name]` and `[SEQUENTIAL]`/`[PARALLEL-GROUP-X]`
   - **Step 4: Research Resolution**:
     * Simple research: solve with agent tools (Grep, Read, WebSearch, Context7, Supabase docs)
     * Complex research: create research prompt in research/, wait for user deepresearch, incorporate results
   - Output: Updated tasks.md with executor annotations
   - **Atomicity Rule (CRITICAL)**: 1 Task = 1 Agent Invocation
     * Never give multiple tasks to one agent in single run
     * **Parallel execution**: Launch N agent calls in single message (not sequentially)
     * Example: 3 parallel tasks for meta-agent → 3 meta-agent calls in single message
     * Example: 5 parallel tasks for fullstack → 5 fullstack calls in single message
     * Sequential tasks: 1 agent run, wait for completion, then next agent run

5. **Project Setup Verification**:
   - **REQUIRED**: Create/verify ignore files based on actual project setup:

   **Detection & Creation Logic**:
   - Check if the following command succeeds to determine if the repository is a git repo (create/verify .gitignore if so):

     ```sh
     git rev-parse --git-dir 2>/dev/null
     ```

   - Check if Dockerfile* exists or Docker in plan.md → create/verify .dockerignore
   - Check if .eslintrc*or eslint.config.* exists → create/verify .eslintignore
   - Check if .prettierrc* exists → create/verify .prettierignore
   - Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
   - Check if terraform files (*.tf) exist → create/verify .terraformignore
   - Check if .helmignore needed (helm charts present) → create/verify .helmignore

   **If ignore file already exists**: Verify it contains essential patterns, append missing critical patterns only
   **If ignore file missing**: Create with full pattern set for detected technology

   **Common Patterns by Technology** (from plan.md tech stack):
   - **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
   - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`