init
This commit is contained in:
86
.opencode/skills/cook/README.md
Normal file
86
.opencode/skills/cook/README.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# Cook Skill
|
||||
|
||||
End-to-end feature implementation with smart intent detection.
|
||||
|
||||
## Installation
|
||||
|
||||
Copy the `cook/` folder to your Claude skills directory:
|
||||
```bash
|
||||
cp -r cook ~/.opencode/skills/
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
/ck:cook <natural language task OR plan path>
|
||||
```
|
||||
|
||||
The skill automatically detects your intent and routes to the appropriate workflow.
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Interactive mode (default)
|
||||
/ck:cook implement user authentication
|
||||
|
||||
# Execute existing plan
|
||||
/ck:cook plans/260120-auth
|
||||
|
||||
# Fast mode (skip research)
|
||||
/ck:cook quick fix for login bug
|
||||
/ck:cook implement feature --fast
|
||||
|
||||
# Auto mode (trust me bro)
|
||||
/ck:cook implement dashboard trust me
|
||||
/ck:cook implement feature --auto
|
||||
|
||||
# Parallel mode (multi-agent)
|
||||
/ck:cook implement auth, payments, notifications
|
||||
/ck:cook implement feature --parallel
|
||||
|
||||
# No-test mode
|
||||
/ck:cook implement feature --no-test
|
||||
```
|
||||
|
||||
## Modes
|
||||
|
||||
| Mode | Research | Testing | Review | Use Case |
|
||||
|------|----------|---------|--------|----------|
|
||||
| interactive | ✓ | ✓ | User approval | Default, full control |
|
||||
| auto | ✓ | ✓ | Auto if score≥9.5 | Trusted, hands-off |
|
||||
| fast | ✗ | ✓ | Simplified | Quick fixes |
|
||||
| parallel | Optional | ✓ | User approval | Multi-feature work |
|
||||
| no-test | ✓ | ✗ | User approval | Speed priority |
|
||||
| code | ✗ | ✓ | User approval | Existing plans |
|
||||
|
||||
## Intent Detection
|
||||
|
||||
The skill detects mode from:
|
||||
1. **Explicit flags:** `--fast`, `--auto`, `--parallel`, `--no-test`
|
||||
2. **Plan paths:** `./plans/*`, `plan.md`, `phase-*.md`
|
||||
3. **Keywords:** "fast", "quick", "trust me", "auto", "no test"
|
||||
4. **Feature count:** 3+ features → parallel mode
|
||||
|
||||
## Workflow
|
||||
|
||||
```
|
||||
[Intent Detection] → [Research?] → [Plan] → [Implement] → [Test?] → [Review] → [Finalize]
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
```
|
||||
cook/
|
||||
├── SKILL.md # Main skill definition
|
||||
├── README.md # This file
|
||||
└── references/
|
||||
├── intent-detection.md # Detection rules
|
||||
├── workflow-steps.md # Step definitions
|
||||
├── review-cycle.md # Review process
|
||||
└── subagent-patterns.md # Subagent usage
|
||||
```
|
||||
|
||||
## Version
|
||||
|
||||
2.1.0 - Review gates added for human-in-the-loop mode
|
||||
2.0.0 - Smart intent detection (hybrid approach)
|
||||
158
.opencode/skills/cook/SKILL.md
Normal file
158
.opencode/skills/cook/SKILL.md
Normal file
@@ -0,0 +1,158 @@
|
||||
---
|
||||
name: ck:cook
|
||||
description: "ALWAYS activate this skill before implementing EVERY feature, plan, or fix."
|
||||
argument-hint: "[task|plan-path] [--interactive|--fast|--parallel|--auto|--no-test]"
|
||||
metadata:
|
||||
author: claudekit
|
||||
version: "2.1.1"
|
||||
---
|
||||
|
||||
# Cook - Smart Feature Implementation
|
||||
|
||||
End-to-end implementation with automatic workflow detection.
|
||||
|
||||
**Principles:** YAGNI, KISS, DRY | Token efficiency | Concise reports
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/ck:cook <natural language task OR plan path>
|
||||
```
|
||||
|
||||
**IMPORTANT:** If no flag is provided, the skill will use the `interactive` mode by default for the workflow.
|
||||
|
||||
**Optional flags to select the workflow mode:**
|
||||
- `--interactive`: Full workflow with user input (**default**)
|
||||
- `--fast`: Skip research, scout→plan→code
|
||||
- `--parallel`: Multi-agent execution
|
||||
- `--no-test`: Skip testing step
|
||||
- `--auto`: Auto-approve all steps
|
||||
|
||||
**Example:**
|
||||
```
|
||||
/ck:cook "Add user authentication to the app" --fast
|
||||
/ck:cook path/to/plan.md --auto
|
||||
```
|
||||
|
||||
<HARD-GATE>
|
||||
Do NOT write implementation code until a plan exists and has been reviewed.
|
||||
This applies regardless of task simplicity. "Simple" tasks are where unexamined assumptions waste the most time.
|
||||
Exception: `--fast` mode skips research but still requires a plan step.
|
||||
User override: If user explicitly says "just code it" or "skip planning", respect their instruction.
|
||||
</HARD-GATE>
|
||||
|
||||
## Anti-Rationalization
|
||||
|
||||
| Thought | Reality |
|
||||
|---------|---------|
|
||||
| "This is too simple to plan" | Simple tasks have hidden complexity. Plan takes 30 seconds. |
|
||||
| "I already know how to do this" | Knowing ≠ planning. Write it down. |
|
||||
| "Let me just start coding" | Undisciplined action wastes tokens. Plan first. |
|
||||
| "The user wants speed" | Fastest path = plan → implement → done. Not: implement → debug → rewrite. |
|
||||
| "I'll plan as I go" | That's not planning, that's hoping. |
|
||||
| "Just this once" | Every skip is "just this once." No exceptions. |
|
||||
|
||||
## Smart Intent Detection
|
||||
|
||||
| Input Pattern | Detected Mode | Behavior |
|
||||
|---------------|---------------|----------|
|
||||
| Path to `plan.md` or `phase-*.md` | code | Execute existing plan |
|
||||
| Contains "fast", "quick" | fast | Skip research, scout→plan→code |
|
||||
| Contains "trust me", "auto" | auto | Auto-approve all steps |
|
||||
| Lists 3+ features OR "parallel" | parallel | Multi-agent execution |
|
||||
| Contains "no test", "skip test" | no-test | Skip testing step |
|
||||
| Default | interactive | Full workflow with user input |
|
||||
|
||||
See `references/intent-detection.md` for detection logic.
|
||||
|
||||
## Process Flow (Authoritative)
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[Intent Detection] --> B{Has plan path?}
|
||||
B -->|Yes| F[Load Plan]
|
||||
B -->|No| C{Mode?}
|
||||
C -->|fast| D[Scout → Plan → Code]
|
||||
C -->|interactive/auto| E[Research → Review → Plan]
|
||||
E --> F
|
||||
D --> F
|
||||
F --> G[Review Gate]
|
||||
G -->|approved| H[Implement]
|
||||
G -->|rejected| E
|
||||
H --> I[Review Gate]
|
||||
I -->|approved| J{--no-test?}
|
||||
J -->|No| K[Test]
|
||||
J -->|Yes| L[Finalize]
|
||||
K --> L
|
||||
L --> M[Report + Journal]
|
||||
```
|
||||
|
||||
**This diagram is the authoritative workflow.** Prose sections below provide detail for each node. If prose conflicts with this flow, follow the diagram.
|
||||
|
||||
## Workflow Overview
|
||||
|
||||
```
|
||||
[Intent Detection] → [Research?] → [Review] → [Plan] → [Review] → [Implement] → [Review] → [Test?] → [Review] → [Finalize]
|
||||
```
|
||||
|
||||
**Default (non-auto):** Stops at `[Review]` gates for human approval before each major step.
|
||||
**Auto mode (`--auto`):** Skips human review gates, implements all phases continuously.
|
||||
**Claude Tasks:** Utilize `TaskCreate`, `TaskUpdate`, `TaskGet`, `TaskList` during implementation step. **Fallback:** These are CLI-only tools — unavailable in VSCode extension. If they error, use `TodoWrite` for progress tracking instead.
|
||||
|
||||
| Mode | Research | Testing | Review Gates | Phase Progression |
|
||||
|------|----------|---------|--------------|-------------------|
|
||||
| interactive | ✓ | ✓ | **User approval at each step** | One at a time |
|
||||
| auto | ✓ | ✓ | Auto if score≥9.5 | All at once (no stops) |
|
||||
| fast | ✗ | ✓ | **User approval at each step** | One at a time |
|
||||
| parallel | Optional | ✓ | **User approval at each step** | Parallel groups |
|
||||
| no-test | ✓ | ✗ | **User approval at each step** | One at a time |
|
||||
| code | ✗ | ✓ | **User approval at each step** | Per plan |
|
||||
|
||||
## Step Output Format
|
||||
|
||||
```
|
||||
✓ Step [N]: [Brief status] - [Key metrics]
|
||||
```
|
||||
|
||||
## Blocking Gates (Non-Auto Mode)
|
||||
|
||||
Human review required at these checkpoints (skipped with `--auto`):
|
||||
- **Post-Research:** Review findings before planning
|
||||
- **Post-Plan:** Approve plan before implementation
|
||||
- **Post-Implementation:** Approve code before testing
|
||||
- **Post-Testing:** 100% pass + approve before finalize
|
||||
|
||||
**Always enforced (all modes):**
|
||||
- **Testing:** 100% pass required (unless no-test mode)
|
||||
- **Code Review:** User approval OR auto-approve (score≥9.5, 0 critical)
|
||||
- **Finalize (MANDATORY - never skip):**
|
||||
1. `project-manager` subagent → run full plan sync-back (all completed tasks/steps across all `phase-XX-*.md`, not only current phase), then update `plan.md` status/progress
|
||||
2. `docs-manager` subagent → update `./docs` if changes warrant
|
||||
3. `TaskUpdate` → mark all Claude Tasks complete after sync-back verification (skip if Task tools unavailable)
|
||||
4. Ask user if they want to commit via `git-manager` subagent
|
||||
5. Run `/ck:journal` to write a concise technical journal entry upon completion
|
||||
|
||||
## Required Subagents (MANDATORY)
|
||||
|
||||
| Phase | Subagent | Requirement |
|
||||
|-------|----------|-------------|
|
||||
| Research | `researcher` | Optional in fast/code |
|
||||
| Scout | `ck:scout` | Optional in code |
|
||||
| Plan | `planner` | Optional in code |
|
||||
| UI Work | `ui-ux-designer` | If frontend work |
|
||||
| Testing | `tester`, `debugger` | **MUST** spawn |
|
||||
| Review | `code-reviewer` | **MUST** spawn |
|
||||
| Finalize | `project-manager`, `docs-manager`, `git-manager` | **MUST** spawn all 3 |
|
||||
|
||||
**CRITICAL ENFORCEMENT:**
|
||||
- Steps 4, 5, 6 **MUST** use Task tool to spawn subagents
|
||||
- DO NOT implement testing, review, or finalization yourself - DELEGATE
|
||||
- If workflow ends with 0 Task tool calls, it is INCOMPLETE
|
||||
- Pattern: `Task(subagent_type="[type]", prompt="[task]", description="[brief]")`
|
||||
|
||||
## References
|
||||
|
||||
- `references/intent-detection.md` - Detection rules and routing logic
|
||||
- `references/workflow-steps.md` - Detailed step definitions for all modes
|
||||
- `references/review-cycle.md` - Interactive and auto review processes
|
||||
- `references/subagent-patterns.md` - Subagent invocation patterns
|
||||
101
.opencode/skills/cook/references/intent-detection.md
Normal file
101
.opencode/skills/cook/references/intent-detection.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# Intent Detection Logic
|
||||
|
||||
Detect user intent from natural language and route to appropriate workflow.
|
||||
|
||||
## Detection Algorithm
|
||||
|
||||
```
|
||||
FUNCTION detectMode(input):
|
||||
# Priority 1: Explicit flags (override all)
|
||||
IF input contains "--fast": RETURN "fast"
|
||||
IF input contains "--parallel": RETURN "parallel"
|
||||
IF input contains "--auto": RETURN "auto"
|
||||
IF input contains "--no-test": RETURN "no-test"
|
||||
|
||||
# Priority 2: Plan path detection
|
||||
IF input matches path pattern (./plans/*, plan.md, phase-*.md):
|
||||
RETURN "code"
|
||||
|
||||
# Priority 3: Keyword detection (case-insensitive)
|
||||
keywords = lowercase(input)
|
||||
|
||||
IF keywords contains ["fast", "quick", "rapidly", "asap"]:
|
||||
RETURN "fast"
|
||||
|
||||
IF keywords contains ["trust me", "auto", "yolo", "just do it"]:
|
||||
RETURN "auto"
|
||||
|
||||
IF keywords contains ["no test", "skip test", "without test"]:
|
||||
RETURN "no-test"
|
||||
|
||||
# Priority 4: Complexity detection
|
||||
features = extractFeatures(input) # comma-separated or "and"-joined items
|
||||
IF count(features) >= 3 OR keywords contains "parallel":
|
||||
RETURN "parallel"
|
||||
|
||||
# Default: interactive workflow
|
||||
RETURN "interactive"
|
||||
```
|
||||
|
||||
## Feature Extraction
|
||||
|
||||
Detect multiple features from natural language:
|
||||
|
||||
```
|
||||
"implement auth, payments, and notifications" → ["auth", "payments", "notifications"]
|
||||
"add login + signup + password reset" → ["login", "signup", "password reset"]
|
||||
"create dashboard with charts and tables" → single feature (dashboard)
|
||||
```
|
||||
|
||||
**Parallel trigger:** 3+ distinct features = parallel mode
|
||||
|
||||
## Mode Behaviors
|
||||
|
||||
| Mode | Skip Research | Skip Test | Review Gates | Auto-Approve | Parallel Exec |
|
||||
|------|---------------|-----------|--------------|--------------|---------------|
|
||||
| interactive | ✗ | ✗ | **Yes (stops)** | ✗ | ✗ |
|
||||
| auto | ✗ | ✗ | **No (skips)** | ✓ (score≥9.5) | ✓ (all phases) |
|
||||
| fast | ✓ | ✗ | Yes (stops) | ✗ | ✗ |
|
||||
| parallel | Optional | ✗ | Yes (stops) | ✗ | ✓ |
|
||||
| no-test | ✗ | ✓ | Yes (stops) | ✗ | ✗ |
|
||||
| code | ✓ | ✗ | Yes (stops) | Per plan | Per plan |
|
||||
|
||||
**Review Gates:** Human approval checkpoints between major steps (see `workflow-steps.md`).
|
||||
- All modes EXCEPT `auto` stop at review gates for human approval.
|
||||
- `auto` mode is the only mode that runs continuously without stopping.
|
||||
|
||||
## Examples
|
||||
|
||||
```
|
||||
"/ck:cook implement user auth"
|
||||
→ Mode: interactive (default, stops at review gates)
|
||||
|
||||
"/ck:cook plans/260120-auth/phase-02-api.md"
|
||||
→ Mode: code (path detected, stops at review gates)
|
||||
|
||||
"/ck:cook quick fix for the login bug"
|
||||
→ Mode: fast ("quick" keyword, stops at review gates)
|
||||
|
||||
"/ck:cook implement auth, payments, notifications, shipping"
|
||||
→ Mode: parallel (4 features, stops at review gates)
|
||||
|
||||
"/ck:cook implement dashboard --fast"
|
||||
→ Mode: fast (explicit flag, stops at review gates)
|
||||
|
||||
"/ck:cook implement everything --auto"
|
||||
→ Mode: auto (NO STOPS, implements all phases continuously)
|
||||
|
||||
"/ck:cook implement dashboard trust me"
|
||||
→ Mode: auto ("trust me" keyword, NO STOPS)
|
||||
```
|
||||
|
||||
**Note:** Only `--auto` flag or "trust me"/"auto"/"yolo" keywords enable continuous execution.
|
||||
|
||||
## Conflict Resolution
|
||||
|
||||
When multiple signals detected, priority order:
|
||||
1. Explicit flags (`--fast`, `--auto`, etc.)
|
||||
2. Path detection (plan files)
|
||||
3. Keywords in text
|
||||
4. Feature count analysis
|
||||
5. Default (interactive)
|
||||
75
.opencode/skills/cook/references/review-cycle.md
Normal file
75
.opencode/skills/cook/references/review-cycle.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Code Review Cycle
|
||||
|
||||
Interactive review-fix cycle used in code workflows.
|
||||
|
||||
## Interactive Cycle (max 3 cycles)
|
||||
|
||||
```
|
||||
cycle = 0
|
||||
LOOP:
|
||||
1. Run code-reviewer → score, critical_count, warnings, suggestions
|
||||
|
||||
2. DISPLAY FINDINGS:
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Code Review Results: [score]/10 │
|
||||
├─────────────────────────────────────────┤
|
||||
│ Summary: [what implemented], tests │
|
||||
│ [X/X passed] │
|
||||
├─────────────────────────────────────────┤
|
||||
│ Critical Issues ([N]): MUST FIX │
|
||||
│ - [issue] at [file:line] │
|
||||
│ Warnings ([N]): SHOULD FIX │
|
||||
│ - [issue] at [file:line] │
|
||||
│ Suggestions ([N]): NICE TO HAVE │
|
||||
│ - [suggestion] │
|
||||
└─────────────────────────────────────────┘
|
||||
|
||||
3. AskUserQuestion (header: "Review & Approve"):
|
||||
IF critical_count > 0:
|
||||
- "Fix critical issues" → fix, re-run tester, cycle++, LOOP
|
||||
- "Fix all issues" → fix all, re-run tester, cycle++, LOOP
|
||||
- "Approve anyway" → PROCEED
|
||||
- "Abort" → stop
|
||||
ELSE:
|
||||
- "Approve" → PROCEED
|
||||
- "Fix warnings/suggestions" → fix, cycle++, LOOP
|
||||
- "Abort" → stop
|
||||
|
||||
4. IF cycle >= 3 AND user selects fix:
|
||||
→ "⚠ 3 review cycles completed. Final decision required."
|
||||
→ AskUserQuestion: "Approve with noted issues" / "Abort workflow"
|
||||
```
|
||||
|
||||
## Auto-Handling Cycle (for auto modes)
|
||||
|
||||
```
|
||||
cycle = 0
|
||||
LOOP:
|
||||
1. Run code-reviewer → score, critical_count, warnings
|
||||
|
||||
2. IF score >= 9.5 AND critical_count == 0:
|
||||
→ Auto-approve, PROCEED
|
||||
|
||||
3. ELSE IF critical_count > 0 AND cycle < 3:
|
||||
→ Auto-fix critical issues
|
||||
→ Re-run tester
|
||||
→ cycle++, LOOP
|
||||
|
||||
4. ELSE IF critical_count > 0 AND cycle >= 3:
|
||||
→ ESCALATE TO USER
|
||||
|
||||
5. ELSE (no critical, score < 9.5):
|
||||
→ Approve with warnings logged, PROCEED
|
||||
```
|
||||
|
||||
## Critical Issues Definition
|
||||
- Security: XSS, SQL injection, OWASP vulnerabilities
|
||||
- Performance: bottlenecks, inefficient algorithms
|
||||
- Architecture: violations of patterns, coupling
|
||||
- Principles: YAGNI, KISS, DRY violations
|
||||
|
||||
## Output Formats
|
||||
- Waiting: `⏸ Step 4: Code reviewed - [score]/10 - WAITING for approval`
|
||||
- After fix: `✓ Step 4: [old]/10 → Fixed [N] issues → [new]/10 - Approved`
|
||||
- Auto-approved: `✓ Step 4: Code reviewed - 9.8/10 - Auto-approved`
|
||||
- Approved: `✓ Step 4: Code reviewed - [score]/10 - User approved`
|
||||
75
.opencode/skills/cook/references/subagent-patterns.md
Normal file
75
.opencode/skills/cook/references/subagent-patterns.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Subagent Patterns
|
||||
|
||||
Standard patterns for spawning and using subagents in cook workflows.
|
||||
|
||||
## Task Tool Pattern
|
||||
```
|
||||
Task(subagent_type="[type]", prompt="[task description]", description="[brief]")
|
||||
```
|
||||
|
||||
## Research Phase
|
||||
```
|
||||
Task(subagent_type="researcher", prompt="Research [topic]. Report ≤150 lines.", description="Research [topic]")
|
||||
```
|
||||
- Use multiple researchers in parallel for different topics
|
||||
- Keep reports ≤150 lines with citations
|
||||
|
||||
## Scout Phase
|
||||
```
|
||||
Task(subagent_type="scout", prompt="Find files related to [feature] in codebase", description="Scout [feature]")
|
||||
```
|
||||
- Use `/ck:scout ext` (preferred) or `/ck:scout` (fallback)
|
||||
|
||||
## Planning Phase
|
||||
```
|
||||
Task(subagent_type="planner", prompt="Create implementation plan based on reports: [reports]. Save to [path]", description="Plan [feature]")
|
||||
```
|
||||
- Input: researcher and scout reports
|
||||
- Output: `plan.md` + `phase-XX-*.md` files
|
||||
|
||||
## UI Implementation
|
||||
```
|
||||
Task(subagent_type="ui-ux-designer", prompt="Implement [feature] UI per ./docs/design-guidelines.md", description="UI [feature]")
|
||||
```
|
||||
- For frontend work
|
||||
- Follow design guidelines
|
||||
|
||||
## Testing
|
||||
```
|
||||
Task(subagent_type="tester", prompt="Run test suite for plan phase [phase-name]", description="Test [phase]")
|
||||
```
|
||||
- Must achieve 100% pass rate
|
||||
|
||||
## Debugging
|
||||
```
|
||||
Task(subagent_type="debugger", prompt="Analyze failures: [details]", description="Debug [issue]")
|
||||
```
|
||||
- Use when tests fail
|
||||
- Provides root cause analysis
|
||||
|
||||
## Code Review
|
||||
```
|
||||
Task(subagent_type="code-reviewer", prompt="Review changes for [phase]. Check security, performance, YAGNI/KISS/DRY. Return score (X/10), critical, warnings, suggestions.", description="Review [phase]")
|
||||
```
|
||||
|
||||
## Project Management
|
||||
```
|
||||
Task(subagent_type="project-manager", prompt="Run full sync-back in [plan-path]: reconcile completed tasks with all phase files, backfill stale completed checkboxes across all phases, update plan.md status/progress, and report unresolved mappings.", description="Update plan")
|
||||
```
|
||||
|
||||
## Documentation
|
||||
```
|
||||
Task(subagent_type="docs-manager", prompt="Update docs for [phase]. Changed files: [list]", description="Update docs")
|
||||
```
|
||||
|
||||
## Git Operations
|
||||
```
|
||||
Task(subagent_type="git-manager", prompt="Stage and commit changes with conventional commit message", description="Commit changes")
|
||||
```
|
||||
|
||||
## Parallel Execution
|
||||
```
|
||||
Task(subagent_type="fullstack-developer", prompt="Implement [phase-file] with file ownership: [files]", description="Implement phase [N]")
|
||||
```
|
||||
- Launch multiple for parallel phases
|
||||
- Include file ownership boundaries
|
||||
192
.opencode/skills/cook/references/workflow-steps.md
Normal file
192
.opencode/skills/cook/references/workflow-steps.md
Normal file
@@ -0,0 +1,192 @@
|
||||
# Unified Workflow Steps
|
||||
|
||||
All modes share core steps with mode-specific variations.
|
||||
|
||||
**Task Tool Fallback:** `TaskCreate`/`TaskUpdate`/`TaskGet`/`TaskList` are CLI-only — unavailable in VSCode extension. If they error, use `TodoWrite` for progress tracking. All workflow steps remain functional without Task tools.
|
||||
|
||||
## Step 0: Intent Detection & Setup
|
||||
|
||||
1. Parse input with `intent-detection.md` rules
|
||||
2. Log detected mode: `✓ Step 0: Mode [X] - [reason]`
|
||||
3. If mode=code: detect plan path, set active plan
|
||||
4. Use `TaskCreate` to create workflow step tasks (with dependencies if complex)
|
||||
|
||||
**Output:** `✓ Step 0: Mode [interactive|auto|fast|parallel|no-test|code] - [detection reason]`
|
||||
|
||||
## Step 1: Research (skip if fast/code mode)
|
||||
|
||||
**Interactive/Auto:**
|
||||
- Spawn multiple `researcher` agents in parallel
|
||||
- Use `/ck:scout ext` or `scout` agent for codebase search
|
||||
- Keep reports ≤150 lines
|
||||
|
||||
**Parallel:**
|
||||
- Optional: max 2 researchers if complex
|
||||
|
||||
**Output:** `✓ Step 1: Research complete - [N] reports gathered`
|
||||
|
||||
### [Review Gate 1] Post-Research (skip if auto mode)
|
||||
- Present research summary to user
|
||||
- Use `AskUserQuestion` to ask: "Proceed to planning?" / "Request more research" / "Abort"
|
||||
- **Auto mode:** Skip this gate
|
||||
|
||||
## Step 2: Planning
|
||||
|
||||
**Interactive/Auto/No-test:**
|
||||
- Use `planner` agent with research context
|
||||
- Create `plan.md` + `phase-XX-*.md` files
|
||||
|
||||
**Fast:**
|
||||
- Use `/ck:plan --fast` with scout results only
|
||||
- Minimal planning, focus on action
|
||||
|
||||
**Parallel:**
|
||||
- Use `/ck:plan --parallel` for dependency graph + file ownership matrix
|
||||
|
||||
**Code:**
|
||||
- Skip - plan already exists
|
||||
- Parse existing plan for phases
|
||||
|
||||
**Output:** `✓ Step 2: Plan created - [N] phases`
|
||||
|
||||
### [Review Gate 2] Post-Plan (skip if auto mode)
|
||||
- Present plan overview with phases
|
||||
- Use `AskUserQuestion` to ask: "Validate the plan or approve plan to start implementation?" - "Validate" / "Approve" / "Abort" / "Other" ("Request revisions")
|
||||
- "Validate": run `/ck:plan validate` skill invocation
|
||||
- "Approve": continue to implementation
|
||||
- "Abort": stop the workflow
|
||||
- "Other": revise the plan based on user's feedback
|
||||
- **Auto mode:** Skip this gate
|
||||
|
||||
## Step 3: Implementation
|
||||
|
||||
**IMPORTANT:**
|
||||
1. `TaskList` first — check for existing tasks (hydrated by planning skill in same session)
|
||||
2. If tasks exist → pick them up, skip re-creation
|
||||
3. If no tasks → read plan phases, `TaskCreate` for each unchecked `[ ]` item with priority order and metadata (`phase`, `planDir`, `phaseFile`)
|
||||
4. Tasks can be blocked by other tasks via `addBlockedBy`
|
||||
|
||||
**All modes:**
|
||||
- Use `TaskUpdate` to mark tasks as `in_progress` immediately.
|
||||
- Execute phase tasks sequentially (Step 3.1, 3.2, etc.)
|
||||
- Use `ui-ux-designer` for frontend
|
||||
- Use `ck:ai-multimodal` for image assets
|
||||
- Run type checking after each file
|
||||
|
||||
**Parallel mode:**
|
||||
- Utilize all tools of Claude Tasks: `TaskCreate`, `TaskUpdate`, `TaskGet` and `TaskList`
|
||||
- Launch multiple `fullstack-developer` agents
|
||||
- When agents pick up a task, use `TaskUpdate` to assign task to agent and mark tasks as `in_progress` immediately.
|
||||
- Respect file ownership boundaries
|
||||
- Wait for parallel group before next
|
||||
|
||||
**Output:** `✓ Step 3: Implemented [N] files - [X/Y] tasks complete`
|
||||
|
||||
### [Review Gate 3] Post-Implementation (skip if auto mode)
|
||||
- Present implementation summary (files changed, key changes)
|
||||
- Use `AskUserQuestion` to ask: "Proceed to testing?" / "Request implementation changes" / "Abort"
|
||||
- **Auto mode:** Skip this gate
|
||||
|
||||
## Step 4: Testing (skip if no-test mode)
|
||||
|
||||
**All modes (except no-test):**
|
||||
- Write tests: happy path, edge cases, errors
|
||||
- **MUST** spawn `tester` subagent: `Task(subagent_type="tester", prompt="Run test suite", description="Run tests")`
|
||||
- If failures: **MUST** spawn `debugger` subagent → fix → repeat
|
||||
- **Forbidden:** fake mocks, commented tests, changed assertions, skipping subagent delegation
|
||||
|
||||
**Output:** `✓ Step 4: Tests [X/X passed] - tester subagent invoked`
|
||||
|
||||
### [Review Gate 4] Post-Testing (skip if auto mode)
|
||||
- Present test results summary
|
||||
- Use `AskUserQuestion` to ask: "Proceed to code review?" / "Request test fixes" / "Abort"
|
||||
- **Auto mode:** Skip this gate
|
||||
|
||||
## Step 5: Code Review
|
||||
|
||||
**All modes - MANDATORY subagent:**
|
||||
- **MUST** spawn `code-reviewer` subagent: `Task(subagent_type="code-reviewer", prompt="Review changes. Return score, critical issues, warnings.", description="Code review")`
|
||||
- **DO NOT** review code yourself - delegate to subagent
|
||||
|
||||
**Interactive/Parallel/Code/No-test:**
|
||||
- Interactive cycle (max 3): see `review-cycle.md`
|
||||
- Requires user approval
|
||||
|
||||
**Auto:**
|
||||
- Auto-approve if score≥9.5 AND 0 critical
|
||||
- Auto-fix critical (max 3 cycles)
|
||||
- Escalate to user after 3 failed cycles
|
||||
|
||||
**Fast:**
|
||||
- Simplified review, no fix loop
|
||||
- User approves or aborts
|
||||
|
||||
**Output:** `✓ Step 5: Review [score]/10 - [Approved|Auto-approved] - code-reviewer subagent invoked`
|
||||
|
||||
## Step 6: Finalize
|
||||
|
||||
**All modes - MANDATORY subagents (NON-NEGOTIABLE):**
|
||||
1. **MUST** spawn these subagents in parallel:
|
||||
- `Task(subagent_type="project-manager", prompt="Run full sync-back for [plan-path]: reconcile all completed Claude Tasks with all phase files, backfill stale completed checkboxes across every phase, then update plan.md frontmatter/table progress. Do NOT only mark current phase.", description="Update plan")`
|
||||
- `Task(subagent_type="docs-manager", prompt="Update docs for changes.", description="Update docs")`
|
||||
2. Project-manager sync-back MUST include:
|
||||
|
||||
### Status Sync (Finalize)
|
||||
|
||||
Use CLI commands for deterministic status updates:
|
||||
|
||||
```bash
|
||||
# Mark completed phases
|
||||
ck plan check <phase-id>
|
||||
|
||||
# Mark in-progress phases
|
||||
ck plan check <phase-id> --start
|
||||
|
||||
# Revert if needed
|
||||
ck plan uncheck <phase-id>
|
||||
```
|
||||
|
||||
**Fallback:** If `ck` is not available, edit plan.md directly —
|
||||
only change the Status column cell, preserve table structure.
|
||||
- Sweep all `phase-XX-*.md` files in the plan directory.
|
||||
- Mark every completed item `[ ] → [x]` based on completed tasks (including earlier phases finished before current phase).
|
||||
- Update `plan.md` status/progress (`pending`/`in-progress`/`completed`) from actual checkbox state.
|
||||
- Return unresolved mappings if any completed task cannot be matched to a phase file.
|
||||
3. Use `TaskUpdate` to mark Claude Tasks complete after sync-back confirmation.
|
||||
4. Onboarding check (API keys, env vars)
|
||||
5. **MUST** spawn git subagent: `Task(subagent_type="git-manager", prompt="Stage and commit changes", description="Commit")`
|
||||
|
||||
**CRITICAL:** Step 6 is INCOMPLETE without spawning all 3 subagents. DO NOT skip subagent delegation.
|
||||
|
||||
**Auto mode:** Continue to next phase automatically, start from **Step 3**.
|
||||
**Others:** Ask user before next phase
|
||||
|
||||
**Output:** `✓ Step 6: Finalized - 3 subagents invoked - Full-plan sync-back completed - Committed`
|
||||
|
||||
## Mode-Specific Flow Summary
|
||||
|
||||
Legend: `[R]` = Review Gate (human approval required)
|
||||
|
||||
```
|
||||
interactive: 0 → 1 → [R] → 2 → [R] → 3 → [R] → 4 → [R] → 5(user) → 6
|
||||
auto: 0 → 1 → 2 → 3 → 4 → 5(auto) → 6 → next phase (NO stops)
|
||||
fast: 0 → skip → 2(fast) → [R] → 3 → [R] → 4 → [R] → 5(simple) → 6
|
||||
parallel: 0 → 1? → [R] → 2(parallel) → [R] → 3(multi-agent) → [R] → 4 → [R] → 5(user) → 6
|
||||
no-test: 0 → 1 → [R] → 2 → [R] → 3 → [R] → skip → 5(user) → 6
|
||||
code: 0 → skip → skip → 3 → [R] → 4 → [R] → 5(user) → 6
|
||||
```
|
||||
|
||||
**Key difference:** `auto` mode is the ONLY mode that skips all review gates.
|
||||
|
||||
## Critical Rules
|
||||
|
||||
- Never skip steps without mode justification
|
||||
- **MANDATORY SUBAGENT DELEGATION:** Steps 4, 5, 6 MUST spawn subagents via Task tool. DO NOT implement directly.
|
||||
- Step 4: `tester` (and `debugger` if failures)
|
||||
- Step 5: `code-reviewer`
|
||||
- Step 6: `project-manager`, `docs-manager`, `git-manager`
|
||||
- Use `TaskCreate` to create Claude Tasks for each unchecked item with priority order and dependencies (or `TodoWrite` if Task tools unavailable).
|
||||
- Use `TaskUpdate` to mark Claude Tasks `in_progress` when picking up a task (skip if Task tools unavailable).
|
||||
- Use `TaskUpdate` to mark Claude Tasks `complete` immediately after finalizing the task (skip if Task tools unavailable).
|
||||
- All step outputs follow format: `✓ Step [N]: [status] - [metrics]`
|
||||
- **VALIDATION:** If Task tool calls = 0 at end of workflow, the workflow is INCOMPLETE.
|
||||
Reference in New Issue
Block a user