diff --git a/scripts/sync_extensions.py b/scripts/sync_extensions.py index 0a6ccacc..040ff241 100644 --- a/scripts/sync_extensions.py +++ b/scripts/sync_extensions.py @@ -143,7 +143,8 @@ def collect_needed_commands() -> list[CommandSpec]: meta = parse_frontmatter(skill_md.read_text()) desc = str(meta.get("description", "")) for trigger in slash_triggers(meta): - cmd_name = trigger.lstrip("/") + # Replace colons with dashes for cross-platform filename compatibility + cmd_name = trigger.lstrip("/").replace(":", "-") cmd_path = skill_dir / "commands" / f"{cmd_name}.md" needed.append(CommandSpec(path=cmd_path, trigger=trigger, description=desc)) return needed diff --git a/skills/github-pr-reviewer/commands/pr-reviewer:setup.md b/skills/github-pr-reviewer/commands/pr-reviewer-setup.md similarity index 100% rename from skills/github-pr-reviewer/commands/pr-reviewer:setup.md rename to skills/github-pr-reviewer/commands/pr-reviewer-setup.md diff --git a/skills/github-repo-monitor/commands/github-monitor:poll.md b/skills/github-repo-monitor/commands/github-monitor-poll.md similarity index 100% rename from skills/github-repo-monitor/commands/github-monitor:poll.md rename to skills/github-repo-monitor/commands/github-monitor-poll.md diff --git a/skills/incident-retrospective/commands/incident-retro:setup.md b/skills/incident-retrospective/commands/incident-retro-setup.md similarity index 100% rename from skills/incident-retrospective/commands/incident-retro:setup.md rename to skills/incident-retrospective/commands/incident-retro-setup.md diff --git a/skills/linear-triage/commands/linear-triage:setup.md b/skills/linear-triage/commands/linear-triage-setup.md similarity index 100% rename from skills/linear-triage/commands/linear-triage:setup.md rename to skills/linear-triage/commands/linear-triage-setup.md diff --git a/skills/openhands-automation/commands/automation:create.md b/skills/openhands-automation/commands/automation-create.md similarity index 100% rename from skills/openhands-automation/commands/automation:create.md rename to skills/openhands-automation/commands/automation-create.md diff --git a/skills/research-brief/commands/research-brief:setup.md b/skills/research-brief/commands/research-brief-setup.md similarity index 100% rename from skills/research-brief/commands/research-brief:setup.md rename to skills/research-brief/commands/research-brief-setup.md diff --git a/skills/slack-channel-monitor/commands/slack-monitor:poll.md b/skills/slack-channel-monitor/commands/slack-monitor-poll.md similarity index 100% rename from skills/slack-channel-monitor/commands/slack-monitor:poll.md rename to skills/slack-channel-monitor/commands/slack-monitor-poll.md diff --git a/skills/slack-standup-digest/commands/standup-digest:setup.md b/skills/slack-standup-digest/commands/standup-digest-setup.md similarity index 100% rename from skills/slack-standup-digest/commands/standup-digest:setup.md rename to skills/slack-standup-digest/commands/standup-digest-setup.md diff --git a/tests/test_sync_extensions.py b/tests/test_sync_extensions.py index 6c7b5e67..8dfb703d 100644 --- a/tests/test_sync_extensions.py +++ b/tests/test_sync_extensions.py @@ -198,6 +198,20 @@ def test_paths_are_under_commands_dir(self): assert spec.path.parent.name == "commands" assert spec.path.suffix == ".md" + def test_colon_triggers_are_normalized_for_filenames(self, tmp_path, monkeypatch): + skill_dir = tmp_path / "skills" / "test-skill" + skill_dir.mkdir(parents=True) + (skill_dir / "SKILL.md").write_text( + "---\nname: test-skill\ndescription: Test\ntriggers:\n - /test:command\n---\nBody\n" + ) + + monkeypatch.setattr("sync_extensions.SKILL_DIRS", [tmp_path / "skills"]) + + specs = collect_needed_commands() + assert [spec.path.relative_to(tmp_path).as_posix() for spec in specs] == [ + "skills/test-skill/commands/test-command.md" + ] + # ── load_marketplaces ────────────────────────────────────────────────