agentleFS
shreyam1008shreyam1008/shre-skills/skills/code-quality/SKILL.md

code-quality

Skill0 starsChanged 48 days agoMITView on GitHub

Reviews and simplifies code for maintainability and correctness. Use for a requested code review, refactor, removal of unnecessary abstractions or dependencies, or investigation of tangled logic. Not a default checklist for every small edit.

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 65 edited versions we read keep these.

  • 6

    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:

    Start from the requested change or observed maintenance problem.

    line 9
  2. Distinctive:

    Prefer an existing platform API, standard library, or installed dependency when it meets the actual contract.

    line 14
  3. Distinctive:

    Remove unused branches and indirection after checking callers.

    line 15
  4. Distinctive:

    Check empty, absent, duplicate, reordered, concurrent, and failed inputs relevant to the code.

    line 22
  5. Distinctive:

    Check sensitive paths for authorization before access, contextual output encoding, safe query/command APIs, and secret-free logging.

    line 25
  6. Distinctive:

    Run checks appropriate to the changed behavior.

    line 35

“Common” is measured: kept by at least 6 in 10 of the 65 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 review and simplification

Start from the requested change or observed maintenance problem. Identify the behavior, public contracts, and callers that must survive the refactor. Return a focused patch or findings supported by concrete code paths.

Choose the change

  • Trace one representative input through validation, decisions, and side effects. Name where responsibilities become coupled, state becomes inconsistent, or errors disappear.
  • Prefer an existing platform API, standard library, or installed dependency when it meets the actual contract. Compare behavior and maintenance cost before replacing custom code.
  • Remove unused branches and indirection after checking callers. Keep an abstraction when it expresses a real boundary, ownership rule, testing seam, or variation; the number of implementations alone is not a reason to delete it.
  • Simplify the cause of repeated complexity. Do not compress readable logic into clever expressions or mix unrelated cleanup into a focused fix.
  • Preserve security checks, accessibility, error recovery, compatibility, and requested detail. A shorter diff is useful only when the behavior remains correct.

Review correctness at boundaries

  • Parse untrusted data before depending on its shape. Separate parsing from domain decisions and I/O so each failure has a clear owner.
  • Check empty, absent, duplicate, reordered, concurrent, and failed inputs relevant to the code. Validate state transitions rather than checking only successful output.
  • Make ownership of mutable state explicit. Check whether retries, cancellation, stale asynchronous results, or partial writes can corrupt shared state.
  • Preserve public types and failure contracts. Prefer explicit states to contradictory flags; remove casts or suppressions only by establishing the missing invariant.
  • Check sensitive paths for authorization before access, contextual output encoding, safe query/command APIs, and secret-free logging. Use a security-specific review when that is the requested scope.

Simplify with evidence

List the callers or tests that justify removing a branch or dependency. Keep migration requirements visible when a public API changes. Reuse the repository's style and tooling instead of imposing naming, formatting, or folder conventions.

Replace comments that restate the code with explanations of non-obvious constraints. Report the outcome, validation, and remaining tradeoffs at the depth the user needs; this skill does not prescribe a universal response format.

Verify and report

Run checks appropriate to the changed behavior. For a bug, reproduce the failure before changing it when feasible and verify it no longer occurs. Prefer behavior-level tests that cover meaningful failure paths; do not add tests merely to mirror a refactor's internal shape.

For a review, prioritize actionable findings and name their consequence and location. For an edit, summarize what became simpler, which behavior was preserved, and what was tested. Do not claim correctness from a smaller line count alone.

References and attribution

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.