Answer architecture round 1: give the rules/ design its own decision with its premise, move where a choice goes into the comment rules, let each rule file's paths frontmatter be the one map and check every rule file named exists, pass the judge its rules folder, and file two findings outside the chunk
This commit is contained in:
@@ -9,11 +9,10 @@ HUMAN_RULES = "~/.claude/CLAUDE.md"
|
||||
HUMAN_RULES_DIR = "~/.claude/rules/"
|
||||
|
||||
|
||||
def read_records(root: str, claude_md: pathlib.Path) -> str | Stop:
|
||||
def read_records(root: str, claude_md: pathlib.Path, rules_dir: pathlib.Path) -> str | Stop:
|
||||
"""The project's record files, then the human's rules for every project, CLAUDE.md first, each headed by its name; a file that does not exist is left out."""
|
||||
rules = claude_md.parent / "rules"
|
||||
sources = [(root, name, name) for name in RECORD_FILES] + [(str(claude_md.parent), claude_md.name, HUMAN_RULES)]
|
||||
sources += [(str(rules), rule.name, HUMAN_RULES_DIR + rule.name) for rule in sorted(rules.glob("*.md"))]
|
||||
sources += [(str(rules_dir), rule.name, HUMAN_RULES_DIR + rule.name) for rule in sorted(rules_dir.glob("*.md"))]
|
||||
records = []
|
||||
for folder, name, heading in sources:
|
||||
if not pathlib.Path(folder, name).exists():
|
||||
|
||||
Reference in New Issue
Block a user