From 83f9d85d8942aaf7a14575a1d6c309d6201885d4 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sun, 1 Mar 2026 20:08:58 -0600 Subject: [PATCH] store: Pattern: Parallel /simplify agents with isolated worktrees for large refactors --- ...ents-with-isolated-worktrees-for-d75e2a.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 graph/workflows/pattern-parallel-simplify-agents-with-isolated-worktrees-for-d75e2a.md diff --git a/graph/workflows/pattern-parallel-simplify-agents-with-isolated-worktrees-for-d75e2a.md b/graph/workflows/pattern-parallel-simplify-agents-with-isolated-worktrees-for-d75e2a.md new file mode 100644 index 00000000000..1d9743a2861 --- /dev/null +++ b/graph/workflows/pattern-parallel-simplify-agents-with-isolated-worktrees-for-d75e2a.md @@ -0,0 +1,40 @@ +--- +id: d75e2afd-8348-4fe6-9ea1-731604505aa6 +type: workflow +title: "Pattern: Parallel /simplify agents with isolated worktrees for large refactors" +tags: [sba-scouting, rust, claude-code, workflow, refactoring, parallel, worktree] +importance: 0.6 +confidence: 0.8 +created: "2026-03-02T02:08:58.862746+00:00" +updated: "2026-03-02T02:08:58.862746+00:00" +--- + +# Parallel /simplify with Isolated Worktree Agents + +## Overview +Successfully ran 17 parallel agents with `isolation: "worktree"` to simultaneously review and simplify every substantive file in the Rust codebase. + +## How It Works +- Each agent gets its own git worktree copy of the repo +- Agents applied changes directly to the main working tree (not isolated to their worktrees) +- Run all agents in parallel — no coordination needed for read-heavy simplification tasks + +## Results on sba-scouting Rust rewrite +- 17 agents, 24 files modified +- Net: -261 lines removed +- All 105 tests passed after integration + +## Common Simplifications Found +- Duplicated helpers consolidated: `format_rating`, `format_swar`, `tier_style`, `format_relative_time` +- Heap allocations replaced with stack arrays/HashSets +- `OnceLock` for invariant hashes (computed once, reused) +- Transaction wrapping for atomic DB operations +- `tokio::try_join!` for parallel async DB queries + +## When to Use +- Large refactor/cleanup passes across many files +- When changes are independent per-file (no cross-file coordination needed) +- After a feature phase is complete and code needs polish + +## Usage +Use `/simplify` slash command (or equivalent Agent tool call) with `isolation: "worktree"` per file.