with one click
kanban-refine
Refine backlog requirements through structured user interview. Turns rough task descriptions into concrete, actionable requirements with goal, scope, acceptance criteria, and edge cases.
Menu
Refine backlog requirements through structured user interview. Turns rough task descriptions into concrete, actionable requirements with goal, scope, acceptance criteria, and edge cases.
| name | kanban-refine |
| description | Refine backlog requirements through structured user interview. Turns rough task descriptions into concrete, actionable requirements with goal, scope, acceptance criteria, and edge cases. |
| license | MIT |
Shared context: read
../kanban/shared.mdfor DB path, pipeline levels, status transitions, DB operations, error handling, and agent context flow. Safety principles: read../kanban/principles.md— mandatory, not optional.
/kanban-refine <ID> — Refine Backlog RequirementsReads a rough backlog item and refines it into concrete, actionable requirements through structured user interview.
Target: tasks in todo status (backlog). If the task is not todo, warn the user and confirm before proceeding.
① Read the task
TASK = sqlite3 -json "$DB" "SELECT id, title, description, priority, level, tags FROM tasks WHERE id=$ID AND project='$PROJECT'"
Extract: title, description, priority, level, tags
① ½. Look for prior implementation context (always run this before the interview)
a. Check description and tags for dependency hints:
- "Depends on: #NNN" lines in description
- Tags like "after:NNN", "follows:NNN"
b. If dependency found → fetch that card's implementation output:
PRIOR = sqlite3 -json "$DB" "SELECT title, implementation_notes, plan FROM tasks WHERE id=$NNN AND project='$PROJECT'"
Also inspect the actual codebase: read files, interfaces, schemas confirmed in that card.
c. If no explicit dependency → ask ONE question before the main interview:
"Is there a prior task whose implementation this builds on? (task ID or 'none')"
If the user gives an ID, fetch it as in (b).
If "none" or new work → skip, proceed with regular interview.
d. Summarize what was confirmed from prior implementation:
PRIOR_CONTEXT = {
confirmed interfaces, schemas, file paths, component names, API routes, etc.
}
This context is injected into ③ (gap analysis) and ⑤ (description synthesis).
② Display current state
Show the user their raw title + description as-is.
If PRIOR_CONTEXT exists, also show: "Prior implementation context: [summary]"
③ Analyze for gaps
Identify what's missing or vague across these dimensions:
- WHAT: What exactly should be built/changed?
- WHY: What problem does this solve? What's the motivation?
- SCOPE: What's included vs excluded?
- ACCEPTANCE: How do we know it's done?
- CONSTRAINTS: Technical limitations, compatibility, performance?
- EDGE CASES: Error states, boundary conditions?
- DEPENDENCIES: Does it depend on other tasks or external systems?
④ Interview the user (MANDATORY)
Use AskUserQuestion to ask about the gaps found in ③.
Rules:
- Ask 1–4 focused questions per round (AskUserQuestion limit)
- Group related questions in one round
- Run multiple rounds if needed (max 3 rounds)
- Stop early if the user says "enough" or all gaps are filled
- Don't ask about things that are already clear
- Use concrete options when possible, not open-ended questions
⑤ Synthesize refined description
Rewrite the description using this template.
If PRIOR_CONTEXT exists, ground scope/requirements/constraints in confirmed interfaces
and file paths from the prior implementation — not assumptions.
## Goal
[1–2 sentences: what this task achieves and why]
## Prior Implementation Context ← include only if PRIOR_CONTEXT exists
[Confirmed interfaces, schemas, components, or file paths from the prior card
that this task directly builds on. e.g. "POST /api/items → {id, name} per #201"]
## Scope
- IN: [bulleted list of what's included]
- OUT: [bulleted list of what's explicitly excluded]
## Requirements
[Numbered list of concrete, testable requirements]
## Acceptance Criteria
- [ ] [Checklist items — each verifiable]
## Constraints
[Technical constraints, if any identified]
## Edge Cases
[Edge cases to handle, if any identified]
Omit sections that have no content (e.g., skip Constraints if none).
⑥ Present the refined description to the user
Show the full refined description in a code block.
Ask user to confirm with AskUserQuestion:
- "Approve & save" (update the task)
- "Edit more" (go back to interview)
- "Cancel" (discard changes)
⑦ Save
If approved:
- sqlite3 "$DB" "UPDATE tasks SET description='...', updated_at=datetime('now') WHERE id=$ID AND project='$PROJECT'"
- Also update title if it was clarified during interview
- Update level/priority/tags if discussed
- Append to agent_log (see shared.md → JSON 필드 조작):
{ "agent": "Refiner", "model": "<MODEL_REFINER>", "message": "Requirements refined. N questions across M rounds.", "timestamp": "..." }
### Model Routing
Resolve `MODEL_REFINER` from `../kanban/models.json`:
```bash
MODEL_PROVIDER=${KANBAN_MODEL_PROVIDER:-}
if [ -z "$MODEL_PROVIDER" ] && [ -n "${CODEX_THREAD_ID:-}${CODEX_CI:-}" ]; then MODEL_PROVIDER=codex; fi
if [ -z "$MODEL_PROVIDER" ] && [ -n "${CLAUDE_PROJECT_DIR:-}${CLAUDECODE:-}" ]; then MODEL_PROVIDER=claude; fi
if [ -z "$MODEL_PROVIDER" ] && [ -d .claude ]; then MODEL_PROVIDER=claude; fi
if [ -z "$MODEL_PROVIDER" ] && [ -d .codex ]; then MODEL_PROVIDER=codex; fi
MODEL_REFINER=$(python3 - "$MODEL_PROVIDER" <<'PY'
import json, pathlib, sys
d = json.loads(pathlib.Path("../kanban/models.json").read_text())
provider = sys.argv[1] or d["default_provider"]
print(d["providers"][provider]["refiner"])
PY
)
### Interview Tips
- If the user wrote "로그인 기능 추가" → ask: OAuth/email? Session/JWT? Which pages need auth guards?
- If the user wrote "성능 개선" → ask: Which page/API? Current latency? Target latency? Measurement method?
- If the user wrote "UI 수정" → ask: Which component? What's wrong now? Mockup/reference? Responsive?
- Prefer showing concrete options over open-ended "어떤 걸 원하세요?"
Run multiple kanban tasks end-to-end in Rolling Wave order — refine each task based on the prior card's actual implementation, then implement, then verify, then refine the next. Use for epic-level batch execution. --big-bang flag disables rolling wave for simple independent tasks.
Codebase exploration skill for uncertain implementation direction. Deeply explores the codebase, produces a direction report, and creates phased kanban tasks. Use when you don't know exactly how to implement something. NOT for direct implementation.
Scan kanban boards for stagnant tasks and optionally mark them. Detects tasks with no agent activity for N days (default 3), outputs a markdown report table, and appends Heartbeat entries to agent_log unless --dry-run.
Run the AI team pipeline for kanban tasks — orchestration loop with 6 agents (Planner, Critic, Builder, Shield, Inspector, Ranger), single-step execution, and code review. Use /kanban-run to execute tasks through the 7-column pipeline. AUTO-TRIGGER when: user says "implement task NNN" or any task ID + implement/build/do combination; or user confirms with "yes/ok/go/do it" after Claude proposes implementing a specific kanban task.
프로젝트의 전체 아키텍처, 목표, 주요 결정사항을 wiki/ 디렉토리에 합성하여 정리합니다. 첫 실행 시 전체 생성, update로 변경분 반영. 매 카드가 아닌 프로젝트 수준의 지식을 정리합니다.
Initialize the current project in local SQLite kanban. Creates ~/.claude/kanban-dbs/{project}.db and writes local config. Usage: /kanban-init or /kanban-init my-project-name. Run with /kanban-init.