agentleFS
aminemanai2003aminemanai2003/personal-agent-skills/skills/code-quality/SKILL.md

code-quality

Skill4 starsChanged 4 months agoMITView on GitHub

Guide implementation and refactoring toward correct, readable, compatible, secure, and maintainable code. Use when writing production code, changing shared behavior, evaluating dependencies, modifying APIs or schemas, or cleaning up implementation structure.

38 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use spring-boot, design-patterns and 8 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.
  • MindrallySkill

    spring-boot

    Expert guidance for Spring Boot application development with best practices for RESTful APIs, testing, security, and deployment

    Also in 3 projects that use this

  • ratacatSkill

    design-patterns

    Use when designing software architecture, refactoring code structure, solving recurring design problems, or when code exhibits symptoms like tight coupling, rigid hierarchies, scattered responsibilities, or difficult-to-test components. Also use when choosing between architectural approaches or reviewing code for structural improvements.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    python

    Python 3.13 with uv package manager via mise. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `python` work when listed in TEAM.yaml or explicitly requested.

    Also in 3 projects that use this

  • 0xSeroSkill

    security

    Also in 4 projects that use this

  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 3 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 37 edited versions we read keep these.

  • 10

    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 the files to change, their tests, and one comparable implementation.

    line 25
  2. Distinctive:

    Keep orchestration separate from domain logic when their concerns diverge.

    line 29
  3. Distinctive:

    Add or update behavior-focused tests, including relevant edge and failure cases.

    line 30
  4. Distinctive:

    Run targeted checks, then broader checks proportional to shared impact.

    line 31
  5. Distinctive:

    Do not refactor unrelated code during feature work.

    line 36
  6. Distinctive:

    Do not add an abstraction until it removes real complexity or matches a local pattern.

    line 37
  7. Distinctive:

    Do not add a dependency for a trivial convenience.

    line 38
  8. Distinctive:

    Do not silently break public APIs, schemas, persisted data, or configuration.

    line 39
  9. Distinctive:

    Do not optimize without a requirement or measurement when it reduces clarity.

    line 40
  10. Distinctive:

    Parser: use a maintained structured parser for a real grammar.

    line 60

“Common” is measured: kept by at least 6 in 10 of the 37 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 Quality

Purpose

Produce code that fits the existing system, makes behavior explicit, and remains easy to verify and change.

Inputs

  • The behavioral contract and acceptance criteria.
  • Repository instructions, nearby implementation patterns, tests, and public types.
  • Data, security, performance, and compatibility boundaries.
  • Available commands for tests, linting, typing, builds, and formatting.

Scope Boundary

This skill governs implementation and refactoring. For a review-only request, use review-code; for a complete authorized feature, compose this skill through build-feature.

Process

  1. Read the files to change, their tests, and one comparable implementation.
  2. Identify ownership boundaries and public contracts before designing the change.
  3. Choose the smallest coherent implementation that matches established patterns.
  4. Make invalid states difficult to represent with types, validation, and explicit errors where justified.
  5. Keep orchestration separate from domain logic when their concerns diverge.
  6. Add or update behavior-focused tests, including relevant edge and failure cases.
  7. Run targeted checks, then broader checks proportional to shared impact.
  8. Review the diff for duplication, dead paths, hidden coupling, secrets, and unnecessary dependencies.

Constraints

  • Do not refactor unrelated code during feature work.
  • Do not add an abstraction until it removes real complexity or matches a local pattern.
  • Do not add a dependency for a trivial convenience; use a proven library for complex domain behavior.
  • Do not silently break public APIs, schemas, persisted data, or configuration.
  • Do not optimize without a requirement or measurement when it reduces clarity.

Verification

  • Tests exercise observable behavior and would catch the intended regression.
  • Type, lint, build, and focused test checks pass where available.
  • Error and boundary behavior is explicit.
  • Public contract changes include compatibility handling and documentation.
  • The final diff is focused and understandable without a verbal walkthrough.

Failure Modes

  • Copying a nearby pattern that is itself obsolete or unrelated.
  • Hiding complexity behind generic helpers or pass-through wrappers.
  • Tests that mirror implementation details but miss user behavior.
  • Catch-all error handling that destroys useful context.
  • Large mixed commits combining cleanup, migration, and feature behavior.

Examples

Parser: use a maintained structured parser for a real grammar; validate at the boundary and test malformed inputs.

Shared API: preserve old callers or introduce an explicit migration with compatibility tests and documentation.

Sources

See ../../sources/code-quality.sources.md.

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.