craft-principles
Skill0 starsChanged 6 months agoMITView on GitHub
Enforces engineering principles in generated code: readability, simplicity, testability, minimal dependencies.
In this repository13 other files it gives its agents.
- clean-commitSkill
- context-budgetSkill
- debug-circuitSkill
- meeting-driverSkill
- memory-curatorSkill
- output-guardSkill
- plan-firstSkill
- pm-docsSkill
- ship-cycleSkill
- simplify-codeSkill
- sprint-flowSkill
- task-resumeSkill
- verify-buildSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 15 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Write code that a stranger can maintain at 2 AM during an incident.
- Distinctive: line 20
Write code that reads like prose, top to bottom
- Very specific: line 21
Prefer explicit over implicit.
- Distinctive: line 22
No clever one-liners that require a comment to explain
- Distinctive: line 23
If you need a comment, first try renaming the variable or function instead
- Distinctive: line 29
Every layer of indirection must justify its existence
- Distinctive: line 37
If something is hard to test, the design is probably wrong
- Distinctive: line 41
Every dependency is a liability: security risk, upgrade burden, bundle size
- Distinctive: line 42
Before adding a package, ask: "Can I write this in 20 lines?"
- Distinctive: line 43
Prefer standard library solutions over third-party packages
- Distinctive: line 44
When you must add a dependency, choose: actively maintained, small API surface, no transitive dependency tree
- Distinctive: line 50
Never swallow exceptions with empty catch blocks
- Distinctive: line 55
Follow the project's existing patterns even if you'd do it differently
- Distinctive: line 57
If no convention exists, follow the language/framework community standard
- Distinctive: line 58
Document new conventions in the project's contributing guide
- Distinctive: line 69
If any answer is unsatisfying, refactor before presenting.
≈ “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
Craft Principles
Write code that a stranger can maintain at 2 AM during an incident. These principles are non-negotiable.
The Principles
1. Readability Over Cleverness
- Write code that reads like prose, top to bottom
- Prefer explicit over implicit.
getUserById(id)overget(id) - No clever one-liners that require a comment to explain
- If you need a comment, first try renaming the variable or function instead
2. Simplicity Over Flexibility
- Solve the problem at hand, not the hypothetical future problem
- The simplest solution that works correctly is the best solution
- Every layer of indirection must justify its existence
- Three lines of straightforward code beats one line of clever code
3. Testability by Design
- Functions should be pure where possible: same input, same output, no side effects
- Side effects (I/O, state changes, API calls) should be pushed to the edges
- Dependencies should be explicit parameters, not hidden global state
- If something is hard to test, the design is probably wrong
4. Minimal Dependencies
- Every dependency is a liability: security risk, upgrade burden, bundle size
- Before adding a package, ask: "Can I write this in 20 lines?"
- Prefer standard library solutions over third-party packages
- When you must add a dependency, choose: actively maintained, small API surface, no transitive dependency tree
5. Fail Loudly and Early
- Invalid state should throw immediately, not propagate silently
- Error messages should include: what went wrong, what was expected, and how to fix it
- Never swallow exceptions with empty catch blocks
- Validate at system boundaries (API endpoints, user input, external data), trust internal code
6. Convention Over Configuration
- Follow the project's existing patterns even if you'd do it differently
- Consistency within a codebase matters more than individual preference
- If no convention exists, follow the language/framework community standard
- Document new conventions in the project's contributing guide
How to Apply
These principles are a lens, not a checklist. Before presenting code, ask yourself:
- "Would I understand this code if I'd never seen it before?"
- "Is there a simpler way?"
- "Can I test this easily?"
- "Did I add anything that isn't strictly needed?"
If any answer is unsatisfying, refactor before presenting.
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.

