first-party-audit
Skill2 starsChanged 6 months agoApache-2.0View on GitHub
Before writing glue, a wrapper, or a "small helper", audit whether the capability already exists first-party — in the binary, the codebase, or the platform — and whether existing glue bypasses a better first-party implementation. Use when adding shell/Taskfile/CI glue, when a helper feels trivially writable, or when the same logic seems to exist twice. Produces an inventory with receipts, not vibes.
- Installs packages
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- break-glassSkill
- claim-ledgerSkill
- contract-parity-auditSkill
- counterfactual-auditSkill
- design-doc-reviewSkill
- diagram-gen-emergentSkill
- diagram-gen-specSkill
- doc-triageSkill
- explain-workSkill
- feature-implSkill
- finding-triageSkill
- gh-token-rotateSkill
- handoffSkill
- implementSkill
- jj-stackSkill
- linear-escalation-triageSkill
- mache-usageSkill
- park-workSkill
- pr-boardSkill
- pr-bucketsSkill
- prior-art-cartographerSkill
- problem-decomposerSkill
- pr-review-kitSkill
- pr-reviewSkill
- pr-suggestionSkill
- readme-restructureSkill
- repo-description-polishSkill
- repo-homepage-setSkill
- repo-social-previewSkill
- repo-topic-taggerSkill
- review-prepSkill
- review-queueSkill
- reviewSkill
- self-auditSkill
- structural-pr-reviewSkill
- surveySkill
- taskfile-ci-paritySkill
- test-fidelitySkill
- workflow-auditSkill
- work-scopeSkill
- writing-pr-descriptionsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Run BEFORE writing the helper, not after.
- Distinctive: line 62
Verdict, one of four: USE (call the existing thing) / EXPORT (widen visibility, delete nothing) / DELEGATE (glue calls first-party) / WRITE …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Author: jamestexas — drafted from the 2026-08 mache lifecycle sessions (claude-opus-5) -->/first-party-audit — does this already exist, and is the glue worse than the code?
The failure this prevents, measured in one week on one repo: eight
independent re-implementations, each written by an agent with full code
search available — a generated-column probe written three times, a version
parser twice, an env-var override twice, a log-capture helper twice, and a
PinnedVersion() accessor added in the same session that used the existing
constant in the same function being edited. Plus the inverse defect:
Taskfile glue (cp over a live binary) that reimplemented an existing Go
installer LESS correctly than the code it bypassed — the Go code's own comment
warned against exactly what the glue did.
The root cause is never missing tooling. It is writing before interrogating.
Procedure
Run BEFORE writing the helper, not after. Each step ends in a receipt (a file:line or command output pasted into your working notes); a step without a receipt was not performed.
- Name the capability in one sentence, implementation-free. "Detect whether a SQLite column is generated", not "add ColumnIsGenerated".
- Interrogate the binary first.
<tool> --help, subcommand help, hidden commands. The capability may already ship. (A support answer once saidlaunchctl kickstartbecause nobody checked that the binary's owndaemonsurface was the place it belonged.) - Search the codebase for the MECHANISM, not your intended name. Grep for
the distinctive constant, syscall, SQL pragma, or error string the
implementation must contain —
pragma_table_xinfo,SIGTERM,Setpgid, the exact env var. Names differ; mechanisms collide. Then search test files separately: test helpers are where the third copy usually hides. - Check the callers of what you find. An existing implementation with the wrong visibility (unexported, wrong package) is an EXPORT, not a rewrite. An existing one with zero callers is a deletion candidate, not a pattern.
- Audit the glue against the first-party code. For each Taskfile/CI/shell
step that shadows a binary capability: does the glue do it the same way? If
the code does an atomic rename and the glue does
cp, the glue is not duplicative — it is WORSE, and delegating (task install→mache install) deletes the divergence. - Interrogate the platform before reimplementing it. Supervisors,
kernels, and stdlibs have opinions: launchd pins code identity at
bootstrap; SIGTERM semantics interact with KeepAlive;
pragma_table_infoomits generated columns. Read the existing unit/plist/config as first-party code TOO — a missingExitTimeOutis the platform's 20s default silently SIGKILLing your cleanup. - Verdict, one of four: USE (call the existing thing) / EXPORT (widen visibility, delete nothing) / DELEGATE (glue calls first-party) / WRITE (genuinely absent — say where it will live and why that package, since a 49k-line catch-all package is where step 3 goes to die).
Output
A short table: capability | where it exists (file:line or "absent") | callers | verdict | receipt. If the verdict is WRITE, the table is the evidence that the search happened.
Red flags that mean STOP and run this skill
- "I'll just add a small helper" in a package you did not survey
- A Taskfile/CI step about to shell out to do what the binary does
- Writing a probe/parser/env-var whose NAME you invented in the last hour
- A test helper that feels generic (capture-log, fake-daemon, temp-HOME)
- Any second implementation "for now"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

