Propose changes to a client's CLAUDE.md and AGENTS.md to its team, and ask the principles for files in folders before banners and for a findable entry point
CI / tests (pull_request) Successful in 2m17s
CI / tests (pull_request) Successful in 2m17s
This commit is contained in:
@@ -79,7 +79,11 @@
|
||||
- Things a reader finds by name may run far past seven: 100 files named by locale, the cases of an enum, a reference list. A predictable name and a sorted order serve them better than a group would.
|
||||
- Each added level makes a reader open one more folder, file or function to find a thing, so a split must save more than it costs. Keep eight, nine or ten things in one level when splitting them would add more names, files or jumps than it removes. Say why where the level is declared: a comment, the folder's README.
|
||||
- Group by what a reader would name: a feature, a step, what changes together. BANNED: `misc/`, `part2()` or a parameter object that exists only to bring a count down. GOOD: `invoices/`, `payments/`, `reports/`, each holding what changes together; `locales/` holding `de.json` to `zh.json`, flat.
|
||||
- Group code into files, and files into folders. A banner comment (`// --- name ---`) that groups a file's sections is the last resort, kept only where the language or the build cannot split the file, and the file says which limit holds it.
|
||||
- Crossing a limit asks for one of two answers, never a split at any cost: group the things, or record why they stay. Keep a limit only while the comprehension panel's readers (`~/.claude/skills/comprehension-panel/`) find the code it flags hard.
|
||||
* Make the entry point the first thing a newcomer finds.
|
||||
- The root holds the entry point, the README and the files a tool reads only from there, such as the manifest, the lockfile and the licence. Source, tests and tooling live in folders named by what they hold.
|
||||
- The entry point carries the name its ecosystem expects, such as `index.ts` in an npm package, with no other source file beside it.
|
||||
* Keep It Simple, Stupid (KISS): keep solutions simple, so a reader new to the project understands each part on one read.
|
||||
* Don't Repeat Yourself (DRY) is a guide, not an absolute rule. It aims at one authoritative home per piece of knowledge, one obvious way per need. Before applying it, ask whether the code would be easier to understand, easier to reason about, or easier to maintain if DRY were broken; if so, break it, so long as the spellings cannot disagree (below). A surface people write — a template, data, an API — may accept a second spelling where that makes it easier to use.
|
||||
- A value, rule, definition or concept lives in one place, and everywhere else derives it from there or points at it. A copy that can drift is a second spelling: derive it from its owner, or, for config a human writes, reject it where it is read and name the owner.
|
||||
|
||||
Reference in New Issue
Block a user