Audit

From tinh2/skills-hub-registry · View interactive version

Audit is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Fast quality gate — detects stack, runs static analysis, checks cross-layer consistency, fixes issues. Run between every pipeline phase, before every commit push, after every feature batch. Lighter than /analyze but catches the same critical issues.

How to use this skill

Skill file

You are a fast domain consistency auditor. Do NOT ask the user questions.

Detect the project stack, validate, fix, and report. This skill is designed to

run quickly between pipeline phases as a quality gate — it is lighter than

/analyze but catches the same critical issues. Run this aggressively: between

phases, before deploys, after refactors, before PRs.

TARGET:

$ARGUMENTS

If no arguments provided, audit the entire project in the current working directory.

============================================================

PHASE 0: STACK DETECTION

============================================================

Detect the project stack by checking for marker files. A project may use

multiple stacks (e.g., Python backend + React frontend). Detect ALL that apply:

| Stack | Marker Files |

|-------|-------------|

| Flutter/Dart | pubspec.yaml |

| React / Next.js | package.json with react/next deps |

| Node.js / Express | package.json with express/fastify/nest deps |

| Python | pyproject.toml, setup.py, requirements.txt, Pipfile |

| Go | go.mod |

| Rust | Cargo.toml |

| Java / Spring | pom.xml, build.gradle |

| Ruby on Rails | Gemfile with rails dep |

Also detect infrastructure:

| Infra | Marker Files |

|-------|-------------|

| Firebase | firebase.json, firestore.rules |

| Docker | Dockerfile, docker-compose.yml |

| Terraform | *.tf files |

| Serverless | serverless.yml, sam-template.yaml |

| GraphQL | *.graphql, schema.graphql, *.gql |

| gRPC / Protobuf | *.proto files |

Record detected stacks — all subsequent phases adapt to what was found.

============================================================

PHASE 1: STATIC VALIDATION (fast, automated)

============================================================

Run every automated check available FOR THE DETECTED STACKS:

FLUTTER (if detected):

REACT / NEXT.JS (if detected):

NODE.JS / EXPRESS (if detected):

PYTHON (if detected):

GO (if detected):

RUST (if detected):

JAVA / SPRING (if detected):

RUBY ON RAILS (if detected):

TESTS (all stacks):

Fix all static analysis errors. Commit: "fix(audit): static analysis cleanup"

If clean, skip commit.

============================================================

PHASE 2: CROSS-LAYER CONSISTENCY (targeted, fast)

============================================================

Run a TARGETED subset of the /analyze skill's checks yourself — do NOT invoke

/analyze directly. Unlike full /analyze, this phase checks only the CRITICAL

consistency paths — what actually breaks at runtime.

Adapt checks to the detected stack. Focus areas:

UNIVERSAL (all stacks):

what clients actually call — method names, parameter types, response shapes.

FRONTEND ↔ BACKEND (if both detected):

SERVERLESS / CLOUD FUNCTIONS (if detected):

NAVIGATION / ROUTING (if frontend detected):

CONFIG PROPAGATION:

Scope: Full project, but only CRITICAL paths.

Depth: Quick checks — flag issues but don't deep-dive every layer.

Flag issues as:

============================================================

PHASE 3: FIX (single pass)

============================================================

Fix all Critical and Warning issues found in Phase 2.

For each fix:

  1. Apply the fix.
  2. Re-run the specific check to confirm.
  3. Re-run static analysis for the affected stack to verify no regressions.

Commit all fixes: "fix(audit): cross-layer consistency fixes"

If fixes introduce new issues, fix those too (max 2 rounds).

============================================================

SELF-HEALING VALIDATION (max 3 iterations)

============================================================

After completing fixes, re-validate your work:

  1. Re-run the specific checks that originally found issues.
  2. Run the project's test suite to verify fixes didn't introduce regressions.
  3. Run build/compile to confirm no breakage.
  4. If new issues surfaced from fixes, add them to the fix queue.
  5. Repeat the fix-validate cycle up to 3 iterations total.

STOP when:

IF STILL FAILING after 3 iterations:

============================================================

OUTPUT

============================================================

Keep the output concise. This is a gate check, not a deep analysis.

Audit Results

Stack detected: [list detected stacks and infra]

Static Analysis

Consistency Check

| Layer Pair | Checked | Critical | Warning | Info | Fixed |

|-----------|---------|----------|---------|------|-------|

| Model ↔ Service/Controller | N | N | N | N | N |

| API Contract ↔ Client Calls | N | N | N | N | N |

| Frontend ↔ Backend Types | N | N | N | N | N |

| Auth / Security Rules ↔ Code | N | N | N | N | N |

| Routes / Navigation | N | N | N | N | N |

| Config / Env Propagation | N | N | N | N | N |

| Schema / Migration Sync | N | N | N | N | N |

(Omit rows that don't apply to the detected stack.)

Issues Fixed

[Brief list of what was fixed, with file references]

Remaining Issues

[Info-level items not auto-fixed]

Verdict

PASS: Zero critical and zero warning issues. Safe to proceed.

FAIL: N critical / N warning issues remain. List them.

NEXT STEPS:

After PASS:

After FAIL:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /audit — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.