audit
Skill143 starsChanged 2 months agoMITView on GitHub
Read-only, multi-agent audit of the leanSpec codebase. Fans out the py-architect, consensus-researcher, code-tester, and doc-writer agents across the source tree to find dead code, over-abstraction, stdlib simplifications, test gaps, safety/security defects, and documentation rot, then synthesizes a precise, prioritized AUDIT_REPORT.md. Never modifies code.
194 other projects use a version of this.
Adopted by
Most recently taken up by
- Laucked-Security/claude-oswetheir own version, first seen Nov 8, 2026
- sanmidable/skillstheir own version, first seen Nov 8, 2026
- alegauss/claude-traytheir own version, first seen Nov 8, 2026
- ansvisor/ansvisortheir own version, first seen Nov 8, 2026
- ai-search-guru/getcito-worlds-first-open-source-aio-aeo-or-geo-tooltheir own version, first seen Nov 8, 2026
- MammadovEshgin/clean-code-skilltheir own version, first seen Nov 8, 2026
Used with
Projects with it also use delight, teach-impeccable and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
HK-hubSkilldelight
Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.
Also in 32 projects that use this
HK-hubSkillteach-impeccable
One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
Also in 19 projects that use this
zwy123zwySkillnormalize
将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。
Also in 19 projects that use this
SkillPilotCHSkilllevel-up
Eine Automatisierung pro Woche finden, scopen, shippen. Output landet als proposed-Eintrag in cadence.md mit konkreten Implementations-Schritten.
Also in 12 projects that use this
ww-w-aiSkillpm-discovery
PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.
Also in 3 projects that use this
- +7 more from HK-hub
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 194
- openai/plugins★ 7.8ksame name
- ccch1mneyyy/dsh-TUI★ 7.2ksame name
- macro-inc/macro★ 6ksame name
- yournextstore/yournextstore★ 5.5ksame name
- gadievron/raptor★ 4ksame name
- alchemy-run/alchemy★ 1.9ksame name
- alchemy-run/alchemy-effect★ 1.9ksame name
- mattmireles/gemma-tuner-multimodal★ 1.5ksame name
- jsmastery-pro/skills★ 1.4ksame name
- nateherkai/AIS-OS★ 1.4ksame name
184 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 175 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Read-only: Do not call Edit, Write, or NotebookEdit on anything under src/, tests/, packages/, or docs/.
- Very specific: line 22
Evidence or it does not exist: Every finding cites file:line and quotes the offending code.
- Very specific: line 79
Scope: Read the /audit argument:
- Very specific: line 108
Verify (anti-false-positive pass): Before a finding lands in the report, confirm it.
- Distinctive: line 121
Every agent returns findings as a list of records with these fields:
- Distinctive: line 181
Every finding is independently actionable and independently verifiable.
“Common” is measured: kept by at least 6 in 10 of the 175 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.
Files
/audit — multi-agent codebase audit
Produce a rigorous, evidence-backed audit of leanSpec and write it to AUDIT_REPORT.md
at the repository root. This skill never edits source, tests, or docs — its only
artifact is the report. Findings become follow-up pull requests.
The bar is the one used for life-critical software: cryptography, spacecraft flight software (NASA/JPL "Power of Ten", DO-178C), and formally-verified kernels (seL4). A reference Ethereum specification is read by implementers across the ecosystem; an ambiguous line or a dead abstraction here propagates into every client. Audit as if a client bug would trace back to this exact line.
Hard rules
- Read-only. Do not call Edit, Write, or NotebookEdit on anything under
src/,tests/,packages/, ordocs/. The only file you create isAUDIT_REPORT.md. - Evidence or it does not exist. Every finding cites
file:lineand quotes the offending code. No vague "consider improving error handling" entries. - Recommend, do not rewrite. Show the fix as a short illustrative snippet, not a finished patch. The report drives PRs; it is not itself a PR.
- Respect the project laws. The audit's own standard is
CLAUDE.mdplus.claude/rules/*. Flag violations of those rules; never recommend anything that breaks them (no backward-compat shims, no abbreviations, noTYPE_CHECKING, test tree mirrors source, forks tested by vectors not pytest, full-equality assertions).
What counts as a finding
Hunt across these dimensions. Each maps to a lens (and an agent) below.
- Dead code — unused functions, classes, methods, variables, parameters, imports,
constants, type aliases, or whole modules. The recommendation is always delete
(no deprecation shims — see CLAUDE.md). Confirm with a repo-wide usage search before
reporting; a symbol used only in tests, re-exported in
__init__.py, or referenced by string is not dead. - Over-abstraction & helper sprawl — a function/class with exactly one caller, a wrapper that only forwards, an indirection the reader must chase. Recommend inlining. This is a top priority: helpers tax every future reader.
- Stdlib & idiom simplification — hand-rolled code that a single standard-library
call replaces (
itertools,functools,collections,bisect,math.ceil/floor,enumerate,zip, comprehensions,dataclasses,Enum). Quantify the lines saved. (Respect repo taste:math.ceil/math.floorover(a+b-1)//b— see project memory.) - Modernization — Python 3.12 / Pydantic v2 features that read better:
match,Self,@override, PEP 695 type params,StrEnum, frozen models, computed fields, field validators. Only where it genuinely clarifies; never churn for fashion. - Refactoring & reorganization — oversized modules, mixed concerns, misplaced types, a class living in the wrong file, inconsistent module shape across siblings.
- Test gaps — uncovered branches, missing boundary/adversarial/error-path cases, weak assertions (substring instead of full-equality), over-mocking, and especially test-tree mirroring violations and any pytest that should be a consensus vector.
- Safety & security — the gravest class. Consensus safety/liveness hazards,
non-determinism (set/dict iteration order,
Math.random-style, float in consensus), unvalidated external input, integer over/underflow, unbounded allocation from wire data, panics on attacker-controlled paths, crypto misuse (non-constant-time compares on secrets, nonce reuse, weak domain separation, RFC/test-vector deviations). - Naming & documentation — abbreviations, vague placeholder names, stale or missing docstrings, comments that restate code, missing "why" on a non-obvious constant.
The lenses (sub-agents)
Launch these four project agents. Each owns a lens but reads the whole tree; the orchestrator sharded the tree only so the work parallelizes.
- py-architect → dimensions 1–5 (dead code, helper sprawl, stdlib, modernization, refactoring). It is the simplicity guardian; trust its instinct to inline and delete.
- consensus-researcher → dimension 7 (safety & security) plus spec-fidelity of the consensus and crypto logic. It reasons about adversaries, finality, and soundness.
- code-tester → dimension 6 (test gaps, mirroring, assertion quality, vector vs. pytest placement).
- doc-writer → dimension 8 (naming clarity, docstring accuracy, comment noise, reorganization for comprehension).
Workflow
- Scope. Read the
/auditargument:- No argument → audit the full tree (
src/lean_spec/andpackages/). - A path → audit only that subtree.
- A subsystem name (e.g.
crypto,ssz,forks,networking,chain,packages) → map it to its directory and audit that.
- No argument → audit the full tree (
- Shard. Split the in-scope tree into coherent subsystems so agents run in parallel.
The natural shards:
src/lean_spec/spec/crypto/(XMSS, hashing, signatures, aggregation)src/lean_spec/spec/forks/(state transition, fork choice, containers, validator duties, aggregation)src/lean_spec/node/networking/(gossipsub, reqresp, quic, discovery)src/lean_spec/node/chain/(clock, store, sync) and the rest ofnode/src/lean_spec/cli/,base.py,config.py,log.py,__main__.py,spec/observability/packages/testing/(the consensus-testing framework)
Fan out. For each shard, spawn the relevant lenses in parallel (one message, multiple Agent calls). Give every agent the same contract:
- It is read-only. It produces findings, not edits.
- It returns findings in the exact schema below — nothing else.
- It must run a usage search before claiming any symbol is dead.
- It must read
CLAUDE.mdand.claude/rules/*first and judge against them.
For a large audit, prefer the Workflow tool: a
pipelineof (shard × lens) → adversarial verification → synthesis scales better than manual fan-out and keeps each finding independently checked. Manual Agent fan-out is fine for a single subsystem.- Verify (anti-false-positive pass). Before a finding lands in the report, confirm
it. A "dead" symbol must have zero non-test references (
grep/usage search acrosssrc,tests,packages, and string-keyed registries). A "simplification" must be behavior-preserving — call out any semantic difference (e.g.itertoolslaziness, exception types). Discard anything you cannot stand behind. False positives destroy the report's credibility faster than missing findings. - Synthesize. Merge agent outputs, dedupe overlaps, drop unverified items, and write
AUDIT_REPORT.mdin the format below. Sort the backlog by severity then effort so the top of the list is the obvious first PR.
Finding schema
Every agent returns findings as a list of records with these fields:
ID: <SHARD>-<NN> e.g. CRYPTO-03
Location: path/to/file.py:LINE (range if multi-line)
Category: dead-code | over-abstraction | stdlib | modernization |
refactor | test-gap | safety | security | naming | docs
Severity: Critical | Major | Minor
Title: one line, imperative ("Inline single-use `_pad_chunk` helper")
Evidence: a short quoted snippet of the offending code
Why: the concrete cost — reader confusion, attack surface, drift risk,
lines wasted. Tie safety items to a property (safety/liveness/soundness).
Recommendation: the fix, with a minimal before/after snippet. State lines saved.
Effort: Trivial | Small | Medium | Large
References: optional — paper, RFC, CPython docs, or a sibling file that does it rightSeverity rubric:
- Critical — can cause consensus divergence, fund loss, a crypto break, a panic on attacker-controlled input, or non-determinism in state transition / fork choice.
- Major — meaningful correctness, test-coverage, or maintainability risk: a real dead-code path, an untested error branch, an abstraction that obscures protocol logic.
- Minor — clarity, naming, idiom, single-line simplification.
Report format (AUDIT_REPORT.md)
# leanSpec Audit Report
_Scope: <what was audited> · Commit: <git short sha> · Date: <date>_
## Executive summary
3–6 sentences: overall health, the single most important finding, and the themes
(e.g. "helper sprawl in networking", "untested error paths in SSZ decode").
## Findings by severity
A table: ID · Severity · Category · Location · Title. Sorted Critical → Minor.
## Detailed findings
One subsection per finding, rendered from the schema above. Group by subsystem.
Lead with Critical and Major.
## Recommended PR backlog
An ordered checklist mapping findings to PRs, grouped so each line is one shippable
change. Note dependencies ("do X before Y"). This is the section the maintainer acts on.
## Coverage & limitations
What was audited, what was skipped and why, and any finding the auditors could not fully
verify (flagged so a human checks it). No silent gaps.Quality gates for the report itself
- Lean. No filler, no restating the code, no "it is recommended that". One idea per line.
- Every finding is independently actionable and independently verifiable.
- Concrete over abstract: show the snippet, name the stdlib call, count the lines.
- Honest about uncertainty: a low-confidence finding says so rather than overclaiming.
- The reader should be able to open the report, pick the top item, and start a PR with no further investigation.
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.

