[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F8Z17PX2RZR0KXA2924XAR":3,"skill-same:01M7F8Z17PX2RZR0KXA2924XAR":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":32,"install":33,"resources":45},"01M7F8Z17PX2RZR0KXA2924XAR","discovery",null,"Populate and refresh the hub's knowledge from the real codebase via a seeded, per-item confirmed interview — accepted items land through a typed promotion scenario. Re-runnable — a second run surfaces only new or drifted items.","steepy-it\u002Fsteepy-formula","steepy-it","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F299579966?v=4","01M7F8VT4D9JWJZDQFATW4K3YB","Steepy","01M7F8VT4ZR70KR69DV1RR1Q8W",5,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Fdiscovery\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: discovery\ndescription: Populate and refresh the hub's knowledge from the real codebase via a seeded, per-item confirmed interview — accepted items land through a typed promotion scenario. Re-runnable — a second run surfaces only new or drifted items.\nuser-invocable: true\n---\n\n# discovery\n\nPopulate and refresh the hub's knowledge from the actual codebase, via a seeded interview the\nuser confirms item by item — the canonical graph's terms and rules, landed through a typed\npromotion scenario (Step 2.5).\n\n`discovery` is a **standalone** hub-aware skill, like `init` \u002F `new-surface` \u002F `check` — it is not\npart of the brainstorm → plan → implement → review chain. It has its own precondition step below and\ndoes not follow the chain skills' shared gear-selection or Model-Selection-lock format.\n\n> **Engine root:** this skill's base directory is `\u003Cengine-root>\u002Fskills\u002Fdiscovery\u002F`; engine\n> scripts live two levels up, at `\u003Cengine-root>\u002Fscripts\u002F`. Resolve them relative to the base\n> directory your harness reports for this skill.\n\n## Procedure\n\n### Step 0 — Preconditions\n\n**Hub-mode declaration (once per run).** Run `steepy-formula hub-mode` and carry its declared\nmode — `graph`, `migrate`, or `none`, each printed with one `evidence:` line — through the rest\nof the run. The command always exits 0: it is a declaration, not a gate, and this prose never\nre-implements its detection — the command is the single authority. The declared mode branches\nthe whole run:\n\n- **`none`** → the hub is absent: tell the user to run the `init` skill (invoke it the way\n  your harness invokes skills) — the graph-first entry point — and **stop**. `discovery`\n  populates an existing hub, it does not create one.\n- **`migrate`** → Stop and tell the user to run the `graph-migrate` skill (invoke it the way\n  your harness invokes skills) before any other workflow.\n- **`graph`** → every stage rides graph-backed inputs and destinations. Step 1 scoping offers\n  the recorded terms and rules from the Step 0 `context resolve`; Step 2.2 hands the explorer\n  that resolved context; Step 2.4 routes accepted items to typed candidate kinds, not doc\n  sections; the write-back (Step 2.5) and the coherence gate (Step 3) land and verify them\n  through the graph. The interview mechanics — item cards, previews, accept \u002F correct \u002F skip,\n  the emergent-area check — are the same at every stage.\n\nThen read the hub's current state from the canonical graph. First derive the surface targets —\nevery part is deterministic, nothing is guessed: surface names come from the repo's specialist\nagent files (`.claude\u002Fagents\u002F\u003Cname>-agent.md` → surface `\u003Cname>`; CLAUDE.md's Surfaces section is\nthe fallback listing when no agent files exist), the project id is the one the hub-mode\ndeclaration already echoed (its `hub-mode '\u003CprojectId>'` line), and each surface's node id\nfollows the structural convention of `scripts\u002Fstructural-promotion.mjs`:\n`apex:\u003CprojectId>:surface:\u003Cslug(name)>`, under the shared slug discipline (lowercase,\nnon-alphanumeric runs collapse to `-`, edges trimmed). Then resolve the current state — the\nrecorded terms and rules — with `steepy-formula context resolve --target \u003Csurface node id>...`,\nnaming every derived surface id: the resolver walks each surface up to the project root, so\nproject-anchored terms ride along, while a bare project-root target returns an empty context —\nnever target it on its own. The derived surface node ids are the `appliesTo` targets the\nStep 2.5 write-back scopes its rules to. That resolved context (`context.json` +\n`context.md`) is the run's only hub input: Step 1 scopes against it, and Step 2.2 hands it to\nthe explorer.\n\n### Step 1 — Run scoping\n\nAsk the user to scope the run: which surface(s) to enrich (default: all surfaces the Step 0\nstate read enumerated), whether to also include the cross-cutting knowledge this run, and\nwhether to add project-doc discovery (README \u002F `docs\u002F` \u002F ADRs). The cross-cutting offer is the\ngraph-backed scopes: the recorded terms and the cross-surface rules the Step 0 `context resolve`\nreturned — no Markdown doc is offered, because none exists.\n\nThis keeps a run bounded and re-runnable one surface at a time.\n\nIf `.formula\u002Finception\u002Frun.json` exists, its `schema` is\n`steepy-inception-run\u002Fv2`, and its `status` is `complete` (with phase `complete`), also offer the\n**inception source**: import decisions only if Step 2a verifies that completed delivery. Read only\nthat one file to check this, and never list `.formula\u002Finception\u002F`. This is a candidate offer, not a\nverified source; do not load approval or document bodies here. Otherwise do not mention the\ninception source; absent, active or blocked runs and an unsupported run format leave ordinary\ndiscovery available with the user's selected scope. Never migrate or restart a run.\n\nWhen the user chooses the inception source, run Step 2a right after this step, before Step 2. Its\nwindow is the certified initialization revision: the gate accepts the graph only while its head is\nstill the revision `init`'s promotion created, so any promotion before the gate ends the source.\n\n### Step 2 — Per-surface iterative loop\n\nFor each surface selected in Step 1, run this loop:\n\n1. **Scope (interview → areas).** Propose candidate exploration areas drawn from the knowledge-area\n   taxonomy — **Scope**, **Conventions**, **Anti-patterns**, **Testing** (area tags Step 2.4 maps\n   to typed candidate kinds) — plus a couple of\n   surface-type heuristics (e.g. a UI surface might add \"component patterns\"). The user picks which\n   areas matter for this run, or adds their own.\n2. **Explore.** Ensure `.formula\u002Fwork\u002Fdiscovery\u002F` exists (create it if absent), then set\n   `[REPORT_FILE] = .formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-\u003Csurface>.md`. If your harness provides a\n   task\u002Fsubagent tool, dispatch a fresh subagent per surface using\n   `skills\u002Fdiscovery\u002Fexplore-surface-prompt.md`; otherwise perform the exploration inline in a\n   dedicated pass over the same inputs, and state the inline degradation in the run's report (Step 4).\n   When you dispatch, always set `model: standard`\n   explicitly (the explorer's floor tier), rising to `model: most-capable` for a large or subtle\n   surface. Pass it the surface name\u002Fpath, the areas picked in Step 2.1, `[REPORT_FILE]`, and the\n   Step 0 resolved context (`context.json` + `context.md`) as `[HUB_CONTEXT]` — the recorded\n   terms and rules relevant to this surface, with their node ids — and nothing else: no\n   Markdown hub doc exists, and the explorer's only hub input is that resolved context.\n\n   It reads the surface's code and nearby docs\n   (README\u002F`docs`\u002FADR), writes its full findings report — observed conventions, candidate\n   anti-patterns, candidate glossary terms, and discovered doc files, each with `file:line`\n   evidence and no invention — to `[REPORT_FILE]`, and returns only a terse status. This subagent is\n   an **explorer, not a reviewer**: it only gathers raw material; it does not judge, decide, or write\n   hub or code changes. Validate the four-field completion defined in\n   `skills\u002Fdiscovery\u002Fexplore-surface-prompt.md` → \"Output Format\", including the exact `[REPORT_FILE]`.\n   For BLOCKED, read that report's blocker and stop before the interview. For DONE, before Step 2.3,\n   read the report back from `[REPORT_FILE]` — the terse return status is not the report.\n3. **Emergent-area check.** If the report flags important findings outside the areas scoped in Step\n   2.1, present them to the user and ask whether to fold them into this run before drafting\n   (optionally re-dispatch the explorer narrowly on just the new area).\n4. **Seeded interview.** Walk the report area by area. The report lives in a file the user never\n   saw — so before any acceptance prompt, print each item in a plain text message, immediately\n   followed by its **write-back preview**: the exact text that would be written, and its\n   destination. For the three item-card areas — Observed conventions, Candidate anti-patterns,\n   Candidate glossary terms — print the item's full card (all 4 fields: Proposed doc text,\n   Evidence, Occurrences, Why it matters). For **Discovered doc files** — which the explorer\n   reports as `path → one-line purpose` (+ file:line), not a 4-field card — print that line\n   instead, followed by its own preview: the `readme` note it would become. The interviewer routes\n   each item to a destination; the explorer only tagged the item by area, never by destination,\n   because only the interviewer sees every surface:\n   - One of the typed candidate kinds Step 2.5 promotes — never a doc section:\n     a glossary term → `term`; a convention or anti-pattern → `rule`, scoped `appliesTo` one\n     surface node id derived in Step 0 — the candidates schema admits exactly one target per\n     rule, so a pattern spanning several surfaces fans out into one rule candidate per surface\n     it applies to (same statement, each with its own `appliesTo`), and a genuinely global\n     pattern routes to `decision` or `readme` instead of a rule; a rationale worth recording →\n     `decision`; a discovered doc or other out-of-graph note → `readme`. The preview shows the\n     typed candidate exactly as it will land in the Step 2.5 candidates file.\n\n   Decide **accept \u002F correct \u002F skip** on the preview, never on the card or line alone: the\n   card\u002Fline explains the finding, but the preview is the actual text-plus-destination the user is\n   approving. A **correction re-renders the corrected preview** before anything is written. Ask one\n   question at a time, with numbered options and a recommendation; use your harness's question UI if\n   it has one. Never present items as bare IDs (T1, T2, …) as option labels — the short option labels\n   cannot hold a draft, and the user must read the content, not a label. On a re-run, surface only\n   **new** or **drifted** items — compare against what is already recorded: the recorded terms\n   and rules from the Step 0 `context resolve` — each rendered as a\n   preview **diff** against the current state, so the same rule applies uniformly: the user always\n   decides on the exact final text that lands in the hub, whether it's a fresh addition or a drift\n   correction.\n5. **Write-back.** The accepted item cards never edit anything directly: they become a typed\n   candidates document — the closed schema of `scripts\u002Fformula\u002Fcore\u002Fscenario-assembly.mjs`,\n   whose wrapper is that schema's only interpreter (kinds `term`\u002F`rule`\u002F`decision`\u002F`readme`;\n   this prose maps nothing itself) — written to `.formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-\u003Csurface>-candidates.json`\n   as its `candidates` array:\n   - glossary terms → `{kind:'term', term, definition}`\n   - conventions \u002F anti-patterns → `{kind:'rule', title, statement, concern, strength,\n     appliesTo:\u003Csurface node id>}` — `strength` is `must`|`should`, picked with the user at\n     acceptance; `appliesTo` carries exactly one surface node id derived in Step 0 — a\n     cross-surface acceptance lands as one rule candidate per surface, as routed in Step 2.4\n   - recorded rationales → `{kind:'decision', title, statement, context}` — all three text\n     fields are required; a decision candidate alone has no upward edge, so the promotion\n     preview reports it unreachable and apply blocks until the human anchors it (e.g. a\n     `MOTIVATED_BY` edge from an existing rule)\n   - `readme` notes (e.g. discovered-doc mentions) → `{kind:'readme', note}` — no graph\n     operation: the note is reported out-of-graph and edited directly outside the graph,\n     exactly as its preview said.\n\n   Writes are **additive and diff-gated**: the scenario only adds typed candidates, the preview's\n   typed diff shows exactly what lands, and every write is gated per item by the user in\n   Step 2.4, not batched at the end. Never clobber recorded knowledge unseen.\n\n   Then drive the CLI — never an inline graph mutation:\n\n   ```bash\n   steepy-formula promotion create --project \u003Cid> --candidates \u003Cfile.json> [--proposer \u003Cname>] \u003Cscenario-id>\n   steepy-formula promotion preview \u003Cscenario-id>\n   ```\n\n   Show the preview's typed diff to the user and ask one explicit yes\u002Fchange\u002Fno question; then\n   apply ONLY at that human gate —\n\n   ```bash\n   steepy-formula promotion apply \u003Cscenario-id> --yes [--approver \u003Cname>]\n   ```\n\n   — the agent applies directly, passing `--yes` only after the human's explicit yes, in an\n   interactive session, for exactly the scenario just previewed; a no applies nothing, and the\n   CLI's stale check (exit 20) refuses an apply whose base revision moved after the preview.\n   `--approver` names the human who said yes (default: the OS user).\n\n### Step 2a — Inception source (complete run only)\n\nRun this step only when the user chose the inception source in Step 1. It runs right after Step 1\nand before Step 2; the run then continues with Step 2 for the selected surfaces. It turns the\ndecisions of a completed inception run into typed graph candidates landed through one promotion\nscenario. Read by exact path only: never list `.formula\u002Finception\u002F` or a directory under it. A stop\nin this step ends only the inception source; Step 2, Step 3 and Step 4 still run.\n\n1. **Verify before reading.** Before reading any source approval, document, summary, or report\n   body, run:\n\n   ```bash\n   node \u003Cengine-root>\u002Fscripts\u002Finception-state.mjs verify-complete --repo-root .\n   ```\n\n   Require exit 0 and JSON `ok: true` with `runId`, `completion`, `inputPaths`, `checks`, and\n   `coverage`. The helper verifies transitive evidence and current application identity, including\n   only exact certified init additions, before returning document paths. It also rejects a\n   completion whose latest approval does not cover every registered decision document, naming that\n   path. Then check the one-time window: `steepy-formula graph status` must report `head:` equal to\n   `apex:\u003CprojectId>:revision:r1` — the certified initialization revision is still the only one.\n   Only after both succeed may the coordinator or explorer read source bodies, and only the exact\n   returned `inputPaths`. Do not traverse descriptor or approval refs, append raw evidence, infer\n   summary\u002Freport paths, or choose an approval by recency. Stop this source if\n   `.formula\u002Finception\u002Fproject\u002Fdecision-register.md` is not among the returned `inputPaths`.\n\n   On nonzero exit, `ok: false`, malformed output, missing fields, or a head past the\n   initialization revision, stop only the inception source and report the returned reason\n   (unsupported run format, tamper, application-drift, uncovered decision, graph changed since the\n   certified init, or another verification failure). No source bodies are loaded and no source\n   decisions are promoted. Never downgrade rejected source decisions into old design choices.\n   Ordinary discovery remains available for the current code and surfaces already selected in\n   Step 1; the per-surface interview and Steps 3–4 continue. Keep the complete run and all its\n   evidence immutable: no reopen, repeat bootstrap, migration or restart. A refused source is not a\n   request to widen the discovery scope.\n2. **Explore.** Ensure `.formula\u002Fwork\u002Fdiscovery\u002F` exists (create it if absent), then set\n   `[REPORT_FILE] = .formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-inception.md`. If your harness provides a\n   task\u002Fsubagent tool, dispatch a fresh subagent using `skills\u002Fdiscovery\u002Fexplore-inception-prompt.md`,\n   and always set `model: standard` explicitly. Pass `[INPUT_PATHS]` = exactly the successful gate's\n   `inputPaths` array, unchanged — no other run path. Also pass `[REPORT_FILE]` and, as\n   `[HUB_CONTEXT]`, the Step 0 resolved context (`context.json` + `context.md`). Otherwise run the\n   same prompt inline over the same inputs, and state the inline degradation in the run's report\n   (Step 4). Validate the four-field completion defined in\n   `skills\u002Fdiscovery\u002Fexplore-inception-prompt.md` → \"Output Format\", including the exact\n   `[REPORT_FILE]`. For BLOCKED, read that report's blocker and stop the inception source. For DONE,\n   read the report back from `[REPORT_FILE]` before the interview.\n3. **Walk the decision register.** The report holds one item card per `DR-n`, in register order.\n   For each decision, print in a plain text message its card — Proposed doc text, Evidence (the\n   local file and line; it is for the interview only), Verification status (from the verified summary's\n   `coverage` entries), Promotion class — immediately followed by its write-back preview: the typed\n   candidate exactly as it will land in the candidates file. Then run the same accept \u002F correct \u002F\n   skip interview as Step 2.4: decide on the preview, a correction re-renders the preview, one\n   question at a time. Never use bare IDs (DR-1, DR-2, …) as option labels: the user decides on the\n   printed card and preview. A skip is a rejection: ask the user for its reason.\n4. **Promotion rules.** Every decision in the register is approved: Step 2a.1 verified complete\n   delivery, including its approval. Use only the verified summary for coverage and check outcomes; a red source gate\n   permits none of these promotions.\n   - Approved and verified (`verified`) → may land as a `rule` candidate scoped `appliesTo` one\n     surface node id (one candidate per surface it applies to, as in Step 2.4), or as a `term`.\n   - Approved but unverified (`unverified`) → lands as a `decision` candidate recording a design\n     choice, never as a rule asserting an existing component.\n   - A future flow (`future`) → lands as a `decision` candidate whose context marks the future\n     flow, never as a rule, a spec, or a started task.\n5. **Write-back, in one pass after the interview.** Unlike Step 2.5's per-surface scenarios, this\n   source batches its write: promote nothing until every register decision is decided. Each preview\n   is still accepted, corrected or skipped on its own, so every write stays gated by the user. An\n   interview interrupted before the apply leaves the graph at its initialization revision, so the\n   next run's gate still passes and the import starts again (discard a leftover\n   `inception-\u003CrunId>` draft first with `steepy-formula promotion discard`). Then record the decision\n   outcomes (item 6) and write every accepted candidate, verbatim as previewed, into one candidates\n   file `.formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-inception-candidates.json` (the Step 2.5 schema). Candidate\n   text never names, cites, or links `.formula\u002Finception\u002F`; the Evidence stays in the interview. Drive\n   the CLI once, with the deterministic scenario id `inception-\u003CrunId>`:\n\n   ```bash\n   steepy-formula promotion create --project \u003Cid> --candidates \u003Cfile.json> [--proposer \u003Cname>] inception-\u003CrunId>\n   steepy-formula promotion preview inception-\u003CrunId>\n   steepy-formula promotion apply inception-\u003CrunId> --yes [--approver \u003Cname>]\n   ```\n\n   Show the preview's typed diff and apply only at the human gate, with `--yes` only after the\n   human's explicit yes, exactly as in Step 2.5 — a decision candidate needs its anchor before\n   apply, and a no applies nothing.\n6. **Decision outcomes.** Every register decision ends accepted (promoted) or rejected with a\n   reason. Record the outcomes in `[REPORT_FILE]` under `## Decision outcomes`, one line per\n   decision: `DR-n — accepted` or `DR-n — rejected: \u003Creason>`. The import is one-time. Once the\n   scenario applies, the graph head moves past the initialization revision, so a later run's gate\n   refuses the source: report it and continue with ordinary discovery. If the apply was refused,\n   nothing landed and the window stays open; the run's `[REPORT_FILE]` still lists every accepted\n   decision under `## Decision outcomes`.\n\n### Step 3 — Coherence gate\n\nRun `steepy-formula graph validate` — the run is not done until the portable graph invariants and\nthe revision-chain replay come back clean — plus, when a promotion scenario was applied in\nStep 2.5, one sanity `steepy-formula context resolve` of a representative path or target from the\nwork just promoted, confirming the resolver still answers. Any invariant violation or a failed\nresolve is an incomplete run — fix and re-run until green.\n\n### Step 4 — Report\n\nSummarize, per surface: items added, items updated (drift), docs discovered, and any areas\nskipped — so the user sees exactly what changed and that nothing was clobbered. If a re-run found\nnothing new, report it as a no-op: no file changed.\n\nWhen the run used the inception source, also report its decision outcomes from\n`## Decision outcomes`: each decision accepted, with the candidate it landed as, or rejected with\nits reason. If the inception source stopped, report why.\n\n## Model Selection\n\nAlways set `model:` explicitly when dispatching the Explore subagent in Step 2.2 and the inception\nexplorer in Step 2a.2 — an omitted model inherits the expensive session model and defeats the tier\npolicy. Floor at `standard`; rise to `most-capable` for a large or subtle surface. The inception\nexplorer runs at `standard`. Translate the tier to a concrete model by judgment at\ndispatch time using your harness's available models; `most-capable` is the ladder's top rung, not an\nopen-ended \"best available\", and a pricier model sitting above it is never reached from a tier.\nNever hardcode a concrete model id in `explore-surface-prompt.md` or `explore-inception-prompt.md`.\n\nThis flow dispatches **no reviewer subagent**: every write is gated per item by\nthe human in the Step 2.4 seeded interview (Step 2a.3 for the inception source); the Step 3\ncoherence gate is the deterministic net. The Explore subagent dispatched\nin Step 2.2 and the inception explorer dispatched in Step 2a.2 are explorers, not reviewers.\n","# discovery\n\nPopulate and refresh the hub's knowledge from the actual codebase, via a seeded interview the\nuser confirms item by item — the canonical graph's terms and rules, landed through a typed\npromotion scenario (Step 2.5).\n\n`discovery` is a **standalone** hub-aware skill, like `init` \u002F `new-surface` \u002F `check` — it is not\npart of the brainstorm → plan → implement → review chain. It has its own precondition step below and\ndoes not follow the chain skills' shared gear-selection or Model-Selection-lock format.\n\n> **Engine root:** this skill's base directory is `\u003Cengine-root>\u002Fskills\u002Fdiscovery\u002F`; engine\n> scripts live two levels up, at `\u003Cengine-root>\u002Fscripts\u002F`. Resolve them relative to the base\n> directory your harness reports for this skill.\n\n## Procedure\n\n### Step 0 — Preconditions\n\n**Hub-mode declaration (once per run).** Run `steepy-formula hub-mode` and carry its declared\nmode — `graph`, `migrate`, or `none`, each printed with one `evidence:` line — through the rest\nof the run. The command always exits 0: it is a declaration, not a gate, and this prose never\nre-implements its detection — the command is the single authority. The declared mode branches\nthe whole run:\n\n- **`none`** → the hub is absent: tell the user to run the `init` skill (invoke it the way\n  your harness invokes skills) — the graph-first entry point — and **stop**. `discovery`\n  populates an existing hub, it does not create one.\n- **`migrate`** → Stop and tell the user to run the `graph-migrate` skill (invoke it the way\n  your harness invokes skills) before any other workflow.\n- **`graph`** → every stage rides graph-backed inputs and destinations. Step 1 scoping offers\n  the recorded terms and rules from the Step 0 `context resolve`; Step 2.2 hands the explorer\n  that resolved context; Step 2.4 routes accepted items to typed candidate kinds, not doc\n  sections; the write-back (Step 2.5) and the coherence gate (Step 3) land and verify them\n  through the graph. The interview mechanics — item cards, previews, accept \u002F correct \u002F skip,\n  the emergent-area check — are the same at every stage.\n\nThen read the hub's current state from the canonical graph. First derive the surface targets —\nevery part is deterministic, nothing is guessed: surface names come from the repo's specialist\nagent files (`.claude\u002Fagents\u002F\u003Cname>-agent.md` → surface `\u003Cname>`; CLAUDE.md's Surfaces section is\nthe fallback listing when no agent files exist), the project id is the one the hub-mode\ndeclaration already echoed (its `hub-mode '\u003CprojectId>'` line), and each surface's node id\nfollows the structural convention of `scripts\u002Fstructural-promotion.mjs`:\n`apex:\u003CprojectId>:surface:\u003Cslug(name)>`, under the shared slug discipline (lowercase,\nnon-alphanumeric runs collapse to `-`, edges trimmed). Then resolve the current state — the\nrecorded terms and rules — with `steepy-formula context resolve --target \u003Csurface node id>...`,\nnaming every derived surface id: the resolver walks each surface up to the project root, so\nproject-anchored terms ride along, while a bare project-root target returns an empty context —\nnever target it on its own. The derived surface node ids are the `appliesTo` targets the\nStep 2.5 write-back scopes its rules to. That resolved context (`context.json` +\n`context.md`) is the run's only hub input: Step 1 scopes against it, and Step 2.2 hands it to\nthe explorer.\n\n### Step 1 — Run scoping\n\nAsk the user to scope the run: which surface(s) to enrich (default: all surfaces the Step 0\nstate read enumerated), whether to also include the cross-cutting knowledge this run, and\nwhether to add project-doc discovery (README \u002F `docs\u002F` \u002F ADRs). The cross-cutting offer is the\ngraph-backed scopes: the recorded terms and the cross-surface rules the Step 0 `context resolve`\nreturned — no Markdown doc is offered, because none exists.\n\nThis keeps a run bounded and re-runnable one surface at a time.\n\nIf `.formula\u002Finception\u002Frun.json` exists, its `schema` is\n`steepy-inception-run\u002Fv2`, and its `status` is `complete` (with phase `complete`), also offer the\n**inception source**: import decisions only if Step 2a verifies that completed delivery. Read only\nthat one file to check this, and never list `.formula\u002Finception\u002F`. This is a candidate offer, not a\nverified source; do not load approval or document bodies here. Otherwise do not mention the\ninception source; absent, active or blocked runs and an unsupported run format leave ordinary\ndiscovery available with the user's selected scope. Never migrate or restart a run.\n\nWhen the user chooses the inception source, run Step 2a right after this step, before Step 2. Its\nwindow is the certified initialization revision: the gate accepts the graph only while its head is\nstill the revision `init`'s promotion created, so any promotion before the gate ends the source.\n\n### Step 2 — Per-surface iterative loop\n\nFor each surface selected in Step 1, run this loop:\n\n1. **Scope (interview → areas).** Propose candidate exploration areas drawn from the knowledge-area\n   taxonomy — **Scope**, **Conventions**, **Anti-patterns**, **Testing** (area tags Step 2.4 maps\n   to typed candidate kinds) — plus a couple of\n   surface-type heuristics (e.g. a UI surface might add \"component patterns\"). The user picks which\n   areas matter for this run, or adds their own.\n2. **Explore.** Ensure `.formula\u002Fwork\u002Fdiscovery\u002F` exists (create it if absent), then set\n   `[REPORT_FILE] = .formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-\u003Csurface>.md`. If your harness provides a\n   task\u002Fsubagent tool, dispatch a fresh subagent per surface using\n   `skills\u002Fdiscovery\u002Fexplore-surface-prompt.md`; otherwise perform the exploration inline in a\n   dedicated pass over the same inputs, and state the inline degradation in the run's report (Step 4).\n   When you dispatch, always set `model: standard`\n   explicitly (the explorer's floor tier), rising to `model: most-capable` for a large or subtle\n   surface. Pass it the surface name\u002Fpath, the areas picked in Step 2.1, `[REPORT_FILE]`, and the\n   Step 0 resolved context (`context.json` + `context.md`) as `[HUB_CONTEXT]` — the recorded\n   terms and rules relevant to this surface, with their node ids — and nothing else: no\n   Markdown hub doc exists, and the explorer's only hub input is that resolved context.\n\n   It reads the surface's code and nearby docs\n   (README\u002F`docs`\u002FADR), writes its full findings report — observed conventions, candidate\n   anti-patterns, candidate glossary terms, and discovered doc files, each with `file:line`\n   evidence and no invention — to `[REPORT_FILE]`, and returns only a terse status. This subagent is\n   an **explorer, not a reviewer**: it only gathers raw material; it does not judge, decide, or write\n   hub or code changes. Validate the four-field completion defined in\n   `skills\u002Fdiscovery\u002Fexplore-surface-prompt.md` → \"Output Format\", including the exact `[REPORT_FILE]`.\n   For BLOCKED, read that report's blocker and stop before the interview. For DONE, before Step 2.3,\n   read the report back from `[REPORT_FILE]` — the terse return status is not the report.\n3. **Emergent-area check.** If the report flags important findings outside the areas scoped in Step\n   2.1, present them to the user and ask whether to fold them into this run before drafting\n   (optionally re-dispatch the explorer narrowly on just the new area).\n4. **Seeded interview.** Walk the report area by area. The report lives in a file the user never\n   saw — so before any acceptance prompt, print each item in a plain text message, immediately\n   followed by its **write-back preview**: the exact text that would be written, and its\n   destination. For the three item-card areas — Observed conventions, Candidate anti-patterns,\n   Candidate glossary terms — print the item's full card (all 4 fields: Proposed doc text,\n   Evidence, Occurrences, Why it matters). For **Discovered doc files** — which the explorer\n   reports as `path → one-line purpose` (+ file:line), not a 4-field card — print that line\n   instead, followed by its own preview: the `readme` note it would become. The interviewer routes\n   each item to a destination; the explorer only tagged the item by area, never by destination,\n   because only the interviewer sees every surface:\n   - One of the typed candidate kinds Step 2.5 promotes — never a doc section:\n     a glossary term → `term`; a convention or anti-pattern → `rule`, scoped `appliesTo` one\n     surface node id derived in Step 0 — the candidates schema admits exactly one target per\n     rule, so a pattern spanning several surfaces fans out into one rule candidate per surface\n     it applies to (same statement, each with its own `appliesTo`), and a genuinely global\n     pattern routes to `decision` or `readme` instead of a rule; a rationale worth recording →\n     `decision`; a discovered doc or other out-of-graph note → `readme`. The preview shows the\n     typed candidate exactly as it will land in the Step 2.5 candidates file.\n\n   Decide **accept \u002F correct \u002F skip** on the preview, never on the card or line alone: the\n   card\u002Fline explains the finding, but the preview is the actual text-plus-destination the user is\n   approving. A **correction re-renders the corrected preview** before anything is written. Ask one\n   question at a time, with numbered options and a recommendation; use your harness's question UI if\n   it has one. Never present items as bare IDs (T1, T2, …) as option labels — the short option labels\n   cannot hold a draft, and the user must read the content, not a label. On a re-run, surface only\n   **new** or **drifted** items — compare against what is already recorded: the recorded terms\n   and rules from the Step 0 `context resolve` — each rendered as a\n   preview **diff** against the current state, so the same rule applies uniformly: the user always\n   decides on the exact final text that lands in the hub, whether it's a fresh addition or a drift\n   correction.\n5. **Write-back.** The accepted item cards never edit anything directly: they become a typed\n   candidates document — the closed schema of `scripts\u002Fformula\u002Fcore\u002Fscenario-assembly.mjs`,\n   whose wrapper is that schema's only interpreter (kinds `term`\u002F`rule`\u002F`decision`\u002F`readme`;\n   this prose maps nothing itself) — written to `.formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-\u003Csurface>-candidates.json`\n   as its `candidates` array:\n   - glossary terms → `{kind:'term', term, definition}`\n   - conventions \u002F anti-patterns → `{kind:'rule', title, statement, concern, strength,\n     appliesTo:\u003Csurface node id>}` — `strength` is `must`|`should`, picked with the user at\n     acceptance; `appliesTo` carries exactly one surface node id derived in Step 0 — a\n     cross-surface acceptance lands as one rule candidate per surface, as routed in Step 2.4\n   - recorded rationales → `{kind:'decision', title, statement, context}` — all three text\n     fields are required; a decision candidate alone has no upward edge, so the promotion\n     preview reports it unreachable and apply blocks until the human anchors it (e.g. a\n     `MOTIVATED_BY` edge from an existing rule)\n   - `readme` notes (e.g. discovered-doc mentions) → `{kind:'readme', note}` — no graph\n     operation: the note is reported out-of-graph and edited directly outside the graph,\n     exactly as its preview said.\n\n   Writes are **additive and diff-gated**: the scenario only adds typed candidates, the preview's\n   typed diff shows exactly what lands, and every write is gated per item by the user in\n   Step 2.4, not batched at the end. Never clobber recorded knowledge unseen.\n\n   Then drive the CLI — never an inline graph mutation:\n\n   ```bash\n   steepy-formula promotion create --project \u003Cid> --candidates \u003Cfile.json> [--proposer \u003Cname>] \u003Cscenario-id>\n   steepy-formula promotion preview \u003Cscenario-id>\n   ```\n\n   Show the preview's typed diff to the user and ask one explicit yes\u002Fchange\u002Fno question; then\n   apply ONLY at that human gate —\n\n   ```bash\n   steepy-formula promotion apply \u003Cscenario-id> --yes [--approver \u003Cname>]\n   ```\n\n   — the agent applies directly, passing `--yes` only after the human's explicit yes, in an\n   interactive session, for exactly the scenario just previewed; a no applies nothing, and the\n   CLI's stale check (exit 20) refuses an apply whose base revision moved after the preview.\n   `--approver` names the human who said yes (default: the OS user).\n\n### Step 2a — Inception source (complete run only)\n\nRun this step only when the user chose the inception source in Step 1. It runs right after Step 1\nand before Step 2; the run then continues with Step 2 for the selected surfaces. It turns the\ndecisions of a completed inception run into typed graph candidates landed through one promotion\nscenario. Read by exact path only: never list `.formula\u002Finception\u002F` or a directory under it. A stop\nin this step ends only the inception source; Step 2, Step 3 and Step 4 still run.\n\n1. **Verify before reading.** Before reading any source approval, document, summary, or report\n   body, run:\n\n   ```bash\n   node \u003Cengine-root>\u002Fscripts\u002Finception-state.mjs verify-complete --repo-root .\n   ```\n\n   Require exit 0 and JSON `ok: true` with `runId`, `completion`, `inputPaths`, `checks`, and\n   `coverage`. The helper verifies transitive evidence and current application identity, including\n   only exact certified init additions, before returning document paths. It also rejects a\n   completion whose latest approval does not cover every registered decision document, naming that\n   path. Then check the one-time window: `steepy-formula graph status` must report `head:` equal to\n   `apex:\u003CprojectId>:revision:r1` — the certified initialization revision is still the only one.\n   Only after both succeed may the coordinator or explorer read source bodies, and only the exact\n   returned `inputPaths`. Do not traverse descriptor or approval refs, append raw evidence, infer\n   summary\u002Freport paths, or choose an approval by recency. Stop this source if\n   `.formula\u002Finception\u002Fproject\u002Fdecision-register.md` is not among the returned `inputPaths`.\n\n   On nonzero exit, `ok: false`, malformed output, missing fields, or a head past the\n   initialization revision, stop only the inception source and report the returned reason\n   (unsupported run format, tamper, application-drift, uncovered decision, graph changed since the\n   certified init, or another verification failure). No source bodies are loaded and no source\n   decisions are promoted. Never downgrade rejected source decisions into old design choices.\n   Ordinary discovery remains available for the current code and surfaces already selected in\n   Step 1; the per-surface interview and Steps 3–4 continue. Keep the complete run and all its\n   evidence immutable: no reopen, repeat bootstrap, migration or restart. A refused source is not a\n   request to widen the discovery scope.\n2. **Explore.** Ensure `.formula\u002Fwork\u002Fdiscovery\u002F` exists (create it if absent), then set\n   `[REPORT_FILE] = .formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-inception.md`. If your harness provides a\n   task\u002Fsubagent tool, dispatch a fresh subagent using `skills\u002Fdiscovery\u002Fexplore-inception-prompt.md`,\n   and always set `model: standard` explicitly. Pass `[INPUT_PATHS]` = exactly the successful gate's\n   `inputPaths` array, unchanged — no other run path. Also pass `[REPORT_FILE]` and, as\n   `[HUB_CONTEXT]`, the Step 0 resolved context (`context.json` + `context.md`). Otherwise run the\n   same prompt inline over the same inputs, and state the inline degradation in the run's report\n   (Step 4). Validate the four-field completion defined in\n   `skills\u002Fdiscovery\u002Fexplore-inception-prompt.md` → \"Output Format\", including the exact\n   `[REPORT_FILE]`. For BLOCKED, read that report's blocker and stop the inception source. For DONE,\n   read the report back from `[REPORT_FILE]` before the interview.\n3. **Walk the decision register.** The report holds one item card per `DR-n`, in register order.\n   For each decision, print in a plain text message its card — Proposed doc text, Evidence (the\n   local file and line; it is for the interview only), Verification status (from the verified summary's\n   `coverage` entries), Promotion class — immediately followed by its write-back preview: the typed\n   candidate exactly as it will land in the candidates file. Then run the same accept \u002F correct \u002F\n   skip interview as Step 2.4: decide on the preview, a correction re-renders the preview, one\n   question at a time. Never use bare IDs (DR-1, DR-2, …) as option labels: the user decides on the\n   printed card and preview. A skip is a rejection: ask the user for its reason.\n4. **Promotion rules.** Every decision in the register is approved: Step 2a.1 verified complete\n   delivery, including its approval. Use only the verified summary for coverage and check outcomes; a red source gate\n   permits none of these promotions.\n   - Approved and verified (`verified`) → may land as a `rule` candidate scoped `appliesTo` one\n     surface node id (one candidate per surface it applies to, as in Step 2.4), or as a `term`.\n   - Approved but unverified (`unverified`) → lands as a `decision` candidate recording a design\n     choice, never as a rule asserting an existing component.\n   - A future flow (`future`) → lands as a `decision` candidate whose context marks the future\n     flow, never as a rule, a spec, or a started task.\n5. **Write-back, in one pass after the interview.** Unlike Step 2.5's per-surface scenarios, this\n   source batches its write: promote nothing until every register decision is decided. Each preview\n   is still accepted, corrected or skipped on its own, so every write stays gated by the user. An\n   interview interrupted before the apply leaves the graph at its initialization revision, so the\n   next run's gate still passes and the import starts again (discard a leftover\n   `inception-\u003CrunId>` draft first with `steepy-formula promotion discard`). Then record the decision\n   outcomes (item 6) and write every accepted candidate, verbatim as previewed, into one candidates\n   file `.formula\u002Fwork\u002Fdiscovery\u002FYYYY-MM-DD-inception-candidates.json` (the Step 2.5 schema). Candidate\n   text never names, cites, or links `.formula\u002Finception\u002F`; the Evidence stays in the interview. Drive\n   the CLI once, with the deterministic scenario id `inception-\u003CrunId>`:\n\n   ```bash\n   steepy-formula promotion create --project \u003Cid> --candidates \u003Cfile.json> [--proposer \u003Cname>] inception-\u003CrunId>\n   steepy-formula promotion preview inception-\u003CrunId>\n   steepy-formula promotion apply inception-\u003CrunId> --yes [--approver \u003Cname>]\n   ```\n\n   Show the preview's typed diff and apply only at the human gate, with `--yes` only after the\n   human's explicit yes, exactly as in Step 2.5 — a decision candidate needs its anchor before\n   apply, and a no applies nothing.\n6. **Decision outcomes.** Every register decision ends accepted (promoted) or rejected with a\n   reason. Record the outcomes in `[REPORT_FILE]` under `## Decision outcomes`, one line per\n   decision: `DR-n — accepted` or `DR-n — rejected: \u003Creason>`. The import is one-time. Once the\n   scenario applies, the graph head moves past the initialization revision, so a later run's gate\n   refuses the source: report it and continue with ordinary discovery. If the apply was refused,\n   nothing landed and the window stays open; the run's `[REPORT_FILE]` still lists every accepted\n   decision under `## Decision outcomes`.\n\n### Step 3 — Coherence gate\n\nRun `steepy-formula graph validate` — the run is not done until the portable graph invariants and\nthe revision-chain replay come back clean — plus, when a promotion scenario was applied in\nStep 2.5, one sanity `steepy-formula context resolve` of a representative path or target from the\nwork just promoted, confirming the resolver still answers. Any invariant violation or a failed\nresolve is an incomplete run — fix and re-run until green.\n\n### Step 4 — Report\n\nSummarize, per surface: items added, items updated (drift), docs discovered, and any areas\nskipped — so the user sees exactly what changed and that nothing was clobbered. If a re-run found\nnothing new, report it as a no-op: no file changed.\n\nWhen the run used the inception source, also report its decision outcomes from\n`## Decision outcomes`: each decision accepted, with the candidate it landed as, or rejected with\nits reason. If the inception source stopped, report why.\n\n## Model Selection\n\nAlways set `model:` explicitly when dispatching the Explore subagent in Step 2.2 and the inception\nexplorer in Step 2a.2 — an omitted model inherits the expensive session model and defeats the tier\npolicy. Floor at `standard`; rise to `most-capable` for a large or subtle surface. The inception\nexplorer runs at `standard`. Translate the tier to a concrete model by judgment at\ndispatch time using your harness's available models; `most-capable` is the ladder's top rung, not an\nopen-ended \"best available\", and a pricier model sitting above it is never reached from a tier.\nNever hardcode a concrete model id in `explore-surface-prompt.md` or `explore-inception-prompt.md`.\n\nThis flow dispatches **no reviewer subagent**: every write is gated per item by\nthe human in the Step 2.4 seeded interview (Step 2a.3 for the inception source); the Step 3\ncoherence gate is the deterministic net. The Explore subagent dispatched\nin Step 2.2 and the inception explorer dispatched in Step 2a.2 are explorers, not reviewers.\n",{"name":5,"description":7,"user-invocable":24},true,"main","a5e0492607593191c2b0a1c603cf421996b5e22f","skills\u002Fdiscovery",0,"https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula","https:\u002F\u002Fwww.steepy.it","https:\u002F\u002Fgithub.com\u002Fsteepy-it","2026-10-27 16:48:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":24},[35,38,41],{"tool":36,"command":37},"npx","npx skills add steepy-it\u002Fsteepy-formula --skill discovery",{"tool":39,"command":40},"bunx","bunx skills add steepy-it\u002Fsteepy-formula --skill discovery",{"tool":42,"command":43},"pnpm","pnpm dlx skills add steepy-it\u002Fsteepy-formula --skill discovery","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Fdiscovery\u002FSKILL.md",[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"explore-inception-prompt.md","REFERENCE","参考文档",7073,"https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Fdiscovery\u002Fexplore-inception-prompt.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"explore-surface-prompt.md",5921,"https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Fdiscovery\u002Fexplore-surface-prompt.md",[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7F91BV8VJM3DS4SA9ZMHMXB","web-check","Run the web surface checks.","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-hub\u002F.claude\u002Fskills\u002Fweb-check\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7F917VTJWS90304QDH1C3R8","review","Verify implemented work against its spec with real evidence before any \"done\" claim. Checks the spec's success criteria, runs the surface test command, and runs `steepy-formula graph validate` through the deterministic inline evidence capture.","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7F910RRMBN04529ZQZZW76Q","plan","Turn a local working spec into a step-by-step implementation plan. Each step names the owning surface and specialist agent and the surface test command; the plan is written into .formula\u002Fwork\u002Fplans\u002F as a gitignored work artifact.","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Fplan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7F90WV19MCWWJFESM2BNHNN","new-surface","Add a surface: render the graph sub-agent and promote Surface + verification Rule + Check into the graph.","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Fnew-surface\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7F90QA1DXYPVFD08V5HFYY1","loop-engineer","Validate and authorize a gear-4 goal contract, invoke the packaged deterministic loop controller, report its result, and hand off terminal evidence to review.","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Floop-engineer\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7F90EZHJZKYXEWTJ3BWKWRK","init","Graph-first init — gate on a provisioned Stable Knowledge Graph before writing anything, interview the governed structure, scaffold the disk-minimal harness assets, and land the initial graph through a promotion scenario. Never invents Rules from stack detection.","https:\u002F\u002Fgithub.com\u002Fsteepy-it\u002Fsteepy-formula\u002Fblob\u002Fmain\u002Fskills\u002Finit\u002FSKILL.md",[],[]]