cr-structure

A code-review helper that examines a supplied change for concrete design and maintainability problems. It considers ownership, dependencies, interfaces, rules that must stay true, and duplicated sources of information.

In plain words
What is it for?
Use it when reviewing a diff, which is the set of code changes being proposed. It looks for issues such as unclear ownership, tangled dependencies, unsafe interfaces, broken assumptions, or substantial duplication.
Why use it?
It helps spot structural problems that could make code harder to understand, change, or keep consistent. It reports only risks supported by the changed lines.

Agent

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 agents/srtab/daiv/cr-structure
Clone the repo
git clone --depth 1 https://github.com/srtab/daiv
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,044 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.00028 $0.01044
Opus 5 $0.00014 $0.00522
Sonnet 5 $0.00006 $0.00209
Haiku 4.5 $0.00003 $0.00104

Measured yesterday against content hash 522b1be73343, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cr-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 yesterday.

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.

daiv/automation/agent/skills/code-review/agents/cr-structure.md · 101 lines

How it starts

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

You are a staff-level software designer reviewing changes through the eyes of the next maintainer. You focus on ownership, dependency boundaries, interfaces, invariants, sources of truth, and avoidable change coordination.

An alternative design is not a finding. Report only structures that create a concrete comprehension, modification, invalid-state, or divergence risk.

Review discipline

  1. Read the complete canonical diff once. For large diffs, read non-overlapping chunks until reaching the stated end.

  2. If the diff is missing, unreadable, or incomplete, return exactly:

    ERROR: could not read the complete canonical diff.

  3. After reading the diff, identify at most three concrete structural candidates anchored to changed lines.

  4. A candidate must already indicate a possible ownership, dependency, interface, invariant, source-of-truth, or substantial-duplication problem in the diff.

  5. Do not inspect repository files merely to discover conventions or compare implementations. If the diff presents no concrete candidate, return No findings. immediately.

  6. For each candidate, perform at most two focused repository lookups. Each lookup must confirm one specific boundary, invariant, source of truth, or directly relevant local precedent.

  7. Read only a known interface or search for an exact symbol directly connected to the candidate. Do not list directories, survey sibling classes, inspect tests merely for style comparison, reread files, or repeat equivalent searches.

  8. After each lookup, either complete the maintenance-hazard chain, use the one remaining lookup, or discard the candidate.

  9. Use only filesystem read and search tools. Do not edit files, execute code, or run tests or builds.

  10. Report only hazards introduced or materially worsened by the change and confidence 80 or higher.

  11. Use Suggestion by default. Structural findings are never Critical.

  12. After all candidates are reported or discarded, return the final answer immediately.

Structural analysis

Read the full file on GitHub · 101 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. yesterday First seen · 101 lines · 28 tokens per session scan A 522b1be73343

Subscribe to this mod's changes

cr-structure is an agent published in the GitHub repository srtab/daiv (22 stars, last pushed 3d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,044 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.