بنقرة واحدة
audit-codebase
expert: "Performs a spec-free, whole-codebase quality audit by running static
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
expert: "Performs a spec-free, whole-codebase quality audit by running static
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use at the start of every agent session, even if the task seems obvious and you think you already know what to do. Activates when the agent has just opened a repository, does not know what to do, needs to orient itself, or is beginning any new session. Also activates for "where do I start?", "what should I work on?", "what is the current state?". Skipping orientation leads to wasted effort and missed context.
expert: "Structured task execution procedure for individual implementation
expert: "Multi-agent development orchestration with conflict-aware parallel
expert: "Review orchestration with adaptive specialist dispatch,
Use at the start of every agent session, even if the task seems obvious and you think you already know what to do. Activates when the agent has just opened a repository, does not know what to do, needs to orient itself, or is beginning any new session. Also activates for "where do I start?", "what should I work on?", "what is the current state?". Skipping orientation leads to wasted effort and missed context.
expert: "Structured task execution procedure for individual implementation
| name | audit-codebase |
| description | {"expert":"Performs a spec-free, whole-codebase quality audit by running static analysis tools, knowledge-graph structural queries, and Go style conformance checks. Produces a triage-ready audit report saved to work/reviews/. Used before public releases, after large refactors, or on demand.","natural":"Do a quality audit of the whole codebase. Check for dead code, linting errors, style issues, and performance problems."} |
| triggers | ["audit the codebase","run a quality sweep","check for dead code","pre-release quality check","find linting errors across the whole project","code quality audit","sweep for quality issues","360 review of the codebase"] |
| roles | ["reviewer-quality"] |
| stage | auditing |
| constraint_level | low |
go vet and
staticcheck to surface undefined behaviour, deprecated APIs, and suspicious constructstrace_call_path before classificationmain(), or
framework callback that legitimately has zero graph callers and must be
excluded from dead code results./... unless
narrowed by the callerrefs/go-style.md, or the structural thresholds defined in this skill.
Anchoring to a missing spec produces an empty report.refs/go-style.md rules, Go idiom standards,
or the structural thresholds defined here. Do not look for a spec.trace_call_path(direction: "inbound") and check for USAGE edges before
classifying as dead. If uncertain, mark as "verify before deletion"../...)index_status()go vet ./... — capture all outputstaticcheck ./... — capture all outputgo test -race ./... — record pass/fail and failure detailsrefs/go-style.mdwork/reviews/audit-{slug}.md./...
if none was given.index_status(). IF the index is stale (last
indexed > 7 days ago) or not indexed → call
index_repository(repo_path: ".") before running any graph queries.Run each tool and capture its full output:
go vet ./... — catches undefined behaviour, unreachable code, printf
format mismatches, and suspicious constructs.staticcheck ./... — catches deprecated API usage, redundant code,
incorrect format strings, and a wider set of correctness issues.IF a tool is not installed → note the gap explicitly in the report under that dimension. Do not skip the step silently.
Do NOT run golangci-lint unless the project has a .golangci.yml or
.golangci.toml config file. Running it without project-specific
configuration produces excessive noise.
Run go test -race ./.... Record:
IF tests fail → record these as critical findings. A failing test suite invalidates confidence in all other quality claims made by this audit.
Read .github/skills/codebase-memory-quality/SKILL.md for the exact tool
calls before running queries. Then execute:
Dead code candidates — search_graph with label: "Function",
relationship: "CALLS", direction: "inbound", max_degree: 0,
exclude_entry_points: true.
For each candidate: verify with trace_call_path(direction: "inbound", depth: 1) and check for USAGE edges. Classify confirmed dead code as
major. Mark uncertain cases as "verify before deletion".
High fan-out functions — search_graph with relationship: "CALLS",
direction: "outbound", min_degree: 10.
For each result: is the fan-out incidental (a large dispatch table or
switch) or a genuine SRP violation? Classify genuine SRP violations as
major; incidental fan-out as minor.
Change coupling — query_graph for FILE_CHANGES_WITH edges with
coupling_score >= 0.5. Identify semantically unrelated file pairs with
high coupling. Classify hidden coupling between unrelated packages as major.
Unused imports — search_graph with relationship: "IMPORTS",
direction: "outbound", max_degree: 0, label: "Module". These should
already be caught by go vet; note any that were missed by tooling.
Read refs/go-style.md. For each rule category, scan for violations using
grep and read_file:
_ = on error-returning calls; unwrapped
error returns that discard context.URL, HTTP, ID not Url, Http, Id);
package names with underscores or mixed case.context.Context for
cancellation.Before writing the report:
test_health, static_analysis, structural_quality,
style_conformance.work/reviews/audit-{slug}.md where {slug} is a short
kebab-case descriptor (e.g., pre-v1-release, post-storage-refactor).doc(action: "register", path: "work/reviews/audit-{slug}.md", type: "report", title: "Quality Audit: {description}", auto_approve: true)Quality Audit: <description>
Date: <ISO 8601 date>
Scope: <path filter, e.g. ./...>
Index state: current | refreshed | stale (noted)
Tools run: go vet, staticcheck, go test -race, knowledge graph
Overall: clean | clean_with_findings | has_major_findings | has_critical_findings
Dimensions:
test_health: clean | clean_with_notes | has_findings
Summary: <N tests, Y passed, Z failed; race: none | detected>
Findings:
- [critical] <test name>: <failure message> (location: <file:line>)
Recommendation: <fix>
static_analysis: clean | clean_with_notes | has_findings
Summary: <N findings from go vet, M findings from staticcheck>
Findings:
- [<severity>] <tool>: <message> (location: <file:line>)
Recommendation: <fix>
structural_quality: clean | clean_with_notes | has_findings
Summary: <N dead code candidates confirmed, M high fan-out, K coupled pairs>
Findings:
- [<severity>] dead_code: <FunctionName> — zero callers confirmed
(location: <file:line>)
Recommendation: delete or add intent comment if deliberate
- [<severity>] high_fan_out: <FunctionName> calls <N> functions
(location: <file:line>)
Recommendation: <extract / decompose>
- [<severity>] change_coupling: <file-a> <-> <file-b>
coupling_score: <X>, co-changes: <N>
Recommendation: investigate / extract shared dependency
style_conformance: clean | clean_with_notes | has_findings
Summary: <N violations found>
Findings:
- [<severity>] <rule>: <description> (location: <file:line>)
Recommendation: <fix>
Finding Summary:
Critical: <count>
Major: <count>
Minor: <count>
Total: <count>
Next Actions:
1. <highest-severity finding — one-line description and location>
2. <next finding>
...
Overall verdict rules:
clean — zero findings across all dimensions.clean_with_findings — zero critical or major; one or more minor findings.has_major_findings — one or more major findings; zero critical.has_critical_findings — one or more critical findings (test failures,
race conditions, correctness bugs).See examples-audit-codebase.md for worked audit output examples: unverified dead code, linter output without triage, and triaged audit with calibrated severity.
trace_call_path before
classification? Weight: required.golangci-lint vs. just staticcheck?