Skip to content

Commit 5ec0599

Browse files
committed
fix(templates): tighten constitution sync scope
Propagate dollar-style invocation prefixes when installing into projects without a default integration, and restrict constitution synchronization to Spec Kit-managed templates and commands. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
1 parent 25c36e5 commit 5ec0599

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

src/specify_cli/integrations/_install_commands.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import typer
77

88
from .._console import console
9+
from .._invocation_style import is_dollar_skills_agent
910
from .._utils import _display_project_path
1011
from ..integration_runtime import (
1112
invoke_separator_for_integration as _invoke_separator_for_integration,
@@ -130,6 +131,14 @@ def integration_install(
130131
infra_integration, current, infra_key, infra_parsed,
131132
project_root=project_root,
132133
),
134+
invoke_prefix=(
135+
"$"
136+
if is_dollar_skills_agent(
137+
infra_key,
138+
infra_integration.is_skills_mode(infra_parsed, project_root),
139+
)
140+
else "/"
141+
),
133142
)
134143
if os.name != "nt":
135144
from .. import ensure_executable_scripts

templates/commands/constitution.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ This command updates project governance only. It may modify:
2020

2121
- `.specify/memory/constitution.md`
2222
- dependent templates under `.specify/templates/`
23-
- installed Spec Kit command files and runtime guidance documents when required to keep
24-
them consistent with the amended constitution
23+
- installed Spec Kit command files when required to keep them consistent with the
24+
amended constitution
2525

2626
It **MUST NOT** create or modify application source code, feature specifications, plans,
2727
tasks, tests, or other implementation artifacts.
@@ -105,7 +105,6 @@ Follow this execution flow:
105105
- Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
106106
- Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
107107
- 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.
108-
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
109108
110109
5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
111110
- Version change: old → new

tests/integrations/test_integration_generic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ def test_constitution_command_rejects_implementation_scope(self, tmp_path):
215215
assert "## Scope Guard" in content
216216
assert "MUST NOT" in content
217217
assert "application source code" in content
218+
assert "runtime guidance documents" not in content
219+
assert "README.md" not in content
218220
assert "Do not execute it during this command." in content
219221
assert "Never invoke a suggested follow-up command automatically." in content
220222
assert "/speckit.specify <intent>" in content

tests/integrations/test_integration_subcommand.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,24 @@ def test_install_bare_project_gets_shared_infra(self, tmp_path):
12561256
assert "/speckit-specify" in script_content
12571257
assert "/speckit.specify" not in script_content
12581258

1259+
def test_install_dollar_skill_into_bare_project_gets_native_shared_refs(
1260+
self, tmp_path
1261+
):
1262+
"""A dollar-style integration supplies its prefix without a default."""
1263+
project = tmp_path / "bare-codex"
1264+
project.mkdir()
1265+
(project / ".specify").mkdir()
1266+
1267+
result = _run_in_project(
1268+
project, ["integration", "install", "codex", "--script", "sh"]
1269+
)
1270+
1271+
assert result.exit_code == 0, result.output
1272+
plan = project / ".specify" / "templates" / "plan-template.md"
1273+
plan_content = plan.read_text(encoding="utf-8")
1274+
assert "$speckit-plan" in plan_content
1275+
assert "/speckit-plan" not in plan_content
1276+
12591277
def test_install_defers_extension_commands_until_use(self, tmp_path):
12601278
"""Installing a second integration does not register enabled extensions.
12611279

0 commit comments

Comments
 (0)