agentleFS
pecigonzalopecigonzalo/agent-skills/skills/standards-code/SKILL.md

standards-code

Skill0 starsChanged 4 months agoMITView on GitHub

Use this skill whenever you write, refactor, or review production code in any language, including small edits and bug fixes, even when the user only asks for a quick change. Provides the language-neutral maintainability baseline for testable boundaries, cohesive units, explicit dependencies, clear errors, and minimal change scope. Load the language-specific standards skill alongside it.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    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:

    Keep public interfaces stable unless the task requires a contract change.

    line 43
  2. Distinctive:

    Keep resource ownership obvious: open and close, acquire and release, start and stop.

    line 45
  3. Distinctive:

    Do not log secrets, tokens, or unnecessary PII.

    line 56
  4. Distinctive:

    Before finishing code work:

    line 63

≈ “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

Code Standards

Provides: Language-neutral maintainability rules to apply before the language-specific standards skill.

Quick Reference

Golden Rule: Code is maintainable when its behavior is easy to verify

Prefer:

  • Small cohesive units with one reason to change
  • Explicit inputs, outputs, errors, and dependencies
  • Clear boundaries between pure logic and side effects
  • Data that is not mutated in place, especially inputs owned by the caller
  • Simple control flow and early exits over deep nesting
  • Minimal, focused changes that preserve nearby conventions

Avoid:

  • Hidden global state and surprising side effects
  • Broad rewrites unrelated to the task
  • Error swallowing or ambiguous failure modes
  • Premature abstraction or framework cleverness

Scope note: This skill is deliberately language-neutral. Naming, formatting, file layout, and idiom rules belong to the language skill, which overrides anything here that conflicts.


Design Checks

Before editing:

  • Identify the existing convention in the area you are touching.
  • Find the narrowest seam for the change.
  • Decide what test or command will prove the behavior.
  • Load the language or framework standards skill when one exists.

While editing:

  • Keep public interfaces stable unless the task requires a contract change.
  • Validate data at system boundaries.
  • Keep resource ownership obvious: open and close, acquire and release, start and stop.
  • Make concurrency, caching, and retries explicit where used.
  • Name things by domain meaning, not implementation detail.
  • Do not mutate caller-provided data in place. Return new values, or make the mutation explicit in the signature and the doc comment. Silent in-place mutation of a shared slice, map, dict, or object creates aliasing bugs that surface far from the call site. Languages with legitimate in-place idioms are fine, as long as the contract says so.

Error Handling

  • Preserve the original error context when wrapping or translating errors. A rethrown error that drops its cause forces the next reader to guess.
  • Return or report errors at the level that can act on them.
  • Do not log secrets, tokens, or unnecessary PII.
  • Distinguish validation, permission, conflict, transient, and internal errors when callers need to behave differently. Collapsing them into one generic failure pushes that classification onto every caller.

Checklist

Before finishing code work:

  • The smallest practical verification command has run, or is reported as skipped
  • New behavior has a test where practical
  • Edge cases and error paths changed by the task are covered or noted
  • The diff contains no unrelated refactors
  • Public interfaces are unchanged, or the contract change is intentional and documented

See also

  • Load the language skill for syntax, naming, and idiom: standards-go, standards-python, standards-typescript, standards-shell, or standards-pulumi-typescript.
  • Load standards-testing when writing or changing tests.
  • Load standards-security for authentication, untrusted input, secrets, or sensitive data.
  • Load standards-api-design for public or internal contracts.
  • Load standards-database for persistence changes.
  • Load standards-observability when adding logging, metrics, or tracing.

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.