kimchi:refine
This command should be used to iteratively improve the plan until quality threshold is reached or diminishing returns detected. Sixth stage of the Kimchi planning pipeline. Produces .kimchi/PLAN-DRAFT.md.
Best use case
kimchi:refine is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
This command should be used to iteratively improve the plan until quality threshold is reached or diminishing returns detected. Sixth stage of the Kimchi planning pipeline. Produces .kimchi/PLAN-DRAFT.md.
Teams using kimchi:refine should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/refine/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How kimchi:refine Compares
| Feature / Agent | kimchi:refine | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This command should be used to iteratively improve the plan until quality threshold is reached or diminishing returns detected. Sixth stage of the Kimchi planning pipeline. Produces .kimchi/PLAN-DRAFT.md.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Kimchi Refine
<command_purpose>
Iteratively evaluate and improve the plan until quality is sufficient. Exits on: quality threshold reached, diminishing returns, regression, or max loops.
</command_purpose>
## Input
Read `.kimchi/PLAN-REVIEWED.md` (preferred) or `.kimchi/PLAN.md` (if review was skipped).
Parse `$ARGUMENTS` for `--loops N` option (default: 3).
## Process
### 1. Evaluate Plan Quality
Score the plan on 5 criteria (each 0-20, total 100):
| Criterion | Score 20 | Score 10 | Score 0 |
|-----------|----------|----------|---------|
| **Completeness** | All v1 requirements covered | Most covered | Gaps exist |
| **Clarity** | Every task unambiguous | Minor ambiguity | Vague descriptions |
| **Testability** | Each task has verifiable criteria | Some criteria vague | Missing criteria |
| **Independence** | Parallel where possible | Unnecessary dependencies | Serial when could be parallel |
| **Size** | All tasks S or M | One L task | Multiple L tasks |
### 2. Refinement Loop
```
for each iteration (up to max_loops):
1. Score the plan
2. Check exit conditions:
- Score >= 90 → exit "quality_reached"
- Score improvement < 5 from last → exit "diminishing_returns"
- Score decreased → revert, exit "regression"
- Max loops reached → exit "max_loops"
3. Identify lowest-scoring criterion
4. Apply targeted improvement:
- Completeness: Add missing tasks for uncovered requirements
- Clarity: Rewrite ambiguous task descriptions
- Testability: Add/improve acceptance criteria
- Independence: Break unnecessary dependencies
- Size: Split L tasks into S/M tasks
5. Record what changed
```
### 3. Write Output
Write `.kimchi/PLAN-DRAFT.md`:
```markdown
# Draft Plan: [Feature Name]
**Refined:** [today's date]
**Source:** .kimchi/PLAN-REVIEWED.md
## Refinement History
| Iteration | Score | Lowest Criterion | Changes Made | Exit Reason |
|-----------|-------|-----------------|--------------|-------------|
| 1 | [N]/100 | [criterion] | [what changed] | - |
| 2 | [N]/100 | [criterion] | [what changed] | - |
| 3 | [N]/100 | - | - | [exit reason] |
## Draft Plan
[Complete refined plan with all improvements applied]
```
Report: "Refinement complete (exit: [reason], score: [N]/100). Saved to .kimchi/PLAN-DRAFT.md"
Suggest: "Run `/kimchi:plan-revise` for cross-model analysis, or `/kimchi:beads` to convert directly."Related Skills
kimchi:verification-before-completion
Use when about to claim work is complete, fixed, or passing — before committing or creating PRs. Evidence before assertions, always.
kimchi:validate
This command should be used to validate bead YAML files for standalone executability. Runs 4 validators (context completeness, deliverables clarity, test specification, isolation) and enriches failing beads. Eighth stage of the Kimchi planning pipeline.
kimchi:tdd
Use when implementing any feature, bugfix, or behavior change — before writing implementation code. Enforces RED-GREEN-REFACTOR cycle.
kimchi:systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior — before proposing fixes. Enforces 4-phase root cause analysis.
kimchi:status
This command should be used to check the current state of the Kimchi planning pipeline, including which stages have completed, what artifacts exist, and bead validation status.
kimchi:simplicity-enforcement
Use when designing solutions, implementing features, or considering abstractions. Enforces YAGNI, minimal code, and preferring duplication over wrong abstraction.
kimchi:review
This command should be used to run multi-persona review of the implementation plan. Five specialized personas critique the plan for scope creep, complexity, premature optimization, and test coverage. Fifth stage of the Kimchi planning pipeline. Produces .kimchi/PLAN-REVIEWED.md.
kimchi:reset
This command should be used to clear the Kimchi working directory (.kimchi/) and start fresh. Preserves .beads/ directory. Use when starting a new planning session or recovering from a bad state.
kimchi:research
This command should be used to investigate codebase patterns, frameworks, and existing implementations before planning. Third stage of the Kimchi planning pipeline. Produces .kimchi/RESEARCH.md.
kimchi:requirements
This command should be used to extract and categorize requirements from CONTEXT.md into v1 (must have), v2 (next iteration), and out of scope. Second stage of the Kimchi planning pipeline. Produces .kimchi/REQUIREMENTS.md.
kimchi:plan
This command should be used to run the Kimchi planning pipeline through refinement, transforming a vague idea into a draft plan ready for cross-model analysis. Orchestrates 6 stages: clarify, requirements, research, generate, review, refine. Use --full-auto to also run beads + validate after manual revise/synthesize.
kimchi:plan-synthesize
This command should be used to synthesize multiple cross-model plan revisions into a superior hybrid plan. Eighth stage of the Kimchi planning pipeline. Reads PLAN-REVISED-*.md files and outputs PLAN-SYNTHESIZED.md — the TRUE final plan.