iterate
Orchestrates 4-stage development workflow (PLAN → IMPLEMENT → TEST → FINAL)
What this skill does
# kenken Iterate Workflow
> **For Claude:** This skill orchestrates development through 4 stages. Follow each stage sequentially. Do not skip phases.
## When to Use
```dot
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"];
}
```
## Overview
**Stages:** PLAN → IMPLEMENT → TEST (optional) → FINAL
```dot
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`
## Initialization
1. Load configuration (see Configuration section)
2. Create or read state file
3. If resuming, continue from saved phase
4. If new, start at Phase 1.1
## Stage 1: PLAN
Complete all phases before advancing to IMPLEMENT.
### Phase 1.1: Brainstorm
**Goal:** Understand the problem and design a production-ready solution.
**Skill:** `superpowers:brainstorming` + `superpowers:dispatching-parallel-agents`
**Prompt:** See `prompts/brainstorm.md`
**Actions:**
1. Read existing code to understand context
2. Dispatch parallel agents to research:
- Existing patterns in codebase
- Requirements and constraints
- Edge cases and failure modes
- Security considerations
3. Ask clarifying questions (one at a time)
4. Propose 2-3 approaches with honest trade-offs, addressing:
- Core functionality
- Error handling strategy
- Edge cases and boundary conditions
- Security implications
- Observability (logging, monitoring)
- Maintainability
5. Get user agreement on approach
6. Save design to `docs/plans/{date}-{topic}-design.md`
**Exit criteria:** Design documented and approved.
### Phase 1.2: Write Plan
**Goal:** Create detailed implementation plan with tasks in Task API format.
**Skill:** `superpowers:writing-plans`
**Actions:**
1. Break design into tasks (each 2-5 minutes of work)
2. For each task, specify:
- Files to create/modify
- Exact code changes
- How to verify it works
3. Include logging requirements (adopt repo conventions)
4. **Convert each task to Task API format:**
```yaml
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
```
5. Save plan to `docs/plans/{date}-{topic}-plan.md`
**Task 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.
### Phase 1.3: Plan Review
**Goal:** Validate plan quality before implementation.
**Tool:** Configured tool (default: `mcp__codex-high__codex`)
**Prompt:** See `prompts/plan-review.md`
**Actions:**
1. Submit plan for review
2. If issues found:
- Fix the plan
- Re-run review (increment retryCount)
3. If approved, advance to IMPLEMENT stage
**On failure:** Retry (max configured retries). After max, ask user.
## Stage 2: IMPLEMENT
Complete all phases before advancing to TEST or FINAL.
### Phase 2.1: Implementation
**Goal:** Execute the plan task by task.
**Implementer (from config `stages.implement.implementation.implementer`):**
- `claude` (default): Use Claude subagents via `superpowers:subagent-driven-development`
- `codex-high`: Use `mcp__codex-high__codex` for implementation
- `codex-xhigh`: Use `mcp__codex-xhigh__codex` for implementation
**Actions:**
1. Load plan from `docs/plans/{date}-{topic}-plan.md`
2. Parse the `tasks:` YAML block into task list
3. Check `stages.implement.implementation.implementer` config:
#### Claude Mode (default)
Create TodoWrite with all tasks. For each task (respecting `dependencies`):
- Mark task in_progress in TodoWrite
- **Dispatch using Task tool:**
```
Task(
description: task.description,
prompt: task.prompt,
subagent_type: task.subagent_type,
model: task.model, // optional
run_in_background: task.run_in_background // optional
)
```
- Add logging (match repo conventions, include error context)
- Dispatch spec reviewer subagent
- Dispatch code quality reviewer subagent
- Mark task completed in TodoWrite
**Parallel execution:** Tasks with no unmet dependencies can run in parallel using `run_in_background: true`
Commit after each task or logical group.
#### Codex Mode (codex-high or codex-xhigh)
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):**
- Detect repo's logging library (winston, pino, console, etc.)
- Add logs at: function entry, errors, warnings, state changes
- Error logs must include: message, stack, context
**Exit criteria:** All tasks completed and committed.
### Phase 2.2: Code Simplify
**Goal:** Reduce complexity while preserving functionality.
**Plugin:** `code-simplifier:codeRelated in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.