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.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- mcpSkill
- pattern-orchestration-complexSkill
- pattern-task-breakdownSkill
- role-architectSkill
- role-code-reviewSkill
- role-data-engineerSkill
- role-developerSkill
- role-orchestratorSkill
- role-product-engineerSkill
- role-qa-engineerSkill
- role-security-auditorSkill
- role-site-reliability-engineerSkill
- role-technical-writerSkill
- standards-analysisSkill
- standards-api-designSkill
- standards-databaseSkill
- standards-documentationSkill
- standards-go-concurrencySkill
- standards-go-performanceSkill
- standards-goSkill
- standards-go-testingSkill
- standards-markdownSkill
- standards-observabilitySkill
- standards-pulumi-typescriptSkill
- standards-pythonSkill
- standards-securitySkill
- standards-shellSkill
- standards-skill-authoringSkill
- standards-testingSkill
- standards-typescriptSkill
- tool-storeSkill
- workflow-debuggingSkill
- workflow-pi-extensionSkill
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
- Distinctive: line 43
Keep public interfaces stable unless the task requires a contract change.
- Distinctive: line 45
Keep resource ownership obvious: open and close, acquire and release, start and stop.
- Distinctive: line 56
Do not log secrets, tokens, or unnecessary PII.
- Distinctive: line 63
Before finishing code work:
≈ “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.
Files
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, orstandards-pulumi-typescript. - Load
standards-testingwhen writing or changing tests. - Load
standards-securityfor authentication, untrusted input, secrets, or sensitive data. - Load
standards-api-designfor public or internal contracts. - Load
standards-databasefor persistence changes. - Load
standards-observabilitywhen adding logging, metrics, or tracing.
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
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.

