promptdojo_

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 .toml in 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) → +1
    • rules >= 5 (actionable bullets present) → +1
    • links >= 1 (links instead of duplicating) → +1
    • fluff_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.

open this same url on a laptop to keep going today.