codebase-audit
Skill0 starsChanged 6 months agoMITView on GitHub
Ruthless codebase audit reporting only real problems. Use when asked to 'audit', 'code audit', 'codebase audit', 'review code', 'find bugs', or 'code review'.
- Reads credentials
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 26 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
If running interactively (human present), output "Read Codebase Audit skill." to acknowledge.
- Very specific: line 53
Look for these patterns. Each includes the correct fix — an agent must apply the fix, not just report the problem.
- Distinctive: line 102
Do NOT report missing comments, missing types, or missing docs
- Distinctive: line 103
Do NOT suggest adding error handling "just in case" for impossible states
- Distinctive: line 104
Do NOT recommend abstractions for one-time code
- Distinctive: line 105
Every issue must have a concrete file and line reference
- Distinctive: line 106
If the codebase is clean, say so.
“Common” is measured: kept by at least 6 in 10 of the 26 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
Codebase Audit
If running interactively (human present), output "Read Codebase Audit skill." to acknowledge. If running with --dangerously-skip-permissions (AFK/unattended), skip acknowledgement and proceed directly.
You are a senior staff engineer performing a ruthless codebase audit. Analyze whatever code has been provided — whether that's a full codebase, a single file, or a specific directory — and report ONLY real problems. Skip anything that's fine.
Audit only what's provided. Do not assume missing files exist. This could be:
- A full codebase (all files in context)
- Specific files dragged into the chat
- A directory path the user mentions
- A file tree pasted inline
Report in this exact format, grouped by severity:
CRITICAL — Will cause bugs or data loss
- [file:line] What's wrong and why it will break
SECURITY — Exploitable vulnerabilities
- [file:line] The vulnerability and how it's exploitable
DEAD CODE — Unused files, functions, imports, variables
- [file:line] What's dead and safe to delete
LOGIC ERRORS — Code that doesn't do what the author intended
- [file:line] What it does vs what it should do
RACE CONDITIONS & EDGE CASES — Concurrent access, null states, empty arrays, off-by-one
- [file:line] The scenario that triggers the bug
DRY VIOLATIONS — Duplicated logic that should be consolidated
- [file:line] and [file:line] do the same thing
INCONSISTENCIES — Same pattern done 2 different ways
- [file:line] vs [file:line] — which convention to pick and why
MEMORY LEAK PATTERNS — Code that will leak memory at runtime
- [file:line] The pattern, why it leaks, and the correct fix (not just "flag it")
Look for these patterns. Each includes the correct fix — an agent must apply the fix, not just report the problem. See rules/resource-management.md for full code examples.
Module-scope state:
[BOTH]Module-scope accumulation — Maps, Sets, arrays, or objects at module scope that grow with each request/render and are never cleared. Fix: add eviction (LRU/TTL/max size) AND wrap inglobalThis.__x ??=for HMR safety[DEV]HMR module stacking — module-scope state (even bounded caches, singletons) duplicated on every HMR cycle because the bundler retains old module instances. Look fornew Map(),new LRUCache(), singletons, or large data arrays at module scope withoutglobalThis.__x ??=protection. Fix:const x = (globalThis.__x ??= new Thing())withdeclare globalfor TypeScript[DEV]Large static data at module scope — files with hundreds/thousands of inline data objects (reviews, keywords, routes, config) that are re-allocated on every HMR cycle. Flag any module-scope array/object literal exceeding ~100 entries. Fix: extract to JSON file + lazy accessor withglobalThiscache, OR useimport data from './data.json'(bundler treats JSON as static asset). Do NOT fix by deleting the data or wrapping in a function withoutglobalThis[BOTH]Per-request SDK client creation —new AnalyticsSDK(),new PostHog(),new SentryClient(), databasenew Pool(), etc. created inside functions instead of as module-scope singletons. Each instance allocates internal queues, timers, and connections that may not fully clean up on shutdown. Fix:globalThis.__client ??= new SDK(key)— singleton AND HMR-safe
Lifecycle cleanup:
[PROD]Event listeners without cleanup —addEventListener,.on(),.subscribe(),.observe()without corresponding removal in cleanup/unmount/destroy. Fix: useAbortController.signaloption for multiple listeners, or manualremoveEventListener/.disconnect()in cleanup[PROD]Timers without cleanup —setInterval/setTimeout/requestAnimationFramewithoutclearInterval/clearTimeout/cancelAnimationFrameon teardown. Fix: store the ID, clear in cleanup function[PROD]Unaborted fetch/async —fetch()or async operations withoutAbortControllercleanup on component unmount or route change. Fix:AbortController+ abort inuseEffectcleanup + guardsetStatewithsignal.abortedcheck[PROD]React effects without cleanup —useEffectthat creates resources without a return cleanup function. Fix: return a function that cleans up ALL resources created in the effect
Bounded collections:
[PROD]Unbounded caches — in-memory caches (Map, plain objects) with no eviction, TTL, or size limit. Fix:LRUCache({ max, ttl }), orWeakMapwhen keys are objects[PROD]SSE/WebSocket event accumulation — Server-Sent Events or WebSocket listeners that buffer incoming messages without backpressure or consumption bounds, growing memory linearly with uptime. Fix: sliding window (splicewhen length > max), or process-and-discard pattern
Reference retention:
[PROD]Closures capturing large scope — callbacks or handlers that close over large data structures unnecessarily, preventing GC of the entire captured scope. Fix: extract only the primitive values needed into local variables before creating the closure[PROD]Circular references in persistent structures — objects referencing each other in long-lived data structures preventing GC
I/O resources:
[PROD]Stream/connection leaks — database connections, file handles, or readable streams opened without guaranteedclose()/destroy()in error paths. Fix:try/finally, TC39using, or connection pooling[PROD]Middleware state accumulation — middleware or interceptors that append to request-scoped arrays/objects that survive the request lifecycle
Build-time:
[DEV]Unconditional build plugin wrapping —withSentryConfig(),withBundleAnalyzer(), or similar config wrappers applied regardless ofNODE_ENV, importing full plugin SDKs in dev mode when the plugin is disabled. Fix:process.env.NODE_ENV === "production" ? withPlugin(config) : config[DEV]Console logging large objects in hot paths —console.log(largeObject)in per-request middleware, render functions, or event handlers creates serialized string copies retained by the console buffer. Fix: log only identifiers/summaries, or use structured logger with level gating
HUD Events
Emit bookend events so the HUD tracks this audit:
source ~/dotfiles/bin/write-hud-state.sh
# At start
write_hud_event "info" "codebase-audit: started"
# At end — report findings count
write_hud_event "info" "codebase-audit: completed — N findings"Rules
- Do NOT report missing comments, missing types, or missing docs
- Do NOT suggest adding error handling "just in case" for impossible states
- Do NOT recommend abstractions for one-time code
- Every issue must have a concrete file and line reference
- If the codebase is clean, say so. Do not manufacture problems.
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- TencentCloudBase/CloudBase-AI-Toolkit★ 1.2ksame name
- TencentCloudBase/CloudBase-AI-ToolKit★ 1.1ksame name
- TencentCloudBase/CloudBase-MCP★ 1.1ksame name
- kekzl/imp★ 124same name
- mhylle/claude-skills-collection★ 20same name
- myatminlu/vector-skills★ 18same name
- sohei56/maul-team★ 17same name
- GoldenWing-360/claude-security-skills★ 16same name
- rommelporras/kiro-config★ 13same name
- frostney/pascal-mcp-sdk★ 2same name
16 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.
Used alongsideProjects with it also use cloud-api-recipe-authoring, codebuddy-ide-mcp-upgrade 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.
TencentCloudBaseSkillcloud-api-recipe-authoring
Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/). Encodes why the long tail of control-plane capabilities is deliberately NOT wrapped as MCP/CLI tools, the API-first admission test for whether a capability deserves a recipe, the negative and positive lists, the fixed recipe structure, the writing rules distilled from writing-for-agents, the user-facing copy red lines, and the product regeneration/verification pipeline. Also routes contributors (and their agents) to the contribution flow and the pre-PR self-test protocol in references/contributing.md. Use when adding a recipe, judging whether a scenario belongs in the recipe set, updating the recipes index, re-checking existing recipes against the admission test, or onboarding someone who wants to submit one.
Also in 3 projects that use this
TencentCloudBaseSkillcodebuddy-ide-mcp-upgrade
升级 CodeBuddy IDE(genie 扩展)内置的 CloudBase MCP,以及 MCP 发版时同步 IDE 侧白名单。当用户提到「更新 IDE 里的 MCP」「内置 MCP 版本太老」「IDE 集成的 CloudBase 功能不足」「改工具白名单 toolWhiteList」「把新 bundle 打进 CodeBuddy」「白名单漂移」「MCP 发版要同步什么」时使用。覆盖:解包定位内置 bundle 与内嵌配置、重新构建 mcp bundle、生成新的工具白名单与系统提示词、安全注入 IDE 并备份、用 MCP 协议验证工具清单、人工端到端验收、一键回滚。
Also in 3 projects that use this
frostneySkillnative-nostalgia-stack
Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.
Also in 3 projects that use this
frostneySkillroadmap-review
Reviews a roadmap from fresh project evidence and produces a verified, throughput-anchored version plan, with execution gated on confirmation. Use when reviewing a roadmap, planning releases, or sequencing a backlog.
Also in 3 projects that use this
- +7 more from TencentCloudBase
- +1 more from frostney
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-assetsSkill
- agent-navigabilitySkill
- agent-session-frictionSkill
- agent-testabilitySkill
- architectSkill
- atomic-commitsSkill
- cavemanSkill
- code-reviewSkill
- compliance-auditSkill
- data-object-conventionsSkill
- documentSkill
- do-workSkill
- error-auditSkill
- exploreSkill
- frontend-component-styleSkill
- grill-meSkill
- grill-with-docsSkill
- halbert-copy-editorSkill
- improve-architectureSkill
- logging-auditSkill
- mobile-devSkill
- npm-security-auditSkill
- performance-auditSkill
- plan-archiveSkill
- prd-to-issuesSkill
- press1-checkSkill
- pr-preflightSkill
- repo-hygieneSkill
- researchSkill
- review-pr-copilotSkill
- sanity-best-practicesSkill
- session-closeSkill
- sketch-the-solutionSkill
- skill-scaffolderSkill
- stress-testSkill
- systematic-debuggingSkill
- tddSkill
- visual-feedbackSkill
- write-a-prdSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

