codex/skills/patch/SKILL.md
Create micro-patches from staged git changes (minimal incision) with at least one validation signal per patch. Use when asked to split work into small .patch files, export/share diffs, or produce patches instead of commits.
npx skillsauth add tkersey/dotfiles patchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Carve changes into surgical git patch files: one coherent change, minimal blast radius, and at least one feedback signal before exporting.
This skill treats a patch as a transport artifact (a context-sensitive diff), not a magical commutative "merge atom". The goal is to make patches small, reviewable, and maximally likely to apply cleanly.
HEAD), keep patches tiny, and validate against a clean base.git apply-style patch from the index.
git apply.git am/email-style patch (requires commits).
git am.format-patch.Inspect:
git status -sbgit diffStage what you intend (prefer file-level staging in non-interactive harnesses):
git add <paths...>git restore --staged <paths...>Verify:
git diff --cached matches the intended incision.If you truly need hunk-level staging but your environment can't do interactive staging, ask the user to stage hunks locally or provide a patch you can apply.
scripts/micro_scope.py (staged vs unstaged size).Heuristics that reduce downstream conflicts:
references/loop-detection.md.Choose an output path, e.g. patches/0001-<slug>.patch.
Before exporting, sanity-check for secrets (tokens, creds, private keys). If likely, stop and ask.
Export the staged change as a binary-safe patch (deterministic diff output):
git diff --cached --binary --no-ext-diff --no-textconv --no-color > <patch-path>Verify the patch is non-empty:
test -s <patch-path>Verify patch correctness (two levels):
git apply --check --reverse --binary <patch-path>git worktree add --detach <tmp-dir> HEAD<tmp-dir>: git apply --check --binary <patch-path>git worktree remove <tmp-dir>Keep staged changes intact unless the user asks to unstage or reset.
Repeat until the working tree is clean or remaining changes are intentionally deferred.
git patch-id --stable (best-effort, not cryptographic).references/patch-theory.md.scripts/micro_scope.pyreferences/loop-detection.mdreferences/patch-theory.mdtools
Invokes Apple's macOS 27 fm command-line tool from a local Mac to use the on-device system model or Private Cloud Compute, including instructions, image prompts, schema-constrained JSON, and noninteractive automation. Use when the user asks to run Apple Foundation Models through fm, compare system versus pcc, generate structured output, or automate fm without Swift or an app.
development
Compile historical Codex sessions into governed counterfactual evidence, evaluate an existing owner-applied candidate through blinded paired HCTP trials, and fold observable evidence into RUN, OBSERVE, or STOP. Use for `$hylo`, CRF extraction, counterfactual replay, source-governed direct or historical trials, sealed evidence, paired baseline/candidate evaluation, causal frontiers, or evidence-governed improvement.
testing
Ensure a `ledger` command is available on PATH; materialize, validate, record, replay, and project requested Actuating artifacts without taking semantic or execution authority; coordinate the shared Learnings/Synesthesia/Negative Ledger lifecycle checkpoint and repo-local source-memory reconciliation; address Universalist plans and receipts; and perform pure artifact validation.
testing
Classify and quotient review findings, failing tests, incidents, bug reports, migration failures, and other witnessed falsifiers against accepted intent and the current Construction. Author counterexample-set/v1 without selecting repairs, counting review credit, or granting mutation.