Skip to content

Load constitution context in /speckit.implement to enforce governance during implementation#2460

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-implement-command-to-load-constitution-md
Open

Load constitution context in /speckit.implement to enforce governance during implementation#2460
Copilot wants to merge 2 commits intomainfrom
copilot/fix-implement-command-to-load-constitution-md

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

/speckit.implement loaded feature artifacts but omitted constitution.md, so implementation could ignore project governance and reintroduce violations caught later by /speckit.analyze. This change adds constitution to implement-time context so governance constraints are present during code generation.

  • Template update: implement context loading

    • Updated templates/commands/implement.md to load constitution alongside existing implementation artifacts.
    • Added an explicit optional read in the “Load and analyze the implementation context” section.
  • Regression coverage: generated command output

    • Added a focused integration test in tests/integrations/test_integration_generic.py to verify generated speckit.implement.md includes /memory/constitution.md in its context-loading instructions.
- **IF EXISTS**: Read research.md for technical decisions and constraints
- **IF EXISTS**: Read /memory/constitution.md for governance constraints
- **IF EXISTS**: Read quickstart.md for integration scenarios

Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 22:54
Copilot AI changed the title [WIP] Fix implement command to load constitution.md during code generation Load constitution context in /speckit.implement to enforce governance during implementation May 5, 2026
Copilot finished work on behalf of mnriem May 5, 2026 22:55
Copilot AI requested a review from mnriem May 5, 2026 22:55
@mnriem mnriem marked this pull request as ready for review May 5, 2026 23:00
@mnriem mnriem requested review from Copilot and removed request for Copilot May 5, 2026 23:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the core /speckit.implement command template so implementation-time prompts include the project constitution, aligning implementation with governance rules that are already enforced elsewhere in the workflow.

Changes:

  • Added /memory/constitution.md to the implementation context-loading step in the shared implement command template.
  • Added a generic integration test intended to verify generated speckit.implement.md output includes constitution context loading.
Show a summary per file
File Description
templates/commands/implement.md Adds constitution loading to the implement workflow context.
tests/integrations/test_integration_generic.py Adds regression coverage for generated generic speckit.implement.md content.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

implement_file = tmp_path / ".custom" / "cmds" / "speckit.implement.md"
assert implement_file.exists()
content = implement_file.read_text(encoding="utf-8")
assert "/memory/constitution.md" in content
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.

The /speckit.implement command does not load constitution.md — governance gap in code generation

3 participants