Standing Mandates
- NEVER write a rule the repo doesn't show: an unevidenced rule is the model's taste filed as the user's policy, and
every later session obeys it. Each positive rule needs ≥2
file:lineexamples from ≥2 files and a consistency ratio; absence/boundary rules ("never imports", "append-only") carry a violation count or commit evidence plus onefile:lineexample. - A pattern below 70% consistency, or seen in fewer than 3 files, is uncertain — listed, not written.
- ALWAYS cite from
references/sources.mdonly. No fitting source →repo-only. Never cite a book or item from memory. - NEVER adopt a habit that contradicts a cited source silently — it goes under Conflicts; the user decides keep or drop.
- NEVER sample generated, vendored, or fixture code: its style is the generator's, not the team's. Formatter/linter configs in the repo outrank counted habits.
- NEVER overwrite a filled line in an existing convention file: someone wrote it deliberately. Fill
<!-- fill -->placeholders and append; show the diff. - Cite only a section whose title names the rule's topic (mapping:
references/sources.md); a stretched fit isrepo-only. - Rules are checkable: "functions ≤ 30 lines (91% of 212)", not "functions are short".
- Every count comes from a command you ran (grep, a script), never an estimate.
- A source repo or target that can't be read is
[확인 필요: ○○]; stop before Write.
Goal: every written rule has its count, ≥2 examples and a source or repo-only; everything seen but not written is
listed as uncertain or conflict; the closing tally recounts to the written files.
Like My Code
Not for reviewing code against conventions (develop:clean-code), deciding what the architecture should be
(develop:architecture-designer), or installing the empty convention files (harness:install).
Process
1. Collect. Source repo (default: current project) · optional sub-path · target dir for the policy
(default: <current project>/.claude/conventions/). Source ≠ target is fine — a reference project's
style can govern a new one.
2. Sample. Recently touched hand-written files: git log --since=6.months --name-only, drop
generated/vendor/test-fixture paths, keep up to ~40 files across modules. Read formatter and lint configs
(.editorconfig, ktlint, detekt.yml, .eslintrc*, ruff.toml, …) first — they are rules already.
3. Observe. Count, per dimension, what the samples do: naming, functions, errors, comments, structure,
dependencies, boundaries (what to count: references/dimensions.md).
4. Cite. For each rule ≥70%, attach the source from references/sources.md that states it
([CC ch.3], [RF Long Function], [CA ch.22], [KT naming rules]). A rule the source contradicts
→ Conflicts with both sides quoted.
5. Show the draft. Rules, uncertain, conflicts — the user edits before anything is written.
6. Write. coding.md gets Naming & structure / Style / Dependencies; boundaries.md gets its three
lists: Do not modify without explicit user approval, Off-limits entirely (generated/vendored dirs),
Requires a dependent update when changed. Missing file → create from the harness template headings. Report the diff.
7. Recount. Count the rules in each written file, those with a source, and repo-only; fix the tally line if the
files differ.
Output Template
Source: <repo>@<sha> · N files sampled · configs: .editorconfig, detekt.yml
Target: <dir>/.claude/conventions/
coding.md
## Naming & structure
- Predicates start with is/has/can — 94% (118/125) · ex: src/a/Order.kt:42, src/b/User.kt:17 · [CC ch.2]
(then Style, Dependencies in the same shape)
boundaries.md
## Do not modify without explicit user approval
- db/migration/** — append-only (0 edits after add in 38 files) · ex: db/migration/V12__add_user.sql:1 · repo-only
(then Off-limits entirely, Requires a dependent update when changed)
Uncertain: [pattern — ratio — why not a rule]
Conflicts: [habit + ratio] vs [source says] — keep or drop?
Tally: <n> rules written (<s> sourced · <r> repo-only) · <u> uncertain · <c> conflicts awaiting your call
What Claude Does / What You Do
| Claude | You |
|---|---|
| Samples, counts, cites only from sources.md, separates uncertain and conflicts | Names the source repo and target |
| Shows the draft before writing; fills placeholders without overwriting | Edits the draft; decides each conflict |
| Writes coding.md / boundaries.md and reports the diff | Commits the convention files |
Related Skills
develop:clean-code— reviews code against these conventions; its references explain each dimensiondevelop:clean-architecture— the dependency rule behind the Dependencies sectionharness:install— scaffolds the empty convention files this skill fillswrite:like-me— the same idea for prose