code-rules
Skill0 starsChanged 15 days agoApache-2.0View on GitHub
Load the repository's code rules that apply to the work at hand, from docs/code/, reading their frontmatter first and only the ones 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
4 other projects use a version of this.
Adopted by
Most recently taken up by
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- robo311/devflowtheir own version, first seen Oct 20, 2026
- FrankieeW/agent-skillstheir own version, first seen Mar 19, 2026
- claude-office-skills/claude-office-plugintheir own version, first seen Mar 9, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- claude-office-skills/claude-office-plugin★ 9same name
- robo311/devflow★ 1same name
- zedarvates/frugal-skills★ 1same name
- FrankieeW/agent-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 repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-checkSkill
- code-formatSkill
- code-genSkill
- code-integrateSkill
- code-restackSkill
- code-reviewSkill
- code-syncSkill
- 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. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
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 52
Read nothing adjacent: If no trigger matches, say so: a gap in the code rules is worth reporting.
- Very specific: line 54
Read selections at docs/code/<name>.md, or docs/arch/<name>.md for a decision record.
“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
Code Rules
A repository that uses Lorecraft keeps its code rules (also called code rules), the conventions for how its code
is written, as a corpus in docs/code/, one convention or topic per code rule. 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 corpus spec, 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 code rule does: it states how the code is built. List them too, and treat only those whose status is
accepted as binding:
grep -m 4 -E '^(description|status):' docs/arch/adr-*.mdEach description says what its document covers and, where the corpus spec 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, then load its base chain. For every hyphen-prefix ancestor of the matched
filename, read the corresponding existing
.mddocument indocs/code/, broadest first. For example, a match topython-typing-castloads the existingpython-typingancestor; thepythonancestor is absent in this corpus. Skip a missing intermediate name and continue with any more specific existing ancestor. The matched document and its base chain count as one selection. - Expect two to four selections. One is common. A selection includes its matched document and its base chain. 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 code 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. Code rules that apply to all design work
Some code rules — design principles, usually a principle-* group — govern every change, so no task will match
their triggers. Treat their catalog descriptions as the principles 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 code rules are the repository's decisions, and they outrank general practice and your defaults. Where one
seems wrong for the task, follow it and raise the conflict; do not silently deviate. Each code rule 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.

