← ClaudeAtlas

pi-tool-repair-integrationlisted

Build or wrap tools in a pi coding-agent extension using @r3b1s/pi-repair-layer's adaptToolDefinition and the optional-dependency fallback pattern. Use when authoring a pi extension that registers tools, when adding argument repair (aliases, envelope recovery, schema-guided fixes) to an extension-owned tool, or when deciding whether pi-repair-layer should be a hard or optional dependency. Triggers on pi extensions, registerTool, prepareArguments, tool-call repair, or pi-repair-layer integration tasks.
r3b1s/pi-dev-skills · ★ 1 · AI & Automation · score 65
Install: claude install-skill r3b1s/pi-dev-skills
# pi Tool Repair Integration Integrate `@r3b1s/pi-repair-layer` into a pi extension's own tools so malformed model arguments (`{file_path: "/x"}` instead of `{path: "/x"}`, stringified JSON, stray `null`s) are repaired before pi validation — without forcing every downstream user to install the repair layer. Verified baselines: package `^0.3.0`, Node 22+, pi 0.80.6 (probed through 0.80.10). ## The ownership boundary (read first) pi runs `prepareArguments → validation → tool_call → execute`. Arguments that fail validation never reach `tool_call`, so repair must run in `prepareArguments` — and only the extension that owns a tool definition can install that hook. Installing pi-repair-layer repairs pi's *built-in* tools only; it never discovers or wraps tools registered by other extensions. Your extension must opt in per tool. Never attempt to wrap another extension's tools. ## Step 1 — Choose the dependency posture | Posture | When | How | | --- | --- | --- | | **Optional (default for standalone extensions)** | The tool works fine unwrapped; repairs are an enhancement | Fallback recipe below; package stays out of runtime deps | | Hard dependency | The tool relies on repair behavior (e.g. legacy-shape migration via preprocessors) | `pnpm add @r3b1s/pi-repair-layer`; import statically | The optional posture turns "also install pi-repair-layer" into an end-user opt-in: pi installs all `npm:` extensions into one shared `node_modules` per scope, so a user who runs `pi install n