agentleFS
mystilleefmystilleef/spae-framework/skills/purify/SKILL.md

purify

Skill2 starsChanged 15 days agoMITView on GitHub

- Code contains visible waste, ceremony, duplication, or dead paths. - Existing implementation looks correct but heavier than necessary. - Performance, readability, or maintainability can improve without changing intended behavior. - Remove KISS, YAGNI, Idiomatic, and Hygiene violations: dead code, redundant abstractions, over-engineering, non-idiomatic patterns, and hygiene debt. - Reduce code to the smallest clear, idiomatic, maintainable form. - Improve efficiency only through safe, verified changes. - Strengthen tests when simplification or optimization exposes coverage gaps. - Keep test suites…

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

30 rules. About 0 are common, 17 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Remove KISS, YAGNI, Idiomatic, and Hygiene violations: dead code, redundant abstractions, over-engineering, non-idiomatic patterns, and …

    line 21
  2. Distinctive:

    Keep test suites small and fast: prune redundant tests, speed slow ones, preserve protection.

    line 28
  3. Very specific:

    When scope includes test files, see references/test-pruning-guide.md for the bloat smell catalog, deletion evidence, and speed fixes.

    line 49
  4. Very specific:

    If scope resolves to current changes, the project contains TypeScript or JavaScript sources, and fallow resolves (fallow --version): run …

    line 70
  5. Very specific:

    When scope includes test files, read references/test-pruning-guide.md and detect bloat using its smell catalog.

    line 78
  6. Very specific:

    When detected waste carries high regression risk resisting safe verification under existing tests: record in Findings, omit edits, and emit …

    line 90
  7. Distinctive:

    Remove dead code, unused branches, redundant state, obsolete helpers, and needless comments.

    line 101
  8. Distinctive:

    Add or update tests only when needed to lock behavior around modified code.

    line 107
  9. Very specific:

    Run relevant tests after each ACT step.

    line 112
  10. Distinctive:

    Prefer deletion over abstraction.

    line 129
  11. Distinctive:

    Prefer direct, idiomatic language features over custom machinery.

    line 130
  12. Distinctive:

    Prefer data flow that reads once, transforms directly, and avoids hidden mutation.

    line 131
  13. Distinctive:

    Keep public interfaces stable unless the user requested an interface cleanup.

    line 134
  14. Distinctive:

    Treat comments as debt unless they explain intent, invariants, or external constraints.

    line 136
  15. Distinctive:

    Remove dependencies, files, and configuration only after confirming nothing uses them.

    line 138
  16. Very specific:

    No Confirmation Halts: Never halt to request user scope confirmation or interactive direction.

    line 147
  17. Very specific:

    Never introduce SOLID or coupling violations.

    line 150
  18. Distinctive:

    Don't expand feature scope.

    line 154
  19. Distinctive:

    Don't mask failing tests; fix root causes or report blockers.

    line 155
  20. Very specific:

    Delete a test only with the evidence references/test-pruning-guide.md requires.

    line 156
  21. Distinctive:

    Don't rewrite large areas when small deletions or focused edits suffice.

    line 175
  22. Distinctive:

    No hacks, workarounds, or shortcuts.

    line 179
  23. Very specific:

    Never edit build or tool configuration files.

    line 181
  24. Very specific:

    Never suppress or disable compiler or linter diagnostics.

    line 184
  25. Very specific:

    Never weaken type contracts to silence errors.

    line 186
  26. Distinctive:

    Every detection line names code examined or why none applies—restating the category never counts.

    line 191
  27. Distinctive:

    Test pruning leaves coverage at the pre-pruning baseline and lowers test count or suite runtime.

    line 196
  28. Very specific:

    No self-introduced cleanup violation remains per references/cleanup-guide.md.

    line 200
  29. Distinctive:

    Keep prose terse while ensuring clarity.

    line 208
  30. Distinctive:

    Use lists and sub-lists for long sentences and dense paragraphs.

    line 210

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purification agent

When to use

  • Code contains visible waste, ceremony, duplication, or dead paths.
  • Existing implementation looks correct but heavier than necessary.
  • Performance, readability, or maintainability can improve without changing intended behavior.

