CLAUDE.md, AGENTS.md, .cursor/rules — the system prompt your agent reads every session — step 8 of 9
Write score_claude_md(text) that scores a CLAUDE.md against
the four properties from step 3. The function:
- Returns a dict with keys:
lines,rules,links,fluff_count,score(0-4). lines= total line count (split on\n, count non-empty lines).rules= count of lines starting with-(bullet rules).links= count of lines with.md,.yaml,.json, or.tomlin them (rough heuristic for "links to a real file").fluff_count= count of lines containing any of these phrases (case-insensitive):"clean code","be helpful","good code","write good","high quality","best practices".score= sum of these checks (each adds 1):lines <= 80(terse) → +1rules >= 5(actionable bullets present) → +1links >= 1(links instead of duplicating) → +1fluff_count == 0(no fluff) → +1
Two cases run for you. Expected output:
good file: lines=15 rules=10 links=2 fluff=0 score=4
bad file: lines=3 rules=2 links=0 fluff=2 score=1
⌘↵ runs the editor.read, then continue.
Write score_claude_md(text) that scores a CLAUDE.md against
the four properties from step 3. The function:
- Returns a dict with keys:
lines,rules,links,fluff_count,score(0-4). lines= total line count (split on\n, count non-empty lines).rules= count of lines starting with-(bullet rules).links= count of lines with.md,.yaml,.json, or.tomlin them (rough heuristic for "links to a real file").fluff_count= count of lines containing any of these phrases (case-insensitive):"clean code","be helpful","good code","write good","high quality","best practices".score= sum of these checks (each adds 1):lines <= 80(terse) → +1rules >= 5(actionable bullets present) → +1links >= 1(links instead of duplicating) → +1fluff_count == 0(no fluff) → +1
Two cases run for you. Expected output:
good file: lines=15 rules=10 links=2 fluff=0 score=4
bad file: lines=3 rules=2 links=0 fluff=2 score=1
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.