[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AX9HWAD45YSH77FFF156PG":3,"skill-same:01M7AX9HWAD45YSH77FFF156PG":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7AX9HWAD45YSH77FFF156PG","harness-capture",null,"Capture real harness behavior before implementing against it. Use when adding or changing any claim about Claude Code, Codex, or OpenCode — hook payload fields, tool argument shapes (ShellShapes, FileShapes, toolmap, tool.shell, tool.file), which tools a harness advertises, whether a wire channel (updatedInput, systemMessage) is honoured, which interpreter or shell dialect a shell tool runs (.capture\u002Fshell-dialects), whether a harness loads another harness's files (`.claude\u002Fsettings.json`, `.claude\u002Fskills`, `.mcp.json`) — or when adding fixtures under fixtures\u002F\u003Charness>\u002F, editing a provenance README, working in .capture\u002F (including .capture\u002Ffile-tools), or verifying an adapter claim live.","roryeckel\u002Fhooknostic","roryeckel","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16675082?v=4","01M7AX8JWEFHND7P2G338X0TQW","Rory","01M7AX8JX2FGW3TMBVSGFAPQD2",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fharness-capture\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: harness-capture\ndescription: Capture real harness behavior before implementing against it. Use when adding or changing any claim about Claude Code, Codex, or OpenCode — hook payload fields, tool argument shapes (ShellShapes, FileShapes, toolmap, tool.shell, tool.file), which tools a harness advertises, whether a wire channel (updatedInput, systemMessage) is honoured, which interpreter or shell dialect a shell tool runs (.capture\u002Fshell-dialects), whether a harness loads another harness's files (`.claude\u002Fsettings.json`, `.claude\u002Fskills`, `.mcp.json`) — or when adding fixtures under fixtures\u002F\u003Charness>\u002F, editing a provenance README, working in .capture\u002F (including .capture\u002Ffile-tools), or verifying an adapter claim live.\n---\n\n# Harness capture\n\nThe repository's core discipline: **capture first, then implement.** Every\nadapter claim points at evidence, and the evidence class is recorded. The\npilot port found four doc-drift defects in one pass that only capture\nrevealed; the one guess that slipped through (a tool argument key) produced a\nguard that compiled clean and silently allowed a whole harness's shell calls.\n\n## Provenance classes (record one per fixture, in that directory's README)\n\n| Class | Meaning | Trust |\n|---|---|---|\n| **captured** | Verbatim payload from a live harness session, with version and date | Full |\n| schema-derived | Built from wire schemas extracted from the harness binary | Shape only, not behavior |\n| doc-derived | From vendor docs | Weakest — docs drift; three adapters found doc drift only capture revealed |\n| constructed | Assembled (e.g. log-derived args in a schema-derived envelope) | Say exactly what was observed and what was not |\n\nUpgrading a claim's provenance (doc-derived → captured) is always worth a\ncommit. Downgrading one honestly (a \"capture\" that turns out constructed) is\nworth more.\n\n## Per-harness recipes\n\nEach `.capture\u002F\u003Charness>\u002FREADME.md` is authoritative; the short version:\n\n- **Claude Code** — `.capture\u002Fclaude` is a teeing project (every hook appends\n  stdin to `captured\u002F\u003CEvent>.jsonl`). Drive it headless:\n  `claude -p \"\u003Cprompt>\" --model sonnet --dangerously-skip-permissions` from\n  that directory. Hook payloads carry the tool input **verbatim**, so a tool\n  capture is just a PreToolUse capture.\n- **Codex** — `.capture\u002Fcodex` is the teeing project. Gotchas that have each\n  cost a session: repo-level `.codex\u002Fhooks.json` loads only in **trusted**\n  projects (untrusted → hooks silently don't fire, no error); trust is\n  per-entry (hash in `~\u002F.codex\u002Fconfig.toml`), and an edited entry needs\n  `--dangerously-bypass-hook-trust`; on Windows,\n  `[windows] sandbox = \"unelevated\"` must be set or every spawn is policy-\n  rejected — and the harness may still *report success*; `codex exec` reads\n  its prompt but hangs without stdin EOF (`\u003C \u002Fdev\u002Fnull`). Tool arguments are\n  also visible one level below hooks via\n  `RUST_LOG=codex_core=debug codex exec …` — the router logs `ToolCall:` and\n  the exact spawned command line *before* sandbox rejection, which makes both\n  tool-args capture and write-path verification possible in a restricted\n  environment (`.capture\u002Fcodex-tools\u002FREADME.md`).\n- **OpenCode** — in-process: a capture plugin receives live objects\n  (`.capture\u002Fopencode*`). Behavioral facts (in-place args mutation, event\n  timing) must be observed on live objects, not inferred from types. The\n  advertised tool set depends on the model id (a GPT-like id swaps\n  `edit`\u002F`write` for a patch tool), so discover under more than one id.\n\n**Tool-argument captures need no model spend.** `.capture\u002Ffile-tools\u002Fdrive.mjs`\nruns the real binary against the loopback playback model, discovers the\nadvertised tools and their live argument keys, and scripts one call per case\n(`TurnAction.arguments`, or `freeformInput` for a grammar tool like Codex's\n`apply_patch`). The hook payload is **captured**; say in the provenance row\nthat the argument *values* were scripted. Its README is the worked example.\n\n**A payload cannot show which interpreter ran.** A shell tool's grammar is\nestablished by the process that executed the command, observed under each host\nconfiguration that could change it, and compared with whatever the harness\nstates about its shell. `.capture\u002Fshell-dialects` is the procedure: process\nancestry on three platforms, a host-configuration comparison, a per-build mode,\nand fixture promotion. Its Linux half ran in a container as an unprivileged\naccount. Give any scratch `npm install` an explicit `--prefix`: without one\nnpm installs into the nearest ancestor that has a `package.json`.\n\n**Probe foreign reads in both directions.** A harness may load another\nharness's project files as a compatibility feature, and then run that target's\noutput in a form it only approximates (ADR-0033). For each foreign location,\nput a marker entry in a scratch project and observe whether it runs. Then try\nan opt-out key on the reader, and capture the owning harness with the same key.\nBoth halves are required, and each is observed by effect: the reader skips it,\nand the owner still runs it with the rest of the file applied. Startup events\nsuch as `SessionStart` fire before any model request, so these probes need no\ncredential. The worked pair is `.capture\u002Fcopilot\u002Fclaude-settings-probe.sh`\n(reader) and `claude-tolerance-probe.mjs` (owner).\n\n## The router\u002Fhook-boundary distinction (Codex)\n\nThe shape a harness uses internally is **not** necessarily the shape hooks\nreceive: Codex 0.151 routes `exec_command {cmd, workdir}` but presents the\nhook a translated `Bash {command}` payload with `workdir` dropped. So: a\nrouter-log capture is evidence about the router, a hook capture is evidence\nabout the hook boundary, and only the latter is what adapters decode. File\nthem as different provenance.\n\n## Verify effects by effect, never by harness output\n\nCodex prints `hook: \u003CEvent> Completed` for hooks it skipped. To prove a write\nchannel is honoured, make the effect observable: rewrite a command to one that\nwrites a marker file, or read the spawned command line from the debug log.\n\"The harness didn't complain\" is not evidence.\n\n## Where results land\n\n1. `fixtures\u002F\u003Charness>\u002F\u003Cversion>\u002F\u003Ccase>.{input,canonical}.json` + a provenance\n   row in that directory's README. Canonical = decode result minus `raw`.\n   **Redact the capturing account name to `user` before committing** — this is\n   a public repository and every payload carries a home directory. Redact only\n   that segment: the drive letter, backslash escaping, and any derived form\n   (Claude's mangled `C--Users-user-…` project directory) stay intact and\n   mutually consistent, because path *shape* is evidence. Input and canonical\n   must move together. The README's redaction note already covers it; say so\n   again only if you redact something new.\n2. Wire the case into the adapter's `decode.test.ts` list; the testkit\n   contract suite picks up shell- and file-bearing fixtures automatically\n   (codec obligations, and every table entry needs such a fixture).\n3. Shape claims go in the adapter's `toolmap.ts` `ShellShapes` or\n   `FileShapes` table (ADR-0007, ADR-0026) with a comment naming the fixture. **A tool whose shape you have no evidence for\n   stays absent from the table** — absence is the documented fall-back\n   signal. One carved exception: router-log provenance (a shape observed one\n   level below the hook boundary, never in a hook payload) is admissible as\n   *defensive* coverage — reading the wrong-but-real keys is harmless, and\n   dropping a security-relevant entry on the strength of not having seen it\n   is the wrong direction — but the entry's comment and its fixture's\n   provenance row must both say so (see Codex `exec_command`, ADR-0007).\n4. A novel *procedure* (not just a payload) gets its own `.capture\u002F\u003Cname>\u002F`\n   directory with a README recording question, method, observation, and\n   consequences.\n5. **Append a `ValidationRecord`** to the relevant profile's\n   `source.validatedOn` (`packages\u002Fadapter-*\u002Fsrc\u002Fprofile.ts`): version, date,\n   method (the classes above map one-to-one), evidence path, and one line of\n   what the session established. The contract suite requires the record's\n   version to fall inside a profile range, and `doctor`\u002F`inspect`\u002Fthe\n   generated `docs\u002Fharness-support.md` all read it -- a capture session that\n   skips this step is invisible to every consumer surface. Then rerun\n   `node scripts\u002Fgenerate-harness-support.mjs`. **One exception to\n   append-only**: the marker-delimited scheduled-playback region in each\n   profile holds a single rolling record that\n   `scripts\u002Frecord-playback-validation.mjs` rewrites in place — never edit it\n   by hand; the policy is ADR-0009.\n6. Never name downstream consumers in capture records (see `AGENTS.md`).\n","# Harness capture\n\nThe repository's core discipline: **capture first, then implement.** Every\nadapter claim points at evidence, and the evidence class is recorded. The\npilot port found four doc-drift defects in one pass that only capture\nrevealed; the one guess that slipped through (a tool argument key) produced a\nguard that compiled clean and silently allowed a whole harness's shell calls.\n\n## Provenance classes (record one per fixture, in that directory's README)\n\n| Class | Meaning | Trust |\n|---|---|---|\n| **captured** | Verbatim payload from a live harness session, with version and date | Full |\n| schema-derived | Built from wire schemas extracted from the harness binary | Shape only, not behavior |\n| doc-derived | From vendor docs | Weakest — docs drift; three adapters found doc drift only capture revealed |\n| constructed | Assembled (e.g. log-derived args in a schema-derived envelope) | Say exactly what was observed and what was not |\n\nUpgrading a claim's provenance (doc-derived → captured) is always worth a\ncommit. Downgrading one honestly (a \"capture\" that turns out constructed) is\nworth more.\n\n## Per-harness recipes\n\nEach `.capture\u002F\u003Charness>\u002FREADME.md` is authoritative; the short version:\n\n- **Claude Code** — `.capture\u002Fclaude` is a teeing project (every hook appends\n  stdin to `captured\u002F\u003CEvent>.jsonl`). Drive it headless:\n  `claude -p \"\u003Cprompt>\" --model sonnet --dangerously-skip-permissions` from\n  that directory. Hook payloads carry the tool input **verbatim**, so a tool\n  capture is just a PreToolUse capture.\n- **Codex** — `.capture\u002Fcodex` is the teeing project. Gotchas that have each\n  cost a session: repo-level `.codex\u002Fhooks.json` loads only in **trusted**\n  projects (untrusted → hooks silently don't fire, no error); trust is\n  per-entry (hash in `~\u002F.codex\u002Fconfig.toml`), and an edited entry needs\n  `--dangerously-bypass-hook-trust`; on Windows,\n  `[windows] sandbox = \"unelevated\"` must be set or every spawn is policy-\n  rejected — and the harness may still *report success*; `codex exec` reads\n  its prompt but hangs without stdin EOF (`\u003C \u002Fdev\u002Fnull`). Tool arguments are\n  also visible one level below hooks via\n  `RUST_LOG=codex_core=debug codex exec …` — the router logs `ToolCall:` and\n  the exact spawned command line *before* sandbox rejection, which makes both\n  tool-args capture and write-path verification possible in a restricted\n  environment (`.capture\u002Fcodex-tools\u002FREADME.md`).\n- **OpenCode** — in-process: a capture plugin receives live objects\n  (`.capture\u002Fopencode*`). Behavioral facts (in-place args mutation, event\n  timing) must be observed on live objects, not inferred from types. The\n  advertised tool set depends on the model id (a GPT-like id swaps\n  `edit`\u002F`write` for a patch tool), so discover under more than one id.\n\n**Tool-argument captures need no model spend.** `.capture\u002Ffile-tools\u002Fdrive.mjs`\nruns the real binary against the loopback playback model, discovers the\nadvertised tools and their live argument keys, and scripts one call per case\n(`TurnAction.arguments`, or `freeformInput` for a grammar tool like Codex's\n`apply_patch`). The hook payload is **captured**; say in the provenance row\nthat the argument *values* were scripted. Its README is the worked example.\n\n**A payload cannot show which interpreter ran.** A shell tool's grammar is\nestablished by the process that executed the command, observed under each host\nconfiguration that could change it, and compared with whatever the harness\nstates about its shell. `.capture\u002Fshell-dialects` is the procedure: process\nancestry on three platforms, a host-configuration comparison, a per-build mode,\nand fixture promotion. Its Linux half ran in a container as an unprivileged\naccount. Give any scratch `npm install` an explicit `--prefix`: without one\nnpm installs into the nearest ancestor that has a `package.json`.\n\n**Probe foreign reads in both directions.** A harness may load another\nharness's project files as a compatibility feature, and then run that target's\noutput in a form it only approximates (ADR-0033). For each foreign location,\nput a marker entry in a scratch project and observe whether it runs. Then try\nan opt-out key on the reader, and capture the owning harness with the same key.\nBoth halves are required, and each is observed by effect: the reader skips it,\nand the owner still runs it with the rest of the file applied. Startup events\nsuch as `SessionStart` fire before any model request, so these probes need no\ncredential. The worked pair is `.capture\u002Fcopilot\u002Fclaude-settings-probe.sh`\n(reader) and `claude-tolerance-probe.mjs` (owner).\n\n## The router\u002Fhook-boundary distinction (Codex)\n\nThe shape a harness uses internally is **not** necessarily the shape hooks\nreceive: Codex 0.151 routes `exec_command {cmd, workdir}` but presents the\nhook a translated `Bash {command}` payload with `workdir` dropped. So: a\nrouter-log capture is evidence about the router, a hook capture is evidence\nabout the hook boundary, and only the latter is what adapters decode. File\nthem as different provenance.\n\n## Verify effects by effect, never by harness output\n\nCodex prints `hook: \u003CEvent> Completed` for hooks it skipped. To prove a write\nchannel is honoured, make the effect observable: rewrite a command to one that\nwrites a marker file, or read the spawned command line from the debug log.\n\"The harness didn't complain\" is not evidence.\n\n## Where results land\n\n1. `fixtures\u002F\u003Charness>\u002F\u003Cversion>\u002F\u003Ccase>.{input,canonical}.json` + a provenance\n   row in that directory's README. Canonical = decode result minus `raw`.\n   **Redact the capturing account name to `user` before committing** — this is\n   a public repository and every payload carries a home directory. Redact only\n   that segment: the drive letter, backslash escaping, and any derived form\n   (Claude's mangled `C--Users-user-…` project directory) stay intact and\n   mutually consistent, because path *shape* is evidence. Input and canonical\n   must move together. The README's redaction note already covers it; say so\n   again only if you redact something new.\n2. Wire the case into the adapter's `decode.test.ts` list; the testkit\n   contract suite picks up shell- and file-bearing fixtures automatically\n   (codec obligations, and every table entry needs such a fixture).\n3. Shape claims go in the adapter's `toolmap.ts` `ShellShapes` or\n   `FileShapes` table (ADR-0007, ADR-0026) with a comment naming the fixture. **A tool whose shape you have no evidence for\n   stays absent from the table** — absence is the documented fall-back\n   signal. One carved exception: router-log provenance (a shape observed one\n   level below the hook boundary, never in a hook payload) is admissible as\n   *defensive* coverage — reading the wrong-but-real keys is harmless, and\n   dropping a security-relevant entry on the strength of not having seen it\n   is the wrong direction — but the entry's comment and its fixture's\n   provenance row must both say so (see Codex `exec_command`, ADR-0007).\n4. A novel *procedure* (not just a payload) gets its own `.capture\u002F\u003Cname>\u002F`\n   directory with a README recording question, method, observation, and\n   consequences.\n5. **Append a `ValidationRecord`** to the relevant profile's\n   `source.validatedOn` (`packages\u002Fadapter-*\u002Fsrc\u002Fprofile.ts`): version, date,\n   method (the classes above map one-to-one), evidence path, and one line of\n   what the session established. The contract suite requires the record's\n   version to fall inside a profile range, and `doctor`\u002F`inspect`\u002Fthe\n   generated `docs\u002Fharness-support.md` all read it -- a capture session that\n   skips this step is invisible to every consumer surface. Then rerun\n   `node scripts\u002Fgenerate-harness-support.mjs`. **One exception to\n   append-only**: the marker-delimited scheduled-playback region in each\n   profile holds a single rolling record that\n   `scripts\u002Frecord-playback-validation.mjs` rewrites in place — never edit it\n   by hand; the policy is ADR-0009.\n6. Never name downstream consumers in capture records (see `AGENTS.md`).\n",{"name":5,"description":7},"master","b8669236433862d74703a9a146bf1373f9b0b209",".agents\u002Fskills\u002Fharness-capture",0,"https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic","https:\u002F\u002Fgithub.com\u002Froryeckel","https:\u002F\u002F2labz.com","I write a lot of software and delegate the rest to LLMs","2026-11-15 04:44:54",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add roryeckel\u002Fhooknostic --skill harness-capture",{"tool":39,"command":40},"bunx","bunx skills add roryeckel\u002Fhooknostic --skill harness-capture",{"tool":42,"command":43},"pnpm","pnpm dlx skills add roryeckel\u002Fhooknostic --skill harness-capture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fharness-capture\u002FSKILL.md",true,[],[48,55,60,65,70,77],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7AXANW27HCE8N4ZD2H8GZG5","sample","Explain the synthetic sample project.","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002Fexamples\u002Flocal-project\u002Fskills\u002Fsample\u002FSKILL.md",[],[],{"skillNo":56,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7AXAKKRACEVMN7CZ44ZC6A1","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002Fexamples\u002Flocal-project\u002F.pi\u002Fskills\u002Fsample\u002FSKILL.md",[],[],{"skillNo":61,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7AXAJEYX4DKRCRBSNPM7J09","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002Fexamples\u002Flocal-project\u002F.claude\u002Fskills\u002Fsample\u002FSKILL.md",[],[],{"skillNo":66,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7AXAFPMXR8EJM4D2Z1WKBH2","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002Fexamples\u002Flocal-project\u002F.agents\u002Fskills\u002Fsample\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AXADDP9ASKQBVG8T8KE3XV","greet","Greet the user by name and summarize the repo state.","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002Fexamples\u002Fagent-plugin\u002Fskills\u002Fgreet\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AXAC2V6M2XGEEBAPARQA4R","where","Reports where this skill lives. Use when asked where the probe skill is.","https:\u002F\u002Fgithub.com\u002Froryeckel\u002Fhooknostic\u002Fblob\u002Fmaster\u002F.capture\u002Fskill-directory\u002FSKILL.md",[],[]]