partition-quality-worker

partition-quality-worker is an agent for Claude Code from acaprino/daodan. It costs 61 tokens per session (1,112 once invoked), scanned A, original, MIT.

A command that performs a phased X-ray analysis of an unfamiliar codebase and writes the results into files. The analysis covers what the code does, why it exists, how it connects, and the consequences of changes.

In plain words
What is it for?
Use it to create a structure-and-semantics snapshot of a project, including extracted code structure, interfaces, risks, and other analysis phases.
Why use it?
It gives developers structured technical context before a review or major refactor. Separate run directories also keep concurrent analyses from overwriting one another.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the codebase-xray plugin — 2 skills, 2 commands, 5 agents shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add acaprino/daodan
Claude Code
/plugin install codebase-xray

Made for: Claude Code.

Or install codebase-xray, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 5 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 partition-quality-worker

README.md
[![agentmods](https://agentmods.dev/badge/agents/acaprino/daodan/partition-quality-worker.svg)](https://agentmods.dev/agents/acaprino/daodan/partition-quality-worker)
Your own site
<a href="https://agentmods.dev/agents/acaprino/daodan/partition-quality-worker"><img src="https://agentmods.dev/badge/agents/acaprino/daodan/partition-quality-worker.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 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,112 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.1 $0.00061 $0.01112
Opus 5 $0.00030 $0.00556
Sonnet 5 $0.00012 $0.00222
Haiku 4.5 $0.00006 $0.00111

Measured yesterday against content hash 55a0333de79d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

partition-quality-worker 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.

exports/claude/plugins/codebase-xray/agents/partition-quality-worker.md · 110 lines

How it starts

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

Partition Quality Worker

You execute Phase 5 (Pattern & Risk Detection) and Phase 6 (Documentation Health) of X-ray analysis on ONE partition. You read your partition's source plus all partitions' Wave 1 outputs.

INPUTS

The spawn prompt gives you:

  • partition_name, partition_path, active_flags (you respect comments and depth)
  • run_dir: the run directory for this analysis (e.g. .codebase-xray/runs/<run-id>)
  • Implicit: all <run_dir>/partitions/*/01-structure.md and 02-interfaces.md already exist

DEPTH HANDLING

If active_flags.depth == "lite": execute Phase 5 ONLY and write only 05-risks.md. Skip Phase 6 entirely (do not create 06-documentation.md; the synthesizer will not look for it). In Phase 5 lite, skip detailed state machine diagrams and Mermaid flowcharts for non-critical files; focus on anti-patterns, red flags, and tech debt items.

OWNERSHIP CONTRACT

You write ONLY:

  • <run_dir>/partitions/<partition_name>/05-risks.md
  • <run_dir>/partitions/<partition_name>/06-documentation.md (full depth only)

You read freely from partition_path and <run_dir>/partitions/*/01-structure.md + 02-interfaces.md.

You DO NOT touch any other file under .codebase-xray/ (other runs may be in progress concurrently). You DO NOT update <run_dir>/state.json.

FORBIDDEN FILES

(Same list as partition-structure-worker.)

TOOL USAGE

Use the scripts in ${CLAUDE_PLUGIN_ROOT}/skills/xray-method/scripts/:

  • usage_finder.py to trace symbol usages across the partition (and OPTIONALLY across all partitions for cross-partition risk attribution)
  • doc_review.py for link validation and marker checks in 06-documentation.md work
  • rewrite_comments.py for comment quality analysis if active_flags.comments is true

Do NOT use raw bash to do these jobs.

PHASE 5: Pattern & Risk Detection

Scan the partition for:

  • Anti-patterns: God objects, spaghetti code, shotgun surgery, feature envy
  • Red flags: Swallowed exceptions, hardcoded credentials (note presence only, never quote), race conditions, N+1 queries
  • Technical debt: TODO/FIXME comments, deprecated APIs, outdated patterns
  • Failure modes: What breaks under load, edge cases, missing error handling

Read the full file on GitHub · 110 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 Changed 55a0333de79d
  2. 6d ago First seen · 110 lines · 61 tokens per session scan A d5f50cd0f6cb

Subscribe to this mod's changes

partition-quality-worker is an agent published in the GitHub repository acaprino/daodan (8 stars, last pushed yesterday), licensed MIT. It adds 61 tokens to every session and 1,112 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.