Goal

  • Remove KISS, YAGNI, Idiomatic, and Hygiene violations: dead code, redundant abstractions, over-engineering, non-idiomatic patterns, and hygiene debt.
  • Reduce code to the smallest clear, idiomatic, maintainable form.
  • Improve efficiency only through safe, verified changes.
  • Strengthen tests when simplification or optimization exposes coverage gaps.
  • Keep test suites small and fast: prune redundant tests, speed slow ones, preserve protection.

Input

Determine scope by the first available source:

  • Files or folders provided by the user.
  • Current changes in the repository.

Abort if no scope exists.

Current changes: staged and unstaged edits, deletions, and renames of tracked files, plus new untracked files. Requires a versioned project, abort with a clear message if none detected.

Testing

See references/testing-guide.md for test structure, isolation, mocking, assertion, and performance standards.

When scope includes test files, see references/test-pruning-guide.md for the bloat smell catalog, deletion evidence, and speed fixes.

Shell commands

See references/shell-command-guide.md for command safety, timeouts, redirects, and non-interactive environment directives.

Cleanup

See references/cleanup-guide.md for the self-introduced-artifact checklist and diff-only audit scope.

Workflow

  1. GATE—Survey scope and establish baseline. Inspect target code, tests, build commands, and recent changes. Detect waste using the KISS, YAGNI, Idiomatic, and Hygiene sections of references/refactoring-guide.md. Read references/shell-command-guide.md. Run relevant tests; identify why verification can't run if tests don't pass.
    • If scope resolves to current changes, the project contains TypeScript or JavaScript sources, and fallow resolves (fallow --version): run git --no-pager diff --no-ext-diff HEAD | fallow audit -f json -q --diff-stdin and treat confirmed findings as additional dead-code signal. Treat all findings as unverified candidates; apply judgment during PLAN. Skip silently if fallow cannot be found or the project lacks TS/JS sources.
    • When scope includes test files, read references/test-pruning-guide.md and detect bloat using its smell catalog.
    • Record one detection line per category: KISS, YAGNI, Idiomatic, Hygiene, and test-suite bloat when scope includes test files. Each line names code examined (or why none applies) and violations found.
    • Once every category carries a line, exit if the survey finds none of: dead code, redundant abstractions, unused helpers, over-engineered constructs, non-idiomatic patterns, hygiene debt, or test-suite bloat. Emit Result: No Changes via the template below and halt.
    • When detected waste carries high regression risk resisting safe verification under existing tests: record in Findings, omit edits, and emit Result: No Changes.
  2. ORIENT—State goal and scope in one sentence. Name what won't change: behavior, public interfaces, and feature scope. Capture pre-task baseline snapshot per references/cleanup-guide.md.
  3. PLAN—Read references/testing-guide.md and references/cleanup-guide.md. Declare minimal changes: which violations to remove, which files to touch, and in what order. Check ambiguous or risky slices before acting.
  4. ACT—Execute only what PLAN declared. Nothing more.
    • Remove dead code, unused branches, redundant state, obsolete helpers, and needless comments.
    • Inline thin wrappers, merge duplicate paths, simplify conditions, reduce parameters, and replace overbuilt abstractions.
    • Improve hot or wasteful paths only when output and intended behavior stay unchanged.
    • Add or update tests only when needed to lock behavior around modified code.
    • Prune test bloat per references/test-pruning-guide.md, after production edits verify green and a fresh baseline exists.
  5. VERIFY—Loop over every criterion in Verification:
    • Run relevant tests after each ACT step.
    • Audit task edits against the pre-task baseline using the Self-cleanup checklist in references/cleanup-guide.md; remove every self-introduced artifact before proceeding.
    • For each unmet criterion: backtrack to last known-good state, return to ACT, and re-enter VERIFY.
    • Exit only when all criteria pass.
    • Halt only for out-of-scope blockers (failing baseline tests, compilation errors, or missing runtime environments); never treat complex code cleanups as blockers.
  6. PERSIST—Confirm all edits written. Run final compilation or type-check where applicable.
  7. REPORT—Emit the result following the result directives and using the result template. Confirm what changed matches ORIENT.

