自适应迭代开发循环
run-cycle
执行自适应迭代开发周期——每个周期都是自包含的计划/执行/验证/反思循环,重塑路线图,并从自身输出中衍生出涌现的后续工作范围。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- run-cycle
- hooks
- { "Stop": [ { "hooks": [ { "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/skills/run-cycle/scripts/stop-gate.sh\"", "timeout": 300 } ] } ] }
- description
- Executes adaptive iterative development cycles — each cycle is a self-contained plan/execute/verify/reflect loop that reshapes the roadmap and derives emergent follow-on scope from its own output
- allowed-tools
- Read, Glob, Grep, Write, Edit, TodoWrite, WebFetch, WebSearch, Bash, Agent, Task, Skill
- argument-hint
- [total_cycles]
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/design-rationale.md9.7 KB
- 参考文档references/run-level-procedures.md18.6 KB
- 脚本scripts/stop-gate.sh23.0 KB
03 SKILL.md 正文
Development Cycle Runner
Execute iterative development cycles. Each cycle is a self-contained micro-loop — re-plan, design (if needed), execute, verify, reflect, derive-next. The roadmap is a phase backlog, not a cycle plan: only the current cycle is scoped concretely, and each cycle's outcome decides the next cycle's scope. Earlier cycles reshape the backlog based on what they reveal.
Two rules follow from that, and they are the ones runs actually break:
- The roadmap must not know cycle numbers. Concrete scope exists for one cycle — this one. Everything beyond it is a phase-level direction.
- STEP 5 must actively derive what this cycle's output implies next, across the user/developer/operator lenses, and gate each candidate autonomous-eligible vs. discussion. Skipping this is the early-termination failure users feel as "it only did the initial plan".
Why — the failure modes behind both, the L0–L3 rationale, and the unscoped-Bash decision:
references/design-rationale.md.
Durable state over conversation memory
The cycle logs ARE the memory. Native context can be compacted mid-run, so a cycle must never
depend on remembering earlier cycles from conversation. Every cycle reconstructs its state from
on-disk artifacts (previous cycle-*.md, ROADMAP.md, git log). Write logs richly enough that a
fresh context could resume from them with zero conversational history.
Compaction truncates these instructions too, not only the conversation. Auto-compaction re-attaches just the first 5,000 tokens of a skill, and this body is longer than that — so on a long run the later sections are gone from context while the run is still going. Three things make that survivable, and each is load-bearing rather than incidental:
- The per-cycle loop is front-loaded; run-level procedure lives in
references/and is named at the point it is needed. A pointer costs a line and survives; the procedure it points at can be re-read on demand. When a section here reads as a summary with a link, follow the link rather than reconstructing the procedure from memory. - The previous cycle log is a worked example of the current one. STEP 0 reads it anyway; it
carries the section shape and the literal
FRONTIER-…marker this run is expected to write. - The Stop hook is unaffected — it is a script (
scripts/stop-gate.sh) that reads the logs directly, so its BLOCK reason restates whatever contract the block is about. Treat that text as authoritative.
Delegating to subagents keeps this fit, and is never fenced off. A step whose raw tool output
would only sit in this context without needing to persist (STEP 1 survey/research, a STEP 3 run) is
a candidate for the Agent tool — dispatch it, keep only the distilled result. Optional per step,
not a mandate; STEP 0/5 don't delegate (they need this run's accumulated judgment). Why:
design-rationale.md.
The cycle, at a glance
This block is the loop in miniature, placed here on purpose: it is inside the surviving window, so a compacted run still holds the whole sequence and can follow the links below for detail it has lost.
| Step | Weight | What it must produce |
|---|---|---|
| 0 Re-plan | always, light (~5 min) | This cycle's scope — exactly one cycle, never a cycle-numbered table. Open the log stub first; re-check the Blocked-on-Human ledger, absorb any reverted decision, inherited defects first |
| 1 Design | conditional | Skipped for isolated pattern-following change; otherwise survey the codebase, research, pick an approach with a one-line rationale |
| 2 Execute | always | The scope, incrementally. Inherited defects before new work. Root cause, not symptom |
| 3 Verify | always | Acceptance criteria stated before checking them; checks sized to the change — build plus the tests it reaches, the full suite only when the change is broad (the full run is owed before a release); output as evidence, not assertion; drive the real surface when user-facing; fix and re-run failures in-cycle |
| 4 Reflect | always, mandatory | Six dimensions, judged from outside. Defects fixed here; structural improvements are L1 — done and ledgered, not proposed; orphans removed |
| 5 Derive Next | always, mandatory | Carry-Forward · both ledgers carried forward · exactly one frontier token · Roadmap Revisions · hygiene pass · Next-Cycle Scope for one cycle. Then flip the log's Status: to complete |
The literals a cycle writes — the Stop hook greps for them as strings, so they are written verbatim or not at all. Exactly one frontier token per log, in the Emergent Next Capability line:
FRONTIER-OPEN: <candidate> [autonomous|discussion]
FRONTIER-EXHAUSTED: <why, across all three lenses> | goal-gap: cycle <NN> — <what it found> | ladder: <rung acted on, or "no actionable signal — why">
A run does not write the second one until it has looked from the goal back to the product —
once per run, as a cycle of its own, when STEP 5 first comes up dry: FRONTIER-OPEN: goal-gap review [autonomous], procedure in
run-level-procedures.md. goal-gap: names
that cycle; the Stop hook sends back a claim without it.
Plus, when they apply: HUMAN-NEEDED: <reason> at the start of a line (run-fatal only — ends the
run) and BLOCKED-ITEM: <scope> — <reason + what was tried + what would unblock it> (parks one scope,
never ends the run; it is read from the Blocked-on-Human ledger when an early stop is audited).
At the end of the run, not of a cycle: the End-of-Run Report, then the commit, then the
release review (only when the invocation granted a release), then /iyu:handoff (invoke it with
the Skill tool) — the report, commit and handoff unconditional on every termination path, procedure
in references/run-level-procedures.md. The
handoff leaves HANDOFF.md ready for /clear → /iyu:resume, so the next run starts from files.
A release grant ("push+ship 승인", "배포 승인") is permission for the run's end, never a per-cycle must. Cycles do not push, publish or deploy — except a defect users are hitting now or an external window closing before the run does (log which). One release review at run end; an open gate is handed over: release-cadence.md §5.
Do not end the turn between cycles — go from one cycle's STEP 5 straight into the next cycle's
STEP 0. Ending the turn is a stop the Stop hook has to reverse, and Claude Code overrides the next
block after eight consecutive reversals (CLAUDE_CODE_STOP_HOOK_BLOCK_CAP), ending the run with no
report. Wait on long commands inside the turn; end it only when the run itself ends.
Continuity root — where that durable state lives
continuity-docs.md is the definition — §1
for resolving the root and what lives in it, §2 for what belongs in each document, §5 for the
language logs and reports are written in. handoff, backlog-discover, and telemetry-az read the
same file, which is what keeps all four landing in one directory. Do not restate those rules here; a
second copy drifts.
Run-specific on top of it:
- Resolve
<root>once, in Preparation, before reading or writing anything. - This skill owns two artifacts in it:
<root>/cycle-logs/cycle-{NN}.mdand<root>/cycle-logs/RUN-SUMMARY-{YYYY-MM-DD}.md. - Record the resolved root in each cycle log header, so a fresh context picks it up without re-deriving it — and so the Stop hook, which has no session context, reads the same one.
Parameters
One parameter: the cycle budget. $0 = total cycles (default: 10). Anything else in
$ARGUMENTS, and anything the user wrote alongside the invocation, is scope context — it feeds
Preparation step 1, not a flag parser. There are no flags: a run always executes, and always commits.
A release grant — given there, or declared as standing in the project's own instructions — is
recorded with the acts it names (push only, or push and ship) in the first cycle log's Re-plan —
together with each package's release gate as fixed at run start (release-cadence §2), since the run
end judges that gate and not one it cuts for itself.
The starting cycle number is derived, not passed: the highest existing
<root>/cycle-logs/cycle-*.md index + 1 (1 when none exist). The repo already knows where the last run stopped; asking the caller to restate it only
creates a way to get it wrong.
Record both in every cycle log header (Budget: / Start: — see Cycle Log). The Stop hook has
no session context and receives no invocation arguments, so the logs are the only place it can read
them; omit the lines and it cannot tell this run from an earlier one.
In an umbrella whose submodules keep their own cycle-logs/ with independent numbering, one run
writes logs into several directories. Every one of them carries the run's own Budget: and
Start: (the number the run started at — not that directory's), and the hook counts the run's
completed logs across all of them; the report may sit in any of those directories.
N is a ceiling, not a target. It bounds how many cycles may run — it is not a quota of scopes to fill in advance. Do not pre-partition N into N scopes. If the work runs dry before N, rule 9 decides when to terminate early. If more work surfaces than N can hold, stop at N and carry the rest forward. The right mental model is "I have up to N turns," never "I must plan N things now."
Preparation (light)
The preparation phase is thin by design. Deep analysis belongs to each cycle's STEP 1, where it can be informed by what's actually happening.
0. Resolve the continuity root
Apply the resolution rule in Continuity root above, before reading or writing anything; every <root>/… path below is relative to it.
One-time migration, here and nowhere else: if resolution found a continuity doc (ROADMAP.md / HANDOFF.md / HISTORY.md) sitting inside cycle-logs/, move it up to <root>/ now and note the move in this cycle's Roadmap Revisions. Resolution is what discovers the misplacement, so it is also what corrects it — re-checking every cycle would buy nothing.
1. Conversation Context (highest priority)
Check the preceding conversation for scope — explicit tasks, agreed-upon next steps, "continue with..." statements.
Also absorb corrections to prior self-decisions: if the human has said an earlier L1 decision was wrong (in this conversation or a prior run's report), capture it now and write it durably into the Decisions Ledger (status → reverted) so STEP 0 acts on it and a compaction cannot lose it. Conversation is the fastest channel; the ledger is what makes the correction survive.
Then run the project's external inbox check, if it defines one (continuity-docs.md §6): an item that arrived since the last session is scope context of the same standing as the conversation, and a run that skips it hands off a HANDOFF.md that never mentions it. Record the result (even "nothing new") in the first cycle log's Re-plan.
No /iyu:resume earlier in this session → open the session here. Apply steps 2–5 of
resume: ground HANDOFF.md in current state, reorder what
no longer fits, settle each flagged decision as provisional and record it. Then continue — resume's
closing stop is for a session that asked only for the briefing. What it settled goes in the
End-of-Run Report.
2. Previous Cycle Logs
Glob: <root>/cycle-logs/cycle-*.md
Review the most recent log's Carry-Forward and Roadmap Revisions sections. These are inherited obligations and prior re-planning decisions.
Was the previous run abandoned mid-frontier? A newest log that is Status: complete and carries FRONTIER-OPEN: means work was derived and never picked up. Say so in one line before scoping ("직전 런이 {scope}을 남기고 중단됨") — nothing else records it, since the Stop hook does not run when a session is interrupted or cleared, and from the files alone an abandoned run looks exactly like a finished one.
Rule 10 already carries that scope forward, so this is about naming the interruption and breaking a tie: if conversation context (step 1) or HANDOFF.md's ## Next disagrees with the abandoned scope, the abandoned one wins — it was derived from the code as it actually stood — unless the human says otherwise here.
Derive this run's starting cycle number here: highest existing cycle-{NN} index + 1, or 1 if
none exist.
Then immediately open the first cycle log as a stub — <root>/cycle-logs/cycle-{Start}.md
containing only the header (Date / Root / Budget / Start / Status: in-progress), before any
cycle work begins. This is not bookkeeping: the Stop hook gets no invocation arguments and can only
learn this run's budget from a log this run wrote. Without the stub, a stop in the window before
the first cycle completes leaves the hook reading the previous run's log — whose count is
already at or past its own budget — and it would allow the run to end having done nothing. Each
cycle flips its own Status to complete when its log is finished (STEP 5), and the hook counts
only completed logs.
3. Plan Discovery (only if no scope from above)
Stop at first found: CLAUDE.md → AGENTS.md → <root>/HANDOFF.md → <root>/ROADMAP.md (the resolved root from step 0 — the same file STEP 5 would create, never a differently-located one) / TASKS.md / TODO.md → docs/ → README.md. If nothing found, ask the user. Do not invent scope.
HANDOFF.md outranks ROADMAP.md here, deliberately. The handoff's "Next" section is the last
session's considered judgment about what to do now, made with knowledge of what it just finished;
the roadmap is phase-level direction that has not been narrowed to a session. When both exist, the
handoff is this run's opening scope and the roadmap tells you where it sits — unless every ## Next
item is blocked: then the roadmap's startable phases are (order is not a gate, continuity-docs.md §4).
/iyu:handoff writes that section — the two skills meet here.
4. Philosophy Alignment (high-level only)
Evaluate the overall goal — not every future cycle — against CLAUDE.md / README.md, using the four canonical dimensions of philosophy-alignment-guide.md (Core Mission Fit · Scope Alignment · Pattern Consistency · User Base Impact). That guide is the single definition of the four dimensions across this plugin.
One run-specific check rides alongside them, and it is not one of the four: Dependency Direction — no upstream→downstream leakage (a consuming project's domain concept must not be pushed into a library it consumes).
Reject scope items that score low at the overall level. Per-cycle drift checks (STEP 0) catch localized issues later.
5. Phase Backlog (not a cycle plan)
Create <root>/ROADMAP.md if step 3 found none (<root> from step 0 — if the repo already keeps a roadmap, that one is the backlog; do not create a second). It holds phase-level directions only — a backlog of goals, not an itinerary of cycles:
- Group work as phases / goals, each revisable by per-cycle Derive-Next
- Include known unknowns and investigation needs, not presumed answers
ROADMAP.mdholds remaining work only — completed phases live inHISTORY.md(see Continuity-Doc Hygiene)
Hard rule — the roadmap must not know cycle numbers. Do NOT produce a Cycle 1 = …, Cycle 2 = … table, and do NOT assign scope to any cycle beyond the first. You cannot know what Cycle 2+ should contain — that is decided by the preceding cycle's STEP 5, by design. A cycle-numbered scope table here is the single failure this skill exists to prevent.
Then scope only the first cycle of this run: pick the one most valuable phase to start, and leave the rest of the backlog as undated phases.
Per-Cycle Process
Every cycle runs these six steps in order. Steps are differentiated by weight — STEP 0 is always light, STEP 1 runs only when triggered, STEP 4 reflection is always mandatory.
STEP 0: Re-plan (always, light)
The first thing any cycle does is check whether the plan it inherited is still correct. Open this
cycle's log stub first (header only, Status: in-progress) — Preparation already opened the run's
first one; every later cycle opens its own here.
Scope exactly one cycle — this one. STEP 0 decides what this cycle does, nothing further. Do not lay out cycle 2, 3, … N here: the first cycle is not a planning summit for the whole run, and a cycle-numbered table is forbidden (rule 5). The next cycle's scope is produced by this cycle's STEP 5, once you know what this cycle revealed.
Bounded inputs (keep this cheap — target <5 minutes):
- Previous cycle's Carry-Forward + Next-Cycle Scope + Roadmap Revisions
- The phase backlog (
ROADMAP.md) — for direction only, to pick this cycle's scope from - Any changes to CLAUDE.md / README.md since the last cycle (diff only, not full re-read)
Decisions:
- Re-check the Blocked-on-Human ledger first — for each parked
BLOCKED-ITEM, ask "is the blocker now resolved (credential provided, decision made)?" If yes, un-park it — it becomes an eligible candidate again. If still blocked, it stays parked and is skipped as scope this cycle. - Absorb corrections to prior self-decisions — check the Decisions Ledger (and the preceding conversation) for any
provisionalL1 decision the human has markedrevertedor asked to change. For each, re-open it as new scope this cycle, re-evaluated together with whatever was built on top of it — do not merely swap in the opposite option, since later work may depend on the original choice; treat dependents as part of the scope. A correction given only in conversation must be written into the ledger (status →reverted) before acting, so a compaction cannot lose it. - Inherited defects first — if previous Carry-Forward contains actionable items, they are this cycle's priority scope
- This-cycle scope (skip blocked candidates) — if no inherited next-step exists (e.g. Cycle 1), pick the single most valuable unblocked phase from the backlog and scope only it. If the inherited Next-Cycle Scope is itself blocked (needs a credential / user-only decision), do NOT terminate — park it as a
BLOCKED-ITEMand fall through to the next unblocked candidate (another backlog phase, a Carry-Forward defect, or an autonomous-eligible Emergent Next Capability). Only when no unblocked candidate exists anywhere does the run reach its terminal state (see rule 9). - Drift check — 1–2 sentence judgment: has anything in the project invalidated the inherited next step?
- Trigger check — see below
Output: This cycle's scope only (an unblocked candidate), either as-inherited or adjusted.
Trigger matrix
| Trigger | Signal | Action |
|---|---|---|
| 🔴 HARD STOP (run-fatal) | Inherited plan conflicts with the project constitution (CLAUDE.md / philosophy / architecture), OR architecture change invalidates 3+ future cycles, OR critical dependency deprecated — a blocker that poisons all remaining work | Constitutional conflict → amendment, not override: name the conflict (planned scope X vs. constitution clause Y), then escalate with the two resolutions — revise the scope to fit, OR amend the governing doc (propose a concrete CLAUDE.md/design-doc diff). Log blocker in Carry-Forward, emit a single line HUMAN-NEEDED: <one-line reason>, then generate the End-of-Run Report (it must exist on this path too) and terminate the whole run. Reserve this for genuine structural invalidation — a merely-blocked single scope is 🔵 BLOCKED below, not HARD STOP. Do not silently proceed against the constitution, and do not unilaterally override it. |
| 🔵 BLOCKED (item-level, does NOT terminate) | This scope needs something only a human can supply — an external credential/dependency, or a product/API decision only the user can make — but the blocker is local to this scope and leaves other work workable | Self-unblock first, then park — never terminate. See "Self-unblock before parking" below: a blocker is only real once you have tried to resolve it yourself. What survives moves to the Blocked-on-Human ledger (Carry-Forward) with BLOCKED-ITEM: <scope> — <one-line reason + what was already tried + what would unblock it> (NOT HUMAN-NEEDED), then fall through to the next unblocked candidate — a backlog phase, a Carry-Forward defect, or an autonomous-eligible Emergent Next Capability — and continue the run. The run terminates on item-level blockers only when every remaining candidate is likewise blocked or exhausted (see termination rule 9). |
| 🟠 RE-PLAN | Roadmap order/split needs change, but overall goals remain valid | Adjust roadmap autonomously, record in Roadmap Revisions log section |
| 🟡 SCOPE ADJUST | This cycle's scope needs trimming or expansion only | Adjust inline, proceed to STEP 1 |
| ⚪ NONE | Plan still valid | Proceed with inherited scope |
HARD STOP is deliberately narrow: it kills the whole run, so it is only for structural invalidation that poisons all remaining work. If in doubt between RE-PLAN and HARD STOP, choose RE-PLAN; between 🔵 BLOCKED-item and 🔴 HARD STOP, choose 🔵 BLOCKED — ending the whole run on a local blocker while other work remains is precisely the early-termination failure this skill exists to prevent.
Self-unblock before parking (mandatory precondition of 🔵 BLOCKED)
A capable delegate does not hand back a task the moment it looks blocked — they first check whether the thing they are waiting for is already available. Parking is only legitimate for a blocker that survived an attempt to remove it. Before writing any BLOCKED-ITEM, run this bounded (~5 min) check:
- Is the resource actually missing? Look, don't assume — env vars, config files, existing fixtures/mocks,
gh auth status, a local package source, an existing test double. "I would need X" is not evidence that X is absent (rule 7.5). - Is the decision already made? A "user-only decision" is not open if CLAUDE.md / README / an architecture doc / an accepted issue / a prior Decisions-Ledger entry already answers it. Follow the existing decision instead of re-asking it.
- Can a useful slice proceed? Split the scope: implement and verify the part that does not touch the blocker (the logic behind an unavailable credential, the offline path, the interface plus a test double). Park only the residue, not the whole scope.
- Is it really L2? If the "decision only the user can make" turns out reversible, it is L1 — decide it, record it
provisional, and keep going (in dubio, pro autonomy). - Is the reason one the rules accept? How much work the scope is, that it brings no user-visible benefit, and a breaking change below 1.0 never make a scope L2 or a blocker. A check or approval that only closes the work (a person looking at the result, a sign-off to call it done) does not block starting it: do the work, and ledger the pending check as the residue. The Stop hook's auditor judges parked phases by these same reasons.
Record what was tried in the ledger entry. An entry that cannot say what was attempted is an assumed blocker, not a proven one — and assumed blockers are how a run stalls with budget left.
Record the step, never the secret. This check inspects real infrastructure, so it is exactly where operational values leak into a log that then gets committed. Write what to obtain and where it lives — the env var name, the config key, the grant to request — never the value: no host IPs or hostnames, connection strings, credentials, tokens, API keys. Nothing is lost, because the diagnostic content is the failure, not the address: production DB (<env: APP_DB_HOST>) unreachable — 1433 timeout says all the literal address would. Applies to every BLOCKED-ITEM: entry and the ledger carrying them forward; same rule in decision-briefing.md §1.
Decision leveling (overlay on the constructs above)
Every decision a cycle faces sits at one of four levels, keyed on stakes × reversibility (two-way vs. one-way door) — escalate what is irreversible or theirs-alone, self-decide what is reversible. (why)
| Level | Test (stakes × reversibility) | Handling | Maps to |
|---|---|---|---|
| L0 | pure taste/convention, no real trade-off | decide silently, not reported | inline autonomy |
| L1 | a real trade-off exists but the choice is reversible (two-way door) | pick the best option (five co-equal lenses, rule 2.5), proceed now, record provisional in the Decisions Ledger for later confirm/reverse |
rule 2.5 + Decisions Ledger |
| L2 | irreversible (an act outside the repo, a 1.0+ published-contract change) or only a human can decide — never edit size; other work is independent | park & batch, do not block the run | 🔵 BLOCKED-ITEM / Pending Human Decisions |
| L3 | run-fatal: poisons all remaining work | escalate & terminate | 🔴 HARD STOP (HUMAN-NEEDED:) |
In dubio, pro autonomy. Ambiguous between L1 and L2 → choose L1: decide it, record it provisional, let the end-of-run report surface it for correction. Same bias as "if in doubt, choose RE-PLAN / choose 🔵 BLOCKED", one rung further. The one exception: if the five lenses irreducibly conflict — no option is defensible across them — that is itself an L2 signal; escalate rather than force a pick. L1 never gates termination.
STEP 1: Design (conditional)
Skip if ALL true (and record "skipped — pattern-following change" in the log):
- Scope is an isolated, pattern-following change
- Identical patterns already exist in the codebase
- No new external dependencies or API changes
- No performance/security implications
Otherwise:
- Codebase survey — trace call paths, map existing patterns and conventions
- External research — WebSearch for best practices, library docs, known pitfalls. Do not guess.
- Approach decision — if multiple viable approaches exist, compare trade-offs and pick one with a 1-line rationale
Record findings briefly in the cycle log. Do not pad this step when skip conditions hold. Wide or
noisy 1/2 (many files, several searches) is a candidate for the Agent tool — dispatch it, keep only
the distilled finding (see "Delegating to subagents" above).
STEP 2: Execute
Implement the scope. Progress incrementally. Inherited defects are fixed first, before new roadmap work.
Root cause mindset: When problems surface, ask "why" until the real cause emerges. Fix all instances of a pattern, not just the symptom that triggered investigation.
STEP 3: Verify
- Define "done" before checking it — restate this cycle's scope as concrete, checkable acceptance criteria (which test passes, which behavior holds, which output appears). Verify against that, not against a self-assessed "looks done".
- Size the checks to the change, not to the cycle. Re-running the whole suite every cycle buys no evidence the change needed — it is cost, not rigor. Run the build/typecheck and lint, and the tests the change reaches: the changed modules and their direct users, through the runner's filter, path, or related-files option. A text-only change (docs, comments) needs no test run.
- Widen when the change is broad. A public contract (API, schema, serialized format), build
configuration, dependency versions, a cross-module refactor, concurrency, or a security path → the
full suite of every affected project. When the reach cannot be judged, widen; never guess small.
The full suite plus the project's integration/E2E checks is owed before a release (
/iyu:ship) — that run collects what the cycles left out. - Never buy the same result twice. Unchanged code gets no re-run. While fixing, re-run the failing tests, then the affected range once. Heavy checks — E2E, browser runs, benchmarks, model or GPU calls, starting a dev stack — run only when their surface changed; a stack already up is reused across cycles, not restarted.
- Write what was left out and why in the log's Verification section. A suite that cannot run in parts,
or a flaky test, is a STEP 4 defect — not a reason to skip. A project's own tiers (its
AGENTS.md/CLAUDE.md) override these defaults. - Drive the real thing when the change is user-facing. If the cycle touched UI, app flow, or CLI output, a green test suite is not the same as the feature working. Exercise it on its actual surface — a browser-automation MCP if the session has one, the CLI, the running service — and say what you observed. No such surface available: record "skipped — no runnable surface" and move on. Never add a dependency to satisfy this. STEP 4 asks you to judge user-facing quality; this is where you get the evidence to judge it with.
- Evidence, not assertion — completion is proven by actual command output (test/build results), never by claiming it works. The top failure mode of long-running agents is marking work complete without verifying it. If you cannot show the passing evidence, it is not done.
- On failure: fix and re-run immediately within this cycle — do not defer (the failing tests first, then the affected range)
- If a failure exposes a trigger-class issue (HARD STOP / RE-PLAN), loop back to STEP 0 rather than forcing progress
- A verbose suite is a candidate for the
Agenttool too — have it run and report pass/fail plus enough failure detail to fix, rather than letting the raw output sit in this context
STEP 4: Reflect & Evaluate (always, mandatory)
Objective quality review. This is the step that makes cycles cumulative rather than sequential.
Perspective: Evaluate as someone who didn't write this — a contributor, reviewer, or end user seeing the result for the first time. Internal consistency is necessary but not sufficient; external coherence is what reveals the issues an author cannot see.
Assess six dimensions:
- Scope fit: Does the implementation meet the cycle's intent?
- Latent defects: Bugs, unhandled edges, architecture violations in or around the changes
- Structural improvement opportunities: Better patterns, refactoring candidates, orphan code/files/docs found during the cycle
- Philosophy drift: library/application boundary leakage, pattern deviation. Scope widened to reach the root cause is not drift
- Roadmap impact & emergent scope: Two questions, not one. (a) Does this cycle's outcome change what existing phases should do? (b) What does the capability just built naturally imply next — the follow-on a user would expect, the case a developer sees left brittle, the safeguard an operator would demand? Capture both; (b) is the raw material STEP 5 turns into derived scope, and skipping it is what makes cycles terminate prematurely.
- User-facing quality (when changes touch UI, API contracts, CLI output, or app flow): Usability, interaction coherence, convention alignment, flow correctness relative to user mental models. Reference standards concisely when they anchor a finding objectively (e.g., "violates REST uniform interface", "missing affordance — Nielsen #1", "keyboard trap — WCAG 2.1.2").
Defect vs. improvement distinction:
- Defects (bugs, broken edges, violations) → fix before leaving STEP 4. Loop: discover → fix → re-verify. A structural defect this cycle could only route around is fixed at the root now, widening scope as needed.
- Structural improvements (better patterns, refactoring candidates) → reversible inside the repo, so L1: judged on the lenses, done this cycle or set as the next one's scope, recorded in the Decisions Ledger. Never silent, never parked as a proposal.
- Orphans (unused code, unreferenced files, stale docs) → remove immediately, note in cycle log.
Only L2 (Pending Human Decisions, STEP 5) is exempt; size and pre-1.0 breaking never qualify (why).
STEP 5: Derive Next
This step has two jobs: (a) record what cannot be resolved autonomously, and (b) actively derive the scope the cycle's own output now makes possible. (b) is the engine that prevents premature termination — never skip it because the roadmap "looks done".
-
Carry-Forward (actionable): Things to address next cycle
-
Emergent Next Capability (derive from multiple lenses, don't wait): The cycle's output is itself a source of scope. Derive candidates by asking, from each stakeholder lens, "given what was just built, what does it naturally imply next?"
- User lens — what would a user now expect, want, or hit? (the missing case, the obvious convenience, the input that breaks it — e.g. after single-file upload: "an empty/oversized file crashes it", "the real workflow obviously needs several files", "drag-and-drop")
- Developer / maintainer lens — does the new surface fit the project's philosophy and boundaries? what did it leave brittle, duplicated, or untested? (this lens also vetoes candidates that breach declared scope — see gate)
- Operator lens — what does running this in production now require? (input validation, resource limits, an observability hook, an unhandled failure mode)
Then classify every candidate through the derivation gate — this is the answer to "autonomous, or discussion?":
- Autonomous-eligible (→ becomes a Next-Cycle Scope / value-ladder candidate) when ALL hold: its absence would be felt as incompleteness or a defect; it stays within the project's declared role and established patterns; and it carries no trade-off only the owner can weigh — a reversible trade-off is L1: decide it and ledger it.
- Discussion / proposal-only (→ Pending Human Decisions; never taken as autonomous scope) when it opens a new product direction, introduces a new interaction paradigm, dependency, or surface the project has not committed to, or involves a trade-off only a human / product owner should weigh. Propose with rationale — do not self-decide.
- Worked examples of both: design-rationale.md.
- Frontier exhausted — a valid, expected outcome: the capability is genuinely complete and any further extension would be scope creep or needs human direction.
Write the outcome as a token, not as prose. The Emergent Next Capability line's value is one of exactly two markers — the Stop hook searches for them as literal strings, the same way it searches for
HUMAN-NEEDED::FRONTIER-OPEN: <candidate> [autonomous|discussion]— at least one follow-on was derived.FRONTIER-EXHAUSTED: <why, across all three lenses> | goal-gap: cycle <NN> — <what it found> | ladder: <rung acted on, or "no actionable signal — why">— derivation ran and produced no autonomous-eligible candidate, and this run's goal-gap review is done (the first dry STEP 5 of a run writesFRONTIER-OPEN: goal-gap review [autonomous]instead). Only this token permits early termination. Theladder:half is observability, not enforcement — it lets a later reader tell "checked, no signal" from "skipped". Write the rung you acted on, or say plainly that there was no signal and why.
Neither token present means derivation was skipped, which is never a valid reason to stop.
-
Decisions Ledger (L1 self-decisions — persists and accumulates, does NOT terminate): Every reversible self-decision made this cycle that carried a real trade-off (rule 2.5, L1). Each entry:
id · decision · alternatives considered · the trade-off · cross-lens rationale · cost-to-reverse · status. New entries startprovisional. Copy every unconfirmed entry forward and re-check it at STEP 0 for human corrections (reverted). Unlike Blocked-on-Human, this ledger never gates termination — the run does not wait on confirmation; it proceeds on provisional decisions and lets the human confirm or reverse them after the fact (that after-the-fact surface is the End-of-Run Report). L0 taste-only choices are NOT recorded here. -
Blocked-on-Human (ledger — persists and accumulates, does NOT terminate): Concrete scopes that hit an item-level blocker this cycle — a needed external credential/dependency, or a decision only the user can make — where the blocker is local to that scope and other work stays workable — and only after the self-unblock check failed to remove it. Each entry records the scope, the blocker, what was already tried, and what would unblock it. Copy every unresolved entry forward to the next cycle (like Carry-Forward defects) and re-check it at STEP 0. This ledger only grows; it never ends the run. The run terminates only when every remaining candidate is in this ledger (nothing unblocked left) or the frontier + ladder are exhausted. Distinct from Pending Human Decisions: those are advisory proposals; this is a parked, un-runnable scope that governs termination.
-
Structural Improvements: each STEP 4 finding marked done (Decisions Ledger id) or scheduled (Next-Cycle Scope, or a
ROADMAP.mdphase if it spans cycles), with reason. Size decides staging only. -
Pending Human Decisions (L2 only): a change to a contract published at 1.0+, an architecture choice the lenses irreducibly split on, scope only the owner can define, and every discussion-class emergent candidate above. Breaking before 1.0 is L1
-
Roadmap Revisions: If STEP 4's roadmap-impact judgment said "yes" — record the change to
ROADMAP.md(phase level) and log it -
Release placement: If the backlog carries a push/publish/release item, apply release-cadence.md §2 and move it to the phase boundary it belongs to — remaining work that touches the same consumer-facing surface means the release goes after it, since publishing mid-phase buys a version the next few items obsolete and each pushed pipeline spends a shared CI budget. The outcome is a reordered
ROADMAP.mdwith a one-line reason and the frozen batch at the marker (§2, §4), not a note. Log the move under Roadmap Revisions. This places the release; it never performs one — a grant is used only at run end (§5) -
Continuity-doc hygiene (every cycle, unconditional): Apply Continuity-Doc Hygiene (section below) — migrate every completed phase/item found in
ROADMAP.md(andHANDOFF.md, if the project keeps one) toHISTORY.md, keep the handoff current + next only, and updateSTRANDS.md(see below). Runs even when nothing else in the roadmap changed. -
Next-Cycle Scope: This is where the next cycle is actually planned — concretely, for one cycle only. Draw it from three sources in priority order: (1) inherited / this-cycle Carry-Forward defects, (2) mid-cycle discoveries (a problem too large for this cycle, or one deserving its own), (3) the highest-value autonomous-eligible Emergent Next Capability, (4) a startable backlog phase or standing-track item. All four empty → the goal-gap review, if this run has not done it; only after it does Next-Cycle Scope become "none", handing off to the value ladder. Do not scope cycle+2 and beyond — those stay phase-level in the backlog until their predecessor's STEP 5 reaches them. When the next cycle is the budget's last, the run holds a release grant, and the release batch is still open, prefer the candidate that closes the batch over one that opens a new surface (release-cadence.md §5).
Do NOT carry forward defects that could have been fixed in STEP 4. If you can fix it, fix it now.
Close the log: fill in every section above, then flip the header's Status: to complete. The
Stop hook counts completed logs only — a cycle whose log still says in-progress reads as the cycle
running now, which is exactly right while it is, and wrong the moment the cycle is actually done.
Continuity-Doc Hygiene
Apply continuity-docs.md §3 in full at
every STEP 5 — migrate completed work out of ROADMAP.md into HISTORY.md (archiving overflow past
its live window), rewrite HANDOFF.md to current + next, update and compress STRANDS.md (§3 step
4 — archiving overflow past its live window; ## 진행 중/## 중단됨 are never archived), keep the
> History: link, treat a still-long doc as a wrong-layer signal. handoff runs the identical pass
— including the STRANDS.md transition procedure — which is why it lives in one shared file rather
than two copies that would drift.
Two things specific to running it inside a cycle: HISTORY.md and STRANDS.md entries carry this
run's cycle-{NN} as their unit (continuity-docs.md §3 step 4 — handoff instead records
session-{YYYY-MM-DD}), and hygiene never gates termination — it is doc upkeep inside STEP 5 and
the doc-sync floor, not a completion criterion, and it adds nothing to the Stop-hook logic. Its
structural checks (§7) still run every cycle — run the script,
sh "${CLAUDE_SKILL_DIR}/../_shared/scripts/docs-lint.sh" <root>: what fails is fixed in the same
pass, and anything left becomes a Carry-Forward item rather than a stop.
Cycle Log
Each cycle's log is opened as a header-only stub when the cycle begins and completed when it
ends — the first one in Preparation, every later one at the start of its own STEP 0. Status: flips
to complete only when the sections below are filled in; the Stop hook counts completed logs and
reads Budget:/Start: from the newest one, so a log that exists from the moment a cycle starts is
what keeps the hook anchored to this run.
<root>/cycle-logs/cycle-{NN}.md:
# Cycle {NN}: {Title}
Date: {YYYY-MM-DD}
Root: {resolved continuity root, e.g. `claudedocs/`}
Budget: {total cycles N for this run}
Start: {starting cycle number for this run}
Status: {in-progress | complete}
## Re-plan
{Trigger detected (if any) and scope decision — or "Plan valid, inherited scope"}
## Scope & Implementation
{What was tackled, files changed, key design decisions}
## Verification & Defect Resolution
{Test/build status and the range run (and what was left out, why), defects discovered and resolved — or "No defects found"}
## Reflection
{Scope fit, philosophy drift, roadmap impact — evaluated from an external perspective. User-facing findings (if applicable): usability, flow, convention issues with standards reference.}
## Carry-Forward
- Actionable: {items for next cycle, or "None"}
- Decisions Ledger (L1 self-decisions): {reversible decisions made this cycle that carried a real trade-off — each with alternatives, the trade-off, cross-lens rationale, cost-to-reverse, status=provisional; carried forward until the human confirms/reverts, or "None". Non-terminating.}
- Blocked-on-Human (ledger): {parked scopes, each with blocker + what was already tried (self-unblock check) + what would unblock it — carried forward every cycle until resolved, or "None". These accumulate; they do NOT terminate the run.}
- Structural Improvements: {each done (ledger id) or scheduled (next scope / roadmap phase) with reason, or "None"}
- Pending Human Decisions: {decisions needing human input + discussion-class emergent candidates, or "None"}
- Emergent Next Capability: `FRONTIER-OPEN:` {follow-on(s) derived across user/developer/operator lenses, each tagged autonomous / discussion} — OR — `FRONTIER-EXHAUSTED:` {why, across all three lenses} `| goal-gap: cycle` {NN — what it found} `| ladder:` {rung acted on, or "no actionable signal — why"}. {Exactly one marker, written verbatim: never blank, never untokenized prose — the Stop hook searches this log for the literal string.}
- Roadmap Revisions: {phase-level changes made to ROADMAP.md, plus completed items migrated to HISTORY.md, or "None"}
- Next-Cycle Scope: {concrete scope for the next single cycle — from Carry-Forward defects, mid-cycle discoveries, or the top autonomous-eligible Emergent Next Capability. "None" only when the frontier is explicitly exhausted. Do not scope further ahead.}
When STEP 5 comes up dry (summary — procedure in references)
A passionate maintainer whose task list empties does not down tools. Two things come before
FRONTIER-EXHAUSTED:, in this order:
- Goal-gap review — once per run: compare what the project says it is for with the product as
it runs, adopt the gaps that stay inside its declared role into
ROADMAP.md, propose the rest. - Surplus-Cycle Value Ladder — ② 내공/durable value → ③ 방어선/stability → ④ 가속기/efficiency,
acting only where the project shows a concrete gap. Reversible → do it through STEP 2→4, logged
[ladder:②/③/④]; a new direction or an L2 act → Pending Human Decisions. A defect in any surplus track returns you to the main loop. Doc-sync is the always-applicable floor.
Both in full: references/run-level-procedures.md. Termination is governed by rule 9(d).
Execution Rules
- No interruptions within a cycle: Decide autonomously. Do not ask for confirmation mid-cycle.
- Terminate only on run-fatal: a HARD STOP (the trigger matrix's 🔴) emits
HUMAN-NEEDED: <reason>, generates the End-of-Run Report (required on this path too), then ends the run — do not force progress. An item-level blocker (🔵) emitsBLOCKED-ITEM: <scope> — <reason + what was tried>after the self-unblock check and never ends it; rule 9 governs what happens next. 2.5. Option-question self-resolution (L0/L1): When a non-blocker decision has multiple reasonable options, do NOT ask the user — self-decide and proceed. Weigh the five co-equal lenses together (this is NOT a priority order): 근본/structural fit, 정석/balanced-canonical, 표준/convention, 세련/elegant-minimal, 철학/project-philosophy alignment — defined once in decision-lenses.md. Pick the option best across them as a whole. If the choice is pure taste with no real trade-off (L0), decide silently. If a real trade-off exists but the choice is reversible (L1), record it in the Decisions Ledger asprovisional— decision, alternatives, the trade-off, the cross-lens rationale, and cost-to-reverse — so the End-of-Run Report can surface it for confirmation or correction; do not stop or wait on it. If the five lenses irreducibly conflict (no option is defensible across them), that is an escalation signal — treat it as L2 (Pending Human Decision), not a forced pick. - Fix what you find: STEP 4 defects (bugs, broken edges) MUST be resolved in the same cycle. Structural improvements are L1 — done (this cycle or scheduled as the next) and ledgered, never silent, never parked as proposals. Orphans (unused code, stale docs) are removed immediately and noted in the log.
- Inherited defects first: Previous Carry-Forward actionables are mandatory at STEP 0.
- Roadmap is a phase backlog, not a cycle plan: It holds phase-level directions only — never a cycle-numbered scope table. Concrete scope exists for one cycle at a time (this one); the next cycle is scoped by this cycle's STEP 5. Revise the backlog when evidence requires and log revisions explicitly.
- Quality over scope: Reduce new scope if needed — never reduce defect resolution or reflection depth.
- Research actively: WebSearch before guessing. Record sources. 7.5. No invention: Data you did not directly observe (a command's output, a file's contents, a test result) stays "unknown" — never present a guess as fact. When something is unknown and matters, state it and take the step that would observe it rather than assuming.
- Defect honesty: Record issues openly. "It works" ≠ "It's good".
- No idle early stop — park blockers, push unblocked work, quit last (normative home for the termination test — the trigger matrix, rule 2, and the value ladder all defer here): While cycles remain, termination is the last resort, reached in this order. (a) Emergent derivation (STEP 5) — derive the natural next capability from what you just built, across the user/developer/operator lenses; if a candidate passes the derivation gate, write
FRONTIER-OPEN:and that is the next cycle (main loop, track ①). (b) When derivation first comes up dry, run the goal-gap review as the next cycle — the stated goal against the running product; gaps inside the declared role become backlog phases. Only after it do you climb the Surplus-Cycle Value Ladder (durable value → stability → efficiency), acting where the project shows a concrete signal; doc-sync is its always-applicable floor. (c) Item-level human blockers never terminate the run — park eachBLOCKED-ITEMin the Blocked-on-Human ledger, carry it forward, and keep pushing every unblocked candidate (backlog phase, Carry-Forward defect, autonomous emergent capability, ladder signal). (d) Terminate early only once no unblocked autonomous work remains anywhere — every backlog phase, Carry-Forward item, autonomous-eligible emergent capability, and ladder signal is either done or parked in the ledger, each remainingROADMAP.mdphase andHANDOFF.md## Nextitem judged done (a✗line that states its ground in the project's own documents and a reopening condition counts, continuity-docs §4) · blocked (what it waits on named) · a design question (level and question stated) · startable — never parked for its place in the order (continuity-docs.md §4) — AND the log carriesFRONTIER-EXHAUSTED:with itsgoal-gap:note AND the ladder surfaces no actionable unblocked signal. Log that judgment (and the full ledger of parked blockers) explicitly, and generate the End-of-Run Report before terminating.FRONTIER-EXHAUSTED:is audited, not taken on trust — the Stop hook hands the claim, with this log, the one before it,ROADMAP.mdandHANDOFF.md's## Next, to a separate read-only auditor, and blocks if work plainly remains unparked — a backlog phase, a## Nextitem, a scope in the log, a ledger entry dropped between the two logs — naming it back to you. Answering a finding by relabelling is judged by the reason given, so a cycle that only reclassifies cannot pass it. Write the token as a claim you could defend, never as a way to stop. Throughout: reversible work, large or small, is done (STEP 2→4) and ledgered; only L2 and discussion-class work is proposed in Derive-Next, never self-decided. - Continuity chain: the previous cycle's Next-Cycle Scope is this cycle's starting scope (STEP 0).
- Latent work priority: The best cycles surface structural improvements nobody thought to ask about — take them on as L1 scope, rationale in the Decisions Ledger. Never fold them in silently.
- Cost discipline: STEP 0 is bounded (~5 min); a drift check that needs deep analysis is a RE-PLAN signal.
Start
Begin: Preparation → the first cycle of this run (derived index) → the next → … until the budget N
is spent, or HARD STOP / early termination.
04 同仓库更多 Skills
walk
Measures a product from its users' purposes instead of its own feature list — a blind setter (a separate, tool-less model call that sees only what the project says it is for) writes personas and missions, an independent walker subagent tries each mission and its variations on the running product as that person would, and every finding is routed to an issue draft, the roadmap, the stage parking lot, or the owner. Changes no product code.
drive
Pushes the open stage of a product to its agreed satisfaction bar — implement one failing scenario at a time, have an independent evaluator judge the running build, repeat until the stage passes or needs something only the owner can supply, then show the owner a demo. Use after `/iyu:charter` has a signed stage contract.
charter
Interviews the owner to set a product's goal and writes the stage contract — an ordered ladder of stages that each work on their own, with scenarios an observer can watch, a calibrated satisfaction bar, the promises each stage must keep, and every owner decision that could block it. Use before `/iyu:drive`, and again at each stage boundary.
accept
Judges the open stage by having an independent evaluator subagent drive the real, running build like a user — scenario by scenario, against the rubric — and record an evidence report and the status fields. Use to get a verdict without building anything; `/iyu:drive` dispatches the same evaluator each round.
Azure Application Insights 遥测分析
telemetry-az
分析自上次运行以来的 Azure Application Insights 遥测数据,以发现缺陷、性能回退和功能弃用信号,并按运行周期追踪为质量趋势(错误率/p95/问题数量的走向,并检测已关闭问题的复发),同时提供仅用于报告的用户分析解读(活跃用户增长、功能/页面偏好变化、用户参与度)。依据项目理念对发现的问题进行分级,仅为超过阈值的问题创建工单,且每份报告都以基于 12 次运行历史、兼顾双重用途的「趋势」章节开头。
版本发布与上线
ship
将完成的工作发布出去——提升版本号、提交、推送,并观察 CI 运行直至完成,若失败则报告失败内容。首先检查当前是否为合适的发布时机——如果剩余的待办工作会触及相同的面向用户的界面,它会如实说明并询问,而不是发布一个随后几项工作就会淘汰的版本。