audit-codebase

A release-readiness checklist for inspecting a software codebase and scoring it across seven areas, with each finding tied to exact files and lines.

In plain words
What is it for?
Use it to audit or grade a codebase before release, checking items such as safe database queries, error handling, token security, password resets, and startup failures.
Why use it?
It helps reviewers find security, reliability, and design problems consistently, while avoiding criticism of decisions already documented in architecture records.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/golid-ai/golid/audit-codebase
Clone the repo
git clone --depth 1 https://github.com/golid-ai/golid

Made for: Cursor.

Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,046 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.02046
Opus 5 $0.00010 $0.01023
Sonnet 5 $0.00004 $0.00409
Haiku 4.5 $0.00002 $0.00205

Measured 2d ago against content hash 7393475c1b60, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit-codebase scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/audit-codebase.mdc · 136 lines

How it starts

The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Codebase Audit Checklist

Thesis: Score the codebase across 7 categories with exact file citations. Check ADRs before flagging documented design decisions.

Run this checklist for release readiness audits. Cite exact file paths and line numbers for every finding. Check docs/adr/ for ADRs before flagging documented design decisions.

Core patterns (apperror, parameterized SQL, batch(), Switch/Match, createResource, alive guard) — see codebase-standards. Frontend fetch — solidjs-data-fetching. Route UI — solidjs-pages.

Backend

  • All SQL uses $N parameterized placeholders (no fmt.Sprintf with values or identifiers)
  • No _ = fn() discarded errors in production code
  • No echo.NewHTTPError in production code (use apperror)
  • Token refresh is transactional and TOCTOU-safe (atomic UPDATE...RETURNING)
  • Password reset uses SELECT...FOR UPDATE inside transaction
  • Verification tokens hashed with selector/verifier pattern
  • All rows.Next() loops check rows.Err() after iteration
  • JWT_SECRET rejects CHANGE_ME placeholder at startup
  • Production entrypoint exits on migration failure
  • Timeout middleware uses Echo's built-in (no custom goroutine race)
  • All operational constants in Config struct with env var overrides
  • ForgotPassword/ResendVerification log errors server-side (anti-enumeration: always return 200)

Frontend

  • Zero createResource — use onMount + signals (see solidjs-data-fetching)
  • Zero nested <Show> for content states — use Switch/Match (see solidjs-pages)
  • Zero window.confirm() — use DestructiveModal (see solidjs-pages)
  • Zero onMount/createEffect cleanup returns — use onCleanup (see solidjs-data-fetching)
  • Zero any in production — use unknown (e.g. Record<string, unknown>)
  • Auth store reacts to auth:session-expired when token cleared
  • Auth cookie Secure on HTTPS set and clear paths
  • Skip link present with correct target and tabindex
  • Auth guard effects use on() without defer (see solidjs-pages)
  • batch() wraps signal updates after every await (see solidjs-data-fetching)

Read the full file on GitHub · 136 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 136 lines · 21 tokens per session scan A 7393475c1b60

Subscribe to this mod's changes

audit-codebase is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It adds 21 tokens to every session and 2,046 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.