Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/specify_cli/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ def init(
zed_skill_mode = selected_ai == "zed" and _is_skills_integration
grok_skill_mode = selected_ai == "grok" and _is_skills_integration
cline_skill_mode = selected_ai == "cline"
forge_skill_mode = selected_ai == "forge"
bob_skill_mode = selected_ai == "bob" and _is_skills_integration
native_skill_mode = (
codex_skill_mode
Expand Down Expand Up @@ -776,6 +777,7 @@ def _display_cmd(name: str) -> str:
if (
_is_slash_skills_agent(selected_ai, _ai_skills_enabled)
or cline_skill_mode
or forge_skill_mode
):
return f"/speckit-{name}"
return f"/speckit.{name}"
Expand Down
36 changes: 36 additions & 0 deletions tests/integrations/test_integration_forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,39 @@ def test_git_extension_command_uses_hyphen_notation(self, tmp_path):
"Found '/speckit.specify' (dot notation) in generated Forge git.feature command body. "
"Forge requires hyphen notation for ZSH compatibility."
)


class TestForgeInitNextSteps:
"""The post-init 'Next steps' panel must show hyphenated /speckit-<name>
commands for Forge, since Forge only registers the hyphenated form
(see the generated command-file tests above)."""

def test_init_next_steps_show_hyphenated_commands(self, tmp_path):
import os

from typer.testing import CliRunner

from specify_cli import app

project = tmp_path / "forge-nextsteps"
project.mkdir()
old_cwd = os.getcwd()
try:
os.chdir(project)
result = CliRunner().invoke(
app,
["init", "--here", "--integration", "forge", "--ignore-agent-tools"],
catch_exceptions=False,
)
finally:
os.chdir(old_cwd)

assert result.exit_code == 0, f"init failed: {result.output}"
# Forge registers /speckit-<name>; the next-steps panel must match.
assert "/speckit-plan" in result.output, (
f"Expected /speckit-plan in next steps but got:\n{result.output}"
)
# Must NOT show the dotted /speckit.plan form Forge can't invoke.
assert "/speckit.plan" not in result.output, (
f"Should not show dotted /speckit.plan for Forge:\n{result.output}"
)