skills/simplify-parallel/SKILL.md
Run code simplification across entire codebase using parallel agents with automatic segmentation and coordination
npx skillsauth add skinnyandbald/fish-skills simplify-parallelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Execute code simplification across a large codebase by automatically segmenting it into logical chunks and processing them concurrently with proper dependency ordering.
| Command | Description |
|---------|-------------|
| /simplify-parallel | Analyze and simplify entire codebase |
| /simplify-parallel --dry-run | Analyze only, show plan without executing |
| /simplify-parallel --focus=lib | Limit to specific area |
| /simplify-parallel --segments=4 | Set max parallel agents |
/simplify-parallel [options]
| Option | Default | Description |
|--------|---------|-------------|
| --dry-run | false | Analyze only, don't modify files |
| --focus=AREA | all | Limit to area: api, lib, components, hooks, pages |
| --segments=N | 3 | Maximum parallel agents |
| --max-files=N | 20 | Max files per segment |
| --verbose | false | Show detailed progress |
This section is the #1 priority. Violations here negate the value of simplification. Workers MUST read this section before making any changes.
Workers must NEVER remove any of the following:
| DO NOT REMOVE | Example |
|---------------|---------|
| Section separators | // ===== Types =====, // ===== Helpers =====, // ===== Component ===== |
| JSDoc/TSDoc docstrings | /** Computes the current project step... */ |
| File header comments | Block comments at top of files explaining purpose |
| "Why" comments | // Only truly block when mutation is actively in flight |
| Business logic comments | // While any query is loading, trust the server-provided step |
| Error handling rationale | // Check if error is retryable based on status code |
| TODO/FIXME/NOTE comments | These track technical debt |
| Biome ignore directives | // biome-ignore lint/style/useNamingConvention: reason |
| Re-export annotations | // Re-export types for convenience, // Production hooks use tRPC |
| Phase/section markers | // Phase 14.16, // Step 1: Fetch and validate |
| DO NOT REMOVE | Reason |
|---------------|--------|
| Explicit intent patterns | if (x) { return x; } return undefined; shows intent vs implicit return x; |
| Named intermediate variables | const isMutationPending = mutation.isPending is clearer than inlining |
| Error handling structure | Don't collapse try/catch blocks that handle different error types |
| Manual test output | console.log in *.integration.ts or manual.*.ts files is intentional |
If removing a comment or simplification changes the clarity of intent, don't do it.
Simplification means removing unnecessary complexity, not removing documentation.
The orchestrator analyzes the codebase structure:
1. Directory Tree Scan -> Identify top-level modules
2. File Metrics Collection -> Count files, LOC, complexity per directory
3. Dependency Graph -> Parse imports to build file->file dependency map
4. Cluster Formation -> Group tightly-coupled files into processing units
Files are grouped into segments based on:
src/app/api/, src/lib/, src/components/Orchestrator (Main Agent)
|-- Worker Agent (Segment A)
|-- Worker Agent (Segment B)
|-- Worker Agent (Segment C)
After all segments complete:
npm run typecheck)npm run lint)npm run test:run)npx tsx scripts/analyze-codebase.ts --verbose
Note: The analysis script automatically excludes .github/worktrees/ directories.
The analysis output shows which segments can run concurrently.
Key principle: Groups are processed sequentially, but segments within a group run in parallel.
For each parallel group:
After all groups complete, run full verification suite:
npm run typecheck
npm run lint
npx vitest run --exclude='.github/worktrees/**'
npm run build
Before committing, verify that comments were NOT removed:
# Check diff for removed comments
git diff HEAD -- '*.ts' '*.tsx' | grep -E '^\-\s*//' | grep -v '^\-\s*//\s*$'
If any helpful comments were removed, restore them before committing.
Manual verification checklist:
// ===...) still present in modified filesWorkers apply these transformations:
| Pattern | Before | After |
|---------|--------|-------|
| Nested ternaries | a ? b ? c : d : e | Helper function |
| Debug logs | console.log('debug') | Removed (production code only) |
| Repeated patterns | Same code 3+ times | Extracted function |
| Complex conditions | if (a && b \|\| c && d) | Named boolean |
| Long functions | 100+ lines | Split into smaller functions |
| Strategy | Implementation | |----------|---------------| | File Ownership | Each segment has exclusive file list - no overlaps | | Dependency Order | Foundation modules processed before dependents | | Sequential Groups | Groups run one at a time, segments within parallel | | Verification Gates | Type-check between groups catches issues early |
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
tools
Verify worktree plugin patches are intact after plugin updates. Checks compound-engineering and superpowers skills for Claude Code launch instructions.
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Reviews the feature you just built and adds missing test coverage. Focuses on behavior that matters — not coverage metrics. Use after completing a feature to identify untested code paths, edge cases, and risk areas.