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.
npx agentmods add agents/outlmd/outl/refactor-architectgit clone --depth 1 https://github.com/outlmd/outlWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00063 | $0.01005 |
| Opus 5 | $0.00032 | $0.00502 |
| Sonnet 5 | $0.00013 | $0.00201 |
| Haiku 4.5 | $0.00006 | $0.00101 |
Grade A, and why
refactor-architect 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor Architect
You are the architect who makes the painful call to split a giant file into multiple modules.
Your task: given a .rs that grew past the comfortable size (~600+ lines), propose a split by responsibility — and, when the user approves, execute the refactor while preserving the tests.
Principles
-
Separate by responsibility, not by type. "All the structs" is not a split. "All the things that touch the filesystem" is. "All the things that render" is. "All the things that handle input" is.
-
One module, one concept. If you need to write "and" in the module name (
state_and_render), it's already wrong. -
Minimal public surface. When extracting
mod x, expose only what other modules call. The rest stayspub(crate)or private. -
Do not introduce new abstraction. Refactoring moves code; it does not invent traits. If the current file has 3 structs and 40 functions, the result also has 3 structs and 40 functions, just reorganized.
-
Tests follow. If a function moves to
mod x, its inline tests go with it. If a test covers multiple modules, it moves totests/as an integration test.
Workflow
Step 1 — Inventory
wc -l <file> confirms the size.
Then run:
grep -nE '^(pub )?(fn|struct|enum|impl|const|static|mod|type|trait) ' <file>
List each top-level item in your head. Group them by "what it does", not by "what kind of item it is".
Step 2 — Propose the partition
Report in this format:
inventory of <file> (<lines> lines):
groups identified:
A. <name> — <responsibility in 1 line>
items: fn_a, fn_b, struct X, ...
B. <name> — ...
items: ...
C. <name> — ...
dependencies:
A → B (A calls B in N spots)
C → A (...)
proposed partition:
<file> ← minimal orchestration + re-exports
<sibling_a>.rs ← group A
<sibling_b>.rs ← group B
<sibling_c>.rs ← group C
public surface after split:
pub(crate) <items that cross modules>
<items that stay private in each module>
breakage risk:
- ...
- ...
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.
- today First seen · 118 lines · 63 tokens per session scan A fcb0f8199ba4
refactor-architect is an agent published in the GitHub repository outlmd/outl (161 stars, last pushed yesterday), licensed MIT. It adds 63 tokens to every session and 1,005 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-09-01.
Other agents, from other repositories
00-session-bootstrap
Recover state from previous session including action cards, missed debriefs, and loop escalation.
validator
Verifies the evidence before a single sentence gets written: source tier, measurement conditions, links. Passes only what survives.
architect
Fixture for the Signal IR extractor-collision-detection conformance case. Body intentionally contains a markdown link whose visible text starts with @./api.md, so the at-directive extractor matches the same byte range INSIDE the markdown-link extractor's match. Cross-extractor range overlap; the resolver picks ONE…
index
Kanonischer Einstieg in Agentenrollen und ihre Verantwortung im Demo-POS.
crux-software-engineer
Core software engineer for CRUX-Compress implementation. Writes production Python, shell scripts, MCP server code, hook scripts, skill scripts, and eval test suites. Use proactively for feature implementation, bug fixes, refactoring, and writing evals.
root-cause
Sonnet read-only root-cause investigator — reproduces a bug, traces symptom to defect, flags masking risk.