agentleFS
samsam007bsamsam007b/claude-code-standards-kit/skills/quick-audit/SKILL.md

quick-audit

Skill2 starsChanged 8 months agoMITView on GitHub

Quick pre-commit audit: runs the 10 critical checks in < 2 min. Run before every important commit.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    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:

    If enabled, offers to fix automatically:

    line 197
  2. Distinctive:

    Add missing React imports

    line 198
  3. Distinctive:

    Add rate limiting on sensitive routes

    line 200
  4. Distinctive:

    Score < 75%: : Commit blocked 🔴 (--no-verify to bypass)

    line 223
  5. Distinctive:

    Recommended usage: : Before every commit with > 50 changed lines

    line 256

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

⚡ Quick Audit (< 2 min)

Quick audit of the 10 most critical checks. Run before every commit or before every PR.


Automatic Execution

# Via pre-commit hook
.git/hooks/pre-commit → runs /quick-audit

# Via Claude Code
/quick-audit

# CI/CD (GitHub Actions)
- name: Quick Audit
  run: claude --skill quick-audit

The 10 Critical Checks

1. TypeScript (5s)

npx tsc --noEmit 2>&1 | grep "error TS" | wc -l

✅ PASS : 0 errors 🔴 FAIL : > 0 errors


2. Console Statements (2s)

grep -r "console\.\(log\|error\|warn\)" app/ lib/ components/ contexts/ \
  --include="*.ts" --include="*.tsx" \
  | grep -v "logger.ts" \
  | wc -l

✅ PASS : 0 statements 🟡 WARN : < 10 statements 🔴 FAIL : > 10 statements


3. Exposed API Keys (3s)

# Check 1 : NEXT_PUBLIC_ for secrets
grep -r "NEXT_PUBLIC_.*KEY\|NEXT_PUBLIC_.*SECRET" .env* app/ components/ \
  | grep -v "NEXT_PUBLIC_SUPABASE_URL\|NEXT_PUBLIC_SUPABASE_ANON_KEY\|NEXT_PUBLIC_STRIPE_PUBLISHABLE"

# Check 2 : Service role on the client
grep -r "SERVICE_ROLE_KEY" app/ components/

✅ PASS : 0 results 🔴 FAIL : > 0 results


4. Debug Endpoints (1s)

find app/api/debug -type f 2>/dev/null | wc -l

✅ PASS : 0 files 🔴 FAIL : > 0 files


5. Unprotected API Routes (10s)

# Sensitive public routes without rate limit
grep -L "ratelimit\|RateLimit" app/api/auth/*/route.ts app/api/upload/*/route.ts 2>/dev/null | wc -l

✅ PASS : 0 routes 🟡 WARN : < 3 routes 🔴 FAIL : > 3 routes


6. Hardcoded Secrets (5s)

# Hardcoded passwords, tokens, keys
grep -rn "password.*=.*['\"].\{8,\}['\"]" app/ lib/ \
  | grep -v "placeholder\|example\|test"

✅ PASS : 0 results 🔴 FAIL : > 0 results


7. SQL Injection Risk (5s)

# String concatenation in SQL
grep -rn "EXECUTE.*||" supabase/migrations/
grep -rn "\${.*}" supabase/migrations/ | grep -v "^--"

✅ PASS : 0 results 🔴 FAIL : > 0 results


8. XSS Risk (5s)

# dangerouslySetInnerHTML without sanitization
grep -r "dangerouslySetInnerHTML" app/ components/ | grep -v "DOMPurify"

✅ PASS : 0 results 🟡 WARN : < 3 with DOMPurify 🔴 FAIL : > 0 without DOMPurify


9. Error Information Disclosure (5s)

# Stack traces in responses
grep -r "error\.stack\|error\.message" app/api/ \
  | grep "Response.json\|NextResponse.json"

✅ PASS : 0 results 🟡 WARN : < 5 results 🔴 FAIL : > 5 results


10. Build Success (30s)

npm run build 2>&1 | grep -E "Compiled successfully|Build failed"

✅ PASS : "Compiled successfully" 🔴 FAIL : "Build failed"


Output Format

⚡ QUICK AUDIT RESULTS ────────────────────

✅ TypeScript:           0 errors
✅ Console:              0 statements
✅ API Keys:             Secured
✅ Debug endpoints:      0
🟡 Unprotected routes:   2 (non-critical)
✅ Hardcoded secrets:    None
✅ SQL injection:        No risk
✅ XSS:                  Sanitized
✅ Error disclosure:     None
✅ Build:                SUCCESS

Score: 95/100 ─ PASS ✅

Warnings:
- 2 API routes without rate limit (non-critical)

Recommendation: SAFE TO COMMIT

Time: 1m 23s
──────────────────────────────────────────

Auto-Fix Mode

/quick-audit --auto-fix

If enabled, offers to fix automatically:

  • Add missing React imports
  • Replace console.log with logger.debug
  • Add rate limiting on sensitive routes

Git Hooks Integration

Installation

# Create pre-commit hook
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
echo "🔍 Running Quick Audit..."
claude --skill quick-audit --exit-code
EOF

chmod +x .git/hooks/pre-commit

Behavior

  • Score ≥ 90% : Commit allowed ✅
  • Score 75-89% : Warning but commit allowed 🟡
  • Score < 75% : Commit blocked 🔴 (--no-verify to bypass)

CI/CD Integration (GitHub Actions)

name: Quick Audit

on: [pull_request]

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci
      - run: npx claude --skill quick-audit
      - name: Comment PR
        uses: actions/github-script@v7
        with:
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              body: process.env.AUDIT_RESULTS
            })

Execution time : 1-2 minutes False positive rate : < 5% Recommended usage : Before every commit with > 50 changed lines

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.