Claude GitHub Copilot Skill

cure

Apply selected fixes from an /age report, findings list, or CI failure. Run the project gates and hand a clean result to /plate. Use when the user wants selected findings resolved. Do not use for review, test authoring, or direct publication.

LLM Mart · 0 points · 7 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download paulnsorensen-easy-cheese-skills_cure-39444e8.zip · 487 KB
Part of paulnsorensen/easy-cheese — 14 skills

Install

skills CLI npx skills add https://github.com/paulnsorensen/easy-cheese/tree/main/skills/cure
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install paulnsorensen-easy-cheese@llmmart
Git git clone https://github.com/paulnsorensen/easy-cheese.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole paulnsorensen/easy-cheese collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

/cure

Use this skill after /age, failed validation, or a request to fix selected review findings.

Phase entry

Run python3 skills/cure/scripts/cure.pyz wheypoint-resolve --ref <slug>. authoritative uses the record; its working_context is the first batched tilth_read. not-found proceeds cold; legacy shows its source and slug, then proceeds. gated, ambiguous, and error stop and show the payload. Show advisory stale-commit and grounded-path-missing findings.

Inputs

Accept an /age slug, a pasted findings list, a CI failure summary, or a scoped fix instruction.

After phase entry, /cure <slug> reads .cheese/age/<slug>.md.

Adopt a locked selection from /age or /affinage. The canonical format is in references/selection.md#handoff-from-age. Otherwise, apply the recommended composite from references/selection.md. That file also defines the selection gate conditions.

For an older report that omits finding fields, read references/selection.md § Older report shape.

Optional flags:

  • --safe — Restore the selection gate and the final publication gate.
  • --open-pr — Permit /plate to publish when no PR exists.
  • --auto — Use automatic mode from /cook --auto. Skip user selection. Require --stake <floor>.
  • --stake <floor> — Set the severity floor for --auto. Accept blocker, high, medium+, or all. Ignore this flag without --auto.
  • --hard — Pass the metacognitive gate flag to /plate.

Read references/selection.md for selection rules.

Read harness-portability.md for portability rules. Slash commands are host renderings, not the control model.

Flow

  1. Load. Read handoff_context.source_report first when the handoff supplies it. Confirm that the file exists and belongs to the named source_skill. Stop with status: halt: unreadable source report when this check fails. Read .cheese/age/<slug>.md when the handoff supplies only a slug. Take the typed path only when the handoff also supplies a CurdPlan. Call validate_curd_plan on that plan. Stop before dispatch when the plan or its digest is invalid. Do not rebuild a plan from a legacy manifest. Take the report path in every other case.

  2. Select. Adopt a locked selection from /age or /affinage. Otherwise, apply the recommended composite. Read references/selection.md for verbs and gate conditions. Expand a user verb with this command:

    python3 skills/cure/scripts/cure.pyz findings parse-selection --report <path> --selection "<verb>"
    

    Use the same bundle command when the host only ships the bundle. Render the coder brief per references/selection.md § Coder brief.

  3. Apply. Fix one logical group at a time. Implement each recommendation: as the locked decision; rebut only under ### Deferred. Confirm each anchor with a fresh bounded read. The report path stops here and continues at step 4. The typed path also invokes easy_cheese.shared.workflow.cure with the validated plan. Add one CureDiagnosisBinding for each selected curd. Create each binding with bind_diagnosis(plan, curd, diagnosis_result). Use only a confirmed DiagnosisResult. Point the binding to the exact plan and curd digest. Set DiagnosisDisposition.CONFIRMED. A plausible but unrelated diagnosis does not unlock Cure. cure resolves each ArtifactRef with resolve_artifact. It accepts only observation-only CurdResultWriterView output. It uses normalize_agent_output to finalize one CurdResult per selected curd. It also finalizes executor failures.

  4. Validate. Run the narrowest test that proves each fix. Then run the relevant project gates. These gates include lint, type checks, and builds. When the handoff has a baseline: block, use quality-gates.md. Identical baseline failures do not block a clean cure or trigger a halt. Fix only new or changed failures.

  5. Taste-test behavioral fixes. Run the fresh-context taste test before you write the handoff slug. Resolve the read-only reviewer (taste-test) phase agent through agent-resolution.md. Request default minimum power and medium effort. Use the Cook review lenses over the cure diff. Reuse the step-2 rendered brief verbatim as the taste test's locked-decision block. Halt when fresh-context isolation is unavailable. Use an inline self-check only under the small-diff cost gate in tdd-loop.md. Skip this step for formatting, comments, imports, and logic-free renames. Send a revise verdict into one bounded correction pass. Stop for a human on a Locked-decision halt. A nested coder defers the authoritative review to the orchestrator.

  6. Correct the domain model. Correct only terms that the Cook diff touches. Read references/domain-model-correction.md first. Do not reverse a canonical term that Mold locked.

  7. Hand off for review. Recommend /age <slug> --scope <touched-path>. Repeat --scope once for each touched path. Send the current slug with every Age dispatch. Forward --hard when the run has that flag. Do not duplicate the Age review inside Cure. A new Age report can start a new /cure run.

  8. Write the report. Record changes, checks, deferred items, and residual risks. Put the handoff slug at the top of .cheese/cure/<slug>.md.

  9. Write back the durable facts. Run § Post-PR write-back before publication. Give each written path to /plate for its artifact inventory.

  10. Hand off for publication. Dispatch /plate after a clean cure. Follow ## Handoff.

Preferred tools and fallbacks

Route source work through code-intelligence-routing.md. Use its fallback when a preferred tool is absent. Stop only when the fallback cannot support a safe fix. Report the precision loss.

Validation

Run the narrowest test that proves each fix. Then run all relevant existing gates. Record why an unavailable gate cannot run. Do not declare readiness while selected findings remain unresolved.

Move a finding to Applied only after its proving test passes. Read references/cure-discipline.md for the Iron Law.

A clean cure has at least one applied fix and all gates pass. It also has no false-premise halt. Identical baseline: failures do not count against green status. Read quality-gates.md.

