code-rules
Skill0 starsChanged 57 days agoApache-2.0View on GitHub
Load the repository's code rules that apply to the work at hand, from the rule documents in docs/code/, reading their frontmatter first and only the documents whose triggers match. Use before planning or writing code, or when asked about the repository's conventions, standards, or design principles. Not for checking finished code; see /code-rules-check
1 other project uses a version of this.
Adopted by
Most recently taken up by
- claude-office-skills/claude-office-plugintheir own version, first seen Mar 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- claude-office-skills/claude-office-plugin★ 9same 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 repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-checkSkill
- code-formatSkill
- code-genSkill
- code-reviewSkill
- code-testSkill
- commitSkill
- feat-discoverySkill
- feat-statusSkill
- feat-validateSkill
- releaseSkill
- code-rules-checkSkill
- docs-rules-checkSkill
- docs-rules-creatorSkill
- docs-rulesSkill
- skills-checkSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
If docs/code/ does not exist, say so: the repository has no code rules to load.
- Distinctive: line 19
Run this first; it is the whole index:
- Distinctive: line 49
Read nothing adjacent: If no trigger matches, say so: a gap in the rules is worth reporting.
- Very specific: line 51
Read selections at docs/code/<name>.md, or docs/arch/<name>.md for a decision record.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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 Rules
A repository that uses Lorecraft keeps the rules for how its code is written as a corpus of rule documents in
docs/code/, one rule or topic per document. This skill loads only their frontmatter, and you choose what to
read from it. Selecting well is the whole job: read what the task needs, nothing more.
If docs/code/ does not exist, say so: the repository has no code rules to load. Its specification, if one
exists, is docs/__meta__/code.md; /docs-rules-creator sets one up.
1. The catalog
Run this first; it is the whole index:
grep -m 3 -E '^(description|type|scope):' docs/code/*.mdWhere the repository also keeps architecture decision records in docs/arch/, an accepted one binds code as
a rule document does: it states how the code is built. List them too, and treat only those whose status is
accepted as rules:
grep -m 4 -E '^(description|status):' docs/arch/adr-*.mdEach description says what its document covers and, where the corpus specification asks for one, a trigger
clause — Load when … or similar — naming the situations the document governs. Other fields, such as type
or scope, are whatever docs/__meta__/code.md defines; read its frontmatter section once if their meaning is
not obvious.
2. Selecting
Match the task against the trigger clauses, then:
- Take the most specific match. A filename prefix is a group:
python-*,test-*. Read the member whose trigger fits — the document on docstrings for a docstring, the one on handling errors for anexcept— not the group's broadest document. Add a broader one only when the task turns on what it owns. - Expect two to four documents. One is common. More than four means the task is unscoped, or you are matching topics instead of triggers.
- Break ties by specificity: a document scoped to the package or directory being changed over a global one, where the frontmatter says which is which.
- Read nothing adjacent. If no trigger matches, say so: a gap in the rules is worth reporting.
Read selections at docs/code/<name>.md, or docs/arch/<name>.md for a decision record. Do not re-read what is
already in context.
3. Rules that apply to all design work
Some rules — design principles, usually a principle-* group — govern every change, so no task will match
their triggers. Treat their catalog descriptions as the rules themselves and design against every one. Read
a full principle document only to argue one: to justify a decision, settle a disagreement, or cite it in a
review. Asked for the principles, read them all and summarise.
4. Applying
The rules are the repository's decisions, and they outrank general practice and your defaults. Where a rule
seems wrong for the task, follow it and raise the conflict; do not silently deviate. Each rule document usually
ends with a checklist: hold it while writing, since /code-rules-check checks the result against it.
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.

