Skip to content

Unify Kimi/Codex skill naming and migrate legacy dotted Kimi dirs#1971

Open
RbBtSn0w wants to merge 8 commits intogithub:mainfrom
RbBtSn0w:fix/kimi-skill-hyphen-invocation
Open

Unify Kimi/Codex skill naming and migrate legacy dotted Kimi dirs#1971
RbBtSn0w wants to merge 8 commits intogithub:mainfrom
RbBtSn0w:fix/kimi-skill-hyphen-invocation

Conversation

@RbBtSn0w
Copy link
Contributor

@RbBtSn0w RbBtSn0w commented Mar 25, 2026

Summary

This PR aligns skill naming/invocation behavior for Kimi and Codex with the skills model discussed in #1918 and follow-up context from #1919.

What changed

  • Unified generated skill names to hyphenated format (speckit-*) for Kimi/Codex paths.
  • Updated hook invocation rendering to emit agent-specific invocation strings and EXECUTE_COMMAND_INVOCATION.
  • Fixed preset skill override mapping for multi-segment command IDs (speckit.fakeext.cmd -> speckit-fakeext-cmd).
  • Added temporary Kimi migration helper to convert/remove legacy dotted dirs (speckit.xxx) during init; annotated for removal after 2026-06-25.
  • Simplified Codex skill dir resolution by removing redundant override config (still resolves to .agents/skills via general config).
  • Synced release packaging scripts (sh/ps1) to hyphenated Kimi skill output.

Why

Discussion #1918 called out that hooks/invocations should be skill-aware for skills agents. This change removes naming drift between generated skills, hook invocation hints, and preset overrides.

Validation

  • uv run --with pytest python -m pytest tests/test_ai_skills.py tests/test_extensions.py tests/test_presets.py::TestPresetSkills
  • Result: 236 passed

Related discussions

@RbBtSn0w RbBtSn0w requested a review from mnriem as a code owner March 25, 2026 09:02
Copilot AI review requested due to automatic review settings March 25, 2026 09:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes skill naming to a single hyphenated format (speckit-...) across Kimi and Codex, and updates related plumbing (hook invocation rendering, preset/extension overrides, packaging) to match that canonical scheme while adding a temporary Kimi legacy directory migration.

Changes:

  • Normalize generated skill directory names to hyphenated form and update extension/preset override mapping for multi-segment command IDs.
  • Update hook messaging/execution metadata to emit agent-specific invocation strings (e.g., /skill:speckit-plan for Kimi, $speckit-tasks for Codex skills mode).
  • Sync template packaging scripts and add a temporary migration helper for legacy dotted Kimi skill directories.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/specify_cli/__init__.py Unifies skill naming, adds Kimi dotted-dir migration helper, updates init output/invocation hints, removes Codex skills dir override.
src/specify_cli/agents.py Makes skills-mode output naming consistently hyphenated (including multi-segment IDs).
src/specify_cli/presets.py Fixes preset skill override mapping for multi-segment command IDs by hyphenating derived skill names.
src/specify_cli/extensions.py Adds init-options-aware hook invocation rendering and returns invocation metadata from hook execution.
tests/test_ai_skills.py Updates expectations to hyphenated Kimi skills and adds tests for legacy Kimi dotted-dir migration.
tests/test_extensions.py Updates Codex skill path/name assertions and adds hook invocation rendering tests.
tests/test_presets.py Adds regression test for hyphenated skill override mapping for speckit.<ext>.<cmd>.
.github/workflows/scripts/create-release-packages.sh Updates Kimi packaging to generate hyphenated skill names.
.github/workflows/scripts/create-release-packages.ps1 Updates Kimi packaging to generate hyphenated skill names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable, please explain why.

Copilot AI review requested due to automatic review settings March 25, 2026 13:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mnriem mnriem self-requested a review March 25, 2026 14:04
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable, please explain why

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mnriem mnriem self-requested a review March 25, 2026 14:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/specify_cli/extensions.py:2024

  • HookExecutor.execute_hook() now returns an invocation field, but the docstring’s “Returns” section doesn’t mention it. Please update the return-value documentation to include invocation so callers know it’s available (and what format it uses).
        Returns:
            Dictionary with execution information:
            - command: str - Command to execute
            - extension: str - Extension ID
            - optional: bool - Whether hook is optional
            - description: str - Hook description
        """
        return {
            "command": hook.get("command"),
            "invocation": self._render_hook_invocation(hook.get("command")),
            "extension": hook.get("extension"),
            "optional": hook.get("optional", True),
            "description": hook.get("description", ""),
            "prompt": hook.get("prompt", "")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mnriem
mnriem previously approved these changes Mar 25, 2026
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable, please explain why

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/specify_cli/extensions.py:1676

  • _render_hook_invocation() is annotated to take command: str, but it’s called with hook.get('command') (potentially None) and defensively checks for non-strings. Updating the parameter type (e.g., str | None) would better reflect actual usage and avoid type-checking warnings.
    def _render_hook_invocation(self, command: str) -> str:
        """Render an agent-specific invocation string for a hook command."""
        if not isinstance(command, str):
            return ""


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RbBtSn0w RbBtSn0w requested a review from mnriem March 25, 2026 16:50
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix test & lint errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants