Agent skill
cook
[Implementation] Implement a feature [step by step]
Install this agent skill to your Project
npx add-skill https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/cook
SKILL.md
[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
Understand Code First — Search codebase for 3+ similar implementations BEFORE writing any code. Read existing files, validate assumptions with grep evidence, map dependencies via graph trace. Never invent new patterns when existing ones work. MUST READ
.claude/skills/shared/understand-code-first-protocol.mdfor full protocol and checklists.
docs/project-reference/domain-entities-reference.md— Domain entity catalog, relationships, cross-service sync (read when task involves business entities/models) (content auto-injected by hook — check for [Injected: ...] header before reading)docs/test-specs/— Test specifications by module (read existing TCs; generate/update test specs via/tdd-specafter implementation)
Plan Quality — Every plan phase MUST include
## Test Specificationssection with TC-{FEAT}-{NNN} format. Verify TC satisfaction per phase before marking complete. Plans must includestory_pointsandeffortin frontmatter. MUST READ.claude/skills/shared/plan-quality-protocol.mdfor full protocol and checklists.
Evidence Gate: MANDATORY IMPORTANT MUST — every claim, finding, and recommendation requires
file:lineproof or traced evidence with confidence percentage (>80% to act, <80% must verify first).
Rationalization Prevention — AI consistently skips steps via: "too simple for a plan", "I'll test after", "already searched", "code is self-explanatory". These are EVASIONS — not valid reasons. Plan anyway. Test first. Show grep evidence with file:line. Never combine steps to "save time". MUST READ
.claude/skills/shared/rationalization-prevention-protocol.mdfor full protocol and checklists.
External Memory: For complex or lengthy work (research, analysis, scan, review), write intermediate findings and final results to a report file in
plans/reports/— prevents context loss and serves as deliverable.
Quick Summary
Goal: Implement a feature step-by-step with research, planning, execution, and verification.
Workflow:
- Question — Clarify requirements via AskUserQuestion; challenge assumptions
- Research — Use researcher subagents in parallel; scout codebase for patterns
- Plan — Create implementation plan, get user approval
- Implement — Execute with skill activation, code-simplifier, review-changes
Key Rules:
- Parent skill for all cook-* variants (cook-auto, cook-fast, cook-hard, cook-parallel)
- Write research findings to
.ai/workspace/analysis/for context preservation - Always activate relevant skills from catalog during implementation
- Break work into small todo tasks; add final review task
Frontend/UI Context (if applicable)
When this task involves frontend or UI changes,
UI System Context — For frontend/UI/styling tasks, MUST READ these BEFORE implementing:
frontend-patterns-reference.md(component base classes, stores, forms),scss-styling-guide.md(BEM methodology, SCSS vars, responsive),design-system/README.md(design tokens, component inventory, icons). MUST READ.claude/skills/shared/ui-system-context.mdfor full protocol and checklists.
- Component patterns:
docs/project-reference/frontend-patterns-reference.md - Styling/BEM guide:
docs/project-reference/scss-styling-guide.md - Design system tokens:
docs/project-reference/design-system/README.md
Pre-Implementation Granularity Gate (MANDATORY)
If ANY check fails → STOP. Ask user: "Phase needs more detail before implementation. Refine with /plan? [Y/n]" DO NOT implement a phase that contains planning verbs, unnamed files, or unresolved decisions. </HARD-GATE>
Per-Phase Quality Cycle (MANDATORY)
TC Satisfaction Verification (Per Phase)
Per
.claude/skills/shared/plan-quality-protocol.md
After implementing each phase, before marking it complete:
- Read the phase's
## Test Specificationssection - For each mapped TC: verify evidence exists (file:line, not TBD), grep-verify the file
- If any TC lacks evidence → phase is NOT complete
- Update phase file's TC table with actual evidence references
Greenfield Mode
Auto-detected: If no existing codebase is found (no code directories like
src/,app/,lib/,server/,packages/, etc., no manifest files likepackage.json/*.sln/go.mod, no populatedproject-config.json), this skill switches to greenfield mode automatically. Planning artifacts (docs/, plans/, .claude/) don't count — the project must have actual code directories with content.
When greenfield is detected:
- If an approved plan exists in
plans/: scaffold project structure from the plan - If no approved plan: redirect to
/planfirst — "No approved plan found. Run /plan first to create a greenfield project plan." - Generate: folder layout, starter files, build config, CI skeleton, CLAUDE.md
- Skip codebase pattern search (no patterns exist yet)
- Use plan's tech stack decisions to generate project scaffold
- After scaffolding, run
/project-configto populate project configuration
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Variant Decision Guide
| If implementation needs... | Use | Why |
|---|---|---|
| Quick, straightforward | /cook-fast |
Skip deep research, minimal planning |
| Complex, multi-layer | /cook-hard |
Maximum verification, subagent research |
| Backend + frontend parallel | /cook-parallel |
Parallel fullstack-developer agents |
| Full autonomous execution | /cook-auto |
Minimal user interaction |
| Fast autonomous | /cook-auto-fast |
Auto + skip deep research |
| Parallel autonomous | /cook-auto-parallel |
Auto + parallel agents |
| General/interactive | /cook (this skill) |
Step-by-step with user collaboration |
Think harder to plan & start working on these tasks: $ARGUMENTS
Your Approach
- Question Everything: Use
AskUserQuestiontool to fully understand the request, constraints, and true objectives. Don't assume — clarify until certain. - Brutal Honesty: Provide frank feedback. If something is unrealistic or over-engineered, say so directly. Prevent costly mistakes.
- Explore Alternatives: Consider multiple approaches. Present 2-3 viable solutions with clear pros/cons.
- Challenge Assumptions: Question the initial approach. Often the best solution differs from what was originally envisioned.
- Consider All Stakeholders: Evaluate impact on end users, developers, operations team, and business objectives.
Workflow
IMPORTANT: Analyze the skills catalog at .claude/skills/* and activate needed skills during the process.
Research
- Use multiple
researchersubagents in parallel to explore the request, validate ideas, and find best solutions. - Keep research reports concise (≤150 lines) with citations.
- Use
/scout-ext(preferred) or/scout(fallback) to search the codebase. - External Memory: Write all research findings to
.ai/workspace/analysis/{task-name}.analysis.md. Re-read ENTIRE file before planning.
Plan
- Use
plannersubagent to create an implementation plan using progressive disclosure structure. - Create directory using plan naming pattern, save overview at
plan.md(under 80 lines). - For each phase:
phase-XX-name.mdwith Context, Overview (date/priority/status), Key Insights, Requirements, Architecture, Related Code Files, Implementation Steps, Todo List, Success Criteria, Risk Assessment, Security Considerations, Next Steps.
Implementation
- Use
/codeslash command to implement the plan step by step. - Use
ui-ux-designersubagent for frontend work per./docs/design-guidelines.md. - For product UIs (dashboards, admin panels, SaaS apps), activate
/interface-designfor craft-driven design guidance. - For marketing pages, landing pages, creative UIs, or screenshot replication, activate
/frontend-designfor distinctive design with bold aesthetics. - Run type checking and compile to verify no syntax errors.
Subagent Context Discipline:
- Provide full task text — paste task content into subagent prompt; don't make subagent read plan file
- "Ask questions before starting" — subagent should surface uncertainties before implementing
- Self-review before reporting — subagent checks completeness, quality, YAGNI before returning results
Batch Checkpoint (Large Plans)
For plans with 10+ tasks, execute in batches with human review:
- Execute batch — Complete next 3 tasks (or user-specified batch size)
- Report — Show what was implemented, verification output, any concerns
- Wait — Say "Ready for feedback" and STOP. Do NOT continue automatically.
- Apply feedback — Incorporate changes, then execute next batch
- Repeat until all tasks complete
Testing
- Write real tests covering happy path, edge cases, and error cases.
- Use
testersubagent to run tests. If failures: usedebuggersubagent to find root cause, fix, re-run. - Repeat until all tests pass. Do not use fake data, mocks, or temporary solutions just to pass the build.
Code Review
- Two-stage review (see
.claude/skills/shared/two-stage-task-review-protocol.md):- First: dispatch
spec-compliance-reviewerto verify implementation matches spec - Only after spec passes: dispatch
code-reviewerfor quality review
- First: dispatch
- If critical issues: fix and re-run
tester. - Repeat until all tests pass and code is reviewed.
- Report summary to user and ask for approval.
Project Management & Documentation
If user approves: Use project-manager and docs-manager subagents in parallel to update progress and documentation.
If user rejects: Ask user to explain issues, fix, and repeat.
Onboarding
- Instruct user on getting started (API keys, env vars, config) if needed.
- Help configure step by step, one question at a time.
Final Report
- Summary of changes with next steps.
- Ask user if they want to commit and push via
git-managersubagent.
Red Flags — STOP (Implementation-Specific)
If you're thinking:
- "This is too simple to need a plan" — Simple tasks have hidden complexity. Plan anyway.
- "I already know how to do this" — Check codebase patterns first. Your assumptions may be wrong.
- "Let me just code it, then test" — TDD. Write the test first. Or at minimum, verify after each change.
- "The plan is close enough, I'll adapt" — Follow the plan exactly or raise concerns. Drift compounds.
- "I'll commit after I finish everything" — Commit after each task. Frequent commits prevent loss.
- "This refactor will make it better" — Only refactor what's in scope. YAGNI.
- "I can skip the review, it's obvious" — Reviews catch what authors miss. Never skip.
Graph-Assisted Investigation — When
.code-graph/graph.dbexists, MUST run at least ONE graph command on key files before concluding. Pattern: Grep finds files →trace --direction bothreveals full system flow → Grep verifies details. Useconnectionsfor 1-hop,callers_of/tests_forfor specific queries,batch-queryfor multiple files. MUST READ.claude/skills/shared/graph-assisted-investigation-protocol.mdfor full protocol and checklists. After implementing, runpython .claude/scripts/code_graph connections <file> --jsonon modified files to verify no related files need updates.
Graph-Trace Before Implementation
When graph DB is available, BEFORE writing code, trace to understand the blast radius:
python .claude/scripts/code_graph trace <file-to-modify> --direction both --json— see what calls this code AND what it triggerspython .claude/scripts/code_graph trace <file-to-modify> --direction downstream --json— see all downstream consumers that may need updating- This prevents breaking implicit dependencies (bus message consumers, event handlers) that aren't visible in the file itself
Workflow Recommendation
IMPORTANT MUST: If you are NOT already in a workflow, use
AskUserQuestionto ask the user:
- Activate
featureworkflow (Recommended) — scout → investigate → plan → cook → review → sre-review → test → docs- Execute
/cookdirectly — run this skill standalone
Next Steps
MANDATORY IMPORTANT MUST after completing this skill, use AskUserQuestion to recommend:
- "/code-simplifier (Recommended)" — Simplify and clean up implementation
- "/review-changes" — Review changes before commit
- "Skip, continue manually" — user decides
Standalone Review Gate (Non-Workflow Only)
MANDATORY IMPORTANT MUST: If this skill is called outside a workflow (standalone
/cook), you MUST create aTaskCreatetodo task for/review-changesas the last task in your task list. This ensures all changes are reviewed before commit even without a workflow enforcing it.If already running inside a workflow (e.g.,
feature,bugfix), skip this — the workflow sequence handles/review-changesat the appropriate step.
Closing Reminders
MANDATORY IMPORTANT MUST break work into small todo tasks using TaskCreate BEFORE starting.
MANDATORY IMPORTANT MUST validate decisions with user via AskUserQuestion — never auto-decide.
MANDATORY IMPORTANT MUST add a final review todo task to verify work quality.
MANDATORY IMPORTANT MUST READ the following files before starting:
- MUST READ
.claude/skills/shared/understand-code-first-protocol.mdbefore starting - MUST READ
.claude/skills/shared/plan-quality-protocol.mdbefore starting - MUST READ
.claude/skills/shared/rationalization-prevention-protocol.mdbefore starting - MUST READ
.claude/skills/shared/ui-system-context.mdbefore starting - MUST READ
.claude/skills/shared/iterative-phase-quality-protocol.mdbefore starting - MUST READ
.claude/skills/shared/graph-assisted-investigation-protocol.mdbefore starting
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
fix-parallel
[Implementation] Analyze & fix issues with parallel fullstack-developer agents
ask
[Utilities] Answer technical and architectural questions.
claude-code
[Utilities] Claude Code CLI setup, configuration, troubleshooting, and feature guidance. Triggers on claude code setup, hook not firing, MCP connection, context limit, skill creation, slash command setup.
workflow-deployment
[Workflow] Trigger Deployment & Infrastructure workflow — CI/CD pipelines, Docker, Kubernetes setup and deployment.
workflow-idea-to-pbi
[Workflow] Trigger Idea to PBI workflow — po/ba workflow: capture idea, refine to pbi, create stories, prioritize.
easy-claude-help
[Utilities] Configuration guide for the easy-claude framework — explain settings, guide users through configuring .ck.json.
Didn't find tool you were looking for?