feat: CLAUDE.md rule generator (closes #12) - #251
Conversation
- Add strict and relaxed rule templates in src/templates/ - Extend 'preflight init' to offer injecting rules into CLAUDE.md - Rules are written to .claude/preflight-rules.md and imported via CLAUDE.md - Strict mode: mandatory preflight_check, verify_completion, clarify_intent - Relaxed mode: recommended practices only - Add 4 tests for template content and mode differences
TerminalGravity
left a comment
There was a problem hiding this comment.
Great DX improvement — the preflight init flow asking about CLAUDE.md rules makes onboarding much smoother. The strict/relaxed split is smart.
A couple minor things:
- Worth adding a comment in the generated CLAUDE.md explaining what the
@import syntax does - The silent
catch {}for missing CLAUDE.md is fine but maybe log at debug level
Good tests, closes #12 nicely. Ready to merge.
TerminalGravity
left a comment
There was a problem hiding this comment.
Clean. Strict + relaxed modes are the right call — not every team wants mandatory gates. Templating via .claude/preflight-rules.md keeps it modular. Consider mentioning in docs that users can customize the generated rules post-init.
TerminalGravity
left a comment
There was a problem hiding this comment.
Clean implementation. The strict/relaxed split is smart — gives users a choice without overwhelming them. The @.claude/preflight-rules.md import pattern keeps it modular. Tests cover the right things. Follow-up idea: a preflight rules --show command to print active rules for debugging. LGTM.
Implements #12. Extends
preflight initto inject preflight rules into CLAUDE.md via.claude/preflight-rules.md. Supports strict (mandatory) and relaxed (recommended) modes. 4 new tests, all 47 pass.