Claude Skill

adapter-drift-audit

Use when checking whether an IronLint adapter still matches its coding harness's current contract — auditing adapter/harness drift, verifying hook payload shapes, plugin manifest schemas, lifecycle events, or tool names are up to date, or doing periodic adapter maintenance. Takes

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

Full trust report

Download ironlint-ironlint-.agents_skills_adapter-drift-audit-35c7cfc.zip · 4 KB
Part of ironlint/ironlint — 5 skills

Install

skills CLI npx skills add https://github.com/ironlint/ironlint/tree/main/.agents/skills/adapter-drift-audit
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ironlint-ironlint@llmmart
Git git clone https://github.com/ironlint/ironlint.git

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

Skill manifest

Adapter Drift Audit

Audit an IronLint adapter against its coding harness's current contract and report drift.

Read-only. You produce findings and recommendations. You do NOT edit adapter files, you do NOT write the watermark, and you do NOT audit ironlint core. The maintainer reads the report and decides what to change.

When to use

  • "Is the claude-code adapter still up to date with Claude Code's hooks?"
  • Periodic adapter maintenance / contract-drift sweeps.
  • After a harness ships a new version and you want to know what the adapter missed.

Inputs

A harness name as the invocation argument: claude-code, codex, pi, or opencode. Each maps to references/<harness>.md. Only harnesses with a reference file can be audited.

Codex specifics

Codex is a PreToolUse-hook harness like claude-code, but its own docs frame the hook as a guardrail, not a hard enforcement boundary — factor that into impact judgments (a codex drift degrades a guardrail; the same drift on claude-code degrades the enforcement point itself).

  • Doc sources: developers.openai.com/codex/hooks (hooks reference) and the codex-rs/hooks/ source tree (ground truth for the exit/JSON decision contract — re-audit for the selected version; current implementation details are in adapters/codex/README.md).
  • Re-verify first: the tool_input.command apply_patch envelope shape (*** Begin Patch / *** Add File: / *** Update File: / *** Delete File: / *** End Patch) that adapters/codex/hooks/hook.sh's python3 parser depends on. This is the single most drift-prone contract in the codex adapter — the parser fails closed (deny) on an envelope it doesn't recognize, so drift here surfaces as edits getting wrongly blocked rather than silently let through, but it's still the first thing to re-check.

Procedure

0. Resolve target

Read the invocation argument as the harness name. Load references/<harness>.md. If no argument was given, list the harnesses that have a reference file under references/ and stop — ask which one.

1. Read the watermark

The reference's Watermark section gives the baseline version / changelog date the adapter was last verified against. Note it; it scopes the changelog read in step 2.

2. Fetch current truth

For each entry in the reference's Doc sources, in this order:

  1. Context7 first (repo + global convention). The reference's Doc sources pin exact library IDs (/websites/code_claude, /anthropics/claude-code), so skip resolve-library-id — the global "always resolve first" rule doesn't apply when the ID is already known. Call query-docs directly on each pinned ID for the contracts under audit.
  2. GitHub CHANGELOG.md since the watermark — the primary signal for what changed. Fetch the changelog and read entries newer than the watermark.
  3. Web docs — fallback / cross-check for any contract Context7 didn't cover.

If a source is unreachable, note it; the affected contracts become ❓ unverifiable in the report rather than silently ✅.

3. Compare each contract

For every row in the reference's Contract surface map: read the cited adapter file:line, compare it to the fetched truth, and classify:

  • ✅ in-sync — adapter matches the current contract.
  • ⚠️ drift — the contract changed; the adapter is stale.
  • ❓ unverifiable — couldn't fetch authoritative truth this run (say which source failed).
  • ✨ new-capability-not-adopted — the harness now offers something relevant the adapter doesn't use. A best-practice gap, not a bug.

Re-read the adapter file rather than trusting the line number — anchors drift as the adapter changes.

4. Emit the report

Use the Report format below exactly.

5. Propose a watermark bump

Print the suggested new Last verified line under a Proposed watermark heading. Do NOT write it into the reference file — the maintainer updates it when they act on the report. This keeps the audit read-only.

Report format

