Skip to content

feat: CLAUDE.md rule generator (closes #12) - #251

Open
TerminalGravity wants to merge 1 commit into
mainfrom
feat/claude-rules-generator
Open

feat: CLAUDE.md rule generator (closes #12)#251
TerminalGravity wants to merge 1 commit into
mainfrom
feat/claude-rules-generator

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Implements #12. Extends preflight init to inject preflight rules into CLAUDE.md via .claude/preflight-rules.md. Supports strict (mandatory) and relaxed (recommended) modes. 4 new tests, all 47 pass.

- 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 TerminalGravity left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TerminalGravity left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TerminalGravity left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant