agentleFS
lgzarturolgzarturo/codeconductor/.agents/skills/token-audit/SKILL.md

token-audit

Skill0 starsChanged 26 days agoMITView on GitHub

Use when a workflow must prove its preset copies stopped wasting context: audit council duplication (C1), fallback sync (C2), and STOP/scope report-only counts (S1) with the official bytes/4 + bytes/% method.

14 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 1

    Distinctive

    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:

    Every non-canonical council copy MUST be a minimal redirect stub: a GENERATED header plus a pointer to the canonical copy, under 400 bytes …

    line 27

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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

Token Audit — Duplication → Redirect → Measured Savings

Scope: $ARGUMENTS

Describe which workflow copies to audit. Include:

  • The canonical source (council canonical: presets/agy/workflows/cc-council.md)
  • The redirect targets to verify (the 5 council copies on codex/claude/cursor/opencode/gemini)
  • The baseline in bytes (council baseline: 19327, about 19KB)

Rules

C1 — Council duplication

Every non-canonical council copy MUST be a minimal redirect stub: a GENERATED header plus a pointer to the canonical copy, under 400 bytes each. A copy carrying the full Steps 0-5 body is a C1 violation. Stubs are produced ONLY by regenerating with inject-ccep-bootstrap.ts + render-agent-commands.ts — never by hand-editing the 5 copies.

C2 — Fallback sync

COUNCIL_FALLBACK_PROFILE MUST be generated from src/core/ccep/workflows/council.yml, never hand-synced. The generated mirror lives at src/core/ccep/council-fallback.generated.ts and is covered by bun run check:drift: any drift between the YAML roster and the fallback artifact fails the gate. A hardcoded fallback literal in profiles.ts is a C2 violation.

S1 — STOP/scope is report-only

Count STOP gates and scope mentions, report the count (for example: 2 STOP gates across the 5 council phases), and never block on it. S1 is report-only by design: no refactor, no gate failure may follow from the count alone.

Official method: bytes/4 + bytes/%

Tokens are estimated as bytes/4. Savings are reported in bytes and in bytes/% against the baseline:

measured = sum of the 5 stub sizes in bytes
saved    = 19327 - measured
pct      = saved / 19327 * 100
tokens   ~= measured / 4

There is no cutoff threshold: always report the measured numbers, even when the reduction is small.

Gates

  • bun run check:council-redirect — every council copy is a stub under 400 bytes pointing at the canonical file. Fails naming each offending copy; passes on a clean tree so work can proceed. Prints the measured total with bytes/% saved.
  • bun run check:drift — regenerates the fallback artifact from council.yml plus all derived presets, then fails on any uncommitted diff.

Regeneration (never manual)

bun run scripts/inject-ccep-bootstrap.ts
bun run scripts/render-agent-commands.ts

Both passes are idempotent: a second run changes zero bytes. If check:council-redirect fails after a regeneration, the stub format regressed — fix the generator, not the copies.

Completion criteria

  • 5/5 council copies are stubs (<400 bytes each, no full Steps body, GENERATED banner + canonical pointer).
  • Fallback artifact matches council.yml and drift is clean.
  • Savings reported in bytes and bytes/% vs the 19327 baseline, with the S1 STOP/scope count attached.

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.