You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(claude): create CLAUDE.md after constitution, not during setup()
The previous placement called ensure_claude_md() from
ClaudeIntegration.setup(), which runs BEFORE
ensure_constitution_from_template() in the init() flow. Since the
creation is gated on the constitution file existing, CLAUDE.md was
silently skipped on a fresh `specify init --ai claude` — the exact
scenario this PR is meant to fix.
The previous tests masked this bug by pre-creating the constitution
file before invoking setup() or the CLI, so they never exercised the
real ordering.
Fix:
- Add a generic `ensure_context_file(project_root, manifest)` hook on
IntegrationBase (default no-op) that runs after the constitution is
in place. Integrations needing a root context file (e.g. CLAUDE.md)
override it.
- Move the CLAUDE.md creation from ClaudeIntegration.setup() into
ClaudeIntegration.ensure_context_file(), which also records the file
in the integration manifest.
- Call resolved_integration.ensure_context_file(...) from init()
immediately after ensure_constitution_from_template(...), and
re-save the manifest if a file was created.
Tests:
- Rewrite the CLI end-to-end test to start from a truly empty project
(no pre-created constitution) so it fails if the ordering regresses.
It now asserts that BOTH the constitution and CLAUDE.md exist.
- Add a test proving setup() alone does NOT create CLAUDE.md.
- Update the three unit tests to call ensure_context_file directly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments