advanced-code-review-report

advanced-code-review-report is a command for coding agents from axiomantic/spellbook. It costs 20 tokens per session (3,534 once invoked), scanned A, original, MIT.

A code-review reporting command that turns verified review findings into a Markdown report and a machine-readable JSON summary.

In plain words
What is it for?
Use it at the final stage of a code review to create written reports, JSON summaries, follow-up actions, CI/CD integration, and automated issue triage.
Why use it?
It filters out disproved findings, orders the remaining issues by severity, and makes the results useful to both people and automated tools.

Command

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/axiomantic/spellbook/advanced-code-review-report
Clone the repo
git clone --depth 1 https://github.com/axiomantic/spellbook

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 advanced-code-review-report

README.md
[![agentmods](https://agentmods.dev/badge/commands/axiomantic/spellbook/advanced-code-review-report.svg)](https://agentmods.dev/commands/axiomantic/spellbook/advanced-code-review-report)
Your own site
<a href="https://agentmods.dev/commands/axiomantic/spellbook/advanced-code-review-report"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/advanced-code-review-report.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,534 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.00020 $0.03534
Opus 5 $0.00010 $0.01767
Sonnet 5 $0.00004 $0.00707
Haiku 4.5 $0.00002 $0.00353

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

Security

Grade A, and why

advanced-code-review-report 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 5d 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.

commands/advanced-code-review-report.md · 433 lines

How it starts

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

Phase 5: Report Generation

Invariant Principles

  1. Signal over noise: Only verified findings appear in the final report. REFUTED findings are excluded. Quality of findings matters more than quantity.
  2. Actionable output: Every finding must have clear next steps. Findings without suggestions or context are not actionable.
  3. Machine-readable artifacts for automation: JSON summary enables CI/CD integration, automated triage, and tooling. Human-readable Markdown is not sufficient alone.

Purpose: Produce final deliverables including Markdown report and machine-readable JSON summary.

5.1 Finding Filtering

Filter to verified and inconclusive findings only:

def filter_findings_for_report(findings: list[dict]) -> list[dict]:
    """Filter out REFUTED findings for final report."""
    return [
        f for f in findings
        if f.get("verification_status") != "REFUTED"
    ]

5.2 Severity Sorting

Sort findings by severity (most critical first):

SEVERITY_ORDER = {
    "CRITICAL": 0,
    "HIGH": 1,
    "MEDIUM": 2,
    "LOW": 3,
    "NIT": 4,
    "QUESTION": 5,
    "PRAISE": 6
}
# QUESTION is a legal severity and MUST be present. Omitting it routes every
# QUESTION finding through the .get(..., 99) fallback, where it sorts last and
# disappears from by_severity. This dict must match the one in the
# advanced-code-review skill key for key.

def sort_by_severity(findings: list[dict]) -> list[dict]:
    """Sort findings by severity, most critical first."""
    return sorted(findings, key=lambda f: SEVERITY_ORDER.get(f["severity"], 99))

5.3 Verdict Determination

Determine overall review verdict:

BLOCKING = {"CRITICAL", "HIGH"}
DISCUSS = {"MEDIUM"}
NON_BLOCKING = {"LOW", "NIT", "QUESTION", "PRAISE"}
KNOWN_SEVERITIES = BLOCKING | DISCUSS | NON_BLOCKING


def determine_verdict(findings: list[dict]) -> str:
    """
    Determine review verdict based on findings.

    This is a MERGE GATE, so it FAILS CLOSED. Two ways it used to fail open:
    exact-uppercase membership testing (a finding emitted as `Critical` matched
    nothing and fell through to APPROVE), and treating an UNRECOGNISED severity
    as non-blocking. Both let a blocking finding merge under
    "No blocking issues found."

    Returns: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"
    """
    severities = {
        str(f.get("severity", "")).strip().upper()
        for f in findings
        if f.get("verification_status") != "REFUTED"
    }

    # An unrecognised severity is NOT evidence of harmlessness. It means a
    # producer is speaking a vocabulary this gate does not know, so the gate
    # cannot rank it -- block and make a human look.
    unknown = severities - KNOWN_SEVERITIES - {""}
    if unknown:
        return "REQUEST_CHANGES"

    if severities & BLOCKING:
        return "REQUEST_CHANGES"

    if severities & DISCUSS:
        return "COMMENT"

    return "APPROVE"

def verdict_rationale(verdict: str, findings: list[dict]) -> str:
    """Generate rationale for verdict."""
    by_severity = {}
    for f in findings:
        # Normalise the same way determine_verdict does. Counting raw strings
        # here would report "0 blocking issue(s)" alongside REQUEST_CHANGES.
        sev = str(f.get("severity", "")).strip().upper()
        by_severity[sev] = by_severity.get(sev, 0) + 1

    unknown = sorted(set(by_severity) - KNOWN_SEVERITIES - {""})

    if verdict == "REQUEST_CHANGES":
        if unknown:
            return (
                f"unrecognised severity value(s) {unknown} -- the gate cannot "
                "rank them and blocks rather than assuming they are harmless"
            )
        critical = by_severity.get("CRITICAL", 0)
        high = by_severity.get("HIGH", 0)
        return f"{critical + high} blocking issue(s) require attention"
    elif verdict == "COMMENT":
        medium = by_severity.get("MEDIUM", 0)
        return f"{medium} medium-severity issue(s) worth discussing"
    else:
        return "No blocking issues found"

Read the full file on GitHub · 433 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. 5d ago First seen · 433 lines · 20 tokens per session scan A 9ec1032a00f1

Subscribe to this mod's changes

advanced-code-review-report is a command published in the GitHub repository axiomantic/spellbook (10 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 3,534 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-31.