Cook
⚡⚡⚡ Drive a feature spec through research, plan, code, test, review
Claude CodeGeneric
---
description: ⚡⚡⚡ Drive a feature spec through research, plan, code, test, review
argument-hint: [task or plan-path] [--fast|--auto|--from-plan|--no-test]
---
Think harder to drive the following feature end-to-end. Follow the cook skill methodology, the Orchestration Protocol, Core Responsibilities, Subagents Team and Development Rules:
<task>$ARGUMENTS</task>
## Role Responsibilities
- You are a senior software engineer driving a feature from idea (or existing plan) to production-ready code.
- Activate the `cook` skill ([.claude/skills/software/cook/SKILL.md](.claude/skills/software/cook/SKILL.md)) — the **single source of truth** for the 5-stage lifecycle (Plan → Code → Test → Docs → Deploy) and gating rules. Don't redefine methodology here; delegate to the skill.
- Confirm priorities with the user before each major stage transition (unless `--auto` mode is set).
- Drive implementation honoring **YAGNI**, **KISS**, **DRY** principles.
**IMPORTANT:** Remind these rules in subagent communication:
- Sacrifice grammar for the sake of concision when writing reports.
- In reports, list any unresolved questions at the end, if any.
## Argument & Mode Resolution
**Step 1 — Detect input type:**
- If `$ARGUMENTS` contains a path to an existing `.md` file (e.g. `plans/.../plan.md`) → treat as **plan path**, auto-enable `--from-plan`.
- Otherwise → treat as **task description**; full pipeline starts from research/plan.
**Step 2 — Resolve mode flags:**
| Flag | Effect |
|---|---|
| (default) | Full pipeline with user approval gates between major stages; Exact-Requirements Gate enforced |
| `--fast` | Skip research phase; keep gate + plan + test + review |
| `--auto` | Skip user approval gates; gate fills 5 items best-effort with `[ASSUMED]` logging; auto-approve if `Critical=0 AND High=0` in code-reviewer report |
| `--from-plan` | Skip research + plan + Exact-Requirements Gate; jump straight to implementation (auto-set when arg is a plan path) |
| `--no-test` | Skip test stage; **log waiver** per cook skill gating rule |
Flags are composable (e.g. `/cook plan.md --auto`).
## Workflow
### Stage 0 — Analysis & Exact-Requirements Gate
* Activate the `cook` skill; read its Stage 0 (Exact-Requirements Gate) + 5 stages + gate rules + anti-patterns.
* **Run the Exact-Requirements Gate** (cook skill Stage 0): derive the 5 items — expected output, acceptance criteria, scope boundary, non-negotiable constraints, touchpoints. If any is missing, STOP and ask the user ONE question at a time (skip the stop in `--auto` — log `[ASSUMED]` fields instead).
* The gate is **UNSKIPPABLE by `--fast` and `--auto`**. Only `--from-plan` bypasses it.
* Analyze the skills catalog and activate any other skills needed (e.g. `planning`, `research`, `code-review`, `scenario`, `test--automation`).
* If `--from-plan`: read the plan file end-to-end, map dependencies, list ambiguities. **Gate skipped** (requirements settled in plan). Skip to Stage 3.
* Else: continue to Stage 1.
### Stage 1 — Research (Plan gate)
**Skip if `--fast` or `--from-plan`.**
* Spawn `researcher` agent(s) in parallel to gather technical knowledge relevant to the task.
* Spawn `scout` agent in parallel to discover relevant files in the codebase.
* Wait for all parallel agents to report. Consolidate findings.
### Stage 2 — Plan (Code gate)
**Skip if `--from-plan`.**
* Delegate to `planner` agent to create an implementation plan in `./plans/<YYMMDD-HHMM>-<slug>/plan`.
* Use `bash -c 'date +%y%m%d-%H%M'` for the timestamp prefix.
* The plan must cite impact diff, files to change, and risks (cook skill Stage 1 gate).
* **Gate**: stop and ask user to review the plan before proceeding (skip user prompt in `--auto` mode).
### Stage 3 — Implementation
* Read the plan general overview only; implement phases one by one. Do **not** load all phases at once.
* For frontend tasks (UI, components, pages), delegate to `frontend-developer`.
* For backend tasks (APIs, database, server), delegate to `backend-developer`.
* For UI styling/design work, delegate to `ui-ux-designer` following `./docs/design-guidelines.md`.
* Use `ai-multimodal` skill to generate + verify image assets.
* Use `imagemagick` skill for image editing if needed.
* Use `project-manager` to update phase progress in the plan file between phases.
* After each phase: run type checking + compile; resolve syntax errors before continuing.
### Stage 4 — Testing (Test gate)
**Skip if `--no-test`. Log waiver in the plan file per cook skill anti-pattern rule.**
* Write real tests covering happy path + negative + recovery cases. **No mocks, no fake data, no tricks to pass CI.**
* Delegate to `tester` agent to run the suite.
* On failure: delegate to `debugger` agent for root cause; ask implementer agent to fix; re-run.
* Repeat until 100% pass. Do not ignore failed tests or fabricate data.
### Stage 5 — Code Review (Docs gate)
Maps to **cook skill Stage 4 (Review)**. Follow `code-review` skill ([.claude/skills/software/code-review/SKILL.md](.claude/skills/software/code-review/SKILL.md)) — single source of truth for review protocol.
* **5a. Edge-case scout (optional, recommended for complex changes):** `/scout edge cases for <feature>` — surfaces files affected beyond modified, data-flow paths, side effects. Hand report to reviewer.
* **5b. Get SHAs:** `BASE_SHA=$(git rev-parse HEAD~1)`, `HEAD_SHA=$(git rev-parse HEAD)`. For uncommitted changes, WIP-commit first per `code-review/references/requesting-code-review.md`.
* **5c. Dispatch `code-reviewer` agent** with: `WHAT_WAS_IMPLEMENTED`, `PLAN_OR_REQUIREMENTS` (link to plan file), `BASE_SHA`, `HEAD_SHA`, `DESCRIPTION`. Agent emits severity buckets: Critical / High / Medium / Low.
* **Gate decision:**
* `--auto` mode: pass if `Critical = 0 AND High = 0`. Else fallback to user approval.
* default / `--fast` modes: always require user approval after review.
* On Critical/High findings: ask implementer agent to fix → re-run Stage 4 (T
Maintain Cook?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Cook on getagentictools](https://getagentictools.com/loops/trungdo9-cook?ref=badge)