agentleFS
jamestexasjamestexas/agents/skills/first-party-audit/SKILL.md

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

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
  1. Distinctive:

    Run BEFORE writing the helper, not after.

    line 27
  2. Distinctive:

    Verdict, one of four: USE (call the existing thing) / EXPORT (widen visibility, delete nothing) / DELEGATE (glue calls first-party) / WRITE …

    line 62

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- 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.

  1. Name the capability in one sentence, implementation-free. "Detect whether a SQLite column is generated", not "add ColumnIsGenerated".
  2. Interrogate the binary first. <tool> --help, subcommand help, hidden commands. The capability may already ship. (A support answer once said launchctl kickstart because nobody checked that the binary's own daemon surface was the place it belonged.)
  3. 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.
  4. 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.
  5. 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.
  6. 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_info omits generated columns. Read the existing unit/plist/config as first-party code TOO — a missing ExitTimeOut is the platform's 20s default silently SIGKILLing your cleanup.
  7. 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"

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.