[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HYHR8FC1VWRCWC03B285HQ":3,"skill-same:01M6HYHR8FC1VWRCWC03B285HQ":94},{"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":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6HYHR8FC1VWRCWC03B285HQ","learn",null,"Use when running a goal end-to-end through a seven-phase learning loop. Sequences Orient → Strategize → Plan → Execute → Debrief → Improve → Memory consolidation, dispatching specialized subagents per phase, and improves itself between runs by mutating its own state directory.","Jinn-Network\u002Fmono","Jinn-Network","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F236846593?v=4","01M6HYDXMQQYRMV3QZPT7JYY87","Jinn Network","01M6HYDXS833N3PY8EJ5NHJGB6",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"read","consolidation","debrief","strategize","end","orient","task","goal","use","write","directory","specialized","plan","loop","improve","learning","Bash","state","memory","2026-11-10 10:12:30",false,"---\nname: learn\ndescription: Use when running a goal end-to-end through a seven-phase learning loop. Sequences Orient → Strategize → Plan → Execute → Debrief → Improve → Memory consolidation, dispatching specialized subagents per phase, and improves itself between runs by mutating its own state directory.\nallowed-tools: Bash, Read, Write, Edit, Glob, Grep, Task\n---\n\n# Learn — claude-code-learner orchestrator\n\nYou are running one goal end-to-end through a seven-phase learning loop. This single skill drives the full pipeline. Each phase below dispatches a fresh-context subagent whose prompt body is read from a sibling `*-prompt.md` file in this skill directory; you collect the subagent's output and proceed.\n\n## Inputs (from the harness)\n\n- `goal` — `{ id, description, kind?, deadline?, spec? }`. Free-form payload describing what to achieve. The plugin reads `description` to know the task and may organize prior runs by `kind` if present. The plugin does not interpret `kind` semantically; it is an opaque string used for organizing artifacts.\n- `workingDir` — ephemeral path; the harness harvests it for delivery when this skill returns.\n- `implStateDir` — the agent's persistent self-state. Git-backed by the SessionStart hook. Mutations here persist across runs and constitute \"learning.\"\n- `candidateStateDir` — set only in `candidate` mode, from the `JINN_LEARNER_CANDIDATE_DIR` env var. A writable copy of `implStateDir` made before this run started, and the sole write target of Improve and Memory consolidation in that mode. Also git-backed.\n- `msUntilDeadline` — function returning remaining time.\n- `mode` — `train`, `frozen`, or `candidate`. Default to `train` if absent. See \"Write target\" below.\n- An abort signal that fires at the goal's deadline (if any).\n\n### Write target\n\nOne rule decides where every self-improving phase writes. Bind it once, at the top of the run, and pass it down:\n\n| `mode` | `stateDir` (the write target) | `implStateDir` |\n| --- | --- | --- |\n| `train` | `implStateDir` | read-write |\n| `frozen` | *nothing is written* | read-only |\n| `candidate` | `candidateStateDir` | **read-only** |\n\n`candidate` mode exists because a run cannot both *be* the policy under measurement and *change* it. Orient, Strategize, Plan, Execute, and Debrief are unchanged in candidate mode — they run against `implStateDir`, read-only, because that directory is the policy being evaluated. Improve and Memory consolidation still run, but everything they would have written to `implStateDir` goes to `candidateStateDir` instead, and the harness seals the result as a *proposal* for separate evaluation. The harness verifies `implStateDir` is byte-identical after the run and discards the run if it is not — the same fence `frozen` mode uses.\n\n```bash\ncase \"${JINN_HARNESS_MODE:-train}\" in\n  candidate) STATE_DIR=\"${JINN_LEARNER_CANDIDATE_DIR:?candidate dir unset}\" ;;\n  frozen)    STATE_DIR=\"\" ;;\n  *)         STATE_DIR=\"$IMPL_STATE_DIR\" ;;\nesac\n```\n\n**If `mode = candidate` and `JINN_LEARNER_CANDIDATE_DIR` is unset, empty, or not a directory: write `workingDir\u002F.errors\u002Fcandidate.json` naming the missing variable, skip sections 8 and 9 entirely, and return.** Never fall back to `implStateDir`. The `:?` above makes the shell fail loudly rather than silently expanding to an empty string, because the failure mode this rules out is the quiet one: an empty `STATE_DIR` turns `$STATE_DIR\u002Fskills\u002F...` into an absolute `\u002Fskills\u002F...`, and a bare `cd \"$STATE_DIR\"` lands in `$HOME`. A candidate run that writes nowhere is recoverable; one that writes to the policy under measurement is not.\n\nThe session-start hook (`hooks\u002Fsession-start`) has already initialized `implStateDir` as a git repo with the `claude-code-learner` author identity.\n\n## 1. Boot\n\nThe session-start hook (`hooks\u002Fsession-start`) has already run with `IMPL_STATE_DIR` set, so:\n- `implStateDir` is a git repo\n- The claude-code-learner git author identity is configured\n- HEAD sha is the implStateDir state at run start\n\nCapture it for the constitution span:\n\n```bash\nIMPL_STATE_DIR_SHA=$(git -C \"$IMPL_STATE_DIR\" rev-parse HEAD)\nSKILL_BUNDLE_CID=$(find \"${CLAUDE_PLUGIN_ROOT:-$PLUGIN_ROOT}\" -type f \\( -name '*.md' -o -name '*.sh' -o -name '*.mjs' \\) | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)\n```\n\nThe plugin root is provided by Claude Code as `${CLAUDE_PLUGIN_ROOT}`. Other harnesses may set `$PLUGIN_ROOT` from their session-start hook (the claude-code-learner hook does both for portability — sets and exports `PLUGIN_ROOT`). If neither is set, hash the loaded skills from their loaded paths.\n\nWrite `workingDir\u002F.coordinator\u002Fboot.json` (downstream phases — particularly Strategize — read it for the constitution span). The directory name is `coordinator` for backward compatibility with the existing on-disk artifact layout consumed by Strategize and Debrief; do not rename it. The shape is:\n\n```json\n{\n  \"implStateDirShaAtStart\": \"\u003Cgit HEAD sha of implStateDir at run start>\",\n  \"skillBundleCid\": \"sha256:\u003Cplugin bundle digest>\",\n  \"goalId\": \"\u003Cgoal.id>\",\n  \"deadline\": \u003Cgoal.deadline as milliseconds since epoch>\n}\n```\n\nThe harness hands you `goal`, `workingDir`, and `implStateDir` as session inputs (not POSIX env vars). Bind them to the variables this section uses, then write the file:\n\n```bash\n# Bind session inputs into shell variables (substitute your harness's\n# mechanism — e.g., values pulled from the initial prompt context or a\n# harness-provided JSON input):\nWORKING_DIR=\"\u003CworkingDir from session inputs>\"\nGOAL_ID=\"\u003Cgoal.id from session inputs>\"\nDEADLINE=\"\u003Cgoal.deadline from session inputs>\"\n\nmkdir -p \"$WORKING_DIR\u002F.coordinator\"\ncat > \"$WORKING_DIR\u002F.coordinator\u002Fboot.json\" \u003C\u003CEOF\n{\n  \"implStateDirShaAtStart\": \"$IMPL_STATE_DIR_SHA\",\n  \"skillBundleCid\": \"sha256:$SKILL_BUNDLE_CID\",\n  \"goalId\": \"$GOAL_ID\",\n  \"deadline\": $DEADLINE\n}\nEOF\n```\n\n`deadline` is the goal's deadline in milliseconds since epoch.\n\n## 2. Phase-range guard\n\n*Phase-range hint:* if the env var `LEARNER_PHASE_RANGE` is set, run only the corresponding subset:\n\n- `full` (or unset) — run all seven phases (sections 3–9), then verify and return (sections 10–11).\n- `pre-execute` — run only sections 3–5 (Orient, Strategize, Plan), then return. The harness's specialist wrapper will run Execute itself and invoke this skill again with `post-execute`.\n- `post-execute` — run section 7 (Debrief), plus sections 8–9 (Improve, Memory consolidation) when `mode = train` or `mode = candidate`. The harness's specialist wrapper has already populated `workingDir\u002F.execute\u002F` from a domain-specialist Execute path before invoking this pass.\n\nThis protocol exists so the harness's first-match wrapper can wrap domain-specialist Execute paths in the learning envelope without the specialist needing to know about the wrapper.\n\nMode controls whether the self-improving phases are allowed, and where they write:\n\n- `mode = train` — run Improve and Memory consolidation when phase-range includes sections 8–9. Write target is `implStateDir`.\n- `mode = candidate` — run the same phases, on the same schedule, with `stateDir = candidateStateDir` as the write target. `implStateDir` is read-only for the whole run. Everything sections 8–9 require is still required.\n- `mode = frozen` — run Orient, Strategize, Plan, Execute, and Debrief only. Skip Improve and Memory consolidation, do not mutate `implStateDir`, and return with no `.improve\u002F` or `.memory-consolidation\u002F` requirement. The daemon enforces this with a freeze fence and rejects any envelope that mutates the frozen implementation state.\n\nFor each section below, in order:\n\n1. Dispatch the section's subagent(s) per the uniform shape (see \"Uniform dispatch shape\" below).\n2. Collect outputs and verify the artifacts exist.\n3. Append a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n   `{ ts, phase, status, summary }`.\n\n## Uniform dispatch shape\n\nEvery section that dispatches a subagent uses the same shape. Spawn a fresh-context subagent. Read the prompt body from `${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002F\u003Crole>-prompt.md` (or `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Flearn\u002F\u003Crole>-prompt.md`) and pass it as the subagent's instructions. Pass these inputs:\n\n```\ngoal             = \u003Ccopy of goal>\nworkingDir       = \u003Cpath>\nimplStateDir     = \u003Cpath, read-only unless this role mutates it>\noutputPath       = workingDir\u002F.\u003Cphase>\u002F\u003Cartifact>.json\nmsUntilDeadline  = \u003Ccurrent value>\n... role-specific inputs (see \u003Crole>-prompt.md inputs section) ...\n```\n\nThe subagent reads the prompt, follows it, writes `outputPath`, and returns a one-line summary plus `artifactPath`.\n\nDo not reference any registered-subagent registry by name. There is no `subagent_type:` argument and no `claude-code-learner:\u003Crole>` identifier. The mechanism is: read prompt file → spawn fresh-context subagent → pass prompt as instructions.\n\nUse the dispatch, wait, and release primitives exposed by the current harness. The harness is responsible for projecting those generic operations onto its native tool surface. Keep these lifecycle rules independent of harness:\n\n- Keep the returned handle\u002Fid for each dispatched subagent.\n- Wait until every required artifact for the current phase exists; if a multi-wait returns only some completed subagents, keep waiting on the remaining handles.\n- Release\u002Fclose completed subagents once their outputs have been verified and their summaries have been captured, especially before spawning a later phase.\n- Pass absolute filesystem paths in subagent inputs. Subagents must use those absolute paths for reads and writes rather than assuming they inherited the coordinator's current working directory.\n\nFor sections that dispatch multiple subagents in parallel (Orient, optional Debrief probes), spawn one subagent per topic with its own `topic` and `outputPath`. If your harness supports it, run them concurrently; otherwise dispatch sequentially. Subagents do not spawn further subagents — they are one level deep.\n\n## 3. Orient\n\nPurpose: gather goal + world-state + history; produce findings Strategize will consume.\n\nDecide what topics need gathering. Choose from these typical categories; add or omit based on the goal:\n\n1. **goal-parse** — what's the goal, kind (if present), deadline, spec, eligibility? Always include.\n2. **world-state** — for goals where the harness exposes tools to inspect external state, pull current relevant state. Include if such tools are available for this goal.\n3. **own-history** — list prior runs of this kind by this operator. Include if `implStateDir\u002Fruns\u002Findex.json` exists or the harness's history-of-runs query is exposed.\n4. **others-history** — recent runs of this kind by other operators. Include if the harness's history-of-runs query is exposed. (This is read-only discovery — it surfaces who ran what, with which evidence tier and score, plus the artifact list and prices; it does not acquire artifact bytes or spend anything. Cross-operator content is hash-verified at acquisition time and the agent re-verifies anything before acting on it, so there is no separate opt-in: the learner always looks at the network when it can.)\n\nFor each chosen topic, dispatch an explorer subagent in parallel. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body      = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fexplorer-prompt.md\ntopic            = \u003Ctopic name, e.g. \"goal-parse\">\ngoal             = \u003Ccopy of goal>\nscope            = \u003Ctopic-specific scope; explorer-prompt.md describes what it expects>\nworkingDir       = \u003Cpath>\nimplStateDir     = \u003Cpath, read-only>\noutputPath       = workingDir\u002F.orient\u002F\u003Ctopic>.json\nmsUntilDeadline  = \u003Ccurrent value>\n```\n\nAfter all explorers return, read each `workingDir\u002F.orient\u002F\u003Ctopic>.json` and write `workingDir\u002F.orient\u002Fsummary.json`:\n\n```json\n{\n  \"goal\": { \"id\": \"...\", \"kind\": \"...\", \"deadline\": 0 },\n  \"topics\": [\n    { \"topic\": \"goal-parse\", \"artifact\": \"workingDir\u002F.orient\u002Fgoal-parse.json\", \"summary\": \"...\", \"flags\": [] },\n    { \"topic\": \"world-state\", \"artifact\": \"workingDir\u002F.orient\u002Fworld-state.json\", \"summary\": \"...\", \"flags\": [\"stale\"] }\n  ],\n  \"openQuestions\": [\"string — anything Strategize needs to know was uncertain or unavailable\"]\n}\n```\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 4. Strategize\n\nPurpose: pick approach, freeze success criteria + timing posture into a constitution record.\n\nDispatch a strategist subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body            = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fstrategist-prompt.md\ngoal                   = \u003Ccopy of goal>\norientSummaryPath      = workingDir\u002F.orient\u002Fsummary.json\npriorStrategiesPath    = implStateDir\u002Fstrategies\u002F\u003Cgoal.kind>\u002F   (or null if absent)\nworkingDir             = \u003Cpath>\nimplStateDir           = \u003Cpath, read-only>\noutputDir              = workingDir\u002F.strategize\u002F\nskillBundleCid         = \u003Cfrom boot.json>\nimplStateDirShaAtStart = \u003Cfrom boot.json>\nmsUntilDeadline        = \u003Ccurrent value>\n```\n\nAfter it returns, verify both files exist:\n- `workingDir\u002F.strategize\u002Fstrategy.json`\n- `workingDir\u002F.strategize\u002Fconstitution.json`\n\nIf either is missing, write `workingDir\u002F.errors\u002Fstrategize.json` with the failure context and abort the pipeline. In `train` and `candidate` mode, still run section 9, Memory consolidation, before returning. In `frozen` mode, return without running section 9.\n\nAfter Strategize, read `workingDir\u002F.strategize\u002Fconstitution.json`. If the harness exposes an OTel tracer, emit the constitution fields as attributes on a state-transition span (the harness defines the span name). Otherwise the file itself is the constitution record; Debrief reads it from there.\n\nNever run a second strategist after the first has committed (no re-strategizing mid-run). The strategy is frozen for the remainder of this run.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 5. Plan\n\nPurpose: produce concrete steps, optionally time-anchored.\n\nDispatch a planner subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body              = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fplanner-prompt.md\ngoal                     = \u003Ccopy of goal>\nstrategyPath             = workingDir\u002F.strategize\u002Fstrategy.json\norientSummaryPath        = workingDir\u002F.orient\u002Fsummary.json\npriorPlanTemplatesPath   = implStateDir\u002Fplans\u002F\u003Cgoal.kind>\u002F (or null)\nreplanContextPath        = workingDir\u002F.plan\u002Freplan-context.json (or null on first plan)\npriorPlanArchives        = [workingDir\u002F.plan\u002Fplan-v1.json, ...] (or empty on first plan)\nworkingDir               = \u003Cpath>\nimplStateDir             = \u003Cpath, read-only>\noutputPath               = workingDir\u002F.plan\u002Fplan.json\nmsUntilDeadline          = \u003Ccurrent value>\n```\n\nAfter it returns, verify `workingDir\u002F.plan\u002Fplan.json` exists. If not, write `workingDir\u002F.errors\u002Fplan.json` and abort the pipeline (still run section 9 before returning).\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 6. Execute\n\nPurpose: walk the plan, dispatch one step-worker per work step, honor wait steps, decide at runtime when stuck.\n\nInputs you read directly:\n- `workingDir\u002F.plan\u002Fplan.json` — the steps\n- `workingDir\u002F.strategize\u002Fstrategy.json` — success criteria + timing posture\n- `workingDir\u002F.orient\u002Fsummary.json` — grounding\n- The goal + deadline + remaining time budget\n\nFor each step in order, respecting `concurrency` markings:\n\n### Work steps\n\nDispatch a step-worker subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body      = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fstep-worker-prompt.md\nstepSpec         = \u003Cthe entire step object from plan.json>\ngoal             = \u003Ccopy of goal>\nworkingDir       = \u003Cpath>\nimplStateDir     = \u003Cpath, read-only>\nmsUntilDeadline  = \u003Ccurrent value>\n```\n\nFor parallel-batch steps (steps sharing a `concurrency: parallel-batch-X` label), dispatch the whole batch concurrently if your harness supports it; wait for all to return before advancing.\n\nAfter a worker returns:\n- The worker's self-reported `status` and `blockers` are evidence; the authoritative verdict is your re-check of the step's `successSignal` against actual outputs on disk.\n- Check `successSignal` — did the step succeed?\n- If yes: append to `workingDir\u002F.execute\u002Flog.jsonl` (carrying the worker's `status` and `blockers` into the log entry) and advance.\n- If no: see \"When stuck\" below.\n\n### Wait steps\n\nUse the harness's wait primitive (per spec §8 harness-adapter contract). Plan-emitted wait steps may include any combination of `durationMs`, `untilTs`, and `condition`; treat absent and explicit `null` identically as \"not set.\" When multiple wakers are set, wake on the first to fire (per spec §5: `wait` wakes when any of duration \u002F deadline \u002F condition fires). The abort signal from the harness (the goal's `deadline`) always overrides any wait.\n\n### When stuck\n\nWhen a step fails its success signal or a worker returns without expected outputs, judge:\n\n- **continue** — accept partial; advance.\n- **retry-step** — dispatch a fresh worker for the same step. Cap at 2 retries unless step `abortCondition` says otherwise.\n- **replan** — archive the current plan and re-run section 5 (Plan), then continue Execute on the new plan. Concretely: rename `workingDir\u002F.plan\u002Fplan.json` to `workingDir\u002F.plan\u002Fplan-v\u003CN>.json` where N is the next unused integer (start at 1), write `workingDir\u002F.plan\u002Freplan-context.json` with `{ failedStepId, blockers, partialOutputs[] }`, then re-dispatch the planner subagent (section 5). The new `plan.json` is grounded in what's now in `workingDir\u002F` (including the archived prior plans, the execute log up to the failure, and the replan-context). Continue Execute on the new `plan.json`.\n- **abort** — write `workingDir\u002F.errors\u002Fexecute.json` with failure context; exit Execute. Continue to Debrief and, in `train` and `candidate` mode only, Improve \u002F Memory consolidation. Abort here is not a pipeline-level abort.\n\nExplain your judgment in `workingDir\u002F.execute\u002Flog.jsonl`.\n\n### Outputs\n\nThroughout the phase:\n- `workingDir\u002F.execute\u002Flog.jsonl` — one entry per step boundary: `{ ts, stepId, decision, summary, retryCount, workerStatus, workerBlockers }`. `workerStatus` and `workerBlockers` come directly from the step-worker's return shape so Debrief sees both the worker's self-assessment and Execute's verdict.\n- Per-step outputs as the plan declared.\n\nAt end, write `workingDir\u002F.execute\u002Fsummary.json`:\n\n```json\n{\n  \"stepsCompleted\": [\"step-1\", \"step-2\"],\n  \"stepsFailed\": [],\n  \"decisions\": [\"continue\", \"retry-step\", \"continue\"],\n  \"elapsedMs\": 0,\n  \"returnReason\": \"all-steps-completed | early-return | hold-and-revise-window-end | continuous-observation-window-end | abort\"\n}\n```\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 7. Debrief\n\nPurpose: post-execution analysis. Mirrors Orient — gather + sense-make in hindsight.\n\n### Optional: dispatch debrief explorers\n\nDispatch explorer subagents in parallel for each post-execution topic that applies. Typical topics:\n\n- `outcome-probe` — re-pull world state via whatever tools the harness exposes for this goal, to see post-execution outcome.\n- `cross-operator-comparison` — the harness's history-of-runs query, if exposed, for similar runs by other operators. Read-only discovery (same as Orient's `others-history`); include it whenever the query is exposed.\n\nUse the uniform dispatch shape; each explorer writes `workingDir\u002F.debrief\u002F\u003Ctopic>.json`.\n\n### Dispatch the analyst\n\nDispatch an analyst subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body          = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fanalyst-prompt.md\ngoal                 = \u003Ccopy of goal>\nstrategyPath         = workingDir\u002F.strategize\u002Fstrategy.json\nconstitutionPath     = workingDir\u002F.strategize\u002Fconstitution.json\nplanPath             = workingDir\u002F.plan\u002Fplan.json\nexecuteSummaryPath   = workingDir\u002F.execute\u002Fsummary.json\nexecuteLogPath       = workingDir\u002F.execute\u002Flog.jsonl\norientSummaryPath    = workingDir\u002F.orient\u002Fsummary.json\ndebriefExplorerPaths = [workingDir\u002F.debrief\u002F\u003Ctopic>.json, ...]\nownHistoryPath       = implStateDir\u002Fruns\u002Findex.json (or null)\nworkingDir           = \u003Cpath>\nimplStateDir         = \u003Cpath, read-only>\noutputPath           = workingDir\u002F.debrief\u002Fanalysis.json\nmsUntilDeadline      = \u003Ccurrent value>\n```\n\nAfter it returns, verify `workingDir\u002F.debrief\u002Fanalysis.json` exists. If not, write `workingDir\u002F.errors\u002Fdebrief.json` and abort the pipeline. In `train` and `candidate` mode, still run section 9 before returning. In `frozen` mode, return without running section 9.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 8. Improve\n\nPurpose: mutate `stateDir`, commit each accepted mutation as a separate git commit. Changes take effect NEXT run (in `candidate` mode, only if the proposal is later adopted).\n\nRun this section when `mode = train` or `mode = candidate`. If `mode = frozen`, skip it entirely and append a coordinator log entry noting `{ phase: \"improve\", status: \"skipped\", summary: \"mode=frozen\" }`.\n\nDispatch a promoter subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body        = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fpromoter-prompt.md\ngoal               = \u003Ccopy of goal>\nanalysisPath       = workingDir\u002F.debrief\u002Fanalysis.json\npolicyPath         = stateDir\u002Fpolicy.json (or null)\nstateDir           = \u003Cthe write target from \"Write target\": implStateDir in train mode,\n                      candidateStateDir in candidate mode — read-write for the promoter>\nimplStateDir       = \u003Cpath, READ-ONLY in candidate mode; the same path as stateDir in train mode>\nworkingDir         = \u003Cpath>\noutputDir          = workingDir\u002F.improve\u002F\nmsUntilDeadline    = \u003Ccurrent value>\n```\n\nThe promoter writes mutations directly into `stateDir`, commits each as a separate git commit (the session-start hook configured the author identity already), and writes one `promotion_record` per mutation under `workingDir\u002F.improve\u002Fpromotions\u002F`.\n\nIn `candidate` mode, pass `implStateDir` only so the promoter can *read* the policy it is proposing a change to. It must not be the promoter's write target, and the harness verifies afterwards that it was not written.\n\nAfter it returns, read `workingDir\u002F.improve\u002Fsummary.json`. Verify:\n- `implStateDirShaAfter` matches `git -C \u003CstateDir> rev-parse HEAD` (the field name is historical; it always refers to the write target's HEAD)\n- One `promotion_record` per accepted change\n- Operator-access requests under `workingDir\u002F.operator-requests\u002F` if any\n\nIf anything is inconsistent, write `workingDir\u002F.errors\u002Fimprove.json` and abort the pipeline, then still run section 9 before returning. This section does not run in `frozen` mode.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 9. Memory consolidation\n\nPurpose: curate `stateDir` (prune unused, revert regressions) and `workingDir` (set public\u002Fprivate boundary); commit durable curation as one separate commit.\n\nRun this section when `mode = train` or `mode = candidate`. If `mode = frozen`, skip it entirely and append a coordinator log entry noting `{ phase: \"memory-consolidation\", status: \"skipped\", summary: \"mode=frozen\" }`. Do not create durable commits or modify `implStateDir` in frozen mode.\n\nDispatch a consolidator subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body          = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fconsolidator-prompt.md\ngoal                 = \u003Ccopy of goal>\nanalysisPath         = workingDir\u002F.debrief\u002Fanalysis.json\nimproveSummaryPath   = workingDir\u002F.improve\u002Fsummary.json\nimprovePromotionsDir = workingDir\u002F.improve\u002Fpromotions\u002F\npolicyPath           = stateDir\u002Fpolicy.json (or null)\nstateDir             = \u003Cthe write target from \"Write target\": implStateDir in train mode,\n                        candidateStateDir in candidate mode — read-write>\nimplStateDir         = \u003Cpath, READ-ONLY in candidate mode; the same path as stateDir in train mode>\nworkingDir           = \u003Cpath, read-write>\noutputPath           = workingDir\u002F.memory-consolidation\u002Fconsolidation_record.json\nmsUntilDeadline      = \u003Ccurrent value>\n```\n\nThe consolidator does both workstreams (durable + ephemeral), writes a single git commit on `stateDir` for the durable curation, and produces the `consolidation_record`.\n\nAfter it returns, verify the `consolidation_record` exists. If the consolidator made a commit, `implStateDirShaAfter` must match `git -C \u003CstateDir> rev-parse HEAD`. If no commit was made (empty curation set), `implStateDirShaAfter` must equal `implStateDirShaBefore` and HEAD remains at that sha.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 10. Verify and return\n\nBefore returning, assert each primary artifact exists:\n\n- `workingDir\u002F.orient\u002Fsummary.json`\n- `workingDir\u002F.strategize\u002Fstrategy.json`\n- `workingDir\u002F.plan\u002Fplan.json`\n- `workingDir\u002F.execute\u002Fsummary.json`\n- `workingDir\u002F.debrief\u002Fanalysis.json`\n- `workingDir\u002F.improve\u002Fsummary.json`\n- `workingDir\u002F.memory-consolidation\u002Fconsolidation_record.json`\n\nWhen `mode = frozen`, do not require `workingDir\u002F.improve\u002Fsummary.json` or `workingDir\u002F.memory-consolidation\u002Fconsolidation_record.json`; those phases are skipped by contract. When `mode = candidate`, both are required exactly as in `train` — the phases ran, they simply wrote elsewhere.\n\nWhen `mode = candidate`, additionally assert that `git -C \"$IMPL_STATE_DIR\" rev-parse HEAD` still equals the `implStateDirShaAtStart` recorded in `workingDir\u002F.coordinator\u002Fboot.json`. If it does not, some phase wrote to the policy under evaluation: write `workingDir\u002F.errors\u002Fcandidate.json` naming what changed and return. The harness's freeze fence will reject the run anyway; catching it here makes the cause legible instead of surfacing as a bare hash mismatch.\n\nDo NOT include any goal-kind-specific assertions. The harness owns goal-kind enforcement (e.g. domain-specific solution payloads). The plugin verifies only its own seven generic phase artifacts.\n\nWhen the pipeline finishes — whether all sections completed cleanly, an abort signal fired, or a section reported failure — return. Never modify anything outside `stateDir\u002F**` or `workingDir\u002F**`.\n\n## 11. Failure handling\n\n- **Within Execute (section 6):** that section judges `continue \u002F retry-step \u002F replan \u002F abort` per its own rules.\n- **Execute reporting `abort` is not a pipeline-level abort** — continue to Debrief and, in `train` and `candidate` mode only, Improve \u002F Memory consolidation so partial work is analyzed and curated. The Execute section writes `workingDir\u002F.errors\u002Fexecute.json` itself.\n- **Other sections:** if a section reports a hard problem, write `workingDir\u002F.errors\u002F\u003Cphase>.json` and abort the pipeline. In `train` and `candidate` mode, still run section 9 (Memory consolidation) so partial work gets curated. In `frozen` mode, do not run section 9.\n- **Abort signal fired (deadline reached):** stop the current section cleanly, write `workingDir\u002F.errors\u002Fabort.json`, and return. In `train` and `candidate` mode, run section 9 first if there is enough time and doing so does not violate the abort signal. In `frozen` mode, do not run section 9.\n\n## Cross-reference\n\n- Pipeline + artifacts: `docs\u002Fsuperpowers\u002Fspecs\u002F2026-04-23-default-learning-restorer-design.md` v1.1.\n- Plugin layout: `docs\u002Fsuperpowers\u002Fspecs\u002F2026-05-06-claude-code-learner-plugin-simplification-design.md` v1.1.\n","# Learn — claude-code-learner orchestrator\n\nYou are running one goal end-to-end through a seven-phase learning loop. This single skill drives the full pipeline. Each phase below dispatches a fresh-context subagent whose prompt body is read from a sibling `*-prompt.md` file in this skill directory; you collect the subagent's output and proceed.\n\n## Inputs (from the harness)\n\n- `goal` — `{ id, description, kind?, deadline?, spec? }`. Free-form payload describing what to achieve. The plugin reads `description` to know the task and may organize prior runs by `kind` if present. The plugin does not interpret `kind` semantically; it is an opaque string used for organizing artifacts.\n- `workingDir` — ephemeral path; the harness harvests it for delivery when this skill returns.\n- `implStateDir` — the agent's persistent self-state. Git-backed by the SessionStart hook. Mutations here persist across runs and constitute \"learning.\"\n- `candidateStateDir` — set only in `candidate` mode, from the `JINN_LEARNER_CANDIDATE_DIR` env var. A writable copy of `implStateDir` made before this run started, and the sole write target of Improve and Memory consolidation in that mode. Also git-backed.\n- `msUntilDeadline` — function returning remaining time.\n- `mode` — `train`, `frozen`, or `candidate`. Default to `train` if absent. See \"Write target\" below.\n- An abort signal that fires at the goal's deadline (if any).\n\n### Write target\n\nOne rule decides where every self-improving phase writes. Bind it once, at the top of the run, and pass it down:\n\n| `mode` | `stateDir` (the write target) | `implStateDir` |\n| --- | --- | --- |\n| `train` | `implStateDir` | read-write |\n| `frozen` | *nothing is written* | read-only |\n| `candidate` | `candidateStateDir` | **read-only** |\n\n`candidate` mode exists because a run cannot both *be* the policy under measurement and *change* it. Orient, Strategize, Plan, Execute, and Debrief are unchanged in candidate mode — they run against `implStateDir`, read-only, because that directory is the policy being evaluated. Improve and Memory consolidation still run, but everything they would have written to `implStateDir` goes to `candidateStateDir` instead, and the harness seals the result as a *proposal* for separate evaluation. The harness verifies `implStateDir` is byte-identical after the run and discards the run if it is not — the same fence `frozen` mode uses.\n\n```bash\ncase \"${JINN_HARNESS_MODE:-train}\" in\n  candidate) STATE_DIR=\"${JINN_LEARNER_CANDIDATE_DIR:?candidate dir unset}\" ;;\n  frozen)    STATE_DIR=\"\" ;;\n  *)         STATE_DIR=\"$IMPL_STATE_DIR\" ;;\nesac\n```\n\n**If `mode = candidate` and `JINN_LEARNER_CANDIDATE_DIR` is unset, empty, or not a directory: write `workingDir\u002F.errors\u002Fcandidate.json` naming the missing variable, skip sections 8 and 9 entirely, and return.** Never fall back to `implStateDir`. The `:?` above makes the shell fail loudly rather than silently expanding to an empty string, because the failure mode this rules out is the quiet one: an empty `STATE_DIR` turns `$STATE_DIR\u002Fskills\u002F...` into an absolute `\u002Fskills\u002F...`, and a bare `cd \"$STATE_DIR\"` lands in `$HOME`. A candidate run that writes nowhere is recoverable; one that writes to the policy under measurement is not.\n\nThe session-start hook (`hooks\u002Fsession-start`) has already initialized `implStateDir` as a git repo with the `claude-code-learner` author identity.\n\n## 1. Boot\n\nThe session-start hook (`hooks\u002Fsession-start`) has already run with `IMPL_STATE_DIR` set, so:\n- `implStateDir` is a git repo\n- The claude-code-learner git author identity is configured\n- HEAD sha is the implStateDir state at run start\n\nCapture it for the constitution span:\n\n```bash\nIMPL_STATE_DIR_SHA=$(git -C \"$IMPL_STATE_DIR\" rev-parse HEAD)\nSKILL_BUNDLE_CID=$(find \"${CLAUDE_PLUGIN_ROOT:-$PLUGIN_ROOT}\" -type f \\( -name '*.md' -o -name '*.sh' -o -name '*.mjs' \\) | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)\n```\n\nThe plugin root is provided by Claude Code as `${CLAUDE_PLUGIN_ROOT}`. Other harnesses may set `$PLUGIN_ROOT` from their session-start hook (the claude-code-learner hook does both for portability — sets and exports `PLUGIN_ROOT`). If neither is set, hash the loaded skills from their loaded paths.\n\nWrite `workingDir\u002F.coordinator\u002Fboot.json` (downstream phases — particularly Strategize — read it for the constitution span). The directory name is `coordinator` for backward compatibility with the existing on-disk artifact layout consumed by Strategize and Debrief; do not rename it. The shape is:\n\n```json\n{\n  \"implStateDirShaAtStart\": \"\u003Cgit HEAD sha of implStateDir at run start>\",\n  \"skillBundleCid\": \"sha256:\u003Cplugin bundle digest>\",\n  \"goalId\": \"\u003Cgoal.id>\",\n  \"deadline\": \u003Cgoal.deadline as milliseconds since epoch>\n}\n```\n\nThe harness hands you `goal`, `workingDir`, and `implStateDir` as session inputs (not POSIX env vars). Bind them to the variables this section uses, then write the file:\n\n```bash\n# Bind session inputs into shell variables (substitute your harness's\n# mechanism — e.g., values pulled from the initial prompt context or a\n# harness-provided JSON input):\nWORKING_DIR=\"\u003CworkingDir from session inputs>\"\nGOAL_ID=\"\u003Cgoal.id from session inputs>\"\nDEADLINE=\"\u003Cgoal.deadline from session inputs>\"\n\nmkdir -p \"$WORKING_DIR\u002F.coordinator\"\ncat > \"$WORKING_DIR\u002F.coordinator\u002Fboot.json\" \u003C\u003CEOF\n{\n  \"implStateDirShaAtStart\": \"$IMPL_STATE_DIR_SHA\",\n  \"skillBundleCid\": \"sha256:$SKILL_BUNDLE_CID\",\n  \"goalId\": \"$GOAL_ID\",\n  \"deadline\": $DEADLINE\n}\nEOF\n```\n\n`deadline` is the goal's deadline in milliseconds since epoch.\n\n## 2. Phase-range guard\n\n*Phase-range hint:* if the env var `LEARNER_PHASE_RANGE` is set, run only the corresponding subset:\n\n- `full` (or unset) — run all seven phases (sections 3–9), then verify and return (sections 10–11).\n- `pre-execute` — run only sections 3–5 (Orient, Strategize, Plan), then return. The harness's specialist wrapper will run Execute itself and invoke this skill again with `post-execute`.\n- `post-execute` — run section 7 (Debrief), plus sections 8–9 (Improve, Memory consolidation) when `mode = train` or `mode = candidate`. The harness's specialist wrapper has already populated `workingDir\u002F.execute\u002F` from a domain-specialist Execute path before invoking this pass.\n\nThis protocol exists so the harness's first-match wrapper can wrap domain-specialist Execute paths in the learning envelope without the specialist needing to know about the wrapper.\n\nMode controls whether the self-improving phases are allowed, and where they write:\n\n- `mode = train` — run Improve and Memory consolidation when phase-range includes sections 8–9. Write target is `implStateDir`.\n- `mode = candidate` — run the same phases, on the same schedule, with `stateDir = candidateStateDir` as the write target. `implStateDir` is read-only for the whole run. Everything sections 8–9 require is still required.\n- `mode = frozen` — run Orient, Strategize, Plan, Execute, and Debrief only. Skip Improve and Memory consolidation, do not mutate `implStateDir`, and return with no `.improve\u002F` or `.memory-consolidation\u002F` requirement. The daemon enforces this with a freeze fence and rejects any envelope that mutates the frozen implementation state.\n\nFor each section below, in order:\n\n1. Dispatch the section's subagent(s) per the uniform shape (see \"Uniform dispatch shape\" below).\n2. Collect outputs and verify the artifacts exist.\n3. Append a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n   `{ ts, phase, status, summary }`.\n\n## Uniform dispatch shape\n\nEvery section that dispatches a subagent uses the same shape. Spawn a fresh-context subagent. Read the prompt body from `${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002F\u003Crole>-prompt.md` (or `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Flearn\u002F\u003Crole>-prompt.md`) and pass it as the subagent's instructions. Pass these inputs:\n\n```\ngoal             = \u003Ccopy of goal>\nworkingDir       = \u003Cpath>\nimplStateDir     = \u003Cpath, read-only unless this role mutates it>\noutputPath       = workingDir\u002F.\u003Cphase>\u002F\u003Cartifact>.json\nmsUntilDeadline  = \u003Ccurrent value>\n... role-specific inputs (see \u003Crole>-prompt.md inputs section) ...\n```\n\nThe subagent reads the prompt, follows it, writes `outputPath`, and returns a one-line summary plus `artifactPath`.\n\nDo not reference any registered-subagent registry by name. There is no `subagent_type:` argument and no `claude-code-learner:\u003Crole>` identifier. The mechanism is: read prompt file → spawn fresh-context subagent → pass prompt as instructions.\n\nUse the dispatch, wait, and release primitives exposed by the current harness. The harness is responsible for projecting those generic operations onto its native tool surface. Keep these lifecycle rules independent of harness:\n\n- Keep the returned handle\u002Fid for each dispatched subagent.\n- Wait until every required artifact for the current phase exists; if a multi-wait returns only some completed subagents, keep waiting on the remaining handles.\n- Release\u002Fclose completed subagents once their outputs have been verified and their summaries have been captured, especially before spawning a later phase.\n- Pass absolute filesystem paths in subagent inputs. Subagents must use those absolute paths for reads and writes rather than assuming they inherited the coordinator's current working directory.\n\nFor sections that dispatch multiple subagents in parallel (Orient, optional Debrief probes), spawn one subagent per topic with its own `topic` and `outputPath`. If your harness supports it, run them concurrently; otherwise dispatch sequentially. Subagents do not spawn further subagents — they are one level deep.\n\n## 3. Orient\n\nPurpose: gather goal + world-state + history; produce findings Strategize will consume.\n\nDecide what topics need gathering. Choose from these typical categories; add or omit based on the goal:\n\n1. **goal-parse** — what's the goal, kind (if present), deadline, spec, eligibility? Always include.\n2. **world-state** — for goals where the harness exposes tools to inspect external state, pull current relevant state. Include if such tools are available for this goal.\n3. **own-history** — list prior runs of this kind by this operator. Include if `implStateDir\u002Fruns\u002Findex.json` exists or the harness's history-of-runs query is exposed.\n4. **others-history** — recent runs of this kind by other operators. Include if the harness's history-of-runs query is exposed. (This is read-only discovery — it surfaces who ran what, with which evidence tier and score, plus the artifact list and prices; it does not acquire artifact bytes or spend anything. Cross-operator content is hash-verified at acquisition time and the agent re-verifies anything before acting on it, so there is no separate opt-in: the learner always looks at the network when it can.)\n\nFor each chosen topic, dispatch an explorer subagent in parallel. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body      = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fexplorer-prompt.md\ntopic            = \u003Ctopic name, e.g. \"goal-parse\">\ngoal             = \u003Ccopy of goal>\nscope            = \u003Ctopic-specific scope; explorer-prompt.md describes what it expects>\nworkingDir       = \u003Cpath>\nimplStateDir     = \u003Cpath, read-only>\noutputPath       = workingDir\u002F.orient\u002F\u003Ctopic>.json\nmsUntilDeadline  = \u003Ccurrent value>\n```\n\nAfter all explorers return, read each `workingDir\u002F.orient\u002F\u003Ctopic>.json` and write `workingDir\u002F.orient\u002Fsummary.json`:\n\n```json\n{\n  \"goal\": { \"id\": \"...\", \"kind\": \"...\", \"deadline\": 0 },\n  \"topics\": [\n    { \"topic\": \"goal-parse\", \"artifact\": \"workingDir\u002F.orient\u002Fgoal-parse.json\", \"summary\": \"...\", \"flags\": [] },\n    { \"topic\": \"world-state\", \"artifact\": \"workingDir\u002F.orient\u002Fworld-state.json\", \"summary\": \"...\", \"flags\": [\"stale\"] }\n  ],\n  \"openQuestions\": [\"string — anything Strategize needs to know was uncertain or unavailable\"]\n}\n```\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 4. Strategize\n\nPurpose: pick approach, freeze success criteria + timing posture into a constitution record.\n\nDispatch a strategist subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body            = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fstrategist-prompt.md\ngoal                   = \u003Ccopy of goal>\norientSummaryPath      = workingDir\u002F.orient\u002Fsummary.json\npriorStrategiesPath    = implStateDir\u002Fstrategies\u002F\u003Cgoal.kind>\u002F   (or null if absent)\nworkingDir             = \u003Cpath>\nimplStateDir           = \u003Cpath, read-only>\noutputDir              = workingDir\u002F.strategize\u002F\nskillBundleCid         = \u003Cfrom boot.json>\nimplStateDirShaAtStart = \u003Cfrom boot.json>\nmsUntilDeadline        = \u003Ccurrent value>\n```\n\nAfter it returns, verify both files exist:\n- `workingDir\u002F.strategize\u002Fstrategy.json`\n- `workingDir\u002F.strategize\u002Fconstitution.json`\n\nIf either is missing, write `workingDir\u002F.errors\u002Fstrategize.json` with the failure context and abort the pipeline. In `train` and `candidate` mode, still run section 9, Memory consolidation, before returning. In `frozen` mode, return without running section 9.\n\nAfter Strategize, read `workingDir\u002F.strategize\u002Fconstitution.json`. If the harness exposes an OTel tracer, emit the constitution fields as attributes on a state-transition span (the harness defines the span name). Otherwise the file itself is the constitution record; Debrief reads it from there.\n\nNever run a second strategist after the first has committed (no re-strategizing mid-run). The strategy is frozen for the remainder of this run.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 5. Plan\n\nPurpose: produce concrete steps, optionally time-anchored.\n\nDispatch a planner subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body              = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fplanner-prompt.md\ngoal                     = \u003Ccopy of goal>\nstrategyPath             = workingDir\u002F.strategize\u002Fstrategy.json\norientSummaryPath        = workingDir\u002F.orient\u002Fsummary.json\npriorPlanTemplatesPath   = implStateDir\u002Fplans\u002F\u003Cgoal.kind>\u002F (or null)\nreplanContextPath        = workingDir\u002F.plan\u002Freplan-context.json (or null on first plan)\npriorPlanArchives        = [workingDir\u002F.plan\u002Fplan-v1.json, ...] (or empty on first plan)\nworkingDir               = \u003Cpath>\nimplStateDir             = \u003Cpath, read-only>\noutputPath               = workingDir\u002F.plan\u002Fplan.json\nmsUntilDeadline          = \u003Ccurrent value>\n```\n\nAfter it returns, verify `workingDir\u002F.plan\u002Fplan.json` exists. If not, write `workingDir\u002F.errors\u002Fplan.json` and abort the pipeline (still run section 9 before returning).\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 6. Execute\n\nPurpose: walk the plan, dispatch one step-worker per work step, honor wait steps, decide at runtime when stuck.\n\nInputs you read directly:\n- `workingDir\u002F.plan\u002Fplan.json` — the steps\n- `workingDir\u002F.strategize\u002Fstrategy.json` — success criteria + timing posture\n- `workingDir\u002F.orient\u002Fsummary.json` — grounding\n- The goal + deadline + remaining time budget\n\nFor each step in order, respecting `concurrency` markings:\n\n### Work steps\n\nDispatch a step-worker subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body      = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fstep-worker-prompt.md\nstepSpec         = \u003Cthe entire step object from plan.json>\ngoal             = \u003Ccopy of goal>\nworkingDir       = \u003Cpath>\nimplStateDir     = \u003Cpath, read-only>\nmsUntilDeadline  = \u003Ccurrent value>\n```\n\nFor parallel-batch steps (steps sharing a `concurrency: parallel-batch-X` label), dispatch the whole batch concurrently if your harness supports it; wait for all to return before advancing.\n\nAfter a worker returns:\n- The worker's self-reported `status` and `blockers` are evidence; the authoritative verdict is your re-check of the step's `successSignal` against actual outputs on disk.\n- Check `successSignal` — did the step succeed?\n- If yes: append to `workingDir\u002F.execute\u002Flog.jsonl` (carrying the worker's `status` and `blockers` into the log entry) and advance.\n- If no: see \"When stuck\" below.\n\n### Wait steps\n\nUse the harness's wait primitive (per spec §8 harness-adapter contract). Plan-emitted wait steps may include any combination of `durationMs`, `untilTs`, and `condition`; treat absent and explicit `null` identically as \"not set.\" When multiple wakers are set, wake on the first to fire (per spec §5: `wait` wakes when any of duration \u002F deadline \u002F condition fires). The abort signal from the harness (the goal's `deadline`) always overrides any wait.\n\n### When stuck\n\nWhen a step fails its success signal or a worker returns without expected outputs, judge:\n\n- **continue** — accept partial; advance.\n- **retry-step** — dispatch a fresh worker for the same step. Cap at 2 retries unless step `abortCondition` says otherwise.\n- **replan** — archive the current plan and re-run section 5 (Plan), then continue Execute on the new plan. Concretely: rename `workingDir\u002F.plan\u002Fplan.json` to `workingDir\u002F.plan\u002Fplan-v\u003CN>.json` where N is the next unused integer (start at 1), write `workingDir\u002F.plan\u002Freplan-context.json` with `{ failedStepId, blockers, partialOutputs[] }`, then re-dispatch the planner subagent (section 5). The new `plan.json` is grounded in what's now in `workingDir\u002F` (including the archived prior plans, the execute log up to the failure, and the replan-context). Continue Execute on the new `plan.json`.\n- **abort** — write `workingDir\u002F.errors\u002Fexecute.json` with failure context; exit Execute. Continue to Debrief and, in `train` and `candidate` mode only, Improve \u002F Memory consolidation. Abort here is not a pipeline-level abort.\n\nExplain your judgment in `workingDir\u002F.execute\u002Flog.jsonl`.\n\n### Outputs\n\nThroughout the phase:\n- `workingDir\u002F.execute\u002Flog.jsonl` — one entry per step boundary: `{ ts, stepId, decision, summary, retryCount, workerStatus, workerBlockers }`. `workerStatus` and `workerBlockers` come directly from the step-worker's return shape so Debrief sees both the worker's self-assessment and Execute's verdict.\n- Per-step outputs as the plan declared.\n\nAt end, write `workingDir\u002F.execute\u002Fsummary.json`:\n\n```json\n{\n  \"stepsCompleted\": [\"step-1\", \"step-2\"],\n  \"stepsFailed\": [],\n  \"decisions\": [\"continue\", \"retry-step\", \"continue\"],\n  \"elapsedMs\": 0,\n  \"returnReason\": \"all-steps-completed | early-return | hold-and-revise-window-end | continuous-observation-window-end | abort\"\n}\n```\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 7. Debrief\n\nPurpose: post-execution analysis. Mirrors Orient — gather + sense-make in hindsight.\n\n### Optional: dispatch debrief explorers\n\nDispatch explorer subagents in parallel for each post-execution topic that applies. Typical topics:\n\n- `outcome-probe` — re-pull world state via whatever tools the harness exposes for this goal, to see post-execution outcome.\n- `cross-operator-comparison` — the harness's history-of-runs query, if exposed, for similar runs by other operators. Read-only discovery (same as Orient's `others-history`); include it whenever the query is exposed.\n\nUse the uniform dispatch shape; each explorer writes `workingDir\u002F.debrief\u002F\u003Ctopic>.json`.\n\n### Dispatch the analyst\n\nDispatch an analyst subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body          = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fanalyst-prompt.md\ngoal                 = \u003Ccopy of goal>\nstrategyPath         = workingDir\u002F.strategize\u002Fstrategy.json\nconstitutionPath     = workingDir\u002F.strategize\u002Fconstitution.json\nplanPath             = workingDir\u002F.plan\u002Fplan.json\nexecuteSummaryPath   = workingDir\u002F.execute\u002Fsummary.json\nexecuteLogPath       = workingDir\u002F.execute\u002Flog.jsonl\norientSummaryPath    = workingDir\u002F.orient\u002Fsummary.json\ndebriefExplorerPaths = [workingDir\u002F.debrief\u002F\u003Ctopic>.json, ...]\nownHistoryPath       = implStateDir\u002Fruns\u002Findex.json (or null)\nworkingDir           = \u003Cpath>\nimplStateDir         = \u003Cpath, read-only>\noutputPath           = workingDir\u002F.debrief\u002Fanalysis.json\nmsUntilDeadline      = \u003Ccurrent value>\n```\n\nAfter it returns, verify `workingDir\u002F.debrief\u002Fanalysis.json` exists. If not, write `workingDir\u002F.errors\u002Fdebrief.json` and abort the pipeline. In `train` and `candidate` mode, still run section 9 before returning. In `frozen` mode, return without running section 9.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 8. Improve\n\nPurpose: mutate `stateDir`, commit each accepted mutation as a separate git commit. Changes take effect NEXT run (in `candidate` mode, only if the proposal is later adopted).\n\nRun this section when `mode = train` or `mode = candidate`. If `mode = frozen`, skip it entirely and append a coordinator log entry noting `{ phase: \"improve\", status: \"skipped\", summary: \"mode=frozen\" }`.\n\nDispatch a promoter subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body        = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fpromoter-prompt.md\ngoal               = \u003Ccopy of goal>\nanalysisPath       = workingDir\u002F.debrief\u002Fanalysis.json\npolicyPath         = stateDir\u002Fpolicy.json (or null)\nstateDir           = \u003Cthe write target from \"Write target\": implStateDir in train mode,\n                      candidateStateDir in candidate mode — read-write for the promoter>\nimplStateDir       = \u003Cpath, READ-ONLY in candidate mode; the same path as stateDir in train mode>\nworkingDir         = \u003Cpath>\noutputDir          = workingDir\u002F.improve\u002F\nmsUntilDeadline    = \u003Ccurrent value>\n```\n\nThe promoter writes mutations directly into `stateDir`, commits each as a separate git commit (the session-start hook configured the author identity already), and writes one `promotion_record` per mutation under `workingDir\u002F.improve\u002Fpromotions\u002F`.\n\nIn `candidate` mode, pass `implStateDir` only so the promoter can *read* the policy it is proposing a change to. It must not be the promoter's write target, and the harness verifies afterwards that it was not written.\n\nAfter it returns, read `workingDir\u002F.improve\u002Fsummary.json`. Verify:\n- `implStateDirShaAfter` matches `git -C \u003CstateDir> rev-parse HEAD` (the field name is historical; it always refers to the write target's HEAD)\n- One `promotion_record` per accepted change\n- Operator-access requests under `workingDir\u002F.operator-requests\u002F` if any\n\nIf anything is inconsistent, write `workingDir\u002F.errors\u002Fimprove.json` and abort the pipeline, then still run section 9 before returning. This section does not run in `frozen` mode.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 9. Memory consolidation\n\nPurpose: curate `stateDir` (prune unused, revert regressions) and `workingDir` (set public\u002Fprivate boundary); commit durable curation as one separate commit.\n\nRun this section when `mode = train` or `mode = candidate`. If `mode = frozen`, skip it entirely and append a coordinator log entry noting `{ phase: \"memory-consolidation\", status: \"skipped\", summary: \"mode=frozen\" }`. Do not create durable commits or modify `implStateDir` in frozen mode.\n\nDispatch a consolidator subagent. Use the uniform dispatch shape with these role-specific inputs:\n\n```\nprompt body          = ${PLUGIN_ROOT}\u002Fskills\u002Flearn\u002Fconsolidator-prompt.md\ngoal                 = \u003Ccopy of goal>\nanalysisPath         = workingDir\u002F.debrief\u002Fanalysis.json\nimproveSummaryPath   = workingDir\u002F.improve\u002Fsummary.json\nimprovePromotionsDir = workingDir\u002F.improve\u002Fpromotions\u002F\npolicyPath           = stateDir\u002Fpolicy.json (or null)\nstateDir             = \u003Cthe write target from \"Write target\": implStateDir in train mode,\n                        candidateStateDir in candidate mode — read-write>\nimplStateDir         = \u003Cpath, READ-ONLY in candidate mode; the same path as stateDir in train mode>\nworkingDir           = \u003Cpath, read-write>\noutputPath           = workingDir\u002F.memory-consolidation\u002Fconsolidation_record.json\nmsUntilDeadline      = \u003Ccurrent value>\n```\n\nThe consolidator does both workstreams (durable + ephemeral), writes a single git commit on `stateDir` for the durable curation, and produces the `consolidation_record`.\n\nAfter it returns, verify the `consolidation_record` exists. If the consolidator made a commit, `implStateDirShaAfter` must match `git -C \u003CstateDir> rev-parse HEAD`. If no commit was made (empty curation set), `implStateDirShaAfter` must equal `implStateDirShaBefore` and HEAD remains at that sha.\n\nAppend a JSONL entry to `workingDir\u002F.coordinator\u002Flog.jsonl`:\n`{ ts, phase, status, summary }`.\n\n## 10. Verify and return\n\nBefore returning, assert each primary artifact exists:\n\n- `workingDir\u002F.orient\u002Fsummary.json`\n- `workingDir\u002F.strategize\u002Fstrategy.json`\n- `workingDir\u002F.plan\u002Fplan.json`\n- `workingDir\u002F.execute\u002Fsummary.json`\n- `workingDir\u002F.debrief\u002Fanalysis.json`\n- `workingDir\u002F.improve\u002Fsummary.json`\n- `workingDir\u002F.memory-consolidation\u002Fconsolidation_record.json`\n\nWhen `mode = frozen`, do not require `workingDir\u002F.improve\u002Fsummary.json` or `workingDir\u002F.memory-consolidation\u002Fconsolidation_record.json`; those phases are skipped by contract. When `mode = candidate`, both are required exactly as in `train` — the phases ran, they simply wrote elsewhere.\n\nWhen `mode = candidate`, additionally assert that `git -C \"$IMPL_STATE_DIR\" rev-parse HEAD` still equals the `implStateDirShaAtStart` recorded in `workingDir\u002F.coordinator\u002Fboot.json`. If it does not, some phase wrote to the policy under evaluation: write `workingDir\u002F.errors\u002Fcandidate.json` naming what changed and return. The harness's freeze fence will reject the run anyway; catching it here makes the cause legible instead of surfacing as a bare hash mismatch.\n\nDo NOT include any goal-kind-specific assertions. The harness owns goal-kind enforcement (e.g. domain-specific solution payloads). The plugin verifies only its own seven generic phase artifacts.\n\nWhen the pipeline finishes — whether all sections completed cleanly, an abort signal fired, or a section reported failure — return. Never modify anything outside `stateDir\u002F**` or `workingDir\u002F**`.\n\n## 11. Failure handling\n\n- **Within Execute (section 6):** that section judges `continue \u002F retry-step \u002F replan \u002F abort` per its own rules.\n- **Execute reporting `abort` is not a pipeline-level abort** — continue to Debrief and, in `train` and `candidate` mode only, Improve \u002F Memory consolidation so partial work is analyzed and curated. The Execute section writes `workingDir\u002F.errors\u002Fexecute.json` itself.\n- **Other sections:** if a section reports a hard problem, write `workingDir\u002F.errors\u002F\u003Cphase>.json` and abort the pipeline. In `train` and `candidate` mode, still run section 9 (Memory consolidation) so partial work gets curated. In `frozen` mode, do not run section 9.\n- **Abort signal fired (deadline reached):** stop the current section cleanly, write `workingDir\u002F.errors\u002Fabort.json`, and return. In `train` and `candidate` mode, run section 9 first if there is enough time and doing so does not violate the abort signal. In `frozen` mode, do not run section 9.\n\n## Cross-reference\n\n- Pipeline + artifacts: `docs\u002Fsuperpowers\u002Fspecs\u002F2026-04-23-default-learning-restorer-design.md` v1.1.\n- Plugin layout: `docs\u002Fsuperpowers\u002Fspecs\u002F2026-05-06-claude-code-learner-plugin-simplification-design.md` v1.1.\n",{"name":5,"description":7,"allowed-tools":43},"Bash, Read, Write, Edit, Glob, Grep, Task","next","f2aa6f30f2c7d7bcfc4c11e1f6b69f3f44c28603","operator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono","https:\u002F\u002Fgithub.com\u002FJinn-Network","2026-11-14 18:31:46",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add Jinn-Network\u002Fmono --skill learn",{"tool":56,"command":57},"bunx","bunx skills add Jinn-Network\u002Fmono --skill learn",{"tool":59,"command":60},"pnpm","pnpm dlx skills add Jinn-Network\u002Fmono --skill learn","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002FSKILL.md",true,[64,70,74,78,82,86,90],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"analyst-prompt.md","REFERENCE","参考文档",2532,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fanalyst-prompt.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"consolidator-prompt.md",7315,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fconsolidator-prompt.md",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"explorer-prompt.md",2844,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fexplorer-prompt.md",{"path":79,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":80,"sourceHtmlUrl":81},"planner-prompt.md",3066,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fplanner-prompt.md",{"path":83,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":84,"sourceHtmlUrl":85},"promoter-prompt.md",9478,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fpromoter-prompt.md",{"path":87,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":88,"sourceHtmlUrl":89},"step-worker-prompt.md",1775,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fstep-worker-prompt.md",{"path":91,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":92,"sourceHtmlUrl":93},"strategist-prompt.md",2716,"https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Flearner\u002Fskills\u002Flearn\u002Fstrategist-prompt.md",[95,118,139,160,176,190],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":38},"01M6HYJ7FA967P7Z0KJ98Y6EDB","jinn-operator","Reference for how a Jinn Network operator ran. The operator network is parked and is not running tasks, so use this to explain the jinn CLI, the MCP tools, and the Jinn protocol, not to set up, fund, or start an operator. Activates on mentions of \"jinn\", \"jinn agent\", \"jinn network\", \"jinn run\", \"Task\", \"SolverNet\", \"restoration\", or \"SolverPlugin\" in the context of operating an agent.","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fskills\u002Fjinn-operator\u002FSKILL.md",[],[102,103,27,104,105,106,107,108,109,110,28,19,111,112,113,35,114,115,116,117],"jinn operator","operator","how","for","context","Tools","start","network","edit","run","cli","tasks","MCP","up","SET","operating",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6HYJ34J55KTVBX4ECARYPYG","swe-rebench-v2-task","Reference for swe-rebench-v2.v1 task structure — input fields, repo setup, FAIL_TO_PASS\u002FPASS_TO_PASS semantics, the swe-rebench-v2-solution.v1 output schema, and how to submit a typed payload. Consult this skill when orienting on a task or constructing a solution.","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Fswe-rebench-v2-runtime\u002Fskills\u002Ftask\u002FSKILL.md",[],[25,125,126,127,128,129,130,131,132,133,134,135,105,104,136,137,138],"swe rebench v2 task","v1","reference","input","schema","setup","how to","payload","repo setup","repo","submit","structure","consult","output",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":38},"01M6HYHZF9Z8857QWYNJX2HPAP","swe-rebench-v2-test-map","Walk PASS_TO_PASS test names to their source files via repo grep, identify the test-to-source ratio, and pre-load the relevant call graph into context before writing the patch.","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Fswe-rebench-v2-diffmin\u002Fskills\u002Ftest-map\u002FSKILL.md",[],[146,147,148,149,134,150,151,152,153,154,155,156,157,158,106,159],"test","swe rebench v2 test map","map","graph","source","grep","via","patch","load","writing","files","call","call graph","relevant",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":38},"01M6HYHW5ZD1JW791VGWT08KCG","swe-rebench-v2-diffmin","Bias the patch toward the smallest change that flips FAIL_TO_PASS without disturbing PASS_TO_PASS. Use diff_stats to validate hunk count, file count, and rename absence before submitting.","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Fswe-rebench-v2-diffmin\u002Fskills\u002Fdiffmin\u002FSKILL.md",[],[167,168,169,170,171,172,173,174,175,153,27],"swe rebench v2 diffmin","bias","diff","hunk","rename","validate","change","stats","file",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":38},"01M6HYHJNRRRFAFQ97Y2DQMB9S","jinn-repo-task","Reference for jinn-repo.v1 task structure — input fields, repo setup (checkout of Jinn-Network\u002Fmono at base_commit), the jinn-repo-solution.v1 output schema, and how the daemon harvests your diff. Consult this skill when orienting on a task or constructing a solution.","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Fjinn-repo-runtime\u002Fskills\u002Ftask\u002FSKILL.md",[],[183,25,134,138,128,184,109,185,104,186,136,137,187,126,129,133,188,105,169,189],"jinn repo task","base","at","mono","commit","daemon","checkout",{"skillNo":191,"name":192,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"publishedAt":38},"01M6HYHEW08BPA4FV5X9K6B3KX","prediction-corpus-retrieval","https:\u002F\u002Fgithub.com\u002FJinn-Network\u002Fmono\u002Fblob\u002Fnext\u002Foperator\u002Fplugins\u002Fjinn-prediction-plugin\u002Fskills\u002Fprediction-corpus-retrieval\u002FSKILL.md",[],[196,197],"retrieval","prediction corpus retrieval"]