@@ -923,7 +923,23 @@ def test_git_extension_commands_registered(self, tmp_path):
923923
924924
925925class TestSharedInfraCommandRefs :
926- """Verify _install_shared_infra resolves __SPECKIT_COMMAND_*__ in page templates."""
926+ """Verify _install_shared_infra resolves __SPECKIT_COMMAND_*__ in shared infra."""
927+
928+ @staticmethod
929+ def _combined_script_content (project , script_type ):
930+ script_dir = "bash" if script_type == "sh" else "powershell"
931+ suffix = "sh" if script_type == "sh" else "ps1"
932+ names = [
933+ f"check-prerequisites.{ suffix } " ,
934+ f"common.{ suffix } " ,
935+ f"setup-tasks.{ suffix } " ,
936+ ]
937+ return "\n " .join (
938+ (project / ".specify" / "scripts" / script_dir / name ).read_text (
939+ encoding = "utf-8"
940+ )
941+ for name in names
942+ )
927943
928944 def test_dot_separator_in_page_templates (self , tmp_path ):
929945 """Markdown agents get /speckit.<name> in page templates."""
@@ -968,6 +984,46 @@ def test_hyphen_separator_in_page_templates(self, tmp_path):
968984 assert "__SPECKIT_COMMAND_" not in content
969985 assert "/speckit-tasks" in content
970986
987+ @pytest .mark .parametrize ("script_type" , ["sh" , "ps" ])
988+ def test_dot_separator_in_shared_scripts (self , tmp_path , script_type ):
989+ """Markdown agents get /speckit.<name> in shared script hints."""
990+ from specify_cli import _install_shared_infra
991+
992+ project = tmp_path / f"dot-script-{ script_type } "
993+ project .mkdir ()
994+ (project / ".specify" ).mkdir ()
995+
996+ _install_shared_infra (project , script_type , invoke_separator = "." )
997+
998+ content = self ._combined_script_content (project , script_type )
999+ assert "__SPECKIT_COMMAND_" not in content
1000+ assert "/speckit.specify" in content
1001+ assert "/speckit.plan" in content
1002+ assert "/speckit.tasks" in content
1003+ assert "/speckit-specify" not in content
1004+ assert "/speckit-plan" not in content
1005+ assert "/speckit-tasks" not in content
1006+
1007+ @pytest .mark .parametrize ("script_type" , ["sh" , "ps" ])
1008+ def test_hyphen_separator_in_shared_scripts (self , tmp_path , script_type ):
1009+ """Skills agents get /speckit-<name> in shared script hints."""
1010+ from specify_cli import _install_shared_infra
1011+
1012+ project = tmp_path / f"hyphen-script-{ script_type } "
1013+ project .mkdir ()
1014+ (project / ".specify" ).mkdir ()
1015+
1016+ _install_shared_infra (project , script_type , invoke_separator = "-" )
1017+
1018+ content = self ._combined_script_content (project , script_type )
1019+ assert "__SPECKIT_COMMAND_" not in content
1020+ assert "/speckit-specify" in content
1021+ assert "/speckit-plan" in content
1022+ assert "/speckit-tasks" in content
1023+ assert "/speckit.specify" not in content
1024+ assert "/speckit.plan" not in content
1025+ assert "/speckit.tasks" not in content
1026+
9711027 def test_full_init_claude_resolves_page_templates (self , tmp_path ):
9721028 """Full CLI init with Claude (skills agent) produces hyphen refs in page templates."""
9731029 from typer .testing import CliRunner
@@ -995,6 +1051,10 @@ def test_full_init_claude_resolves_page_templates(self, tmp_path):
9951051 assert "/speckit-plan" in content , "Claude (skills) should use /speckit-plan"
9961052 assert "__SPECKIT_COMMAND_" not in content
9971053
1054+ script_content = self ._combined_script_content (project , "sh" )
1055+ assert "/speckit-specify" in script_content
1056+ assert "/speckit.specify" not in script_content
1057+
9981058 def test_full_init_copilot_resolves_page_templates (self , tmp_path ):
9991059 """Full CLI init with Copilot (markdown agent) produces dot refs in page templates."""
10001060 from typer .testing import CliRunner
@@ -1022,6 +1082,10 @@ def test_full_init_copilot_resolves_page_templates(self, tmp_path):
10221082 assert "/speckit.plan" in content , "Copilot (markdown) should use /speckit.plan"
10231083 assert "__SPECKIT_COMMAND_" not in content
10241084
1085+ script_content = self ._combined_script_content (project , "sh" )
1086+ assert "/speckit.specify" in script_content
1087+ assert "/speckit-specify" not in script_content
1088+
10251089 def test_full_init_copilot_skills_resolves_page_templates (self , tmp_path ):
10261090 """Full CLI init with Copilot --skills produces hyphen refs in page templates."""
10271091 from typer .testing import CliRunner
@@ -1051,6 +1115,10 @@ def test_full_init_copilot_skills_resolves_page_templates(self, tmp_path):
10511115 assert "/speckit.plan" not in content , "dot-notation leaked into Copilot skills page template"
10521116 assert "__SPECKIT_COMMAND_" not in content
10531117
1118+ script_content = self ._combined_script_content (project , "sh" )
1119+ assert "/speckit-specify" in script_content
1120+ assert "/speckit.specify" not in script_content
1121+
10541122
10551123class TestIntegrationCatalogDiscoveryCLI :
10561124 """End-to-end CLI tests for `integration search`, `info`, and `catalog …`.
0 commit comments