Skip to content

refactor(integrations): own invocation rendering - #4983

Open
mnriem wants to merge 1 commit into
github:mainfrom
mnriem:mnriem-integration-invocation-ownership
Open

mnriem wants to merge 1 commit into
github:mainfrom
mnriem:mnriem-integration-invocation-ownership

Conversation

@mnriem

@mnriem mnriem commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Moves command naming and invocation rendering ownership into integration classes, using the behavior characterized by #4975 as the preservation boundary.

The shared init, command registrar, extension skill and hook paths, preset rendering, and integration runtime now resolve naming and invocation behavior through the active integration. Dollar-prefixed skills, Kimi's /skill: syntax, Cline/Forge/Junie formatting, and mode-sensitive Bob/Copilot behavior live with their owning integrations. The obsolete _invocation_style.py identity tables are removed, and extension code no longer imports concrete integration formatters.

Generated filenames, command-reference replacement, displayed and hook invocations, custom non-Spec-Kit hook commands, and dual-mode behavior remain unchanged. Identity checks intentionally retained are limited to onboarding guidance and companion/content artifact handling, which are outside this ownership change.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

Exact commands and results:

  • uv sync --extra test --quiet — passed.
  • .venv/bin/python -m pytest tests/integrations/test_integration_characterization.py tests/integrations/test_base.py tests/integrations/test_registry.py tests/integrations/test_integration_alquimia.py tests/integrations/test_integration_docker_agent.py tests/integrations/test_integration_droid.py tests/integrations/test_integration_dsh.py tests/integrations/test_integration_zed.py tests/extensions/bug/test_bug_hooks.py tests/extensions/github/test_github_extension.py -q — 1,487 passed, 4 skipped.
  • .venv/bin/python -m pytest tests/test_extensions.py::TestHookInvocationRendering tests/integrations/test_integration_characterization.py tests/integrations/test_integration_cline.py tests/integrations/test_integration_forge.py tests/integrations/test_integration_junie.py tests/integrations/test_base.py -q — 219 passed.
  • .venv/bin/python -m pytest tests/integrations tests/specify_cli/integrations tests/extensions tests/specify_cli/extensions tests/specify_cli/presets tests/specify_cli/test_command_init.py tests/test_init_dir.py tests/test_init_dir_cli.py tests/test_extension_registration.py tests/test_extension_skills.py tests/test_extensions.py tests/test_presets.py tests/test_command_template_hooks.py -q — 6,255 passed, 14 skipped.
  • .venv/bin/python -m pytest tests/test_agent_config_consistency.py -q — 31 passed.
  • .venv/bin/python -m pytest tests -q — 12,581 passed, 101 skipped.
  • After rebasing onto current upstream/main: .venv/bin/python -m pytest tests/integrations/test_integration_characterization.py tests/test_extensions.py::TestHookInvocationRendering tests/test_agent_config_consistency.py -q — 56 passed.
  • git diff --check, .venv/bin/python -m compileall -q src/specify_cli, and uvx ruff check --select F <changed Python files> — passed.

The sample-project coverage is exercised by the table-driven specify init completion-guidance characterization tests for Command Code, Forge, Kimi, Copilot, and DSH.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: GitHub Copilot, powered by GPT-5.6 Sol, operated autonomously in autopilot mode with the runtime-default reasoning setting. It inspected the integration design and characterization baseline, implemented the production and test changes, ran focused and full validation, authored the commit, and drafted this pull request description.

Move registered command naming, command-reference rendering, and hook invocation formatting behind resolved integration classes while preserving existing mode-specific behavior.

Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c44efad8-4dc0-4488-a27f-e2abace733ef
Copilot AI max review requested due to automatic review settings October 15, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The refactor spans several rendering paths and includes a confirmed historical-skill restoration regression.

1 open finding
What changed in this PR

Moves command naming and invocation rendering into integration classes, aiming to preserve the delivery contracts characterized in #4975.

Changes:

  • Adds integration-owned naming, reference, and hook rendering methods.
  • Updates shared callers and removes centralized invocation-style tables.
  • Revises integration tests and design documentation.

AI disclosure: GitHub Copilot for the requester; model/settings unavailable, autonomous review and fix suggestions.

File Description
tests/​integrations/​test_integration_zed.py Renames style tests and updates comments.
tests/​integrations/​test_integration_dsh.py Clarifies the invocation-style docstring.
tests/​integrations/​test_integration_droid.py Tests integration-owned references.
tests/​integrations/​test_integration_docker_agent.py Tests native skill references.
tests/​integrations/​test_integration_alquimia.py Replaces centralized-helper assertions.
tests/​integrations/​test_base.py Tests integration-owned prefixes.
tests/​extensions/​github/​test_github_extension.py Derives dollar-prefix coverage from integrations.
src/​specify_cli/​presets/​_manager_skills.py Delegates preset skill references.
src/​specify_cli/​integrations/​zcode/​__init__.py Declares dollar-prefix skill style.
src/​specify_cli/​integrations/​vibe/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​rovodev/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​lingma/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​kimi/​__init__.py Declares the native /skill: prefix.
src/​specify_cli/​integrations/​junie/​__init__.py Owns hook command formatting.
src/​specify_cli/​integrations/​hermes/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​generic/​__init__.py Selects separators by output mode.
src/​specify_cli/​integrations/​forge/​__init__.py Owns hook command formatting.
src/​specify_cli/​integrations/​cursor_agent/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​command_code/​__init__.py Declares dollar-prefix skill style.
src/​specify_cli/​integrations/​codex/​__init__.py Declares dollar-prefix skill style.
src/​specify_cli/​integrations/​cline/​__init__.py Owns hook command formatting.
src/​specify_cli/​integrations/​claude/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​base.py Adds shared naming and rendering methods.
src/​specify_cli/​integrations/​alquimia/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integrations/​agy/​__init__.py Declares mode-gated skill style.
src/​specify_cli/​integration_runtime.py Delegates prefix selection.
src/​specify_cli/​extensions/​__init__.py Uses integration rendering for skills and hooks.
src/​specify_cli/​command_init.py Delegates displayed command references.
src/​specify_cli/​agents.py Delegates registered names and references.
src/​specify_cli/​_invocation_style.py Removes centralized identity tables.
design/​integration.md Documents rendering ownership.

🧠 Review effort: Max


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +557 to +559
skills_enabled = is_ai_skills_enabled(
load_init_options(project_root)
)
@mnriem mnriem added the triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review label Oct 15, 2026

This branch has not been deployed

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

Labels

triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants