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 constitution-preset-template-sync: discover and propagate to all effective template layers
Apply the remediation from the bug assessment on issue #3737.
Update the constitution command template (step 4) to resolve the full
effective template stack for plan-template, spec-template, and
tasks-template before propagating constitutional guidance. The agent now
discovers project-local overrides and all active preset-provided
replacements (via .specify/presets/*/preset.yml replaces fields) and
propagates to every layer, not just the hard-coded built-in path.
Step 5 (Sync Impact Report) is updated to derive entries from the
resolved stack and only mark templates as updated when actually reviewed.
Refs #3737
Assisted-by: GitHub Copilot (model: claude-sonnet-4.6, autonomous)
4. Consistency propagation checklist (convert prior checklist into active validations):
100
-
- Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
101
-
- Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
102
-
- Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
100
+
101
+
**Before reading any template, resolve the full effective template stack for each governed template type.**
102
+
For each of the three governed templates — `plan-template`, `spec-template`, and `tasks-template` — perform this discovery:
103
+
104
+
a. **Discover all active layers** (in priority order):
105
+
1. **Project-local override**: Check if `.specify/templates/<template-name>.md` exists. If so, include it.
106
+
2. **Active preset-provided replacements**: List every subdirectory of `.specify/presets/` (if the directory exists).
107
+
For each subdirectory, read `preset.yml` and look for entries under `provides.templates` where the `replaces`
108
+
field matches `<template-name>`. For each matching entry, the preset-provided file path is
109
+
`.specify/presets/<preset-id>/<file>` (the `file` field from `preset.yml`). Include all such files.
110
+
3. **Core/built-in reference**: Note that the core template in the package itself is not directly editable
111
+
by the agent; treat it as the canonical reference for constitutional guidance.
112
+
113
+
b. **Propagate constitutional guidance to every discovered layer** (project-local overrides and preset-provided
114
+
replacements). For each discovered file:
115
+
- Read the file.
116
+
- Ensure any "Constitution Check" sections, rules, task categories, or scope/requirements constraints align
117
+
with the updated principles.
118
+
- Preserve the file's existing structure, specialized content, and provider-specific generation behavior —
119
+
do **not** overwrite provider-specific sections with generic content from a different layer.
120
+
- Write back only if changes are needed; otherwise mark as already-compliant.
121
+
122
+
c. **Fallback (no active layers found)**: If no project-local override or preset-provided replacement exists for
123
+
a template, note in the Sync Impact Report that no installed copy was found and the core template (read-only)
124
+
is the effective source.
125
+
126
+
After resolving all three template types, also:
103
127
- Read each installed Spec Kit command file for your agent (including this one) — named `speckit.*` or `speckit-*` (dot or hyphen depending on the agent), or laid out as `speckit-<name>/SKILL.md` for skills-based integrations, e.g. in `.github/agents/`, `.github/skills/`, `.claude/skills/`, or your agent's equivalent commands directory — to verify no outdated references (CLAUDE-only or other agent-specific names) remain when generic guidance is required.
104
128
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
105
129
@@ -108,7 +132,11 @@ Follow this execution flow:
108
132
- List of modified principles (old title → new title if renamed)
0 commit comments