refactorer
soma init --template refactorer New project — scaffolds .soma/ with this template's identity, protocols, and settings.
/install template refactorer Existing project — adds this template's protocols and settings to your current .soma/.
soma fork template refactorer Copies to ~/.soma/templates/refactorer/ for customization. Your fork resolves first on future inits.
Details
Refactorer
Migration and refactoring specialist. Scan before touching, one file at a time, backward-compatible transitions, verify at every step.
Install
soma install template refactorer
What You Get
- 5 muscles — incremental-refactor (hot), precision-edit (hot), safe-file-ops, test-hygiene, task-tooling
- 4 protocols — tool-discipline, quality-standards, working-style, pre-flight
- SOMA.md — refactoring-focused identity that never changes code without scanning dependencies first
- Settings — higher muscle budget (4000 tokens), faster heat detection
Recommended Add-ons
These hub AMPS extend refactoring workflows:
- code-navigator — fast codebase navigation,
refsfor rename safety - ripple-awareness — map blast radius before committing
- verification-instinct — verify observable behavior is identical after changes
soma install muscle code-navigator
Best For
- Renaming modules, functions, or files across a codebase
- Migrating from one framework/library to another
- Restructuring directory layouts
- Cleaning up technical debt
- Any change that touches many files and needs to stay backward-compatible
What's Included
tool discipline
v3.1.0Scripts first, then raw commands. Read before edit. Check .soma/amps/scripts/ before writing grep/find. Build a script when you do the same thing twice.
quality standards
v1.0.0Deletion is irreversible — move or archive. Tests cover NEW code, not just pass on old. Blast radius before editing — find every caller, test, and doc. Atomic commits — one concern each.
working style
v1.2.0Be direct — no ceremony. Lead with action. Know your tools before starting — name them, note gaps. Understand before you change, verify after you build AND after you ship. Maintain the tools — when code changes, verify scripts still produce correct output. Plans live in files, not in context.
pre flight
v1.0.0Check what exists before creating. Verify assumptions before building.
incremental refactor
v1.0.0never refactor blind. Phase: (1) scan → `soma-refactor.sh scan/refs/graph/tags` to map dependencies + references, (2) route audit → `soma-refactor.sh routes` if touching extensions (signals/capabi
precision edit
v1.0.0the match must be verified by `read` first.
safe file ops
v1.0.0Safe file operations — read before write, verify after edit, never delete without scanning dependencies.
test hygiene
v1.1.0Validate tests aren't stale after any code removal, rename, or restructure. Run all suites, grep for orphaned references, check pass counts. Dead tests are worse than no tests.
task tooling
v1.0.0Before touching code, name your tools. Map scripts, muscles, and MAPs for each phase of the task. Gaps are worth building for.
Ships with Soma
These core protocols are always available — no install needed.
breath cycle
v3.0.1Inhale → hold → exhale. Auto-breathe at 50%/70%/85%. Rotation is self-initiated (natural-language wrap-up phrases fire it). The exhale is a complete checklist — the preload is the last step, never the only one.
community safe
v2.1.0Community/public content must never contain private data. ⚠ The channel guard blocks pro-keywords and credential FILE SHAPES only — nothing blocks emails, API keys or IPs at push time. This protocol covers the judgment and the check you must run yourself.
correction capture
v1.1.0When corrected, acknowledge without justifying, log old→new pattern, write a muscle if repeated. Third correction on same thing → escalate to protocol or identity.
detection triggers
v1.0.0Capture on corrections, preferences, 3+ patterns, knowledge gaps. Bubble-up: log → muscle → protocol → core.
frontmatter standard
v1.2.0Every .md file needs frontmatter: type, status, created, updated. All AMPS get `## TL;DR` for warm-tier loading.
git identity
v2.0.0Soma's guard checks git identity on every commit. Configure expected email in settings.json — mismatches trigger warnings. This behavior is built into soma-guard.ts.
heat tracking
v2.0.0Soma loads protocols and muscles by temperature: cold (skip), warm (breadcrumb), hot (full). Heat auto-adjusts from usage patterns and decays when idle. /pin and /kill for manual control.
hub sharing
v1.0.0How Soma handles /hub share. This behavior is built into the hub extension — this protocol helps you understand what's happening. Not loaded into the system prompt.
implementation plans
v1.0.0Write plans your next self can execute without re-reading anything.
meta workflow
v1.2.0The operating cadence — how work flows in a project. Three nested loops (session / feature / evolution); the cadence self-amends from its own observations. The body IS the project; instantiate this as a per-project META_WORKFLOW.md.
pattern evolution
v1.4.0Maturation: Skills → Muscles → Protocols → Automations. Born from gaps and repeated friction. Not every pattern climbs the full ladder.
pre flight
v1.0.0Check what exists before creating. Verify assumptions before building.
response style
v1.0.0Prefer prose over bullets. Minimum formatting for the content. One question per response max. No hollow social scripts.
session checkpoints
v2.0.0Soma can auto-commit .soma/ state on every exhale and surface git diffs on boot. Two tracks: .soma/ internal git (never pushed) and project code (squash before push).
task tracking
v1.0.0One board: .soma/_kanban.md. Move cards in real time. Verify on exhale. A stale board is worse than no board.
tool discipline
v3.1.0Scripts first, then raw commands. Read before edit. Check .soma/amps/scripts/ before writing grep/find. Build a script when you do the same thing twice.