dvy1987/agent-loom / .agents/skills/code-simplification
code-simplification
VerifiedSimplify application code for clarity without changing behavior — refactor after tests pass, reduce nesting and duplication, match project conventions. Load when refactoring for readability, cleaning up after a feature ships, or when code review flags complexity. Also triggers on "simplify this code", "code simplification", "make this easier to read", "reduce complexity", "refactor for clarity". Not for compress/split/prune-skill (skill-library files). Pairs with technical-debt-audit.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.5 KB |
| references/examples.md | markdown | 1.9 KB |
| references/simplification-patterns.md | markdown | 1.9 KB |
| references/simplify-ignore.md | markdown | 1.7 KB |
references/simplify-ignore.md
View on GitHub# Simplify-Ignore — Block Protection
Adapted from [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills) `hooks/simplify-ignore.sh` (MIT). Full setup: **`hooks/SIMPLIFY-IGNORE.md`** at repo root.
## When to use
Mark performance-critical, generated, or vendored sections the model must not rewrite during **code-simplification**.
## Annotation syntax
```js
/* simplify-ignore-start: perf-critical */
// manually unrolled — do not collapse to a loop
result[0] = buf[0] ^ key[0];
result[1] = buf[1] ^ key[1];
/* simplify-ignore-end */
```
```python
# simplify-ignore-start: vendored hash table
# ... large third-party block ...
# simplify-ignore-end
```
- Optional reason after `start:` appears in the `BLOCK_<hash>` placeholder.
- Single-line blocks supported; multi-block per file supported.
- Comment styles: `/* */`, `//`, `#`, `<!-- -->`.
## Claude Code hooks (summary)
Register in `.claude/settings.json`:
- **PreToolUse Read** → filter file to placeholders
- **PostToolUse Edit|Write** → expand, apply edits, re-filter
- **Stop** → restore originals from `.claude/.simplify-ignore-cache/`
See `hooks/SIMPLIFY-IGNORE.md` for the JSON snippet and crash recovery (`echo '{}' | bash hooks/simplify-ignore.sh`).
## Example session
<input>Simplify `src/crypto.ts` but keep the unrolled XOR block</input>
<output>
1. Annotate XOR block with `simplify-ignore-start: perf-critical`.
2. Wire hooks per `hooks/SIMPLIFY-IGNORE.md`.
3. Run code-simplification on surrounding helpers only — model sees `/* BLOCK_a1b2c3d4: perf-critical */` instead of the loop body.
4. Session end restores real code with any approved edits outside protected blocks.
</output>
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |