agentleFS
ProjectWajaProjectWaja/claude-skillcraft/skills/craft-principles/SKILL.md

craft-principles

Skill0 starsChanged 6 months agoMITView on GitHub

Enforces engineering principles in generated code: readability, simplicity, testability, minimal dependencies.

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
  1. Distinctive:

    Write code that a stranger can maintain at 2 AM during an incident.

    line 14
  2. Distinctive:

    Write code that reads like prose, top to bottom

    line 20
  3. Very specific:

    Prefer explicit over implicit.

    line 21
  4. Distinctive:

    No clever one-liners that require a comment to explain

    line 22
  5. Distinctive:

    If you need a comment, first try renaming the variable or function instead

    line 23
  6. Distinctive:

    Every layer of indirection must justify its existence

    line 29
  7. Distinctive:

    If something is hard to test, the design is probably wrong

    line 37
  8. Distinctive:

    Every dependency is a liability: security risk, upgrade burden, bundle size

    line 41
  9. Distinctive:

    Before adding a package, ask: "Can I write this in 20 lines?"

    line 42
  10. Distinctive:

    Prefer standard library solutions over third-party packages

    line 43
  11. Distinctive:

    When you must add a dependency, choose: actively maintained, small API surface, no transitive dependency tree

    line 44
  12. Distinctive:

    Never swallow exceptions with empty catch blocks

    line 50
  13. Distinctive:

    Follow the project's existing patterns even if you'd do it differently

    line 55
  14. Distinctive:

    If no convention exists, follow the language/framework community standard

    line 57
  15. Distinctive:

    Document new conventions in the project's contributing guide

    line 58
  16. Distinctive:

    If any answer is unsatisfying, refactor before presenting.

    line 69

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

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) over get(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.

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.