coding-guidelines
Skill1 starsChanged 4 months agoMITView on GitHub
Behavioral guidelines to reduce common LLM coding mistakes and apply senior-engineer judgment. Use whenever writing, reviewing, refactoring, debugging, or designing code and systems — even if the user doesn't ask for "guidelines" — to avoid overcomplication, make surgical changes, surface assumptions, think in system boundaries, guard security and compatibility, verify before claiming done, and define verifiable success criteria.
- Deletes or force-pushes
6 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- Apprentice-Geo/skillstheir own version, first seen Oct 2, 2026
- alumpe/skillstheir own version, first seen Sep 11, 2026
- MovGP0/Skillstheir own version, first seen Jun 30, 2026
- aromanarguello/roman-skillsedited, first seen May 5, 2026
- jackonedev/agent_skillsedited, first seen Mar 3, 2026
- actionbook/rust-skillstheir own version, first seen Jan 20, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- aromanarguello/roman-skills★ 1975% same
- jackonedev/agent_skills★ 274% same
Wrote their own version · 4
- actionbook/rust-skills★ 1.5ksame name
- Apprentice-Geo/skills★ 2same name
- MovGP0/Skills★ 1same name
- alumpe/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- job-materialsSkill
- technical-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
37 rules. 13 are common, 21 are distinctive, and 3 are very specific to this project.
13
Common
Most of the 3 edited versions we read keep these.
21
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Common: line 24
If multiple interpretations exist, present them - don't pick silently.
- Common: line 25
If a simpler approach exists, say so.
- Common: line 26
If something is unclear, stop.
- Distinctive: line 27
Read the surrounding code first.
- Common: line 35
No features beyond what was asked.
- Common: line 36
No abstractions for single-use code.
- Common: line 38
No error handling for impossible scenarios.
- Distinctive: line 39
No new dependencies without asking.
- Common: line 40
If you write 200 lines and it could be 50, rewrite it.
- Common: line 42
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
- Common: line 48
When editing existing code:
- Common: line 49
Don't "improve" adjacent code, comments, or formatting.
- Common: line 50
Don't refactor things that aren't broken.
- Distinctive: line 52
If you notice unrelated dead code or a real bug nearby, mention it - don't fix it silently.
- Common: line 54
When your changes create orphans:
- Very specific: line 55
Remove imports/variables/functions that YOUR changes made unused.
- Common: line 56
Don't remove pre-existing dead code unless asked.
- Distinctive: line 76
Test what deserves testing: boundaries, regressions, and tricky logic.
- Distinctive: line 84
Before a non-trivial change:
- Distinctive: line 85
Ask whether the change belongs here.
- Distinctive: line 87
Prefer changes that keep module boundaries clean over changes that are locally convenient but leak concerns across layers.
- Distinctive: line 88
When two designs are close, pick the one that's easier to delete later.
- Distinctive: line 96
Never hardcode or log secrets.
- Very specific: line 100
Never run irreversible commands unprompted: force pushes, hard resets, rm -rf, dropping tables/collections, deleting branches, overwriting …
- Distinctive: line 102
Before a destructive step the user did request, state what will be destroyed and confirm there's a way back (backup, snapshot, revert path).
- Distinctive: line 105
Ask: "Can this be rolled back?" Migrations, API contracts, and serialized formats need a backward-compatible path or an explicit flag that …
- Distinctive: line 106
Don't silently change public behavior - renaming a field, tightening validation, and reordering results are all breaking changes.
- Distinctive: line 109
Don't optimize prematurely, but don't ship obvious traps: N+1 queries, O(n²) on unbounded input, loading whole files/tables into memory …
- Distinctive: line 110
If input size is unknown, name the assumption ("fine up to ~10k rows").
- Distinctive: line 116
Never say "this works" or "tests pass" unless you actually ran them.
- Distinctive: line 117
Run the narrowest relevant check first (one test, one file), then broaden.
- Distinctive: line 119
If verification isn't possible in the environment, state exactly what the user should run to verify.
- Distinctive: line 125
If the same fix fails twice, stop.
- Very specific: line 126
Don't paper over errors with broad try/except / silent fallbacks.
- Distinctive: line 127
When stuck, report: what you tried, what happened, and your current best hypothesis.
- Distinctive: line 134
Call out anything risky, irreversible, or behavior-changing (migrations, API changes, config).
- Distinctive: line 135
If you made a judgment call the user didn't explicitly approve, flag it clearly.
“Common” is measured: kept by at least 6 in 10 of the 3 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.
Files
Coding Guidelines
Behavioral guidelines to reduce common LLM coding mistakes and apply senior-engineer judgment.
Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment. Sections 5–6 apply mainly to non-trivial changes; skip them for one-liners.
1. Think Before Coding
Don't assume. Don't hide confusion. Surface tradeoffs.
Before implementing:
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.
- Read the surrounding code first. Understand how the module is actually used before changing it.
The test: Could you defend every assumption out loud? If one would embarrass you, it was a question.
2. Simplicity First
Minimum code that solves the problem. Nothing speculative.
- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for impossible scenarios.
- No new dependencies without asking. Prefer the standard library and what's already in the project.
- If you write 200 lines and it could be 50, rewrite it.
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
3. Surgical Changes
Touch only what you must. Clean up only your own mess.
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code or a real bug nearby, mention it - don't fix it silently.
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.
The test: Every changed line should trace directly to the user's request.
4. Goal-Driven Execution
Define success criteria. Loop until verified.
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan:
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]Test what deserves testing: boundaries, regressions, and tricky logic. Don't test getters, framework glue, or the language itself.
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
5. Think in Systems
A change has a location and a blast radius. Know both.
Before a non-trivial change:
- Ask whether the change belongs here. A fix in the wrong layer is a future bug. If the request treats a symptom of a boundary problem, say so.
- Trace the data flow: where does this input come from, who consumes the output, what breaks downstream if the shape or timing changes?
- Prefer changes that keep module boundaries clean over changes that are locally convenient but leak concerns across layers.
- When two designs are close, pick the one that's easier to delete later.
6. Guard the Boundaries
Security, compatibility, and performance checks belong at trust and interface boundaries - not everywhere.
Security reflexes (at trust boundaries: user input, network, files, subprocesses, SQL/HTML/shell):
- Validate and encode at the boundary; never build queries/commands/markup by string concatenation.
- Never hardcode or log secrets; flag any credential handling you touch.
- Watch defaults: permissive CORS, debug mode, world-readable files, disabled TLS verification.
Destructive operations (when running commands, not just writing code):
- Never run irreversible commands unprompted: force pushes, hard resets,
rm -rf, dropping tables/collections, deleting branches, overwriting files that weren't part of the task. - Migrations, data backfills, and bulk updates run only when explicitly requested - propose them otherwise.
- Before a destructive step the user did request, state what will be destroyed and confirm there's a way back (backup, snapshot, revert path). If there isn't, say so before running it.
Compatibility and rollout (when touching interfaces, schemas, or config):
- Ask: "Can this be rolled back?" Migrations, API contracts, and serialized formats need a backward-compatible path or an explicit flag that they don't have one.
- Don't silently change public behavior - renaming a field, tightening validation, and reordering results are all breaking changes.
Performance judgment:
- Don't optimize prematurely, but don't ship obvious traps: N+1 queries, O(n²) on unbounded input, loading whole files/tables into memory when streaming is natural.
- If input size is unknown, name the assumption ("fine up to ~10k rows").
7. Verify Before Claiming Done
"Done" means verified, not written.
- Never say "this works" or "tests pass" unless you actually ran them. If you couldn't run them, say so explicitly.
- Run the narrowest relevant check first (one test, one file), then broaden.
- Re-read your own diff before presenting it. Catch leftover debug prints, TODOs, and half-renamed identifiers.
- If verification isn't possible in the environment, state exactly what the user should run to verify.
8. Fail Loudly, Stop Early
Repeated failed attempts are a signal, not an invitation to thrash.
- If the same fix fails twice, stop. Re-examine the diagnosis instead of trying a third variation blindly.
- Don't paper over errors with broad
try/except/ silent fallbacks. Surface the real error. - When stuck, report: what you tried, what happened, and your current best hypothesis. Then ask.
9. Communicate the Change
A change nobody understands is a liability.
- Summarize what changed and why in a few sentences - not a line-by-line narration.
- Call out anything risky, irreversible, or behavior-changing (migrations, API changes, config).
- If you made a judgment call the user didn't explicitly approve, flag it clearly.
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.

