cook-frontend
Cook — Frontend Workflow
Structured workflow for frontend projects. Every non-trivial task flows through ordered phases.
Plan → Design → Code → Review → Test
Memory Bank — Required for Every Session
At the start of EVERY session, read all files in memory-bank/:
projectbrief.md— Core requirements and goalsproductContext.md— Problem and solution contexttechContext.md— Technical setup and dependenciessystemPatterns.md— Architecture and design patternsactiveContext.md— Current work focus and recent changesprogress.md— Completed work and known issues
If memory-bank/ does not exist, create it with the files above based on what you learn from the codebase.
After completing work (end of Test phase or any stopping point), update:
activeContext.md— What was done, current state, next stepsprogress.md— Mark completed items, add new known issues
This ensures continuity across sessions. Never skip this step.
[PLAN] Plan
- Read requirements. Ask if ambiguous.
- Identify affected components, pages, and state.
- Break into subtasks. Define acceptance criteria including visual/UX requirements.
- Identify data flow — where does data come from? What triggers re-renders?
Output: Numbered plan with component tree changes and acceptance criteria. Rule: No code in this phase.
[DESIGN] Design
- Define component hierarchy and props interfaces.
- Choose state management approach (local state, context, store).
- Plan responsive behavior and accessibility.
- Identify reusable vs one-off components.
Output: Component signatures, data flow, and layout approach. Rule: Match existing component patterns. Don't create new design conventions.
[CODE] Code
- Build from leaf components up — smallest pieces first.
- Implement layout and structure, then interactivity, then styling polish.
- Handle loading, error, and empty states for every data-dependent view.
- Ensure accessibility — semantic HTML, keyboard navigation, ARIA labels.
Rules:
- Match existing component patterns and naming conventions.
- No hardcoded strings for user-facing text if the project uses i18n.
[REVIEW] Review
- Visual — Does it match the requirements? Responsive on mobile/tablet/desktop?
- Accessibility — Keyboard navigable? Screen reader friendly? Color contrast?
- State — No unnecessary re-renders? Proper cleanup of effects/subscriptions?
- Types — Props typed correctly? No
any? - Edge cases — Loading states, error states, empty states, long text overflow?
Fix issues immediately. If layout/design is wrong, loop back to Design.
[TEST] Test
- Component tests — Render components, assert output and interactions. Use Testing Library patterns (query by role/label, not implementation).
- Visual check — Run the dev server and manually verify the feature looks correct.
- Run the full test suite and type checker.
Rule: Test user behavior ("user clicks submit, sees success message"), not implementation details.
Iteration
If any phase reveals problems:
- Test failures from a bug → Fix in Code, re-run Review + Test.
- Review reveals missing requirements → Loop back to Plan.
- Design flaw found during Code → Loop back to Design.
- User feedback changes scope → Restart from Plan.
Always note which phase you're returning to and why.
Phase Markers
Prefix progress with the current phase:
[PLAN] Analyzing requirements...
[DESIGN] Defining component hierarchy...
[CODE] Implementing components...
[REVIEW] Self-reviewing changes...
[TEST] Running component tests...