code-principles
Skill3 starsChanged 5 days agoMITView on GitHub
The coding mindset: nine principles for all code, in any language. Use every time you design, write, fix, or refactor code. The plugin loads them at the start of each session.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- doodledood/manifest-devtheir own version, first seen Nov 29, 2026
- wiseiodev/skillstheir own version, first seen Oct 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- doodledood/manifest-dev★ 80same name
- wiseiodev/skills★ 1same 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 repository15 other files it gives its agents.
- adr-distillSkill
- adr-initSkill
- adr-newSkill
- adr-reviewSkill
- adrSkill
- best-promptingSkill
- commitSkill
- create-skillsSkill
- fixSkill
- microcopySkill
- prSkill
- research-firstSkill
- simple-writingSkill
- test-auditSkill
- writingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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 16
Simple interface over simple implementation: Do not add a parameter, flag, or exception that makes every caller choose what the module can …
- Distinctive: line 17
Subtract: Remove before you add. Do not add speculative guards, parsers, options, or edge cases that the spec does not need.
- Distinctive: line 18
Fix the cause: Do not hide a state that should never exist with a guard, retry, swallowed error, clamped value, or default.
- Distinctive: line 24
Read the project ADRs and conventions first.
- Distinctive: line 28
Before you report the work as done, read your diff against the principles.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 principles
Apply these principles to all code you write or change. Apply them while you design, while you write, and before you report the work as done.
Principles
- One decision, one place. Keep a format, rule, limit, or list of allowed values in one module. When the project generates types from a schema, use them. Test: name a likely change and count the files it touches. Two or more files fail the test. Trivial repeated lines do not count.
- Low reader load. Do not write wrappers with one caller, adapters with one implementation, or methods that only forward. Keep state in the smallest scope: return over mutate, local over field, field over module state. Derive values. Do not sync copies. Test: can a reader find where X is set and what changes it? Split a long function only when a part has its own name and its own reason to change.
- Model the domain. Use a state machine, discriminated union, map, or typed model in place of scattered booleans, phase checks, or if/else chains across files. Test: does the change add one more branch to a chain, or a second boolean that must stay in sync with the first? Keep plain code when the shape is local and will not grow.
- Types at the boundary. Parse external data (requests, config, env, rows, API responses) into domain types where it enters. Inside, trust the types: no repeated validation, no redundant null checks. Give two primitives different types when the code can mix them up. Narrow types so bad values cannot exist. Handle a case inside the module when the caller cannot do anything useful with it. Errors that the caller must decide on (permissions, user input, remote failures) stay errors.
- Simple interface over simple implementation. Do not add a parameter, flag, or exception that makes every caller choose what the module can choose with a good default. Keep a parameter when callers need different values. A default for missing data falls under principle 7.
- Subtract. Remove before you add. Do not add speculative guards, parsers, options, or edge cases that the spec does not need. When an API changes, migrate every caller in the same change or stack, and delete the old path, unless outside users depend on it.
- Fix the cause. Do not hide a state that should never exist with a guard, retry, swallowed error, clamped value, or default. Fix the code that produces the state. Fix every place with the same fault.
- Safe state changes. An operation that changes state must give the correct result when it runs twice, or after a crash at any point. Read the current state. Apply the difference in one transaction, or with an upsert or a unique constraint. For files, write to a temp path, then rename it. Each concurrent actor writes its own key, file, or row. Merge them on read. Lock (
SELECT FOR UPDATE, a lockfile) only when one shared target is a real invariant. - Names and comments. If a thing is hard to name, or needs a long comment to explain how it works, change the design. Do not use vague names (
data,info,manager). Comments give the reason, units, invariants, and edge cases. They never repeat what the code already says.
When you code
- Read the project ADRs and conventions first. A project rule wins over these principles.
- Get the data shape and types right before the logic.
- For a new module or interface, write the interface comment first. If it is long or hard to write, change the design. Sketch two different designs and pick one.
- For each new class, function, parameter, or error, name what it removes. If it removes nothing, do not add it.
- Before you report the work as done, read your diff against the principles. Fix what fails.
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.

