name: rw-planner description: "Lite+Contract planner: hybrid askQuestions + subagent planning + DAG/task-graph generation with approval integrity. Bootstraps .ai/ workspace on first run. Input: feature request — resolves required fields first, asks only missing fields, then deep-dive if ambiguous."
RW Planner Skill
Bootstrap workspace + hybrid interview → feature normalization → task decomposition → DAG/task-graph generation.
When to Use
- Starting a new feature that needs structured decomposition
- Re-planning after loop escalation (
NEXT_COMMAND=rw-planner) - Reviewing or revising an existing plan
Procedure Overview
Phase 1: Bootstrap → scaffold .ai/ dirs and templates (first run only)
Phase 2: Plan → interview → feature → plan artifacts → atomic tasks
Output: NEXT_COMMAND=rw-loop
Phase 1: Bootstrap
Scaffold the workspace for first-time use. Skip items that already exist.
- Create directories:
.ai/features,.ai/tasks,.ai/notes,.ai/runtime,.ai/plans,.ai/memory
- Create
.ai/CONTEXT.mdwith the following default language policy:# CONTEXT - Response language: 한국어 - Machine tokens: English (pending, in-progress, completed, blocked, VERIFICATION_EVIDENCE, etc.) - Section headers: English (unless overridden below) - Create
.ai/memory/shared-memory.md(see memory-contract.md). - Copy feature-template.md to
.ai/features/FEATURE-TEMPLATE.md. - Create
.ai/PROGRESS.mdwith initial format:# Progress ## Task Status | Task | Title | Status | Commit | |------|-------|--------|--------| ## Phase Status Current Phase: Phase 1 ## Log - Create
.ai/PLAN.mdwith initial format:# Plan - PLAN_ID: (none) - Feature Key: (none) - Strategy: (none) - Task Range: (none) - Validate
runSubagentis available. If not, printRW_ENV_UNSUPPORTEDand stop. - Validate
askQuestionsis available. If not, printINTERVIEW_REQUIREDand stop.
Phase 2: Plan
Load full planner contract: planner-contract.md
Quick Reference
- Step 0 Guard: Validate
.ai/CONTEXT.md, check for.ai/PAUSE.md, verifyrunSubagent+askQuestions. - Hybrid Intake (via
askQuestions):- Phase A: Resolve
TARGET_KIND,USER_PATH,SCOPE_BOUNDARY,PLANNING_PROFILE,ACCEPTANCE_SIGNAL(Gate A/B),REFERENCE_BASELINE/PARITY_REQUIREDfrom request. Ask only for missing fields. - Phase B: Deep-dive (6–10 questions) if ambiguity remains.
- Phase C: Confirmation gate (one yes/no).
- Phase D: Ambiguity scoring (0–100 rubric) → select
PLAN_STRATEGY(SINGLE or PARALLEL_AUTO). - Phase E: Subagent planning — generate plan candidates via
runSubagent, confirm selection.
- Phase A: Resolve
- Feature File: Create/update under
.ai/features/with approval metadata + SHA-256 hash integrity. - Approval Gate: Feature must have
Approval: APPROVED. Hash mismatch resets approval. - Plan Artifacts:
plan-summary.yaml,task-graph.yaml,research_findings_*.yamlunder.ai/plans/<PLAN_ID>/(task-graphnodes must start withstatus: pending). If parity is required,reference-parity.mdis mandatory (useassets/reference-parity-template.md). - Task Decomposition: Create 2–6 atomic
TASK-XX-*.mdin.ai/tasks/with frontmatterstatus: pending, acceptance criteria, user path, and fast task-scoped verification commands. Same-phase tasks must be independent by default; add dependency edges only with explicit rationale. Put full regression commands inTASK-00phase/final gate policy, defineEnvironment Preflight Requirements+ runtime evidence expectations for user-visible tasks, and map user-visible tasks to parity element IDs when parity is required. - Update Progress: Append task rows to
.ai/PROGRESS.mdaspending.
Planner Output Contract (success)
FEATURE_FILE=<path>
FEATURE_KEY=<JIRA-123|FEATURE-XX>
FEATURE_STATUS=PLANNED
PLAN_ID=<id>
PLAN_STRATEGY=<SINGLE|PARALLEL_AUTO>
AMBIGUITY_SCORE=<0-100>
AMBIGUITY_REASONS=<comma-separated-codes>
PLAN_MODE=<INITIAL|REPLAN|EXTENSION>
PLAN_TASK_RANGE=<TASK-XX~TASK-YY>
TASK_BOOTSTRAP_FILE=<path>
TASK_GRAPH_FILE=<path>
PLAN_RISK_LEVEL=<LOW|MEDIUM|HIGH>
PLAN_CONFIDENCE=<HIGH|MEDIUM|LOW>
OPEN_QUESTIONS_COUNT=<n>
NEXT_COMMAND=rw-loop
After emitting the success output contract, stop planner execution immediately. Do not start implementation, do not dispatch rw-loop internally, and do not modify product code.
Failure Handling
| Token | Meaning | Next |
|---|---|---|
RW_ENV_UNSUPPORTED |
runSubagent unavailable |
stop |
TARGET_ROOT_INVALID |
workspace not writable | stop |
LANG_POLICY_MISSING |
.ai/CONTEXT.md unreadable after bootstrap |
stop |
INTERVIEW_REQUIRED |
askQuestions unavailable |
stop |
INTERVIEW_ABORTED |
user declined confirmation | stop |
INTERVIEW_DEEP_REQUIRED |
deep dive still unresolved | retry |
FEATURE_NEED_INSUFFICIENT |
scope still insufficient after confirmation | stop |
FEATURE_REVIEW_REQUIRED |
approval missing or hash changed | re-approve |
REFERENCE_PARITY_INCOMPLETE |
parity artifact missing/incomplete | fix parity matrix |
PLAN_ARTIFACTS_INCOMPLETE |
required plan artifacts missing | retry |
PAUSE_DETECTED |
.ai/PAUSE.md exists |
remove pause file |
Language Policy
.ai/CONTEXT.md부트스트랩 기본값: prose는 한국어, 머신 토큰은 영어.- 모든
.ai/**아티팩트 작성 전.ai/CONTEXT.md를 먼저 읽을 것.