patch-md

A system for packaging and managing versioned PATCH.md changes. Each package describes its purpose and scope, includes a machine-readable manifest, and uses scripts to apply, check, or undo changes safely.

In plain words
What is it for?
Use it to create or migrate a patch, inspect its status, plan or apply it, verify the result, roll it back, or reapply it elsewhere.
Why use it?
It helps changes remain repeatable across machines and detects when the files or package layout have drifted from what the patch expects.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/firstp1ck/pi-coding-agent-forge/patch-md
Any agent
npx skills add Firstp1ck/pi-coding-agent-forge --skill patch-md
Clone the repo
git clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forge

Made for: Claude Code, Codex.

Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,191 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.01191
Opus 5 $0.00023 $0.00596
Sonnet 5 $0.00009 $0.00238
Haiku 4.5 $0.00005 $0.00119

Measured 2d ago against content hash e187c9ab11e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

patch-md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/main_module.mjs, scripts/patch_md_extract.mjs, scripts/patchctl.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pi-skill-patch-md/skills/patch-md/SKILL.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Patch MD Skill

When to Use

Use this skill to:

  • create or update a patch package;
  • migrate a legacy prose-only PATCH.md to schema v2;
  • inspect patch status after package updates;
  • plan, apply, verify, or roll back a patch;
  • reapply a patch across machines or package layouts.

Required v2 Artifact

A trusted patch package contains:

PATCH.md
patch.manifest.json
scripts/<lifecycle-handler>.mjs

Tests and fixtures are required for package-version or layout-dependent patches.

  • PATCH.md explains intent, scope, transformations, verification, rollback, and limitations.
  • patch.manifest.json is the machine-readable source of truth.
  • The lifecycle handler discovers actual runtimes and implements semantic, idempotent transformations.

Use PATCH-TEMPLATE.md, TOOL-CALL-SPEC.md, and patch-manifest-v2.schema.json.

Lifecycle Commands

Resolve paths relative to this skill directory:

node ./scripts/patch_md_extract.mjs --patch /path/to/PATCH.md --strict
node ./scripts/patchctl.mjs status --patch /path/to/PATCH.md
node ./scripts/patchctl.mjs plan --patch /path/to/PATCH.md
node ./scripts/patchctl.mjs apply --patch /path/to/PATCH.md --plan-hash <reviewed-hash>
node ./scripts/patchctl.mjs verify --patch /path/to/PATCH.md
node ./scripts/patchctl.mjs rollback --patch /path/to/PATCH.md --confirm

Workflow

Choose the lifecycle mode below from the user's request and current patch state. Always enter through strict extraction, use read-only status/plan before mutation, and finish with verification or an explicit blocker report.

Mode A — Create or Migrate

  1. Discover actual runtime entrypoints and package dependency graphs.
  2. Define stable logical targets instead of user-specific absolute paths.
  3. Add package support ranges and semantic fingerprints.
  4. Implement three-way status: applicable, already-applied/upstreamed, or unsupported.
  5. Add idempotent transformation and postconditions.
  6. Add offline verification, receipt-based rollback, fixtures, and tests.
  7. Parse with strict mode and run the package test suite.

Read the full file on GitHub · 148 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 148 lines · 45 tokens per session scan A e187c9ab11e7

Subscribe to this mod's changes

patch-md is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (74 stars, last pushed 2d ago), licensed MIT. It adds 45 tokens to every session and 1,191 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.