audit-code

audit-code is a command for Codex from KaelSensei/MagicAIBuilder. It costs 0 tokens per session (2,016 once invoked), scanned A, original, MIT.

A code-audit command that reviews a project or selected files for code quality, security, project standards, documentation, and related checks. It can also include web-performance checks when the audit covers a Next.js front end.

In plain words
What is it for?
Use it to audit the whole codebase or a specific area such as screens or database code before making or submitting changes.
Why use it?
It gathers the project's rules and documentation before reviewing the code, reducing the chance that important security, testing, or maintenance requirements are missed.

Command for Codex

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 commands/kaelsensei/magicaibuilder/audit-code
Clone the repo
git clone --depth 1 https://github.com/KaelSensei/MagicAIBuilder

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audit-code

README.md
[![agentmods](https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/audit-code.svg)](https://agentmods.dev/commands/kaelsensei/magicaibuilder/audit-code)
Your own site
<a href="https://agentmods.dev/commands/kaelsensei/magicaibuilder/audit-code"><img src="https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/audit-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,016 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.00000 $0.02016
Opus 5 $0.00000 $0.01008
Sonnet 5 $0.00000 $0.00403
Haiku 4.5 $0.00000 $0.00202

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

Security

Grade A, and why

audit-code 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 3d 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.

.agents/commands/audit-code.md · 295 lines

How it starts

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

Audit Code Command – Code Quality and Security Analysis

When /audit-code [target] is invoked, immediately execute the following steps to analyze code quality, security, and adherence to project standards.

Skills used: web-performance (PageSpeed and Core Web Vitals — required when the audit scope touches the Next.js front-end; see Step 4b).


Step 1: Load Project Context

  1. Assume the project root as the working directory
  2. Load and strictly follow ALL Cursor rules from .cursor/rules/*.mdc:
    • security.mdc - Security requirements
    • technical-stack.mdc - React Native/SQLite patterns
    • documentation.mdc - Documentation update requirements
    • version-management.mdc - Git commit/push workflow
  3. Read relevant documentation:
    • README.md
    • PROGRESS.md
    • Architecture documents
    • Security guidelines
  4. Identify the current Git branch
  5. Determine the audit scope:
    • If no target specified: audit entire codebase
    • If target specified: audit specific files/directories (e.g., src/screens/, src/db/)

Step 2: Understand the Audit Scope

  1. Parse the target provided after /audit-code (if any)
  2. Determine audit focus:
    • Security: Check for vulnerabilities, unsafe patterns, backdoors
    • Code Quality: Check for bugs, anti-patterns, technical debt
    • Architecture: Check adherence to project patterns
    • Performance: Check for performance issues
    • Documentation: Check for missing or outdated docs
  3. Identify files to analyze:
    • TypeScript/JavaScript files
    • Database schemas and queries
    • Configuration files
    • Test files (if applicable)

Step 3: Security Audit (Mandatory)

  1. Check for security vulnerabilities:
    • SQL injection risks in database queries
    • Unsafe external API calls (only Moxfield/Scryfall allowed)
    • File system access issues
    • Prototype pollution vectors
    • Unsafe object merging
    • Dynamic code execution (eval, Function, dynamic imports)
    • Hidden logic or obfuscated code

Read the full file on GitHub · 295 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. 3d ago First seen · 295 lines · 0 tokens per session scan A 2a20536a5a89

Subscribe to this mod's changes

audit-code is a command published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,016 tokens. 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-31.

Related

Other commands, from other repositories