agentleFS
rioX432rioX432/agent-witness/.claude/skills/audit/SKILL.md

audit

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Audit codebase for tech debt, code quality, and architecture issues — then create GitHub Issues

193 other projects use a version of this.

Adopted by

Most recently taken up by

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-hubSkill

    delight

    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 31 projects that use this

  • HK-hubSkill

    teach-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 18 projects that use this

  • zwy123zwySkill

    normalize

    将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。

    Also in 18 projects that use this

  • ww-w-aiSkill

    pm-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

  • ww-w-aiSkill

    qa-phase

    Run QA tests at various levels (L1-L5) for features under PDCA management. Integrates with MCP tools to execute structured test plans.

    Also in 3 projects that use this

  • +7 more from HK-hub

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 3

    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:

    Run the project's lint/static analysis commands from CLAUDE.md's Commands section.

    line 51
  2. Distinctive:

    If not specified, auto-detect:

    line 53
  3. Distinctive:

    All Critical + High (recommended)

    line 225

“Common” is measured: kept by at least 6 in 10 of the 174 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

/audit — Codebase Health Audit

Audit the codebase for code quality, tech debt, architecture, and security issues. Findings become GitHub Issues.

Scope: $ARGUMENTS (default: all)


Step 1: Setup

Create task tracker:

  1. "Run static analysis"
  2. "Scan tech debt"
  3. "Scan code quality"
  4. "Scan architecture"
  5. "Scan visual bugs"
  6. "Scan dependencies"
  7. "Aggregate findings"
  8. "Create GitHub Issues"

Step 2: Static Analysis

Mark task 1 in_progress.

Run the project's lint/static analysis commands from CLAUDE.md's Commands section.

If not specified, auto-detect:

  • build.gradle.kts → ./gradlew detekt, ./gradlew ktlintCheck
  • package.json → npm run lint
  • Cargo.toml → cargo clippy
  • pyproject.toml → ruff check

Mark task 1 completed.


Step 3: Parallel Code Scans

Mark tasks 2–4 in_progress. Launch 3 Explore agents in parallel.

Agent A: Tech Debt Scanner

Scan for tech debt in the codebase.

## What to find:
1. TODO / FIXME / HACK / WORKAROUND comments
2. Deprecated API usage
3. Hardcoded values (magic numbers, config strings)
4. Dead code (unused functions, unreachable branches)
5. Commented-out code blocks

Return findings as structured list:
- category, severity (high/medium/low), file, line, description, snippet

Agent B: Code Quality Scanner

Scan for code quality issues.

## What to find:
1. Long functions (50+ lines)
2. Large files (500+ lines)
3. Deep nesting (4+ levels)
4. Duplicated code (3+ similar blocks)
5. Missing error handling (empty catch, swallowed errors)
6. Public API without tests
7. Inconsistent patterns across similar features

Return findings as structured list:
- category, severity, file, line, description, snippet

Agent C: Architecture Scanner

Read CLAUDE.md to understand the project architecture, then scan for:

## What to find:
1. Layer violations (check architecture boundaries in CLAUDE.md)
2. Circular dependencies between modules
3. Incorrect dependency direction
4. Missing abstractions (concrete where interface should be)
5. Resource leak indicators (open without close)
6. Concurrency issues (shared mutable state without synchronization)

Return findings as structured list:
- category, severity, file, line, description, snippet

Mark tasks 2–4 completed.

Agent D: Visual Bug Scanner

Scan for visual UI issues. Adapt method based on available tools.

## If Playwright MCP is available AND a web app (dev server URL in CLAUDE.md):
1. Start dev server (or use provided URL)
2. Navigate to key pages with Playwright
3. Take screenshots at default viewport
4. Analyze each screenshot for:
   - Layout overflow or element overlap
   - Text truncation or unreadable content
   - Missing images or broken assets
   - Blank/empty screens that should have content
5. Check responsive: resize to mobile (375px) and check again

## If Playwright is NOT available OR mobile native app:
1. Glob for UI files (*.kt Compose, *.swift SwiftUI, *.tsx, *.jsx, *.vue)
2. Scan for common visual bug patterns:
   - Hardcoded sizes (px instead of dp/sp/rem)
   - Missing error/loading/empty states
   - Missing contentDescription / accessibilityLabel
   - Clickable areas < 48dp (Android) / 44pt (iOS)
   - Unbounded text without maxLines or ellipsis

Return findings as structured list:
- category: visual, severity (high/medium/low), screen/file, description

Mark task for Agent D completed.

Agent E: Dependency Scanner

Scan project dependencies for security and freshness issues.

## What to find:
1. Known security vulnerabilities (CVEs)
   - Gradle: `./gradlew dependencyCheckAnalyze` or check dependency versions against known CVEs
   - npm: `npm audit`
   - pip: `pip-audit` or check requirements
2. Outdated major versions (1+ major behind)
   - Gradle: check version catalogs or dependency declarations
   - npm: `npm outdated`
3. Deprecated dependencies (archived repos, no updates in 2+ years)
4. Dependency conflicts or duplicate versions
5. Unused dependencies (declared but not imported)

For each finding include:
- dependency name, current version, latest version, severity, CVE ID (if applicable), upgrade risk (low/medium/high)

Mark task for Agent E completed.


Step 4: Aggregate Findings

Mark task 5 in_progress.

Deduplication

Merge findings from static analysis and code scans that reference the same file+line.

Severity Classification

SeverityCriteria
CriticalCrash risk, data race, memory leak, security, screen unusable
HighArchitecture violation, missing error handling, layout broken/unreadable
MediumCode smell, hardcoded value, missing test, minor visual issue
LowTODO comment, dead code, style issue, pixel-level misalignment

Mark task 5 completed.


Step 5: Present Findings

## Audit Report

Scope: {scope}
Found: {N} issues across {K} files

### Critical (N)
| # | File | Line | Description |
|---|------|------|-------------|

### High (N)
...

### Medium (N)
...

### Low (N)
...

Static Analysis: {pass / N violations}

── AskUserQuestion: Issue Creation ──

Q1: Which findings should become GitHub Issues?

  • All Critical + High (recommended)
  • All findings
  • Let me select
  • None (report only)

Step 6: Create GitHub Issues

Mark task 6 in_progress.

For each selected finding:

gh issue create \
  --title "{Category}: {description}" \
  --body "$(cat <<'EOF'
## Summary
{Description}

## Location
`{file}:{line}`

## Details
{snippet}

## Suggested Fix
{suggestion}
EOF
)" \
  --label "{auto-detected labels}"

Label Mapping

CategoryLabels
Criticalbug, priority: high
Highbug
Code Qualitytech-debt
Architecturetech-debt
Visualux
Dependencydependencies, security (if CVE)

Mark task 6 completed.


Error Handling

SituationAction
Static analysis tool not availableSkip, note in report
Agent returns no findingsNote "No issues found"
gh issue create failsReport, user can create manually
0 findings totalReport "Codebase looks healthy!"

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.