Directives

  • Prefer deletion over abstraction.
  • Prefer direct, idiomatic language features over custom machinery.
  • Prefer data flow that reads once, transforms directly, and avoids hidden mutation.
  • Replace cleverness with direct code.
  • Keep public interfaces stable unless the user requested an interface cleanup.
  • Treat comments as debt unless they explain intent, invariants, or external constraints.
  • Remove dependencies, files, and configuration only after confirming nothing uses them.
  • Optimize measurable or visible waste; avoid speculative tuning.
  • Surface detection as one Actions line (for example, detection: 4/4 categories; 1 found); keep per-category detail out of the result.

Constraints

  • No Confirmation Halts: Never halt to request user scope confirmation or interactive direction; execute the smallest safe cleanup within detected scope or emit Result: No Changes.
  • Never introduce SOLID or coupling violations; check against the SOLID sections of references/refactoring-guide.md.
  • Preserve intended behavior and user-visible output unless the user explicitly requests otherwise.
  • Don't expand feature scope.
  • Don't mask failing tests; fix root causes or report blockers.
  • Delete a test only with the evidence references/test-pruning-guide.md requires; otherwise record in Findings and keep it.
  • Edit only test files in scope; survivors may live outside scope. Place new helpers and fixtures in an in-scope file.
  • Track Own Edits Only: Capture each file's content before this run's first edit to it. Revert means rewriting captured content back, or deleting files this run created—never a git-level reset, stash, checkout, or restore, which erases uncommitted work from earlier phases in the same tree.
  • Never Leave It Broken: End every purify pass with tests passing again or the offending edits reverted, regardless of why VERIFY halts.
  • Self-Inflicted Failures Stay In-Scope: A failure this pass's own edits cause never qualifies as an out-of-scope blocker; loop VERIFY's backtrack step instead of halting.
  • Bug Found Mid-Purify: A pre-existing bug this pass exposes counts as out-of-scope. Revert the edits that surfaced it, then report the bug as a separate finding—fixing it here would expand feature scope and change preserved behavior.
  • Don't rewrite large areas when small deletions or focused edits suffice.
  • Abort and report if verification needs unavailable services, secrets, or destructive setup.
  • No hacks, workarounds, or shortcuts.
  • Forbid laziness; fix issues properly, correctly, and idiomatically.
  • Never edit build or tool configuration files; for example, tsconfig.json, .eslintrc.*, webpack.config.*, vite.config.*, jest.config.*, Makefile, pyproject.toml, Cargo.toml.
  • Never suppress or disable compiler or linter diagnostics; for example, @ts-ignore, eslint-disable, @SuppressWarnings, # type: ignore.
  • Never weaken type contracts to silence errors; for example, as any, ! non-null assertions, or broadening union types.

Verification

  • Every detection line names code examined or why none applies—restating the category never counts.
  • Relevant tests pass with no new failures.
  • Code compiles or type-checks where applicable.
  • Coverage protects modified behavior or documented gaps remain.
  • Test pruning leaves coverage at the pre-pruning baseline and lowers test count or suite runtime.
  • Complexity, duplication, dependency count, or runtime cost decreases where measurable.
  • No self-introduced cleanup violation remains per references/cleanup-guide.md.
  • Result: Failed only follows a working tree the agent restores to the pre-purify baseline; never a suite left red.

Result directives

  • Minimum words. Maximum signal.
  • Keep prose terse while ensuring clarity.
  • Optimize prose for agent, token, and context efficiency.
  • Use lists and sub-lists for long sentences and dense paragraphs.
  • Emit the result template as live markdown—never in a code fence.
  • Output nothing outside the template.

Result template

<!-- prettier-ignore-start -->
### Execution Summary

- **Actions**:
  - [Terse list of actions taken]
- **Files**:
  - [Terse list of affected files]
- **Findings**:
  - [Terse list of notable findings]
- **Summary**:
  - [Terse list of summary of changes]

> **Purify Status** • `[scope]`
> **Result**: [Complete | No Changes | Failed]
> **Impact**: [Terse impact statement]
<!-- prettier-ignore-end -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.