Skip to content

Preset constitution-template (strategy: replace) is not installed, and speckit.constitution is not preset-aware #3272

Description

@PechiSW

Summary

A preset that provides a constitution-template with strategy: replace does not get its constitution installed into the project, and the rendered speckit.constitution command is not preset-aware. So an organization that ships a fixed, ready-to-use constitution in a preset cannot get it installed without the agent re-authoring one.

Environment

  • Spec Kit CLI: 0.8.18 (the project's init-options.json recorded 0.8.18.dev0)
  • Agent integration: claude (also reproducible conceptually for other integrations)

What happens

After specify init followed by specify preset add with a preset that declares:

provides:
  templates:
    - type: "template"
      name: "constitution-template"
      file: "templates/constitution-template.md"
      replaces: "constitution-template"
      strategy: "replace"
  • .specify/templates/constitution-template.md is still the generic upstream placeholder (# [PROJECT_NAME] Constitution, [PRINCIPLE_1_NAME], ...).
  • .specify/memory/constitution.md is also the generic placeholder.
  • Only .specify/presets/<id>/templates/constitution-template.md carries the preset's content.

Separately, the rendered speckit.constitution command (from templates/commands/constitution.md) instructs the agent to treat .specify/memory/constitution.md as a template and fill the [PLACEHOLDER] tokens. So even running /speckit.constitution does not install the preset's document; it has the agent author principles.

Steps to reproduce

  1. Create a preset whose constitution-template entry has replaces: constitution-template, strategy: replace, and a complete, ready-to-use constitution as its content.
  2. specify init . --integration claude
  3. specify preset add --dev /path/to/preset
  4. Inspect .specify/templates/constitution-template.md and .specify/memory/constitution.md.

Expected

The preset's constitution-template (declared replace) should be the active template, and there should be a supported way for the preset's ratified constitution to land in .specify/memory/constitution.md without the agent re-authoring principles.

Actual

The live template and the memory file are the generic placeholder; the preset content is only in the presets/<id> copy; and speckit.constitution re-authors rather than installs.

Impact

For organizations with a fixed, ratified constitution, a developer who runs /speckit.constitution silently gets an AI-invented constitution, which then governs every Constitution Check gate in plan and analyze.

Suggested fix

Either:

  • honor strategy: replace for constitution-template when resolving .specify/memory/constitution.md during setup, or
  • document specify preset resolve constitution-template as the install path and make speckit.constitution preset-aware so a preset can override it to install/validate the preset's document rather than author one (presets can already override other commands such as a custom backlog command).

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions