Skip to content

Constitution template should be in .specify/templates/ to prevent overwrites during reinitialization #1541

@LoveJazzTZ

Description

@LoveJazzTZ

Problem

The constitution.md template currently resides in .specify/memory/constitution.md by default. This causes user-customized constitutions to be overwritten when spec kit is reinitialized (e.g., when setting up for a different AI agent in the same project).

Steps to Reproduce

  1. Initialize spec kit in a project: /speckit.init
  2. Customize .specify/memory/constitution.md with project-specific principles
  3. Run spec kit initialization again (e.g., for a different agent/configuration)
  4. Result: The customized constitution.md is overwritten with the template version

Expected Behavior

The customized constitution.md should be preserved across reinitialization. Only the template files in .specify/templates/ should be updated/overwritten.

Proposed Solution

  1. Move the default constitution template from .specify/memory/constitution.md to .specify/templates/constitution.md
  2. On first initialization (when memory/constitution.md doesn't exist), copy the template from templates/ to memory/
  3. On subsequent initializations, check if memory/constitution.md exists:
    • If it exists, skip copying (preserve user's version)
    • If it doesn't exist, copy from template

Benefits

  • Prevents accidental loss of customized constitutions
  • Allows the same .specify/ structure to work with multiple AI agents without conflicts
  • Aligns with the principle that .specify/memory/ contains project-specific artifacts, while .specify/templates/ contains reusable scaffolds

Workaround (Current)

Users must manually restore their constitution after reinitialization:

git restore .specify/memory/constitution.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions