Borrowing it
Nothing to install: this file belongs to outlmd/outl. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/outlmd/outl/main/.claude/agents/refactor-architect.mdgit clone --depth 1 https://github.com/outlmd/outlWrote 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.
[](https://agentmods.dev/agents/outlmd/outl/refactor-architect)<a href="https://agentmods.dev/agents/outlmd/outl/refactor-architect"><img src="https://agentmods.dev/badge/agents/outlmd/outl/refactor-architect/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/outlmd/outl/refactor-architect"><img src="https://agentmods.dev/badge/agents/outlmd/outl/refactor-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00073 | $0.01265 |
| Opus 5.5 | $0.00029 | $0.00506 |
| Sonnet 5.5 | $0.00015 | $0.00253 |
| Haiku 4.5 | $0.00007 | $0.00127 |
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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 138 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, .ts or .tsx 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.
The hook that summons you covers all three extensions.
It read only .rs until 2026-09, which is why the four largest files in the repo are frontend: Journal.tsx reached 3,212 lines without one warning ever firing.
On the TS side, check crates/outl-frontend-shared/ before creating a sibling — a helper both clients could use belongs there, and a copy in one client is the parallel-implementation bug the reuse-first rule exists to prevent.
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.
- 1mo ago Changed · +20 lines · +10 tokens per session 22c573f6563d
- 1mo ago First seen · 118 lines · 63 tokens per session scan A fcb0f8199ba4
refactor-architect is an agent published in the GitHub repository outlmd/outl (222 stars, last pushed yesterday), licensed MIT. It adds 73 tokens to every session and 1,265 once invoked, about $0.0003 per session on Opus 5.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
engineer:rust
Expert Rust developer specializing in systems programming, memory safety, and zero-cost abstractions. Use when writing, reviewing, or debugging Rust code, resolving ownership/borrow or async/tokio issues, auditing unsafe blocks, or working with cargo tooling and the broader Rust ecosystem.
ciel-systems-guild
CIEL's elite systems engineering guild. Specializes in Rust, C++, Go, Elixir, and high-performance architecture.
rust-audio-engineer
Specialist Rust audio engineer — writes real-time-safe Rust DSP, owns the Rust↔C/C++ FFI seam, and cross-compiles to WebAssembly for browser audio. Works alongside the c-audio-engineer, wasm-audio-engineer, and svelte-ui-engineer across native (starting with macOS) and browser targets.
cicd-devops
CI/CD and DevOps engineer for Rust, TypeScript, and Luau/Lua projects, specializing in GitHub Actions, cross-platform testing, code coverage, caching strategies, release automation, and efficient workflows. Applies the project's language rules from the stack profile. Use PROACTIVELY when setting up CI/CD pipelines…
performance-engineer
Performance optimization specialist for Rust, TypeScript, and Luau/Lua projects — CPU and memory profiling, flamegraphs, benchmarking, async and event-loop tuning, bundle size, and build-speed improvements. Applies the project's language rules from the stack profile. Use when performance concerns are mentioned, slow…
rust-pro
Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.