Skip to content

Commit d28afb7

Browse files
committed
fix: inline skills prompt in dispatch_command auto-detection path
build_command_invocation() reads self._skills_mode which stays False when skills mode is only auto-detected from the project layout. Inline the /speckit-<stem> prompt construction so dispatch_command() sends the correct prompt regardless of how skills mode was detected. Also strengthen test_dispatch_detects_speckit_skills_layout to assert the -p prompt contains /speckit-plan and the user args.
1 parent 5938c22 commit d28afb7

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/specify_cli/integrations/copilot/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ def dispatch_command(
189189
)
190190

191191
if skills_mode:
192-
prompt = self.build_command_invocation(command_name, args)
192+
prompt = f"/speckit-{stem}"
193+
if args:
194+
prompt = f"{prompt} {args}"
193195
else:
194196
agent_name = f"speckit.{stem}"
195197
prompt = args or ""

tests/integrations/test_integration_copilot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,13 @@ def test_dispatch_detects_speckit_skills_layout(self, tmp_path):
659659
assert "--agent" not in call_args, (
660660
f"Skills mode should not use --agent, got: {call_args}"
661661
)
662+
prompt = call_args[call_args.index("-p") + 1]
663+
assert "/speckit-plan" in prompt, (
664+
f"Skills mode prompt should invoke /speckit-plan, got: {prompt}"
665+
)
666+
assert "my args" in prompt, (
667+
f"Skills mode prompt should preserve user args, got: {prompt}"
668+
)
662669

663670
# -- Next-steps display for Copilot skills mode -----------------------
664671

0 commit comments

Comments
 (0)