Lite+Contract loop: DAG-aware dispatch, TDD evidence checks, dual quality gates (state/runtime), env preflight, and phase review contracts. Optional flags: --auto, --no-hitl, --hitl, --parallel, --max-parallel=<1..4>
DAG-aware task dispatch → TDD coder subagent → mandatory verification gates → phase/review contracts.
NEXT_COMMAND=rw-loop)The following must exist before running this skill (created by rw-planner):
.ai/CONTEXT.md — language policy.ai/PROGRESS.md — task status table.ai/tasks/ — atomic task files (TASK-XX-*.md).ai/runtime/rw-active-plan-id.txt + .ai/plans/<PLAN_ID>/task-graph.yaml — DAG + node status source.github/skills/rw-loop/assets/ — 5 subagent prompt files.github/skills/rw-loop/scripts/check_state_sync.py + — pre-dispatch guardsenv_preflight.pyIf any prerequisite is missing, the skill prints a failure token and stops.
Step 0: Guard → verify prerequisites, resolve HITL/parallel mode
Loop: Dispatch → lock task → coder subagent → validate → gates → next
End: Review → final review gate → success output
.ai/CONTEXT.md. If missing: print LANG_POLICY_MISSING, stop..ai/PROGRESS.md and .ai/tasks/ exist. If missing: print TARGET_ROOT_INVALID, stop.runSubagent is available. If not: print RW_ENV_UNSUPPORTED, stop.RW_SUBAGENT_PROMPT_MISSING, stop..ai/memory/shared-memory.md exists, read it before loop start..ai/runtime/rw-active-plan-id.txt, then read matching .ai/plans/<PLAN_ID>/task-graph.yaml as primary dependency graph. If missing/unreadable: print TARGET_ROOT_INVALID, stop..github/skills/rw-loop/scripts/check_state_sync.py.github/skills/rw-loop/scripts/env_preflight.pyTARGET_ROOT_INVALID, stop.| Flag | HITL_MODE | PARALLEL_MODE |
|---|---|---|
| (default) | ON | ON |
--auto or --no-hitl | OFF | ON |
--hitl | ON | ON |
--parallel | (unchanged) | ON |
--max-parallel=<n> | (unchanged) | ON, clamped 1..4 |
When PARALLEL_MODE=ON and --max-parallel is omitted, MAX_PARALLEL=4.
Load full loop contract: loop-contract.md
.ai/PAUSE.md. If exists: print PAUSE_DETECTED, stop.
1a. Run state sync checker before dispatch:
python .github/skills/rw-loop/scripts/check_state_sync.pypython .github/skills/rw-loop/scripts/env_preflight.pyENV_PREFLIGHT=PASS. On fail, stop and fix env/dependencies first.in-progress first, then pending, never blocked).
MAX_PARALLEL independent tasks (default 4).runSubagent.PROGRESS + task frontmatter + task-graph.
TASK-00 policy.TASK_INSPECTION=PASS|FAIL, USER_PATH_GATE=PASS|FAIL, RUNTIME_GATE=PASS|FAIL.SECURITY_GATE=PASS|FAIL.TASK-00 phase-gate full verification commands, then require PHASE_REVIEW_STATUS=APPROVED|NEEDS_REVISION|FAILED.
HITL_MODE=ON: output structured phase summary (completed tasks + evidence + inspector findings + 직접 확인 방법) THEN call askQuestions — unconditionally, never skip.strike.active reaches 3 → blocked + escalate to planner. strike.total/security.total stay cumulative for history IDs, and active counters reset on successful completion.TASK-00 final-gate full verification commands, then require REVIEW_STATUS=OK|FAIL|ESCALATE.PLANNING_PROFILE=UX_STRICT, user-acceptance-checklist.md becomes blocking and must pass USER_ACCEPTANCE_GATE=PASS.pending → in-progress → completed
|
v
blocked (3-strike or security critical)
completed requires VERIFICATION_EVIDENCE count increase.RUNTIME_GATE=PASS.completed → pending forbidden unless explicit review rollback.HITL_MODE=<ON|OFF>
PARALLEL_MODE=<ON|OFF>
PARALLEL_BATCH_SIZE=<1-4>
PLANNING_PROFILE=<STANDARD|FAST_TEST|UX_STRICT>
RUNSUBAGENT_DISPATCH_COUNT=<n>
RUN_PHASE_NOTE_FILE=<path|none>
PHASE_REVIEW_STATUS=<APPROVED|NEEDS_REVISION|FAILED|NA>
REVIEW_STATUS=<OK|FAIL|ESCALATE>
USER_ACCEPTANCE_GATE=<PASS|FAIL|NA>
ARCHIVE_RESULT=<SKIPPED|DONE|LOCKED>
NEXT_COMMAND=<done|rw-planner|rw-loop>
| Token | Meaning | Next |
|---|---|---|
RW_ENV_UNSUPPORTED | runSubagent unavailable | stop |
RW_SUBAGENT_PROMPT_MISSING | subagent prompt file missing | run rw-planner |
TARGET_ROOT_INVALID | required state files missing (PROGRESS, tasks, active-plan graph) | run rw-planner |
RW_SUBAGENT_STATE_SYNC_INVALID | status mismatch across state artifacts | fix sync + re-run |
LANG_POLICY_MISSING | .ai/CONTEXT.md missing | run rw-planner |
TASK_DEPENDENCY_BLOCKED | no dispatchable task | replan |
SECURITY_GATE_FAILED | security regression found | fix + re-run |
USER_ACCEPTANCE_GATE_FAILED | UX_STRICT acceptance checklist gate failed | fix UX + re-run |
PAUSE_DETECTED | .ai/PAUSE.md exists | remove pause file |
.ai/** 아티팩트 작성 전 .ai/CONTEXT.md를 먼저 읽을 것.