outl: Agent for Claude Code

.claude/agents/refactor-architect.md

refactor-architect is an agent for Claude Code from outlmd/outl. It costs 73 tokens per session (1,265 once invoked), scanned A, original, MIT.

An architecture guide for splitting oversized Rust files into smaller modules organized by responsibility. It can also carry out the approved refactoring while keeping tests intact.

In plain words
What is it for?
Use it when a Rust file becomes too large or when reviewing how its responsibilities should be separated.
Why use it?
It provides a clear way to reduce the complexity of large files without adding unnecessary abstractions or changing behavior.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths.

This is outlmd/outl's own configuration. It tells Claude Code how to work on outl itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything outl configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/check-file-size.sh.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/outlmd/outl/main/.claude/agents/refactor-architect.md
Clone the repo
git clone --depth 1 https://github.com/outlmd/outl

Made for: Claude Code.

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 refactor-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/outlmd/outl/refactor-architect/github.svg)](https://agentmods.dev/agents/outlmd/outl/refactor-architect)
Your own site
<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.

agentmods 80×15 button for refactor-architect

Your own site · 80×15
<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>
Per session 73 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,265 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00073 $0.01265
Opus 5.5 $0.00029 $0.00506
Sonnet 5.5 $0.00015 $0.00253
Haiku 4.5 $0.00007 $0.00127

Measured 1mo ago against content hash 22c573f6563d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.claude/agents/refactor-architect.md · 138 lines

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

  1. 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.

  2. One module, one concept. If you need to write "and" in the module name (state_and_render), it's already wrong.

  3. Minimal public surface. When extracting mod x, expose only what other modules call. The rest stays pub(crate) or private.

  4. 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.

  5. Tests follow. If a function moves to mod x, its inline tests go with it. If a test covers multiple modules, it moves to tests/ 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:
  - ...
  - ...

Read the full file on GitHub · 138 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. 1mo ago Changed · +20 lines · +10 tokens per session 22c573f6563d
  2. 1mo ago First seen · 118 lines · 63 tokens per session scan A fcb0f8199ba4

Subscribe to this mod's changes

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.

Related

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.

franzos/claude-plugins · 59 tokens

ciel-systems-guild

CIEL's elite systems engineering guild. Specializes in Rust, C++, Go, Elixir, and high-performance architecture.

jxoesneon/Ciel · 32 tokens

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.

gertsylvest/meta-team · 75 tokens

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…

bug-ops/claude-plugins · 79 tokens

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…

bug-ops/claude-plugins · 77 tokens

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.

dotclaude/marketplace · 59 tokens