mirror of
https://github.com/github/spec-kit.git
synced 2026-07-11 10:34:06 +08:00
feat(integrations): generalize post-processing to all format types (#3311)
* feat(integrations): add post_process_command_content() hook for all format types Add post_process_command_content(self, content: str) -> str to IntegrationBase with a no-op default. Wire it into register_commands() for non-skills format types (Markdown, TOML, YAML) after format rendering, before writing to disk. Also applies to aliases rendered via the inject_name path (cline, forge). Skills-format agents are excluded to preserve the existing post_process_skill_content() path and avoid double-processing. This gives extension authors a clean per-agent content transformation seam for all 21 non-skills integrations that previously had no post-processing hook. Ref: #3303 Assisted-By: 🤖 Claude Code * fix: initialize _integration before conditional branch Prevents potential UnboundLocalError if the non-skills guard is refactored without updating the alias path reference. Assisted-By: 🤖 Claude Code
This commit is contained in:
@@ -123,6 +123,19 @@ class IntegrationBase(ABC):
|
||||
integration that sets this flag.
|
||||
"""
|
||||
|
||||
def post_process_command_content(self, content: str) -> str:
|
||||
"""Transform command content after format rendering.
|
||||
|
||||
Called by ``register_commands()`` for non-skills format types
|
||||
(Markdown, TOML, YAML) after the command has been rendered into
|
||||
its target format and before writing to disk. Skills-format
|
||||
agents use ``post_process_skill_content()`` instead.
|
||||
|
||||
Subclasses may override to inject agent-specific content.
|
||||
The default implementation returns *content* unchanged.
|
||||
"""
|
||||
return content
|
||||
|
||||
# -- Public API -------------------------------------------------------
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user