spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

Add integration-aware command hints

Open nike-17 opened this issue 6 months ago • 1 comments

Description

Adds integration-aware user-facing command invocation rendering so generated Spec Kit hints use the active agent syntax. Codex now renders $speckit-... hints, standard slash-command integrations keep their existing behavior, and shared templates/scripts, extension hooks, presets, and init next steps all route through the integration-owned display invocation API.

Testing

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

Commands run:

uv run --extra test pytest tests/integrations tests/test_agent_config_consistency.py tests/test_workflows.py -q
uv run --extra test pytest tests/integrations/test_integration_codex.py tests/integrations/test_integration_base_skills.py -q
uv run --extra test pytest tests -k "codex and command" -q

Also initialized temporary Codex and Claude projects and verified Codex generated $speckit-plan / $speckit-git-commit without slash-form leaks, while Claude retained /speckit-plan.

AI Disclosure

  • [ ] I did not use AI assistance for this contribution
  • [x] I did use AI assistance (describe below)

Implemented with Codex assistance in this repository workspace.

nike-17 avatar May 30 '26 19:05 nike-17

Please address Copilot feedback and resolve conflicts

mnriem avatar Jun 03 '26 12:06 mnriem

Copilot feedback is addressed: the latest Agy comment was resolved by confirming _inject_hook_command_note is inherited from SkillsIntegration, with tests/integrations/test_integration_agy.py covering that call path. All review threads are resolved and CI is green on the current SHA (5212a54). Could you please re-review when you have a chance?

nike-17 avatar Jun 05 '26 04:06 nike-17

I pushed an explicit Agy compatibility shim in 10d7d39 so AgyIntegration._inject_hook_command_note(...) is defined directly and forwards to SkillsIntegration._inject_hook_command_note(...). This keeps behavior centralized while addressing the Copilot concern. Local verification: 2705 passed, 9 skipped; ruff passed.

nike-17 avatar Jun 05 '26 04:06 nike-17

Agentic follow-up completed and pushed in b626ce0 after rebasing on latest main.

What changed after the prior update:

  • Fixed the legacy init-options.json hook fallback so skills integrations without readable .specify/integration.json render native invocations for Agy/Trae/Devin, while preserving legacy non-skills Codex dotted slash behavior.
  • Removed Agy's redundant second post-processing pass; it now relies on the shared SkillsIntegration path plus the explicit compatibility shim.
  • Added regression coverage for persisted command prefixes, Agy $speckit-git-commit hook notes, strict/corrupt ai_skills handling, and legacy skills fallback rendering.

Verification on the rebased branch:

  • uv run pytest tests/integrations tests/test_extensions.py tests/test_workflows.py tests/test_setup_tasks.py -q -> 2750 passed, 9 skipped
  • uv run --with ruff ruff check src/specify_cli tests -> passed
  • git diff --check -> passed

GitHub now reports the branch as mergeable and there are no unresolved review threads. The only remaining blocker I can see is the stale requested-changes review from the earlier Copilot feedback. Could you please re-review when available?

nike-17 avatar Jun 05 '26 05:06 nike-17

Addressed the new Copilot feedback in 35afa7f.

Change:

  • HookExecutor now caches integration metadata/default key/resolved integration per executor instance, so hook rendering no longer re-reads and parses .specify/integration.json for each hook.
  • Added regression coverage that calls _render_hook_invocation() twice and asserts the integration-state reader is invoked once.

Verification:

  • uv run pytest tests/test_extensions.py tests/integrations/test_integration_agy.py tests/integrations/test_integration_codex.py tests/integrations/test_integration_subcommand.py -q -> 370 passed
  • uv run pytest tests/integrations tests/test_extensions.py tests/test_workflows.py tests/test_setup_tasks.py -q -> 2761 passed, 9 skipped
  • uv run --with ruff ruff check src/specify_cli tests -> passed
  • git diff --check -> passed

The Copilot thread is now resolved.

nike-17 avatar Jun 09 '26 05:06 nike-17

Please rebase on main and run tests.

mnriem avatar Jun 09 '26 21:06 mnriem

Rebased on latest main and pushed dd6a97a.

I also aligned the PR-added init tests with the current CLI after upstream removed --no-git.

Verification after rebase:

  • uv run pytest tests/integrations/test_cli.py::TestSharedInfraCommandRefs::test_full_init_codex_resolves_page_templates tests/test_init_command_invocations.py -q -> 4 passed
  • uv run pytest tests/integrations tests/test_extensions.py tests/test_workflows.py tests/test_setup_tasks.py tests/test_init_command_invocations.py -q -> 2862 passed, 9 skipped
  • uv run --with ruff ruff check src/specify_cli tests -> passed
  • git diff --check -> passed

Current local/GitHub sweep: branch is mergeable and there are no unresolved review threads. GitHub checks have not appeared yet for the new SHA.

nike-17 avatar Jun 10 '26 05:06 nike-17