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

purify

Skill1 starsChanged 4 months 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. Determine scope by the…

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 15 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    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. Very specific:

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

    line 65
  3. Distinctive:

    Check ambiguous or risky slices before acting.

    line 83
  4. Distinctive:

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

    line 85
  5. Distinctive:

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

    line 91
  6. Very specific:

    Run relevant tests after each ACT step.

    line 94
  7. Distinctive:

    Prefer deletion over abstraction.

    line 109
  8. Distinctive:

    Prefer direct, idiomatic language features over custom machinery.

    line 110
  9. Distinctive:

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

    line 111
  10. Distinctive:

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

    line 114
  11. Distinctive:

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

    line 116
  12. Distinctive:

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

    line 118
  13. Very specific:

    Never introduce SOLID or coupling violations.

    line 124
  14. Distinctive:

    Don't expand feature scope.

    line 128
  15. Distinctive:

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

    line 129
  16. Distinctive:

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

    line 144
  17. Distinctive:

    No hacks, workarounds, or shortcuts.

    line 148
  18. Very specific:

    Never edit build or tool configuration files.

    line 150
  19. Very specific:

    Never suppress or disable compiler or linter diagnostics.

    line 153
  20. Very specific:

    Never weaken type contracts to silence errors.

    line 155
  21. Very specific:

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

    line 165
  22. Distinctive:

    Keep prose terse while ensuring clarity.

    line 173
  23. Distinctive:

    Use lists and sub-lists over paragraphs and long sentences.

    line 175

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

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.

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.
    • Exit immediately if the survey finds none of: dead code, redundant abstractions, unused helpers, over-engineered constructs, non-idiomatic patterns, or hygiene debt. Emit Result: No Changes via the template below and halt.
  2. ORIENT—State goal and scope in one sentence. Name what won't change: behavior, public interfaces, and feature scope.
  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.
  5. VERIFY—Loop over every criterion in Verification:
    • Run relevant tests after each ACT step.
    • Audit the task's own git diff/git status against 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.
  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.

Constraints

  • 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.
  • 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

  • Relevant tests pass with no new failures.
  • Code compiles or type-checks where applicable.
  • Coverage protects modified behavior or documented gaps remain.
  • 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 over paragraphs and long sentences.
  • 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.