audit-pr-architecture

A review process for checking whether a pull request follows the codebase's architecture and module boundaries.

In plain words
What is it for?
Use it during or after a pull request to inspect file moves, shared utilities, folder growth, and cross-module dependencies.
Why use it?
It finds structural problems such as misplaced files, duplicate wrappers, incomplete moves, or leftover dead code.

Skill for Claude CodeCodex

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 skills/stainless-code/codemap/audit-pr-architecture
Any agent
npx skills add stainless-code/codemap --skill audit-pr-architecture
Clone the repo
git clone --depth 1 https://github.com/stainless-code/codemap

Made for: Claude Code, Codex.

Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,406 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.00061 $0.03406
Opus 5 $0.00030 $0.01703
Sonnet 5 $0.00012 $0.00681
Haiku 4.5 $0.00006 $0.00341

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

Security

Grade A, and why

audit-pr-architecture 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.

.agents/skills/audit-pr-architecture/SKILL.md · 220 lines

How it starts

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

Audit a PR's architecture

Mid-flight or post-merge structural review of a PR against the repo's own architecture and boundary conventions. Sister skill to pr-comment-fact-check (reviewer-comment-driven triage).

This skill exists because:

  • Lightweight STOP signals (new top-level src/ folder, new shared util with 3+ consumers, folder past ~15 files without index.ts, files moved across module boundaries) miss content-driven smells (twin wrappers, incomplete lifts, dead leftovers from a move) that show up only after the PR has been opened.
  • The audit recipe (codemap reindex → boundary queries → dead-code / complexity recipes → cross-check rules → write findings) is reusable but lived nowhere before this skill — every audit was rebuilding it from scratch.

When to fire

User intent (any of these phrases is enough):

  • "audit this PR's architecture" / "structural review of #N"
  • "check the boundaries on this branch"
  • "is this PR clean / does this respect the boundaries"
  • "post-merge architecture audit"
  • "what did the lift miss"
  • "fact-check the structural choices on this refactor"

Also fire proactively when:

  • A PR moves ≥5 files between top-level src/ modules (e.g. src/cli/src/application/, or any sibling-folder migration).
  • A PR introduces a new src/<X>/ subfolder.
  • A PR closes a structural STOP signal (so the closure is recorded with evidence).

The 6-step recipe

1. Reindex codemap and identify the diff scope

bun src/index.ts   # or: codemap (from outside the repo)
git diff --name-status origin/main...HEAD

Note: the affected source modules (re-derive the live set from docs/architecture.md § Layering — today's layers include src/cli/, src/application/, src/adapters/, src/db.ts, plus runtime / config / parser modules), the PR's intent commit (the lift / extract / share), and the surrounding subtrees.

2. Derive the boundary-leak SQL kit from the repo's own architecture

Read the full file on GitHub · 220 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 · 220 lines · 61 tokens per session scan A 2c952b0e3e18

Subscribe to this mod's changes

audit-pr-architecture is a skill published in the GitHub repository stainless-code/codemap (8 stars, last pushed 8d ago), licensed MIT. It adds 61 tokens to every session and 3,406 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

roam

Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring…

Cranot/roam-code · 86 tokens

agentmap

Use for TypeScript/JavaScript codebase navigation — symbol lookup, blast radius, reuse checks, and repo orientation. Prefer agentmap before serial grep when exploring imports, exports, or where a symbol lives. Package is @raymondchins/agentmap (not the unrelated npm package agentmap).

raymondchins/agentmap · 64 tokens

self-repair-pipeline

Runs the full entry point self-repair pipeline. Detects entry points in Ariadne packages or external codebases, triages false positives via sub-agents, plans fixes for each issue group with competing proposals and multi-angle review, and creates backlog tasks.

CRJFisher/ariadne · 57 tokens

analyze-usage

Use when asked to analyze codescout tool usage, check for error patterns, audit tool health, generate a usage report, spot anti-patterns, or clear usage statistics to start fresh.

mareurs/codescout · 42 tokens

m1nd-first

Use when investigating a repository, searching for implementation, reviewing changes, working from specs/docs, or preparing a risky code change in an environment where m1nd is available. This doctrine makes m1nd the first investigative layer before grep, glob, or manual file reads, except when the task is pure…

maxkle1nz/m1nd · 78 tokens

release

Prepare a new release of Ariadne packages. Creates changesets, verifies build/tests, and drafts the PR to main.

CRJFisher/ariadne · 26 tokens