The agent judges the gate values. The CLI maps those values to a readiness verdict:

python3 skills/cure/scripts/cure.pyz gates classify \
  --press-status <label> \
  [--hard-floor-met] [--has-open-level-1-or-2] [--has-open-level-3] [--has-open-level-4-or-5] [--any-spinning]

Use the same bundle command when the host only ships the bundle.

Handoff slug

Write the report to .cheese/cure/<slug>.md. Put this minimum handoff slug at the top:

status: <canonical status field>
next: age | done
artifact: <path of the report that this run consumed>
baseline: none | <recorded baseline block copied from the upstream handoff — see ../cook/references/quality-gates.md>
<one-line orientation: what cure applied or deferred>

The handback contract defines the status: grammar. Only next: and the additional keyed lines are specific to this phase. artifact: names the source report that this run consumed. Use handoff_context.source_report for that value, or the resolved .cheese/age/<slug>.md path.

Write the report body to a separate file. Then let the canonical writer create .cheese/cure/<slug>.md once. Pass every optional field that this run has.

python3 skills/cure/scripts/cure.pyz write-handoff-artifact \
  --slug <slug> --status <status> --phase cure --next age \
  --artifact <consumed-report-path> --orientation "<one-line orientation>" \
  --baseline "<copied baseline block>" --durable-flags "<one line per flag>" \
  --grounded <path[#start-end]> \
  --body-file <body-path> \
  --payload-schema https://schemas.easy-cheese.dev/curd-result

Use a second command for the terminal state. Omit --payload-schema, because a terminal transition rejects a payload schema.

python3 skills/cure/scripts/cure.pyz write-handoff-artifact \
  --slug <slug> --status <status> --phase cure --next done \
  --artifact <consumed-report-path> --orientation "<one-line orientation>" \
  --baseline "<copied baseline block>" --grounded <path[#start-end]> \
  --body-file <body-path>

Omit --baseline and --durable-flags when this run has no such value. phase=cure controls storage routing. next declares the following phase, and the writer validates that transition.

Use status: ok when at least one finding applies cleanly. Use it when no finding meets the --auto severity floor. Use status: halt: <reason> when every selected fix fails evaluation. Use it when a project gate cannot pass. Use next: age when review follows. This value is the default for automatic and interactive runs. Use next: done only for an interactive run without --auto. The user must also decline review explicitly. Cure does not track the current pass. /age --auto enforces the two-cure-pass cap on its third invocation.

Output

Use formatting.md. Below the slug, add the exact headings ### Applied, ### Deferred, ### Checks, and ### Re-review. Bind <slug> to the stem of the consumed source report. When source_skill is /affinage, end each result line with [from-comment:<id>]. Include finding IDs, evidence, residual risk, and the next command. Use /age <slug> --scope <touched-path> or /plate as that command.

Handoff

Pipeline: culture → mold → cook → press → age → [cure] → plate

After the report exists, decide whether to dispatch /plate or ask. A clean cure updates an open PR without another gate by default. --safe restores the handoff gate.

When /affinage started the run, never dispatch /plate from Cure. This state uses handoff_context.source_skill: /affinage. Apply the fixes and run the automatic Age loop when required. Then return control to /affinage. It posts the GitHub replies before it dispatches /plate.

Default without --safe:

  • With an open PR, dispatch /plate [--hard]. It performs its final write gate, commit, topology update, and publication.
  • With no open PR, use --open-pr to dispatch /plate [--hard]. In this case, explicit topology choices and obviously cohesive work proceed without asking. In other cases, stack-sized or ambiguous work asks before commit or branch-layout mutation.
  • Without --open-pr, leave the remote unchanged. Report no open PR — pass --open-pr or run /plate.
  • Run § Post-PR write-back before every /plate dispatch.
  • Skip /plate when the cure is not clean. Report the blocker and stop.

With --safe, use the shared handoff gate. Offer these choices:

  • Review the touched code. Run /age <slug> --scope <touched-path>. Recommend this choice when fixes extend beyond the finding hunk.
  • Plate it. Run /plate [--hard] to commit and publish.
  • Checkpoint and stop. Run /wheypoint.
  • Stop. Dispatch nothing.

Preselect Plate it only when all selected fixes and gates pass. Run the selected command immediately.

Post-PR write-back

Read references/post-pr-writeback.md before any path publishes to a PR. This includes default, --open-pr, --safe, and automatic publication paths. The file defines candidates, writers, fallback behavior, ownership, and the empty case.

--hard mode

/cure --hard passes --hard to /plate. /plate completes and verifies every durable write. It then gives /hard-cheese the final artifact inventory. Stop publication on a FAILED gate result. Stop publication when a non-TTY environment blocks the gate. An ERROR result uses the hard-cheese fail-open policy, and publication continues. Review, checkpoint, and stop choices skip this gate. Read skills/hard-cheese/SKILL.md and ../hard-cheese/references/composition.md.

Auto mode

Read references/auto-mode.md before auto mode. It defines selection, validation, reversion, Age limits, flag forwarding, publication, and Cook worker exceptions. It also defines the --auto --hard puncture clause.

Rules

  • Use the recommended composite or the locked selection by default. --safe restores the gate. Pause for false-premise, sprawling, structural, or conflicting findings.
  • Keep fixes within the selected findings. Do not fix failures identical to the baseline.
  • Report failed and skipped checks. Put reverted automatic findings under ### Deferred.
  • Follow ## Handoff for every publication decision. Never publish an unclean cure.
  • Stop before you apply a finding that rests on a false premise. Report why the Age claim is wrong or obsolete.
  • Apply the shared voice rules from ../age/references/voice.md. Lead with the applied changes. Mark residual risk as certain | speculating | don't know. Do not invent follow-up work for a correct diff.
  • Identify the gate command before you claim status: ok. Run it again in the same turn. Read its full output. Then make the claim. Do not use should, probably, or I think in completion claims. State what the gate output shows.

Discipline

Read references/cure-discipline.md before you apply any fix. It defines the Iron Law, Red Flags, and rationalization table.

Agent resolution

Resolve fix work through agent-resolution.md.

Work Preferred types Permissions/isolation Minimum power Effort Fallback
Apply selected findings coder write, isolated worktree default high compatible coder, then general

The canonical Cure handoff includes the shared agent_resolution block.

See the generated command inventory in references/commands.md.

Files (easy-cheese)
  • references
    • auto-mode.md 2.8 KB
      # Automatic mode for Cure
      
      Read this file before `/cure --auto --stake <floor>`.
      It defines worker exceptions, the puncture clause, and the empty selection case.
      
      ## Per-finding flow
      
      - Skip the selection list and the handoff gate.
      - Select every finding that meets the severity floor.
        Read `selection.md` § Auto-mode selection for floor definitions.
      - Render the brief per `selection.md` § Coder brief after the floor resolves and before the first dispatch.
      - Apply one finding at a time.
        Implement its `recommendation:` as the locked decision and keep its `invariants:` true.
        A rebuttal goes under `### Deferred`; auto mode never substitutes a fix silently.
        Run the narrowest proving test after each fix.
        Revert a fix that breaks a passing test or project gate.
        Put it under `### Deferred` with the test name and failure summary.
        Continue with the remaining findings.
      - After all findings, invoke `/age <slug> --scope <touched-path> [--scope <touched-path>] --auto`.
        Repeat `--scope` once for each touched path.
        Forward `--open-pr` and `--hard` when they are in scope.
        Skip the handoff gate.
      - Let `/age --auto` enforce the two-pass cap.
        Cure does not track the pass count.
      
      ## Final publication
      
      When Age returns `next: done`, run § Post-PR write-back in `post-pr-writeback.md`.
      Then dispatch `/plate` once.
      It updates an open PR automatically.
      With `--open-pr`, it applies the explicit layout and review rules before a new PR.
      
      A Cure worker from the Cook fan pathway does not invoke `/plate`.
      The orchestrator owns commit and publication.
      
      When `handoff_context.source_skill` is `/affinage`, do not invoke `/plate`.
      Affinage posts its GitHub replies and owns final publication.
      
      With `--auto --hard`, dispatch `/plate --hard` when Age returns `next: done`.
      Do not invoke `/hard-cheese` directly.
      `/plate` gives the completed artifact list to the metacognitive gate.
      A failed hard gate stops publication.
      In a non-TTY environment, report that `--hard` requires an interactive TTY.
      
      When no finding meets the floor, write an empty Cure report.
      Use `### Applied: (none — no findings meet <floor>)`.
      Then continue to the automatic handoff.
      Report `auto chain clean`.
      
      ## Cook fan pathway
      
      Cook can dispatch Cure as a phase-only worker.
      `/ultracook` is retired, but its no-chain contract remains in this pathway.
      This case includes one curd and a curd in a wave.
      Honor the no-chain and no-push override.
      
      For one curd, apply the selected findings and write `.cheese/cure/<slug>.md`.
      Put the handoff slug first and set `next: age`.
      Then stop.
      Do not invoke `/age <slug> --scope <touched-path> --auto`.
      The orchestrator reads the slug and dispatches Age.
      
      For a wave curd, apply the findings and write the Cure slug.
      Then stop.
      Do not invoke `/plate` or change the remote.
      The Cook fan pathway owns final commit and publication.
      
      In both cases, suppress final `/plate` dispatch.
      
    • commands.md 1.5 KB
      # `/cure` bundle commands
      
      `scripts/render_generated_regions.py` generates this file from the static `COMMANDS` manifest in `src/easy_cheese/skills/cure/commands.py`. Do not edit this file. Run each command as `python3 skills/cure/scripts/cure.pyz <command> [args...]`. Each command returns an integer exit status. Pass `--help` to a command for its arguments and output format. Keep worked examples in the skill instructions.
      
      | Command | Purpose | Subcommands |
      | --- | --- | --- |
      | `domain-model-target` | Resolve the domain-model store from explicit Hallouminate probe results |  |
      | `findings` | Render an /age report's selection table or coder brief and resolve selection verbs | `render-table`, `parse-selection`, `render-brief` |
      | `gates` | Map a quality-gate scoreboard's booleans to a readiness verdict | `classify` |
      | `handoff` | Render, parse, and dispatch-split handoff preambles | `render`, `parse`, `dispatch` |
      | `paths` | Slugify, validate, resolve, and list .cheese artifact paths | `slugify`, `validate`, `existing`, `resolve`, `list`, `domain-model-target` |
      | `read-handoff-slug` | Read the handoff preamble back from a phase artifact |  |
      | `render-html` | Render a markdown report into one self-contained offline HTML file |  |
      | `slugify` | Derive a kebab-case slug and durable spec path from task text | `from-task` |
      | `wheypoint-resolve` | Resolve a phase slug through the shared Wheypoint kernel (JSON out) |  |
      | `write-handoff-artifact` | Write a handoff preamble plus optional body atomically; pass --grounded paths |  |
      
    • cure-discipline.md 4.3 KB
      # /cure — Fix-Application Discipline
      
      ## Iron Law
      
      **No finding is Applied until a passing gate proves the fix.**
      
      An edit alone does not make a finding Applied.
      Run the narrowest proving test after each fix.
      Then run each relevant project gate.
      Move a finding to `### Applied` only after these checks pass.
      Keep an unvalidated fix in staged state.
      
      ---
      
      ## Red Flags
      
      Stop when you notice one of these thoughts:
      
      - "The fix is obvious, so I can skip its test."
      - "I can test all fixes together at the end."
      - "The finding gives enough context, so I can skip a fresh read."
      - "The Age report is wrong, but I can apply its fix anyway."
      - "One edit fixes all findings, so I can skip separate checks."
      - "I know a better fix than the recommendation, so I'll do that instead."
      - "I can mark this finding Applied while a gate remains red."
      
      Each thought is a rationalization.
      Name it and stop.
      
      ---
      
      ## Rationalization table
      
      | Rationalization | Why it fails | Required action |
      | --- | --- | --- |
      | "The fix is obvious, so tests are unnecessary." | An unchecked fix can introduce a subtle regression. | Run the narrowest proving test before you mark Applied. |
      | "I can validate all fixes at the end." | A later failure does not identify which fix caused it. | Validate each fix in order. |
      | "The finding has a false premise, so I can skip it." | A silent skip hides a disagreement with the report. | Put the finding in Deferred with the rebuttal. |
      | "The location is clear, so I can skip a fresh read." | A stale location can send an edit to the wrong anchor. | Read the cited location again before every edit. Follow the [shared routing contract](../../cheese/references/code-intelligence-routing.md). |
      | "One root cause means one check is enough." | One edit can affect findings in different ways. | Apply once and validate. Then check every related finding again. |
      | "The gate is flaky, so I can mark Applied." | A red gate cannot prove the fix. | Record the failure in Checks. Keep the finding out of Applied. |
      | "A low severity lets me skip validation." | Severity measures impact, not validation need. | Validate every applied fix. |
      | "The recommendation is only a hint, so I can pick my own fix." | A silent substitution hides a design change from the reviewer and the Locked-decision lens. | Implement the recommendation, or rebut it under Deferred and stop. |
      
      ---
      
      ## Stacked-layer fix write-back
      
      When a fix targets a stacked PR, read the spec's `landing.review_fixes` before
      committing it. `fold` (the default) folds the fix into the layer commit it
      corrects, rewriting that layer in place. `top-up` instead adds the fix as a new
      commit on top of the stack, leaving every existing layer commit untouched.
      
      ## Bounded responsibility on dispatch
      
      A repair agent owns only the findings in its brief.
      Do not add nearby cleanup, repeat the review, or expand the scope.
      This limit makes another dispatch safe and specific.
      
      Before a near-limit stop, return one structured handoff with these parts:
      
      - **Completed.** List each Applied finding and its verification result.
        Keep an unvalidated fix in staged state.
      - **Changed-file ownership.** List every file that the agent changed.
      - **Remaining.** List each unfinished finding and its exact next action.
      - **Blockers.** List each environment or tool failure.
      
      The orchestrator must use this handoff for the next dispatch.
      Give the next agent the completed set and the next action.
      Do not restart the full finding set.
      
      A limit stop keeps the `BLOCKED` disposition.
      The first `unresolved_work` entry starts with `writer stopped at its budget:`.
      Use `budget checkpoint invalid:` when checkpoint validation fails.
      These prefixes distinguish a limit stop from an executor failure.
      
      `easy_cheese.shared.workflow.WriterBudgetExceeded` defines this seam.
      It carries a `WriterCheckpoint` with the four handoff parts.
      The `reason` text carries the blocker and the limit cause.
      The host finalizes the checkpoint as a partial curd result.
      Completed criteria keep their disposition and evidence.
      Unreached criteria receive the limit reason.
      List completed criteria in criterion order.
      List only finished criteria as completed.
      A failed checkpoint can still preserve readable deliverables.
      Reject a checkpoint that claims every criterion.
      The limit path skips review, so full coverage has no review evidence.
      
    • domain-model-correction.md 2.4 KB
      # Domain-model correction for Cure
      
      Read this file before Flow step 6.
      
      After Cook fixes land, correct domain terms that the Cook diff touches.
      Do not rewrite terms outside that diff.
      
      After the Hallouminate probe, resolve the store with the Cure bundle command:
      
      ```text
      python3 skills/cure/scripts/cure.pyz domain-model-target \
        --probe <unavailable|no-match|match> \
        [--corpus repo:<repo>:wiki --model <present|absent|unknown>]
      ```
      
      Use the domain-model probe transport in [`../../cheese/references/optional-plugins.md`](../../cheese/references/optional-plugins.md).
      
      Pass `unavailable` when Hallouminate is not loaded or the probe failed. Pass `no-match` when the listing completed but contained no `repo:*:wiki` corpus. Pass `match` with the exact corpus name and its model status when the listing found one. The command accepts only these explicit probe results; it does not import or invoke MCP machinery. It emits canonical JSON with `backend`, string `location`, and `wiki_reachable`. Preserve the resolver's wiki, docs, then XDG precedence. When `wiki_reachable` is false, report the degraded file fallback before correcting it; the wiki can contain the authoritative model.
      
      Read and write each backend with these steps:
      
      - **One file.** Read the whole file. Update the touched entry. Read the file again.
      - **Split directory.** List the context pages. Select the page of the bounded context that owns the term.
        Read only that page. Update the touched entry there. Read that page again.
        Stop and report when two pages define the same term.
      - **Hallouminate corpus.** Read the entry with `read_markdown`.
        Write the updated entry with `add_markdown` and `overwrite: true`.
        Read the entry again with `read_markdown`.
      
      Report the backend and the exact location in the Cure report.
      
      Update a touched entry when its definition or `_Code_:` target no longer matches the code.
      Write one change note for each edit.
      Use this format:
      
      ```text
      **Term** — definition.
      _Avoid_: syn1, syn2
      _Code_: file:line (or NEW ENTITY)
      ```
      
      `_Avoid_` is optional.
      Mold omits this line when the term has no synonym.
      Keep that omission, and never create a placeholder synonym.
      
      **Hard rule: Report a reversal, but do not apply it.**
      Do not replace or contradict a canonical term that Mold made authoritative.
      Report the term, the Mold decision, and the conflict.
      Leave the entry unchanged.
      Mold selects canonical terms during Curdle.
      Cure applies only bounded corrections.
      
    • post-pr-writeback.md 2 KB
      # Post-PR write-back for Cure
      
      Read this file before any path publishes to a PR.
      These paths include default `/plate`, `--open-pr`, safe **Plate it**, and automatic publication.
      
      Run this write-back before Cure dispatches `/plate`.
      `/plate` requires every durable write before its final gate and commit.
      Give each written path to `/plate` for its artifact inventory.
      Do not write a tracked file after `/plate` completes.
      
      Record implementation facts that became known after Curdle.
      This operation is the second wiki write point.
      Curdle owns the design write point.
      
      Record constraints found during `/cook`.
      Record `/age` findings that changed the design.
      Record domain terms that the diff introduced or changed.
      
      ## Candidates
      
      Read `durable_flags:` from `.cheese/cook/<slug>.md` and `.cheese/age/<slug>.md`.
      Treat each non-`none` entry as a candidate.
      Also include new ADRs and domain model changes.
      Upstream phases record flags only.
      Cure, Plate, and Affinage remain the wiki writers.
      
      ## Writer
      
      When Hallouminate is available, dispatch `/wiki-ingest` with the candidate list.
      Tell it to record only facts that are new since Curdle.
      Its routing and conflict rules prevent duplicate design facts.
      
      When Hallouminate is unavailable, write `docs/adr/<slug>-NNN.md` and the domain model fallback.
      Report that the write-back used files instead of the wiki.
      Do not hide this fallback.
      Read [`optional-plugins.md`](../../cheese/references/optional-plugins.md) for detection and fallback rules.
      
      ## Ownership
      
      Run this write-back before every publication path.
      The frame that dispatches final `/plate` owns the write-back.
      
      Cure does not write back when another skill owns final `/plate`.
      This exception includes Cook fan workers that cannot publish.
      It also includes an Affinage chain.
      The final publication owner performs the write-back.
      
      ## Empty case
      
      When all `durable_flags` are `none` or absent, check for new ADRs and domain changes.
      When no candidate exists, report `no post-PR write-back candidates`.
      Do not create an entry.
      
    • selection.md 7.3 KB
      # Selection gate
      
      The default selection is the **recommended composite**: `all-medium, cheap`.
      It includes medium and higher findings plus inexpensive contained low findings.
      Apply it without a gate by default.
      
      Render the gate when `--safe` is present.
      Also render it for a structural fix, a wide fix, or conflicting findings.
      A rendered gate preselects the recommended composite.
      This rule replaces the old empty default.
      
      `/age` and `/affinage` normally calculate the selection.
      They pass a locked selection to `/cure`.
      This handoff lets the user see the fix work without another prompt.
      If no locked selection exists, Cure calculates the recommended composite.
      
      `--auto --stake <floor>` replaces the composite with a severity floor.
      `/cook --auto` passes this pair.
      Read `## Auto-mode selection` for its rules.
      
      ## Handoff from /age
      
      When `/age` or `/affinage` selects findings, it dispatches `/cure <slug>`.
      It passes this block with the invocation:
      
      ```yaml
      handoff_context:
        source_skill: /age
        source_report: .cheese/age/<slug>.md
        selection: "1,3,5 | all-blocker | all-high | all-medium | cheap | all | skip N"
        resolved_ids: [1, 3, 5]
      ```
      
      Both `selection` and `resolved_ids` are required.
      `selection` stores the verb.
      `resolved_ids` stores the expanded identifiers.
      The source skill expands the verb before dispatch.
      Cure checks the identifiers against the report and applies them.
      
      Do not use a `--select` CLI flag.
      The selection moves through the handoff context.
      
      ## Render the selection list
      
      With a slug, read `.cheese/age/<slug>.md`.
      Render a numbered table by severity.
      Use blocker, high, medium, then low order.
      
      ```text
      | # | severity | confidence  | dim           | location                  | summary |
      |---|----------|-------------|---------------|---------------------------|---------|
      | 1 | blocker  | certain     | encapsulation | src/users/index.ts:42     | `index` re-exports `SqlPgUser` across slice boundary. |
      | 2 | high     | certain     | security      | src/handler.ts:108        | Unvalidated path joined into fs.read. |
      | 3 | medium   | speculating | complexity    | src/util.ts:200-240       | Function is 41 lines and 4 levels nested. |
      | 4 | low      | certain     | deslop        | src/old.ts:55-60          | Unused export `_helper`. |
      ```
      
      Without a slug, accept a findings list, Age path, CI summary, or scoped fix request.
      Render the same table.
      
      ## Recognized selection verbs
      
      ```text
      1,3,5         # specific item ids
      1-3           # an inclusive range of item ids
      all-blocker   # every blocker item
      all-high      # every blocker or high item
      all-medium    # every blocker, high, or medium item
      cheap         # every contained-cost item
      all           # every item; requires explicit input
      none          # explicit opt-out
      skip N        # remove item N from the application order
      ```
      
      Interactive selectors use floor semantics.
      `all-blocker` contains only blockers because blocker is the highest level.
      `all-high` includes blockers and high findings.
      `all-medium` includes blockers, high findings, and medium findings.
      Combine `all-medium, cheap` to match the `medium+` automatic floor.
      
      ### Verb composition
      
      Combine verbs with commas:
      
      - `all-blocker, cheap` selects blockers and contained-cost findings.
      - `all-high, 7` selects blocker and high findings plus item 7.
      - `all-blocker, cheap, skip 4` selects the first two groups without item 4.
      
      Remove duplicates when you apply the selection.
      Apply `skip N` last.
      Do not combine `all` or `none` with another verb.
      
      Older reports can lack `fix-cost-now`.
      For these reports, resolve `cheap` to the empty set.
      Add one note to the Cure report.
      Do not infer cost from missing data.
      
      ## Hard rules
      
      - Use `all-medium, cheap` by default.
        Apply it without a gate unless a gate condition exists.
        At a rendered gate, bare return, `ok`, or `go` selects it.
      - Require explicit input for `all`.
        The default excludes costly low findings.
      - Lock the selection after the user or source skill selects it.
        Report new findings and let the user start another `/cure` run.
      
      ## Coder brief
      
      Render the brief from the locked ids before any dispatch:
      
      ```text
      python3 skills/cure/scripts/cure.pyz findings render-brief --report <path> --selection "<ids>"
      ```
      
      The brief carries each finding's location, claim, `recommendation (locked)`, and `invariants` line.
      The brief also carries each finding's `confidence:` tier; treat a `speculating` locked decision as provisional.
      Give it to the repair agent verbatim.
      The recommendation is the locked decision for that fix.
      Keep every `invariants:` clause true while you edit.
      Deviate only with a `### Deferred` entry that names why the recommendation is wrong or obsolete.
      The taste test takes the same recommendation and invariants as its locked decision.
      The Locked-decision lens halts on a silent substitution.
      
      ## After selection
      
      For each selected finding:
      
      1. Read the cited location again and confirm that the finding still applies.
      2. Implement the locked recommendation per § Coder brief.
      3. Apply a stale-safe edit that matches the read anchor.
      4. Follow the [shared routing contract](../../cheese/references/code-intelligence-routing.md).
      5. Run the narrowest test that proves the fix.
      6. Continue to the next finding.
      
      When a finding no longer applies, put it under `Skipped` with the reason.
      Do not remove it silently.
      
      ## Auto-mode selection
      
      When `/cure` receives `--auto --stake <floor>`, skip the list and user prompt.
      Calculate the selection from the floor.
      
      Use these floors:
      
      - `blocker` selects blocker findings.
      - `high` selects blocker and high findings.
      - `medium+` selects blocker, high, and medium findings.
        It also selects low findings with `fix-cost-now: contained`.
      - `all` selects every finding.
      
      `/cook --auto` always passes `medium+`.
      This floor matches the interactive `all-medium, cheap` selection.
      Do not support a separate `--stake cheap` value.
      Use an interactive composite to combine cheap findings with another floor.
      
      Apply blocker, high, medium, then inexpensive low findings.
      Within one severity, group findings by file to reduce repeated reads.
      For each finding, follow `## After selection`.
      
      When a fix breaks a passing test or project gate, revert that finding's edit.
      Put it under `### Deferred` with the test name and failure summary.
      Continue with the remaining findings.
      
      When a finding no longer applies, put it under `### Skipped`.
      After all findings, invoke `/age <slug> --scope <touched-path> --auto` directly (no handoff gate).
      Repeat `--scope` once for each touched path.
      `/age --auto` enforces the pass cap.
      Cure continues to apply findings when Age calls it.
      
      `--auto` is not an interactive verb.
      If `/cure --auto` lacks `--stake`, return one error line.
      Direct the user to `/cure <slug>`.
      Do not prompt for a floor or fall back to interactive selection.
      
      ## Older report shape
      
      Older Age reports can lack `severity`, `location`, `fix-cost-now`, and `fix-cost-later`.
      When `severity` is absent, infer it from the section heading.
      For example, `## High-stake findings` maps to `high`.
      When `fix-cost-now` is absent, resolve `cheap` to the empty set.
      Record each inference under `### Notes` in the Cure report.
      Treat missing `confidence:` as unspecified.
      Do not infer confidence or reject the report.
      When `recommendation:` is absent, the brief shows `(none in report)`. Read the claim and location, choose the fix yourself, and record that choice under `### Applied`.
      
  • scripts
    • cure.pyz 1.9 MB · in bundle
  • phase-contract.yaml 281 B
    contract_version:
      schema_uri: https://schemas.easy-cheese.dev/phase-contract
      major: "1"
      minor: "0"
    source: cure
    input_schema_uris:
      - https://schemas.easy-cheese.dev/curd-plan
    outputs:
      - destination: age
        payload_schema_uri: https://schemas.easy-cheese.dev/curd-result
    
  • SKILL.md 14.3 KB
    ---
    name: cure
    description: Apply selected fixes from an /age report, findings list, or CI failure. Run the project gates and hand a clean result to /plate. Use when the user wants selected findings resolved. Do not use for review, test authoring, or direct publication.
    license: MIT
    metadata: {dispatches-agents: true}
    ---
    
    # /cure
    
    Use this skill after `/age`, failed validation, or a request to fix selected review findings.
    
    ## Phase entry
    
    Run `python3 skills/cure/scripts/cure.pyz wheypoint-resolve --ref <slug>`.
    `authoritative` uses the record; its `working_context` is the first batched `tilth_read`.
    `not-found` proceeds cold; `legacy` shows its source and slug, then proceeds.
    `gated`, `ambiguous`, and `error` stop and show the payload.
    Show advisory `stale-commit` and `grounded-path-missing` findings.
    
    ## Inputs
    
    Accept an `/age` slug, a pasted findings list, a CI failure summary, or a scoped fix instruction.
    
    After phase entry, `/cure <slug>` reads `.cheese/age/<slug>.md`.
    
    Adopt a locked selection from `/age` or `/affinage`.
    The canonical format is in `references/selection.md#handoff-from-age`.
    Otherwise, apply the recommended composite from `references/selection.md`.
    That file also defines the selection gate conditions.
    
    For an older report that omits finding fields, read `references/selection.md` § Older report shape.
    
    Optional flags:
    
    - `--safe` — Restore the selection gate and the final publication gate.
    - `--open-pr` — Permit `/plate` to publish when no PR exists.
    - `--auto` — Use automatic mode from `/cook --auto`.
      Skip user selection.
      Require `--stake <floor>`.
    - `--stake <floor>` — Set the severity floor for `--auto`.
      Accept `blocker`, `high`, `medium+`, or `all`.
      Ignore this flag without `--auto`.
    - `--hard` — Pass the metacognitive gate flag to `/plate`.
    
    Read `references/selection.md` for selection rules.
    
    Read [`harness-portability.md`](../cheese/references/harness-portability.md) for portability rules.
    Slash commands are host renderings, not the control model.
    
    ## Flow
    
    1. **Load.** Read `handoff_context.source_report` first when the handoff supplies it.
       Confirm that the file exists and belongs to the named `source_skill`.
       Stop with `status: halt: unreadable source report` when this check fails.
       Read `.cheese/age/<slug>.md` when the handoff supplies only a slug.
       Take the typed path only when the handoff also supplies a `CurdPlan`.
       Call `validate_curd_plan` on that plan.
       Stop before dispatch when the plan or its digest is invalid.
       Do not rebuild a plan from a legacy manifest.
       Take the report path in every other case.
    2. **Select.** Adopt a locked selection from `/age` or `/affinage`.
       Otherwise, apply the recommended composite.
       Read `references/selection.md` for verbs and gate conditions.
       Expand a user verb with this command:
    
       ```text
       python3 skills/cure/scripts/cure.pyz findings parse-selection --report <path> --selection "<verb>"
       ```
    
       Use the same bundle command when the host only ships the bundle.
       Render the coder brief per `references/selection.md` § Coder brief.
    3. **Apply.** Fix one logical group at a time.
       Implement each `recommendation:` as the locked decision; rebut only under `### Deferred`.
       Confirm each anchor with a fresh bounded read.
       The report path stops here and continues at step 4.
       The typed path also invokes `easy_cheese.shared.workflow.cure` with the validated plan.
       Add one `CureDiagnosisBinding` for each selected curd.
       Create each binding with `bind_diagnosis(plan, curd, diagnosis_result)`.
       Use only a confirmed `DiagnosisResult`.
       Point the binding to the exact plan and curd digest.
       Set `DiagnosisDisposition.CONFIRMED`.
       A plausible but unrelated diagnosis does not unlock Cure.
       `cure` resolves each `ArtifactRef` with `resolve_artifact`.
       It accepts only observation-only `CurdResultWriterView` output.
       It uses `normalize_agent_output` to finalize one `CurdResult` per selected curd.
       It also finalizes executor failures.
    4. **Validate.** Run the narrowest test that proves each fix.
       Then run the relevant project gates.
       These gates include lint, type checks, and builds.
       When the handoff has a `baseline:` block, use [`quality-gates.md`](../cook/references/quality-gates.md).
       Identical baseline failures do not block a clean cure or trigger a halt.
       Fix only new or changed failures.
    5. **Taste-test behavioral fixes.** Run the fresh-context taste test before you write the handoff slug.
       Resolve the read-only `reviewer (taste-test)` phase agent through [`agent-resolution.md`](../cheese/references/agent-resolution.md).
       Request `default` minimum power and `medium` effort.
       Use the Cook review lenses over the cure diff.
       Reuse the step-2 rendered brief verbatim as the taste test's locked-decision block.
       Halt when fresh-context isolation is unavailable.
       Use an inline self-check only under the small-diff cost gate in [`tdd-loop.md`](../cook/references/tdd-loop.md).
       Skip this step for formatting, comments, imports, and logic-free renames.
       Send a `revise` verdict into one bounded correction pass.
       Stop for a human on a Locked-decision `halt`.
       A nested coder defers the authoritative review to the orchestrator.
    6. **Correct the domain model.** Correct only terms that the Cook diff touches.
       Read `references/domain-model-correction.md` first.
       Do not reverse a canonical term that Mold locked.
    7. **Hand off for review.** Recommend `/age <slug> --scope <touched-path>`.
       Repeat `--scope` once for each touched path.
       Send the current slug with every Age dispatch.
       Forward `--hard` when the run has that flag.
       Do not duplicate the Age review inside Cure.
       A new Age report can start a new `/cure` run.
    8. **Write the report.** Record changes, checks, deferred items, and residual risks.
       Put the handoff slug at the top of `.cheese/cure/<slug>.md`.
    9. **Write back the durable facts.** Run § Post-PR write-back before publication.
       Give each written path to `/plate` for its artifact inventory.
    10. **Hand off for publication.** Dispatch `/plate` after a clean cure.
        Follow `## Handoff`.
    
    ## Preferred tools and fallbacks
    
    Route source work through [`code-intelligence-routing.md`](../cheese/references/code-intelligence-routing.md).
    Use its fallback when a preferred tool is absent.
    Stop only when the fallback cannot support a safe fix.
    Report the precision loss.
    
    ## Validation
    
    Run the narrowest test that proves each fix.
    Then run all relevant existing gates.
    Record why an unavailable gate cannot run.
    Do not declare readiness while selected findings remain unresolved.
    
    Move a finding to Applied only after its proving test passes.
    Read `references/cure-discipline.md` for the Iron Law.
    
    A **clean cure** has at least one applied fix and all gates pass.
    It also has no false-premise halt.
    Identical `baseline:` failures do not count against green status.
    Read [`quality-gates.md`](../cook/references/quality-gates.md).
    
    The agent judges the gate values.
    The CLI maps those values to a readiness verdict:
    
    ```text
    python3 skills/cure/scripts/cure.pyz gates classify \
      --press-status <label> \
      [--hard-floor-met] [--has-open-level-1-or-2] [--has-open-level-3] [--has-open-level-4-or-5] [--any-spinning]
    ```
    
    Use the same bundle command when the host only ships the bundle.
    
    ## Handoff slug
    
    Write the report to `.cheese/cure/<slug>.md`.
    Put this minimum handoff slug at the top:
    
    ```markdown
    status: <canonical status field>
    next: age | done
    artifact: <path of the report that this run consumed>
    baseline: none | <recorded baseline block copied from the upstream handoff — see ../cook/references/quality-gates.md>
    <one-line orientation: what cure applied or deferred>
    ```
    
    The [handback contract](../cheese/references/handback-contract.md) defines the `status:` grammar.
    Only `next:` and the additional keyed lines are specific to this phase.
    `artifact:` names the source report that this run consumed.
    Use `handoff_context.source_report` for that value, or the resolved `.cheese/age/<slug>.md` path.
    
    Write the report body to a separate file.
    Then let the canonical writer create `.cheese/cure/<slug>.md` once.
    Pass every optional field that this run has.
    
    ```text
    python3 skills/cure/scripts/cure.pyz write-handoff-artifact \
      --slug <slug> --status <status> --phase cure --next age \
      --artifact <consumed-report-path> --orientation "<one-line orientation>" \
      --baseline "<copied baseline block>" --durable-flags "<one line per flag>" \
      --grounded <path[#start-end]> \
      --body-file <body-path> \
      --payload-schema https://schemas.easy-cheese.dev/curd-result
    ```
    
    Use a second command for the terminal state.
    Omit `--payload-schema`, because a terminal transition rejects a payload schema.
    
    ```text
    python3 skills/cure/scripts/cure.pyz write-handoff-artifact \
      --slug <slug> --status <status> --phase cure --next done \
      --artifact <consumed-report-path> --orientation "<one-line orientation>" \
      --baseline "<copied baseline block>" --grounded <path[#start-end]> \
      --body-file <body-path>
    ```
    
    Omit `--baseline` and `--durable-flags` when this run has no such value.
    `phase=cure` controls storage routing.
    `next` declares the following phase, and the writer validates that transition.
    
    Use `status: ok` when at least one finding applies cleanly.
    Use it when no finding meets the `--auto` severity floor.
    Use `status: halt: <reason>` when every selected fix fails evaluation.
    Use it when a project gate cannot pass.
    Use `next: age` when review follows.
    This value is the default for automatic and interactive runs.
    Use `next: done` only for an interactive run without `--auto`.
    The user must also decline review explicitly.
    Cure does not track the current pass.
    `/age --auto` enforces the two-cure-pass cap on its third invocation.
    
    ## Output
    
    Use [`formatting.md`](../cheese/references/formatting.md).
    Below the slug, add the exact headings `### Applied`, `### Deferred`, `### Checks`, and `### Re-review`.
    Bind `<slug>` to the stem of the consumed source report.
    When `source_skill` is `/affinage`, end each result line with `[from-comment:<id>]`.
    Include finding IDs, evidence, residual risk, and the next command.
    Use `/age <slug> --scope <touched-path>` or `/plate` as that command.
    
    ## Handoff
    
    **Pipeline:** culture → mold → cook → press → age → **[cure]** → plate
    
    After the report exists, decide whether to dispatch `/plate` or ask.
    A clean cure updates an open PR without another gate by default.
    `--safe` restores the handoff gate.
    
    When `/affinage` started the run, never dispatch `/plate` from Cure.
    This state uses `handoff_context.source_skill: /affinage`.
    Apply the fixes and run the automatic Age loop when required.
    Then return control to `/affinage`.
    It posts the GitHub replies before it dispatches `/plate`.
    
    **Default without `--safe`:**
    
    - With an open PR, dispatch `/plate [--hard]`.
      It performs its final write gate, commit, topology update, and publication.
    - With no open PR, use `--open-pr` to dispatch `/plate [--hard]`.
      In this case, explicit topology choices and obviously cohesive work proceed without asking.
      In other cases, stack-sized or ambiguous work asks before commit or branch-layout mutation.
    - Without `--open-pr`, leave the remote unchanged.
      Report `no open PR — pass --open-pr or run /plate`.
    - Run § Post-PR write-back before every `/plate` dispatch.
    - Skip `/plate` when the cure is not clean.
      Report the blocker and stop.
    
    With `--safe`, use the shared [handoff gate](../cheese/references/handoff-gate.md).
    Offer these choices:
    
    - **Review the touched code.** Run `/age <slug> --scope <touched-path>`.
      Recommend this choice when fixes extend beyond the finding hunk.
    - **Plate it.** Run `/plate [--hard]` to commit and publish.
    - **Checkpoint and stop.** Run `/wheypoint`.
    - **Stop.** Dispatch nothing.
    
    Preselect **Plate it** only when all selected fixes and gates pass.
    Run the selected command immediately.
    
    ### Post-PR write-back
    
    Read `references/post-pr-writeback.md` before any path publishes to a PR.
    This includes default, `--open-pr`, `--safe`, and automatic publication paths.
    The file defines candidates, writers, fallback behavior, ownership, and the empty case.
    
    ## --hard mode
    
    `/cure --hard` passes `--hard` to `/plate`.
    `/plate` completes and verifies every durable write.
    It then gives `/hard-cheese` the final artifact inventory.
    Stop publication on a `FAILED` gate result.
    Stop publication when a non-TTY environment blocks the gate.
    An `ERROR` result uses the hard-cheese fail-open policy, and publication continues.
    Review, checkpoint, and stop choices skip this gate.
    Read `skills/hard-cheese/SKILL.md` and `../hard-cheese/references/composition.md`.
    
    ## Auto mode
    
    Read `references/auto-mode.md` before auto mode.
    It defines selection, validation, reversion, Age limits, flag forwarding, publication, and Cook worker exceptions.
    It also defines the `--auto --hard` puncture clause.
    
    ## Rules
    
    - Use the recommended composite or the locked selection by default.
      `--safe` restores the gate.
      Pause for false-premise, sprawling, structural, or conflicting findings.
    - Keep fixes within the selected findings.
      Do not fix failures identical to the baseline.
    - Report failed and skipped checks.
      Put reverted automatic findings under `### Deferred`.
    - Follow `## Handoff` for every publication decision.
      Never publish an unclean cure.
    - Stop before you apply a finding that rests on a false premise.
      Report why the Age claim is wrong or obsolete.
    - Apply the shared voice rules from `../age/references/voice.md`.
      Lead with the applied changes.
      Mark residual risk as `certain | speculating | don't know`.
      Do not invent follow-up work for a correct diff.
    - Identify the gate command before you claim `status: ok`.
      Run it again in the same turn.
      Read its full output.
      Then make the claim.
      Do not use `should`, `probably`, or `I think` in completion claims.
      State what the gate output shows.
    
    ## Discipline
    
    Read `references/cure-discipline.md` before you apply any fix.
    It defines the Iron Law, Red Flags, and rationalization table.
    
    ## Agent resolution
    
    Resolve fix work through [`agent-resolution.md`](../cheese/references/agent-resolution.md).
    
    | Work | Preferred types | Permissions/isolation | Minimum power | Effort | Fallback |
    | --- | --- | --- | --- | --- | --- |
    | Apply selected findings | coder | write, isolated worktree | default | high | compatible coder, then general |
    
    The canonical Cure handoff includes the shared `agent_resolution` block.
    
    See the generated command inventory in [`references/commands.md`](references/commands.md).
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related