fix(integrations): preserve native skill invocation prefixes#3663
Open
BenBtg wants to merge 12 commits into
Open
fix(integrations): preserve native skill invocation prefixes#3663BenBtg wants to merge 12 commits into
BenBtg wants to merge 12 commits into
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Resolve generated command references with the active agent prefix instead of rewriting all slash-form text during post-processing. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Pass dollar-style skill prefixes through bare-project integration installation and cover the shared template output. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Use agent-native invocation prefixes in extension command registration and dynamic shared-script command hints. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Escape dollar-prefixed commands embedded in Bash strings and propagate the native prefix into installed Python command helpers. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Rewrite installed Bash and PowerShell formatter return expressions so direct callers receive the selected integration's native prefix. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Describe hook-derived references as command invocations so dollar-prefixed skills do not receive contradictory slash-command terminology. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Contributor
There was a problem hiding this comment.
Pull request overview
Preserves native $speckit-* invocation syntax for Codex and ZCode across integration rendering and lifecycle operations.
Changes:
- Centralizes native prefix resolution.
- Propagates prefixes through shared infrastructure, extensions, presets, and integration lifecycle flows.
- Adds coverage for dollar-prefixed rendering across Bash, PowerShell, and Python.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Forwards invocation prefixes to shared infrastructure. |
src/specify_cli/agents.py |
Applies native prefixes during command registration. |
src/specify_cli/commands/init.py |
Supplies the selected prefix during initialization. |
src/specify_cli/integration_runtime.py |
Resolves prefixes by integration mode. |
src/specify_cli/integrations/_helpers.py |
Preserves prefixes when changing defaults. |
src/specify_cli/integrations/_install_commands.py |
Handles prefixes during installation. |
src/specify_cli/integrations/_migrate_commands.py |
Handles prefixes during switch and upgrade. |
src/specify_cli/integrations/base.py |
Renders native skill invocations and hook guidance. |
src/specify_cli/presets/__init__.py |
Preserves prefixes during preset restoration. |
src/specify_cli/shared_infra.py |
Renders prefixes in templates and scripts. |
tests/integrations/test_base.py |
Tests core invocation rendering. |
tests/integrations/test_cli.py |
Tests shared template and script output. |
tests/integrations/test_integration_base_skills.py |
Updates hook-guidance expectations. |
tests/integrations/test_integration_codex.py |
Verifies Codex guidance wording. |
tests/integrations/test_integration_subcommand.py |
Tests install and switch behavior. |
tests/integrations/test_integration_zcode.py |
Cleans up ZCode test formatting. |
tests/test_extensions.py |
Tests Codex extension references. |
tests/test_presets.py |
Tests dollar-prefixed preset restoration. |
tests/test_setup_tasks.py |
Tests Bash and PowerShell formatters. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 19/19 changed files
- Comments generated: 2
- Review effort level: Medium
| slash commands. Subclasses may override — see ``ClaudeIntegration``. | ||
| """ | ||
| return self._inject_hook_command_note(content) | ||
| invocation_prefix = "$" if is_dollar_skills_agent(self.key, True) else "/" |
| "invoke_separator", "." | ||
| ) | ||
| return IntegrationBase.resolve_command_refs(body, separator) | ||
| prefix = "$" if is_dollar_skills_agent(selected_ai, separator == "-") else "/" |
Comment on lines
+105
to
+106
| skills_mode = integration.is_skills_mode(parsed_options, project_root) | ||
| return "$" if is_dollar_skills_agent(key, skills_mode) else "/" |
Comment on lines
+314
to
+315
| content = _BASH_FORMATTER_RETURN_RE.sub( | ||
| f'''printf '{prefix}speckit%s%s\\\\n' "$separator" "$command_name"''', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve each integration's native skill invocation syntax when rendering command references:
$speckit-<name>/speckit-<name>for other skills integrations and/speckit.<name>for command integrationsThis extracts the invocation-prefix work from #3616 so that PR remains focused on the constitution command guardrail. No constitution template or guardrail test changes are included here.
Validation
.venv/bin/python -m pytest tests/integrations/test_base.py tests/integrations/test_cli.py tests/integrations/test_integration_codex.py tests/integrations/test_integration_zcode.py tests/integrations/test_integration_subcommand.py tests/test_extensions.py tests/test_presets.py tests/test_setup_tasks.py -q— 1151 passeduvx ruff check src/specify_cli tests/integrations/test_integration_codex.py tests/integrations/test_integration_zcode.py --quietgit diff --checkAuthored autonomously by GitHub Copilot (model: GPT-5.6 Sol) on behalf of @BenBtg.