audit-structure

audit-structure is a skill for Claude Code, Codex from JHostalek/dotclaude. It costs 77 tokens per session (2,493 once invoked), scanned A, original, CC0-1.0.

A workflow for reviewing how a codebase is organised and how its parts depend on one another. It looks for unclear ownership, oversized modules, misplaced files, broken layer boundaries, circular imports, and excessive nesting.

In plain words
What is it for?
Use it to inspect modules, packages, services, build targets, schemas, generated files, infrastructure, tests, and documentation. It helps identify what should change together, stay isolated, or depend in one direction.
Why use it?
It helps find structural problems that make changes risky, couple unrelated work, or allow components to access things they should not. The review considers runtime links and deployment relationships, not just the folder tree.

Skill for Claude CodeCodex

Part of the jhostalek-skills plugin — 32 skills, 12 agents shipped together

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/jhostalek/dotclaude/audit-structure
Any agent
npx skills add JHostalek/dotclaude --skill audit-structure
Clone the repo
git clone --depth 1 https://github.com/JHostalek/dotclaude

Made for: Claude Code, Codex.

Or install jhostalek-skills, the plugin that ships this one along with the rest of its 32 skills, 12 agents.

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-structure

README.md
[![agentmods](https://agentmods.dev/badge/skills/jhostalek/dotclaude/audit-structure.svg)](https://agentmods.dev/skills/jhostalek/dotclaude/audit-structure)
Your own site
<a href="https://agentmods.dev/skills/jhostalek/dotclaude/audit-structure"><img src="https://agentmods.dev/badge/skills/jhostalek/dotclaude/audit-structure.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,493 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.00077 $0.02493
Opus 5 $0.00039 $0.01247
Sonnet 5 $0.00015 $0.00499
Haiku 4.5 $0.00008 $0.00249

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

Security

Grade A, and why

audit-structure 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.

skills/audit-structure/SKILL.md · 127 lines

How it starts

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

!cat "${CLAUDE_SKILL_DIR}/../shared/audit-workflow.md"

Run as the structure dimension. Find topology and dependency design that makes ownership unclear, couples unrelated change, permits forbidden access, or fails under evolution, deployment, or runtime composition. Do not reduce structure to directory aesthetics.

Work top-down

Reconstruct the system before judging its tree:

  1. Identify intended behavior, domain and team ownership, deployable/runtime units, trust and data boundaries, public contracts, state and control flows, entry points, extension points, lifecycle paths, and operational modes. Derive structural invariants: what must change together, remain isolated, depend in one direction, or stay replaceable.
  2. Map those concepts to files, modules, packages, services, build targets, schemas, generated artifacts, infrastructure, tests, and documentation. Build the actual dependency graph, including runtime discovery, dependency injection, generated links, events, queues, shared storage, configuration, deployment coupling, and external consumers—not imports alone.
  3. Establish intended structure from converging evidence: architecture decisions and policy, enforced boundary configuration, public contracts, ownership, supported framework rules for the exact version, dependency direction, co-change history, release/deployment boundaries, and dominant maintained practice. No source is conclusive alone.
  4. Inspect architecture-wide boundary failures and dangerous compositions first. Then trace concrete change, build, startup, request, job, event, migration, failure, recovery, and shutdown paths across structural seams.
  5. Find wide across every applicable baseline area before applying noise filters. Classify each candidate as confirmed defect, worthwhile improvement, intentional constraint, migration state, generated/vendor/framework requirement, or unresolved question.

Do not infer sound structure from a policy file, framework, directory name, clean import graph, barrel, interface, dependency-injection container, helper abstraction, test presence, longstanding layout, or majority convention. Verify the exact consumers, runtime wiring, ownership, lifecycle, and failure behavior. A declared boundary that shared state, events, build coupling, or operational procedures bypass is not an effective boundary.

Repository convention constrains a correction but does not prove the convention correct. Where dominant structure conflicts with behavior, ownership, enforceable boundaries, or a newer explicit architecture, surface the conflict instead of normalizing toward the majority. History and co-change are evidence, not ground truth: repeated joint changes may expose missing cohesion, but can also reflect cross-cutting work, generated output, or an active migration.

Read the full file on GitHub · 127 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 · 127 lines · 77 tokens per session scan A 824378f23e54

Subscribe to this mod's changes

audit-structure is a skill published in the GitHub repository JHostalek/dotclaude (11 stars, last pushed today), licensed CC0-1.0. It adds 77 tokens to every session and 2,493 once invoked, about $0.0004 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.