Alfred Code system audit
You are the integration engineer for a Claude Code stack. Every other audit in this repo judges ONE part -
the skills, the hooks, the rules, the agents, the CLAUDE.md template, the plugins it installs. You judge
what none of them sees: the install as ONE working system, the way a fresh session meets it. A session is
sent the always-on rules, the AGENTS.md chain, two listings (skills, agents), the hook injections at
session start, per turn, at a seat's dispatch and after compaction, the path rules as files open, and it
acts under the guards on every tool call. The stack works only when those parts agree with each other,
cost what they are worth, guard every route to a dangerous action, and leave a new chat knowing the
project without digging.
Five questions, one dimension each: do the parts conflict; is the context enough and not too much; do the
hooks earn their cost; is every dangerous action guarded on every route; does a fresh session have the
project's facts stated. The stack's own plugin packaging - manifest, marketplace, versioning, validate,
evals - is graded beside them. Measure on throwaway installs of THIS working tree, one per tech profile,
plus the recorded session corpus; never on a real consuming project, never by a billed live session.
It is this repo's own maintenance tool, not part of the shipped catalog.
When to use
- The user types
/repo-audit-system to audit the Alfred Code stack as a whole.
- Not for one part's own quality - that part's audit (
/repo-audit-skills, -hooks, -rules, -agents,
-claude-md) - nor for the third-party plugins themselves (/repo-audit-plugins) or a consuming
project's session log (/repo-audit-usage). A defect found inside one part is handed to its audit.
Parameters
STACK_ROOT: the stack repository (default: .).
PROFILES: the tech profiles to install (default: every stacks key of meta/recommendations.json plus bare - node scripts/profile-fixture.js --help lists them; a key with no markers fails its test).
WORKDIR: where the fixtures go (default: a system-audit folder in the session scratchpad; never inside a real project). Everything in it is test data, deleted at the run's end.
RESULTS: where the run's results stay (default: <docs-path>/audits/<YYYY-MM-DD>/system/ - this repo's docs root, always <data root>/docs - .alfred/docs by default; machine-local, never committed).
CORPUS: a sessions collection root (optional; without it S2, S3 and S5 score their static side only and each says so).
WINDOW: the context window, in tokens, the skill listing budget is judged at (default: 200000).
OWN_PLUGIN_ROOT: the plugin the stack ships (default: the core alfred-code entry - generated into ./meta/plugin-entries.json by scripts/build-marketplace.js and sourced from the repo root, its components declared in the entry; ./setup-plugin holds its commands, its router skill, its own hooks, its eval cases and the plugin.json whose version the release tags). No MCP entry ships since 2.10.1 (build-marketplace.js drops one from the marketplace; stack/mcp/shipped-mcps.json is the record), so a server row in the marketplace is a finding.
MARKETPLACE: the stack's own marketplace file (default: ./.claude-plugin/marketplace.json).
TARGET: minimum grade (default: A / 9).
How the run goes
Autonomous through the report; one ask before any edit; nothing on a machine outside the fixtures.
- Principles. Read
references/principles.md first - it defines a defect for every later phase.
- Phase 0 - discovery (
references/discovery.md). Edit nothing. Install one fixture per profile
(scripts/profile-fixture.js), map each (scripts/session-surface.js --run-hooks --json), read the
corpus and the hook-blocks ledger, then build the conflict map, the guard-route map and the
awareness checklist.
- Phase 1 - scoring. S1-S5 per profile and the packaging grade (
references/rubric.md), every
point citing its line or row. Produce the baseline report (the output contract) before any proposal.
- Phase 1b - currency. Re-read each fact row of
references/currency.md against the live pages
before scoring with it; correct a DRIFTED row in the same run.
- Phase 2 - one ask (
references/remediation.md): the fix list, most severe first, each row with
both sides, the chosen home and the files, or a handoff. Stop for the answer.
- Phase 3 - apply and verify, below, for what the answer picked.
- Results and cleanup, below - on every exit: after Phase 3, after a 'Report only', and after a run a failed
install stopped.
Phase 3 - Verification
- Snapshot every file before its edit into
RESULTS/snapshot/; npm run lint plus the tests that cover each edit, green before the next.
- Re-install every profile a fix touches from the edited tree and re-run
session-surface.js on it; diff the map against the baseline: each fix's claimed row, flag or total moves the way it said, and nothing else moves.
- The temp-project matrix per the repo
CLAUDE.md for every shipped file the fixes changed - fresh, update over the last release, re-run, the user's own config kept, malformed input, every scope touched.
- Packaging:
claude plugin validate --strict on the plugin and the marketplace root, claude --plugin-dir <root> plugin details <name> read with its caveats, and the claude plugin eval with / without delta (setup-plugin/evals/) where a fix touched a command or the router skill.
- A claim that rests on the corpus (a false-block rate, a re-read count, an unused surface) is PENDING until sessions recorded after the change say it moved; report it so, never as proven by the edit.
- Re-score from scratch and record the final grades with the same evidence-cited scoring.
If an edit moved a row it did not claim, or broke an install closure, restore it from the snapshot and report it as unresolved with the reason.
Results and cleanup
The results stay in the docs; the test data is deleted once the last check that reads it has run.
- Kept, under
RESULTS - each written as soon as it exists:
checklist.md - the awareness checklist, at Phase 0 step 1, before any map is read;
maps/<profile>.baseline.json as each map is made, and maps/<profile>.final.json from the Phase 3 re-run - the
session-surface.js --json output, which prints no machine path;
report.md - the output contract below, written before the ask and completed after the apply: the baseline, the ask
and its answer, the before / after diff, the final grades, what was not run;
snapshot/ - every edited file as it was before its edit, the rollback.
- Deleted: every fixture (project, account dir, the shared home), every export, every matrix project and probe
capture -
node scripts/profile-fixture.js --clean <WORKDIR>, which removes only what the fixture script writes and
prints removed: and left:; then whatever else this run put in WORKDIR (a matrix copy, a helper script). An install
log is test data: quote a failed step into report.md before the cleanup.
- Proven gone:
WORKDIR no longer exists (or left: names only what this run did not create), no
session-surface-* folder sits in the OS temp dir (find <tmp> -maxdepth 1 -name 'session-surface-*' - a bare glob
aborts under zsh), and no WORKDIR path appears in the real account's plugins/installed_plugins.json,
plugins/known_marketplaces.json or .claude.json.
Stop conditions
- Every profile at A / 9 on S1-S5, the packaging grade at A / 9, all verified; or
- Every remaining sub-A dimension is a handoff, a user's 'Report only', a PENDING corpus claim, or a blocker a guard forbids fixing.
Report the remainder at its real grade.
Output contract
One report in the conversation, dense, no preamble, no restating this skill:
- Profile table:
profile, session-start chars split house / generated / plugin, a turn, the biggest dispatch, after compaction, flags, S1-S5, grade; the system grade (the lowest profile's) under it.
- Conflict map: one row per relation -
contradicts / duplicates / collides / blocks / dangling / shadows - both sides quoted with file and line, the profiles it appears in, the resolution or the handoff.
- Safety gaps: action, the route that reaches it, the guard or deny that is missing, BLOCKER marked.
- Awareness checklist per profile: each fact, where it is stated (row and file) or
missing, before init and after.
- Packaging block: A1-A5 with cited deductions; the validate, details and eval lines quoted.
- Handoff rows: target audit, the part, the defect, the evidence.
- The Phase 1b currency table with this run's verdicts.
- The ask; after an apply, the before / after surface diff per profile, the files changed and the snapshot location.
- The results line: the
RESULTS path, and the cleanup - what --clean removed, what was left, the leftover checks.
1---2name: repo-audit-system3description: Use when auditing Alfred Code as one system - conflicts across its parts, token budget, hook value, safety, fresh-session context, its own packaging.4disable-model-invocation: true5metadata:6 source: https://skillmd.com/skills/envoydev/repo-audit-system7---89# Alfred Code system audit1011You are the integration engineer for a Claude Code stack. Every other audit in this repo judges ONE part -12the skills, the hooks, the rules, the agents, the CLAUDE.md template, the plugins it installs. You judge13what none of them sees: the install as ONE working system, the way a fresh session meets it. A session is14sent the always-on rules, the AGENTS.md chain, two listings (skills, agents), the hook injections at15session start, per turn, at a seat's dispatch and after compaction, the path rules as files open, and it16acts under the guards on every tool call. The stack works only when those parts agree with each other,17cost what they are worth, guard every route to a dangerous action, and leave a new chat knowing the18project without digging.1920Five questions, one dimension each: do the parts conflict; is the context enough and not too much; do the21hooks earn their cost; is every dangerous action guarded on every route; does a fresh session have the22project's facts stated. The stack's own plugin packaging - manifest, marketplace, versioning, validate,23evals - is graded beside them. Measure on throwaway installs of THIS working tree, one per tech profile,24plus the recorded session corpus; never on a real consuming project, never by a billed live session.2526It is this repo's own maintenance tool, not part of the shipped catalog.2728## When to use2930- The user types `/repo-audit-system` to audit the Alfred Code stack as a whole.31- Not for one part's own quality - that part's audit (`/repo-audit-skills`, `-hooks`, `-rules`, `-agents`,32 `-claude-md`) - nor for the third-party plugins themselves (`/repo-audit-plugins`) or a consuming33 project's session log (`/repo-audit-usage`). A defect found inside one part is handed to its audit.3435## Parameters3637- `STACK_ROOT`: the stack repository (default: `.`).38- `PROFILES`: the tech profiles to install (default: every `stacks` key of `meta/recommendations.json` plus `bare` - `node scripts/profile-fixture.js --help` lists them; a key with no markers fails its test).39- `WORKDIR`: where the fixtures go (default: a `system-audit` folder in the session scratchpad; never inside a real project). Everything in it is test data, deleted at the run's end.40- `RESULTS`: where the run's results stay (default: `<docs-path>/audits/<YYYY-MM-DD>/system/` - this repo's docs root, always `<data root>/docs` - `.alfred/docs` by default; machine-local, never committed).41- `CORPUS`: a sessions collection root (optional; without it S2, S3 and S5 score their static side only and each says so).42- `WINDOW`: the context window, in tokens, the skill listing budget is judged at (default: `200000`).43- `OWN_PLUGIN_ROOT`: the plugin the stack ships (default: the core `alfred-code` entry - generated into `./meta/plugin-entries.json` by `scripts/build-marketplace.js` and sourced from the repo root, its components declared in the entry; `./setup-plugin` holds its commands, its router skill, its own hooks, its eval cases and the `plugin.json` whose `version` the release tags). No MCP entry ships since 2.10.1 (`build-marketplace.js` drops one from the marketplace; `stack/mcp/shipped-mcps.json` is the record), so a server row in the marketplace is a finding.44- `MARKETPLACE`: the stack's own marketplace file (default: `./.claude-plugin/marketplace.json`).45- `TARGET`: minimum grade (default: `A` / `9`).4647## How the run goes4849Autonomous through the report; one ask before any edit; nothing on a machine outside the fixtures.50511. **Principles.** Read `references/principles.md` first - it defines a defect for every later phase.522. **Phase 0 - discovery** (`references/discovery.md`). Edit nothing. Install one fixture per profile53 (`scripts/profile-fixture.js`), map each (`scripts/session-surface.js --run-hooks --json`), read the54 corpus and the hook-blocks ledger, then build the conflict map, the guard-route map and the55 awareness checklist.563. **Phase 1 - scoring.** S1-S5 per profile and the packaging grade (`references/rubric.md`), every57 point citing its line or row. Produce the baseline report (the output contract) before any proposal.584. **Phase 1b - currency.** Re-read each fact row of `references/currency.md` against the live pages59 before scoring with it; correct a DRIFTED row in the same run.605. **Phase 2 - one ask** (`references/remediation.md`): the fix list, most severe first, each row with61 both sides, the chosen home and the files, or a handoff. Stop for the answer.626. **Phase 3 - apply and verify**, below, for what the answer picked.637. **Results and cleanup**, below - on every exit: after Phase 3, after a 'Report only', and after a run a failed64 install stopped.6566## Phase 3 - Verification67681. Snapshot every file before its edit into `RESULTS/snapshot/`; `npm run lint` plus the tests that cover each edit, green before the next.692. Re-install every profile a fix touches from the edited tree and re-run `session-surface.js` on it; diff the map against the baseline: each fix's claimed row, flag or total moves the way it said, and nothing else moves.703. The temp-project matrix per the repo `CLAUDE.md` for every shipped file the fixes changed - fresh, update over the last release, re-run, the user's own config kept, malformed input, every scope touched.714. Packaging: `claude plugin validate --strict` on the plugin and the marketplace root, `claude --plugin-dir <root> plugin details <name>` read with its caveats, and the `claude plugin eval` with / without delta (`setup-plugin/evals/`) where a fix touched a command or the router skill.725. A claim that rests on the corpus (a false-block rate, a re-read count, an unused surface) is PENDING until sessions recorded after the change say it moved; report it so, never as proven by the edit.736. Re-score from scratch and record the final grades with the same evidence-cited scoring.7475If an edit moved a row it did not claim, or broke an install closure, restore it from the snapshot and report it as unresolved with the reason.7677## Results and cleanup7879The results stay in the docs; the test data is deleted once the last check that reads it has run.8081- **Kept, under `RESULTS`** - each written as soon as it exists:82 - `checklist.md` - the awareness checklist, at Phase 0 step 1, before any map is read;83 - `maps/<profile>.baseline.json` as each map is made, and `maps/<profile>.final.json` from the Phase 3 re-run - the84 `session-surface.js --json` output, which prints no machine path;85 - `report.md` - the output contract below, written before the ask and completed after the apply: the baseline, the ask86 and its answer, the before / after diff, the final grades, what was not run;87 - `snapshot/` - every edited file as it was before its edit, the rollback.88- **Deleted:** every fixture (project, account dir, the shared home), every export, every matrix project and probe89 capture - `node scripts/profile-fixture.js --clean <WORKDIR>`, which removes only what the fixture script writes and90 prints `removed:` and `left:`; then whatever else this run put in `WORKDIR` (a matrix copy, a helper script). An install91 log is test data: quote a failed step into `report.md` before the cleanup.92- **Proven gone:** `WORKDIR` no longer exists (or `left:` names only what this run did not create), no93 `session-surface-*` folder sits in the OS temp dir (`find <tmp> -maxdepth 1 -name 'session-surface-*'` - a bare glob94 aborts under zsh), and no `WORKDIR` path appears in the real account's `plugins/installed_plugins.json`,95 `plugins/known_marketplaces.json` or `.claude.json`.9697## Stop conditions9899- Every profile at A / 9 on S1-S5, the packaging grade at A / 9, all verified; or100- Every remaining sub-A dimension is a handoff, a user's 'Report only', a PENDING corpus claim, or a blocker a guard forbids fixing.101102Report the remainder at its real grade.103104## Output contract105106One report in the conversation, dense, no preamble, no restating this skill:1071081. Profile table: `profile`, session-start chars split house / generated / plugin, a turn, the biggest dispatch, after compaction, flags, S1-S5, grade; the system grade (the lowest profile's) under it.1092. Conflict map: one row per relation - `contradicts` / `duplicates` / `collides` / `blocks` / `dangling` / `shadows` - both sides quoted with file and line, the profiles it appears in, the resolution or the handoff.1103. Safety gaps: action, the route that reaches it, the guard or deny that is missing, BLOCKER marked.1114. Awareness checklist per profile: each fact, where it is stated (row and file) or `missing`, before init and after.1125. Packaging block: A1-A5 with cited deductions; the validate, details and eval lines quoted.1136. Handoff rows: target audit, the part, the defect, the evidence.1147. The Phase 1b currency table with this run's verdicts.1158. The ask; after an apply, the before / after surface diff per profile, the files changed and the snapshot location.1169. The results line: the `RESULTS` path, and the cleanup - what `--clean` removed, what was left, the leftover checks.