Skip to content

Lift hook command note injection into SkillsIntegration base class #2523

@mnriem

Description

@mnriem

Problem

Hook commands in extensions.yml use dotted IDs (e.g., speckit.git.commit) but skills use hyphenated names (speckit-git-commit). Without an explicit note in the generated SKILL.md, agents emit /speckit.git.commit which doesn't resolve.

Claude (#2346) and Codex (#2503) both solve this by independently overriding setup() and post_process_skill_content() with identical _HOOK_COMMAND_NOTE constants and _inject_hook_command_note regex logic. Copilot (skills mode) and Vibe have the same latent bug — they don't inject the note.

Prerequisites

This should land after #2503 is merged, since it will deduplicate and lift the hook note logic that #2503 adds for Codex.

Proposed changes

  1. Move the post-processing loop into SkillsIntegration.setup() so it calls self.post_process_skill_content() after writing each SKILL.md. This eliminates the duplicated loop in Claude, Codex, Copilot, and Vibe.

  2. Move _inject_hook_command_note into SkillsIntegration and call it from the base post_process_skill_content(). The dot-to-hyphen translation is inherent to how skills map hook IDs — it's not agent-specific.

  3. Remove the duplicated logic from ClaudeIntegration and CodexIntegration. Claude's post_process_skill_content() would still override for its agent-specific flags (user-invocable, disable-model-invocation) but call super() to get the hook note.

Affected integrations

Integration Has post-process loop Has hook note After refactor
Base (SkillsIntegration) No No Both
Claude Yes (duplicated) Yes Simplified
Codex Yes (duplicated, #2503) Yes Simplified
Copilot (skills) Yes (duplicated) No — bug Fixed
Vibe Yes (duplicated) No — bug Fixed
Agy No No Fixed
Devin No No Fixed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions