Orchestrates 4-stage development workflow (PLAN → IMPLEMENT → TEST → FINAL)
Orchestrates development through structured PLAN → IMPLEMENT → TEST → FINAL stages with automated reviews.
npx claudepluginhub kenkenmain/ken-cc-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
prompts/brainstorm.mdprompts/final-review.mdprompts/implement-review.mdprompts/implementation.mdprompts/plan-review.mdprompts/test-review.mdFor Claude: This skill orchestrates development through 4 stages. Follow each stage sequentially. Do not skip phases.
digraph when_to_use {
"Task requires implementation?" [shape=diamond];
"Has spec or requirements?" [shape=diamond];
"Need structured workflow?" [shape=diamond];
"Use kenken:iterate" [shape=box style=filled fillcolor=lightgreen];
"Use superpowers:brainstorming first" [shape=box];
"Manual implementation" [shape=box];
"Task requires implementation?" -> "Has spec or requirements?" [label="yes"];
"Task requires implementation?" -> "Manual implementation" [label="no - research only"];
"Has spec or requirements?" -> "Need structured workflow?" [label="yes"];
"Has spec or requirements?" -> "Use superpowers:brainstorming first" [label="no - explore first"];
"Need structured workflow?" -> "Use kenken:iterate" [label="yes"];
"Need structured workflow?" -> "Manual implementation" [label="no - simple task"];
}
Stages: PLAN → IMPLEMENT → TEST (optional) → FINAL
digraph workflow {
rankdir=LR;
subgraph cluster_plan {
label="PLAN";
"1.1 Brainstorm" -> "1.2 Write Plan" -> "1.3 Plan Review";
}
subgraph cluster_implement {
label="IMPLEMENT";
"2.1 Implementation" -> "2.2 Code Simplify" -> "2.3 Implement Review";
}
subgraph cluster_test {
label="TEST (optional)";
"3.1 Test Plan" -> "3.2 Write Tests" -> "3.3 Coverage" -> "3.4 Run Tests" -> "3.5 Test Review";
}
subgraph cluster_final {
label="FINAL";
"4.1 Codex Final" -> "4.2 Suggest Extensions";
}
"1.3 Plan Review" -> "2.1 Implementation";
"2.3 Implement Review" -> "3.1 Test Plan" [label="if enabled"];
"2.3 Implement Review" -> "4.1 Codex Final" [label="if disabled"];
"3.5 Test Review" -> "4.1 Codex Final";
"4.2 Suggest Extensions" -> "1.1 Brainstorm" [label="user accepts" style=dashed];
}
State file: .agents/kenken-state.json
Config file: .claude/kenken-config.json
Complete all phases before advancing to IMPLEMENT.
Goal: Understand the problem and design a production-ready solution.
Skill: superpowers:brainstorming + superpowers:dispatching-parallel-agents
Prompt: See prompts/brainstorm.md
Actions:
docs/plans/{date}-{topic}-design.mdExit criteria: Design documented and approved.
Goal: Create detailed implementation plan with tasks in Task API format.
Skill: superpowers:writing-plans
Actions:
tasks:
- id: 1
description: "Short description (3-5 words)"
subagent_type: "general-purpose" # or Bash, Explore, etc.
prompt: |
Full prompt for the subagent including:
- What to implement
- Files to create/modify
- Exact code to write
- How to verify
dependencies: [] # task IDs this depends on
docs/plans/{date}-{topic}-plan.mdTask API Format Reference:
| Field | Required | Description |
|---|---|---|
id | Yes | Unique task identifier (number) |
description | Yes | Short description for Task tool (3-5 words) |
subagent_type | Yes | Agent type: general-purpose, Bash, Explore, etc. |
prompt | Yes | Full prompt with all context needed |
dependencies | No | List of task IDs that must complete first |
model | No | Override model: sonnet, opus, haiku, or versioned like opus-4.5 |
run_in_background | No | Run async: true/false |
Exit criteria: Plan saved with all tasks in Task API format.
Goal: Validate plan quality before implementation.
Tool: Configured tool (default: mcp__codex-high__codex)
Prompt: See prompts/plan-review.md
Actions:
On failure: Retry (max configured retries). After max, ask user.
Complete all phases before advancing to TEST or FINAL.
Goal: Execute the plan task by task.
Implementer (from config stages.implement.implementation.implementer):
claude (default): Use Claude subagents via superpowers:subagent-driven-developmentcodex-high: Use mcp__codex-high__codex for implementationcodex-xhigh: Use mcp__codex-xhigh__codex for implementationActions:
docs/plans/{date}-{topic}-plan.mdtasks: YAML block into task liststages.implement.implementation.implementer config:Create TodoWrite with all tasks. For each task (respecting dependencies):
Task(
description: task.description,
prompt: task.prompt,
subagent_type: task.subagent_type,
model: task.model, // optional
run_in_background: task.run_in_background // optional
)
Parallel execution: Tasks with no unmet dependencies can run in parallel using run_in_background: true
Commit after each task or logical group.
Invoke the configured Codex tool with implementation prompt:
Implement the following tasks from the plan at docs/plans/{date}-{topic}-plan.md
For each task:
1. Read the task requirements
2. Write the code following TDD:
- Write failing test first (if applicable)
- Implement minimal code to pass
- Verify tests pass
3. Follow existing code patterns and conventions
4. Add appropriate logging and error handling
Run these commands after implementation:
1. make lint (if available)
2. make test (if available)
If tests fail, fix issues and re-run until passing.
Commit after implementation is complete.
Logging requirements (both modes):
Exit criteria: All tasks completed and committed.
Goal: Reduce complexity while preserving functionality.
Plugin: code-simplifier:code-simplifier
Actions:
Exit criteria: Code simplified.
Goal: Validate implementation quality.
Tool: Configured tool (default: mcp__codex-high__codex)
Bug Fixer (from config stages.implement.implementReview.bugFixer):
claude: Use Claude subagents to fix issuescodex-high (default): Use mcp__codex-high__codex to fix issuescodex-xhigh: Use mcp__codex-xhigh__codex to fix issuesPrompt: See prompts/implement-review.md
Actions:
On failure: Retry (max configured retries). After max, restart IMPLEMENT stage.
Enable via config: stages.test.enabled: true
Skip this stage if not enabled. Proceed directly to FINAL.
If test configuration is not set, auto-detect and verify with user:
Auto-detection checks:
Look for test frameworks:
package.json → jest, vitest, mochapyproject.toml / pytest.ini → pytestgo.mod → go testCargo.toml → cargo testMakefile → make testLook for existing test files:
*.test.ts, *.spec.ts, __tests__/*_test.py, tests/*_test.goLook for coverage tools:
Present detected config to user using AskUserQuestion:
Goal: Plan what tests to write based on project testing instructions.
Actions:
Exit criteria: Test plan documented.
Goal: Write the tests following project instructions.
Actions:
Exit criteria: Tests written.
Goal: Verify test coverage meets threshold.
Threshold: From config stages.test.coverageThreshold (default: 80%)
Actions:
.agents/logs/coverage-{timestamp}.logOn failure: Return to Phase 3.2 to add more tests.
Exit criteria: Coverage >= threshold.
Goal: Execute tests and capture results.
Actions:
.agents/logs/test-run-{timestamp}.log.agents/logs/errors/error-summary.jsonOn test failure, classify error:
| Error Location | Error Type | Action |
|---|---|---|
| In test file (.test., .spec.) | Test Error | Return to Phase 3.2 |
| In source file (src/, lib/) | Code Logic Error | Fix code, then restart IMPLEMENT stage |
Exit criteria: All tests pass.
Goal: Validate test quality.
Tool: Configured tool (default: mcp__codex-high__codex)
Prompt: See prompts/test-review.md
Actions:
On failure: Retry (max configured retries). After max, ask user.
Goal: Final validation with high reasoning.
Tool: Always uses mcp__codex-xhigh__codex
Bug Fixer (from config stages.final.codexFinal.bugFixer):
claude: Use Claude subagents to fix issuescodex-high (default): Use mcp__codex-high__codex to fix issuescodex-xhigh: Use mcp__codex-xhigh__codex to fix issuesPrompt: See prompts/final-review.md
Actions:
Exit criteria: No HIGH severity issues.
Goal: Propose next steps to user.
Actions:
Exit criteria: User chose extension (restart PLAN), or Done (advance to 4.3).
Goal: Finalize work with optional git/PR operations.
Actions:
Ask user using AskUserQuestion (header: "Git workflow"):
Based on choice:
If No git:
If Commit:
.agents/, docs/plans/, temporary files)Co-Authored-By: ClaudeIf Branch + PR:
Generate branch name using configured format:
git.branchFormat (default: {type}/{slug}){type} (feat/fix/etc), {slug} (task-slug), {date} (YYYY-MM-DD), {user} (git user)git.defaultType (default: feat), or infer from task (fix for bugs)feat/add-user-auth, fix/login-bug, user/feat/2026-01-24-oauthFetch latest main: git fetch origin
Detect main branch (config git.mainBranch): auto detects via git remote show origin | grep 'HEAD branch'
Create branch from latest main:
MAIN_BRANCH=$(git remote show origin | grep 'HEAD branch' | awk '{print $NF}')
git stash --include-untracked # Save any uncommitted changes
git checkout -b <branch-name> origin/$MAIN_BRANCH
git stash pop # Restore changes
Stage and commit (as above)
Push branch to origin: git push -u origin <branch-name>
Create PR using gh pr create:
gh pr create --title "<task summary>" --body "$(cat <<'EOF'
## Summary
<bullet points from task>
## Changes
<list of changed files>
🤖 Generated with kenken workflow
EOF
)"
Display PR URL
Summarize and clear state
Exit criteria: User chose completion option and git operations (if any) succeeded.
IMPORTANT: Configuration MUST be loaded fresh each time the workflow is invoked. Always read both global and project config files at the start.
Config file locations:
~/.claude/kenken-config.json.claude/kenken-config.jsonProject config overrides global config.
On each invocation:
See ../configure/SKILL.md for full schema and defaults.
Track progress in .agents/kenken-state.json:
State/Config Validation:
Before using state or config files:
Recovery behavior:
.backup, start fresh, inform user{
"version": 1,
"task": "task description",
"startedAt": "2026-01-24T10:30:00Z",
"currentStage": "IMPLEMENT",
"currentPhase": "2.1",
"stages": {
"plan": { "status": "completed" },
"implement": {
"status": "in_progress",
"phase": "2.1",
"retryCount": 0,
"maxRetries": 3
},
"test": { "status": "pending", "enabled": true },
"final": { "status": "pending" }
},
"extensions": []
}
Update state after each phase transition.
All logs go to .agents/logs/:
Before writing logs, ensure directories exist:
mkdir -p .agents/logs/errors
| File | Content |
|---|---|
test-run-{ts}.log | Test execution output |
coverage-{ts}.log | Coverage report |
errors/errors-{ts}.log | Extracted errors |
errors/error-summary.json | Indexed error lookup |
Never:
Note: TEST stage (Stage 3) can be skipped entirely when stages.test.enabled=false in config. This is not the same as skipping individual phases.
If blocked:
If tests fail with code logic error:
superpowers:brainstorming - Phase 1.1superpowers:writing-plans - Phase 1.2superpowers:subagent-driven-development - Phase 2.1superpowers:dispatching-parallel-agents - Phases 1.1, 1.2superpowers:requesting-code-review - Review phasescode-simplifier:code-simplifier - Phase 2.2mcp__codex-high__codex - Plan Review, Implement Review, Test Review (configurable)mcp__codex-xhigh__codex - Final Review (fixed)Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.