agentleFS
TairitsuaTairitsua/Monica/.agents/skills/code-simplifier/SKILL.md

code-simplifier

Skill13 starsChanged 7 months agoMITView on GitHub

Simplify recently modified or explicitly selected code for clarity and maintainability while preserving the active task's intended behavior. Use after implementation or when asked to clean up, simplify, or review code for unnecessary complexity. Default to a narrow, coherent scope; do not use for broad architecture redesign, module-boundary changes, or breaking API redesign.

42 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use comment-analyzer, performance and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lin30Skill

    comment-analyzer

    微博评论抓取与深度分析,生成可视化HTML报告。Use when user asks to analyze weibo comments, analyze social media comments, or requests sentiment analysis from weibo posts

    Also in 3 projects that use this

  • pluginagentmarketplaceSkill

    performance

    Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.

    Also in 3 projects that use this

  • AWSSkill

    setup-matt-pocock-skills

    Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

    Also in 3 projects that use this

  • OpenAISkill

    verification-before-completion

    Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

    Also in 4 projects that use this

  • AWSSkill

    to-spec

    Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 9 projects that use this

  • +2 more from aws

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 40 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read callers, tests, contracts, and directly coupled code only as needed to understand behavior, invariants, side effects, concurrency, and …

    line 14
  2. Distinctive:

    Prefer established repository patterns and direct implementations over new concepts.

    line 16
  3. Distinctive:

    Run the most relevant repository-required verification and review the final diff for behavior drift and unrelated edits.

    line 17
  4. Distinctive:

    Stop when the target is locally clear and further changes would mainly express style or anticipate hypothetical requirements.

    line 18
  5. Distinctive:

    Remove provably redundant code and abstractions.

    line 24
  6. Distinctive:

    Do not add configurability, extension points, wrappers, factories, providers, events, or generic frameworks for hypothetical future use.

    line 31
  7. Distinctive:

    Keep external, expensive, or fallible work outside critical sections.

    line 36
  8. Distinctive:

    Do not move I/O or collaborator dependencies onto a model merely because a method assigns many of that model's fields.

    line 37
  9. Distinctive:

    Do not split files or methods solely to reduce length, collapse distinct responsibilities to reduce line count, or replace clear code with …

    line 38
  10. Distinctive:

    Remove comments that repeat the code, but retain comments that explain non-obvious intent, invariants, concurrency, or external constraints.

    line 39
  11. Distinctive:

    Treat this bounded workflow as the applicable refinement mode when the skill is active.

    line 40
  12. Distinctive:

    Keep reporting proportional to the work and any active collaboration instructions.

    line 44

“Common” is measured: kept by at least 6 in 10 of the 40 edited versions of this file we could read. “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

Code Simplifier

Reduce cognitive load and unnecessary concepts without changing behavior beyond the active task.

Workflow

  1. Respect the request mode. For review or report requests, inspect and report only. For cleanup or refactor requests, implement the requested simplifications.
  2. Use the scope named by the user or active task. Otherwise, use the current diff to identify recently modified code while treating pre-existing or unrelated worktree changes as out of scope. If no clear target remains, establish one before acting; do not roam through unrelated code.
  3. Read callers, tests, contracts, and directly coupled code only as needed to understand behavior, invariants, side effects, concurrency, and repository conventions.
  4. Edit the narrowest coherent responsibility. Expand beyond changed code only to preserve correctness, compilation, or a directly related invariant, or to complete a concrete simplification within that responsibility that reduces net complexity.
  5. Prefer established repository patterns and direct implementations over new concepts.
  6. Run the most relevant repository-required verification and review the final diff for behavior drift and unrelated edits.
  7. Stop when the target is locally clear and further changes would mainly express style or anticipate hypothetical requirements.

Simplification Priorities

Apply these choices in order when they improve clarity:

  • Remove provably redundant code and abstractions.
  • Reduce unnecessary nesting, temporary state, indirection, and semantic duplication.
  • Make control flow, names, and ownership explicit.
  • Reuse an existing project pattern or helper when it is clearer than a local implementation.
  • Extract or move behavior only when it names a meaningful operation, owns a real invariant, or lowers total coupling.
  • Introduce a new abstraction only for a current, demonstrated need and only when it removes more concepts, branching, duplication, or volatility than it adds.

Do not add configurability, extension points, wrappers, factories, providers, events, or generic frameworks for hypothetical future use.

Boundaries

  • Preserve the active task's intended behavior and avoid additional changes to public APIs, return values, exceptions, cancellation, ordering, side effects, and concurrency semantics.
  • Keep external, expensive, or fallible work outside critical sections. Encapsulate atomic state transitions and invariant enforcement behind the state-owning abstraction when that makes ownership clearer.
  • Do not move I/O or collaborator dependencies onto a model merely because a method assigns many of that model's fields. Rich models are a tool, not a goal; DTOs, configuration, snapshots, and transport models may remain data-focused.
  • Do not split files or methods solely to reduce length, collapse distinct responsibilities to reduce line count, or replace clear code with clever one-liners.
  • Remove comments that repeat the code, but retain comments that explain non-obvious intent, invariants, concurrency, or external constraints.
  • Treat this bounded workflow as the applicable refinement mode when the skill is active. General repository encouragement to refactor broadly does not expand the scope unless the user explicitly requests broader redesign.

Output

Keep reporting proportional to the work and any active collaboration instructions. Report the meaningful simplification, behavior-sensitive decisions, and verification performed. Mention broader risks separately without implementing them outside the requested scope.

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.