# Adapter drift audit — <harness> (<date>)
Baseline: <watermark>   Current: <version / changelog date observed>

## Drift (⚠️)
- [contract #N: <name>] <adapter file:line>
  now: <current-truth summary>   (source: <doc link / Context7 id>)
  was: <what the adapter assumes>
  recommend: <concrete change>

## New capabilities not adopted (✨)
- <name> — <what it enables> (source: …) — adapter still correct.

## Unverifiable (❓)
- [contract #N] <which source was unreachable>

## In sync (✅)
- <contract #N>, <contract #M>, …

## Proposed watermark
Last verified: <date> against <harness> <version> (changelog entry: <ref>)

Rules

  • Read-only: never edit adapter files or the watermark; only report.
  • Context7 first for schema shape; GitHub CHANGELOG.md is canonical for what changed and when.
  • Impact over difference: use the reference's Thesis to judge whether a drift actually breaks gating, or is cosmetic.
  • No silent ✅: a contract you couldn't verify is ❓, not ✅.
  • Omit empty sections (⚠️ / ✨ / ❓) from the report; always show the ✅ summary and the Proposed watermark.
Files (ironlint)
  • references
    • claude-code.md 5 KB
      # Claude Code — harness intel
      
      Reference for `adapter-drift-audit claude-code`. Audits `adapters/claude-code/` against Claude Code's current contract.
      
      ## Thesis
      
      Claude Code is Anthropic's agentic terminal coding tool. Its integration surface, as the adapter uses it:
      
      - **Lifecycle hooks** fire on named events; a hook is a shell command registered in `hooks.json`. The adapter wires `PostToolUse` (gate each edit), `Stop` (session check), and `SessionStart` (clear stale state).
      - **Hooks communicate by exit code + structured JSON stdout.** Exit `2` = block (stderr is fed back to the agent); exit `0` = allow. A hook can also print a `hookSpecificOutput` JSON object to inject `additionalContext` into the next turn — this is how subagent mode defers semantic evaluation.
      - **Plugins** bundle hooks, skills, agents, slash-commands, and MCP servers behind a `.claude-plugin/plugin.json` manifest. `CLAUDE_PLUGIN_ROOT` is injected at hook-fire time so commands resolve regardless of install path.
      - **Two model paths**: direct-API (`llm.provider` is an API-keyed provider; the hook calls the LLM itself) vs. subscription subagent (`provider: claude-code-subagent`; the hook emits a deferred payload and a subagent evaluates it next turn, billing under the parent subscription).
      
      Use this to judge a drift's *impact*: a renamed hook-payload field silently breaks gating (high impact); a new optional manifest key the adapter ignores is cosmetic.
      
      ## Doc sources
      
      | Source | Use for | Pointer |
      |---|---|---|
      | Context7 (primary) | Reference schemas: hooks, plugins, skills, sub-agents, settings | `/websites/code_claude` |
      | Context7 (versioned) | Release notes pinned to a CLI version | `/anthropics/claude-code` (e.g. `v2.1.89`) |
      | GitHub (drift signal) | `CHANGELOG.md` since the watermark; published plugin examples | `anthropics/claude-code` |
      | Web (fallback) | Cross-check any contract Context7 missed | `docs.claude.com/en/docs/claude-code/{hooks,plugins,skills,sub-agents,settings,slash-commands}` |
      
      Authority: for *schema shape*, prefer `/websites/code_claude` and the web hooks/plugins reference. For *what changed and when*, the GitHub `CHANGELOG.md` is canonical.
      
      ## Contract surface map
      
      Grounded in `adapters/claude-code/` as of 2026-05-28. Line numbers are anchors — re-read the file; they speed location but may shift.
      
      | # | Harness contract | Adapter consumer | Verify against |
      |---|---|---|---|
      | 1 | Hook event names `PostToolUse` / `SessionStart` / `Stop` | `adapters/claude-code/hooks/hooks.json` | hooks reference |
      | 2 | Matcher syntax + file-mutating tool set (`Edit\|Write`) | `adapters/claude-code/hooks/hooks.json:5` | hooks + tool reference (watch for new mutating tools, e.g. `MultiEdit` / `NotebookEdit`) |
      | 3 | `CLAUDE_PLUGIN_ROOT` injection at hook-fire time | `adapters/claude-code/hooks/hooks.json:9,19,29` | hooks reference |
      | 4 | **Hook stdin payload** — `tool_input.file_path` / `.path` / `.old_string` / `.new_string` / `.content` | `adapters/claude-code/hooks/hook.sh:131,154-155` | hooks reference — **most drift-prone**; field renames silently break gating |
      | 5 | Hook decision contract: exit `2` = block, `0` = allow | `adapters/claude-code/hooks/hook.sh` (all case arms) | hooks reference |
      | 6 | Output envelope `hookSpecificOutput.{hookEventName,additionalContext}` | `adapters/claude-code/hooks/hook.sh:68-73,190-195` | hooks reference |
      | 7 | Plugin manifest schema + location `.claude-plugin/plugin.json` | `adapters/claude-code/.claude-plugin/plugin.json` | plugins reference |
      | 8 | Skill `SKILL.md` frontmatter + description-based activation | `adapters/claude-code/skills/*/SKILL.md` | skills reference |
      | 9 | Subagent frontmatter (`name`/`description`/`model`/`tools`/`color`) | `adapters/claude-code/agents/ironlint-evaluator.md:1-7` | sub-agents reference |
      | 10 | Per-dispatch subagent model override (does inline override exist yet?) | `adapters/claude-code/README.md:55-65` (flagged unresolved) | sub-agents reference |
      
      ## Known-fragile spots
      
      Scrutinize these every run — most likely to have moved:
      
      - **Hook stdin field names (#4).** `hook.sh` reads `.tool_input.file_path // .tool_input.path` and `.old_string // .new_string // .content`. A rename or restructure of the `PostToolUse` event payload breaks file extraction with no error — the hook exits 0 and gates nothing.
      - **File-mutating tool set (#2).** The matcher is `Edit|Write`. A new mutating tool means edits via it bypass the gate entirely.
      - **Output envelope (#6).** Subagent mode depends on `hookSpecificOutput.additionalContext` reaching the next turn. If the key or injection semantics change, deferred semantic evaluation silently stops.
      - **Per-dispatch model override (#10).** README:55-65 documents `evaluator_model` as *advisory only* because Claude Code's subagent dispatch did not accept a per-call model override at write time. If that capability ships, flag it ✨ — the adapter can stop treating `evaluator_model` as a hint.
      
      ## Watermark
      
      Last verified: 2026-05-28 against Claude Code v2.1.89 (initial baseline — not yet audited)
      
  • SKILL.md 5.5 KB
    ---
    name: adapter-drift-audit
    description: Use when checking whether an IronLint adapter still matches its coding harness's current contract — auditing adapter/harness drift, verifying hook payload shapes, plugin manifest schemas, lifecycle events, or tool names are up to date, or doing periodic adapter maintenance. Takes a harness name (claude-code, codex, pi, opencode) as argument.
    ---
    
    # Adapter Drift Audit
    
    Audit an IronLint adapter against its coding harness's **current** contract and report drift.
    
    **Read-only.** You produce findings and recommendations. You do NOT edit adapter files, you do NOT write the watermark, and you do NOT audit `ironlint` core. The maintainer reads the report and decides what to change.
    
    ## When to use
    
    - "Is the claude-code adapter still up to date with Claude Code's hooks?"
    - Periodic adapter maintenance / contract-drift sweeps.
    - After a harness ships a new version and you want to know what the adapter missed.
    
    ## Inputs
    
    A harness name as the invocation argument: `claude-code`, `codex`, `pi`, or `opencode`. Each maps to `references/<harness>.md`. Only harnesses with a reference file can be audited.
    
    ### Codex specifics
    
    Codex is a `PreToolUse`-hook harness like claude-code, but its own docs frame the hook as a *guardrail*, not a hard enforcement boundary — factor that into impact judgments (a codex drift degrades a guardrail; the same drift on claude-code degrades the enforcement point itself).
    
    - **Doc sources**: `developers.openai.com/codex/hooks` (hooks reference) and the `codex-rs/hooks/` source tree (ground truth for the exit/JSON decision contract — re-audit for the selected version; current implementation details are in `adapters/codex/README.md`).
    - **Re-verify first**: the `tool_input.command` `apply_patch` envelope shape (`*** Begin Patch` / `*** Add File:` / `*** Update File:` / `*** Delete File:` / `*** End Patch`) that `adapters/codex/hooks/hook.sh`'s python3 parser depends on. This is the single most drift-prone contract in the codex adapter — the parser fails closed (deny) on an envelope it doesn't recognize, so drift here surfaces as edits getting wrongly blocked rather than silently let through, but it's still the first thing to re-check.
    
    ## Procedure
    
    ### 0. Resolve target
    
    Read the invocation argument as the harness name. Load `references/<harness>.md`. If no argument was given, list the harnesses that have a reference file under `references/` and stop — ask which one.
    
    ### 1. Read the watermark
    
    The reference's **Watermark** section gives the baseline version / changelog date the adapter was last verified against. Note it; it scopes the changelog read in step 2.
    
    ### 2. Fetch current truth
    
    For each entry in the reference's **Doc sources**, in this order:
    
    1. **Context7 first** (repo + global convention). The reference's **Doc sources** pin exact library IDs (`/websites/code_claude`, `/anthropics/claude-code`), so skip `resolve-library-id` — the global "always resolve first" rule doesn't apply when the ID is already known. Call `query-docs` directly on each pinned ID for the contracts under audit.
    2. **GitHub `CHANGELOG.md` since the watermark** — the primary signal for *what changed*. Fetch the changelog and read entries newer than the watermark.
    3. **Web docs** — fallback / cross-check for any contract Context7 didn't cover.
    
    If a source is unreachable, note it; the affected contracts become ❓ unverifiable in the report rather than silently ✅.
    
    ### 3. Compare each contract
    
    For every row in the reference's **Contract surface map**: read the cited adapter `file:line`, compare it to the fetched truth, and classify:
    
    - ✅ **in-sync** — adapter matches the current contract.
    - ⚠️ **drift** — the contract changed; the adapter is stale.
    - ❓ **unverifiable** — couldn't fetch authoritative truth this run (say which source failed).
    - ✨ **new-capability-not-adopted** — the harness now offers something relevant the adapter doesn't use. A best-practice gap, not a bug.
    
    Re-read the adapter file rather than trusting the line number — anchors drift as the adapter changes.
    
    ### 4. Emit the report
    
    Use the **Report format** below exactly.
    
    ### 5. Propose a watermark bump
    
    Print the suggested new `Last verified` line under a **Proposed watermark** heading. Do NOT write it into the reference file — the maintainer updates it when they act on the report. This keeps the audit read-only.
    
    ## Report format
    
    ```
    # Adapter drift audit — <harness> (<date>)
    Baseline: <watermark>   Current: <version / changelog date observed>
    
    ## Drift (⚠️)
    - [contract #N: <name>] <adapter file:line>
      now: <current-truth summary>   (source: <doc link / Context7 id>)
      was: <what the adapter assumes>
      recommend: <concrete change>
    
    ## New capabilities not adopted (✨)
    - <name> — <what it enables> (source: …) — adapter still correct.
    
    ## Unverifiable (❓)
    - [contract #N] <which source was unreachable>
    
    ## In sync (✅)
    - <contract #N>, <contract #M>, …
    
    ## Proposed watermark
    Last verified: <date> against <harness> <version> (changelog entry: <ref>)
    ```
    
    ## Rules
    
    - **Read-only**: never edit adapter files or the watermark; only report.
    - **Context7 first** for schema shape; **GitHub `CHANGELOG.md`** is canonical for *what changed and when*.
    - **Impact over difference**: use the reference's Thesis to judge whether a drift actually breaks gating, or is cosmetic.
    - **No silent ✅**: a contract you couldn't verify is ❓, not ✅.
    - **Omit empty sections** (⚠️ / ✨ / ❓) from the report; always show the ✅ summary and the Proposed watermark.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related