Repository navigation
fix(extensions): preserve skills mode on update - #5120
mikamikasuki wants to merge 18 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved skill-registration regressions and incompatible update test doubles block approval.
5 open issues
Update install_update test doubles for register_commands · New Refresh Hermes global skills across consecutive updates · New Preserve skill aliases during skills-only updates · New Retain validation and rollback safeguards in generic skills mode · New Align fresh extension adds with update rendering · New
What changed in this PR
This PR aims to preserve skills-mode extension registration during updates, addressing #5105 by passing the saved project mode through archive installation.
Changes:
- Adds command-registration control to archive and ZIP installers.
- Applies the saved skills-mode setting during extension updates.
- Adds a Claude skills-mode regression test and updates an installer test double.
Verification used source inspection and an isolated signature check; project tests were not run.
AI-generated review: GitHub Copilot, model unknown, automated, for the requester.
| File | Description |
|---|---|
| tests/specify_cli/extensions/test_command_update.py | Adds skills-mode update coverage and forwards the registration flag in a test double. |
| src/specify_cli/extensions/_command_update_transaction.py | Selects registration behavior from saved skills-mode options. |
| src/specify_cli/extensions/__init__.py | Forwards registration control through archive and ZIP installation. |
Review effort: Max
| register_commands=not is_ai_skills_enabled( | ||
| _commands.load_init_options(project_root) | ||
| ), |
| register_commands=not is_ai_skills_enabled( | ||
| _commands.load_init_options(project_root) | ||
| ), |
| register_commands=not is_ai_skills_enabled( | ||
| _commands.load_init_options(project_root) | ||
| ), |
| _ = manager.install_from_zip( | ||
| archive_path, | ||
| speckit_version, | ||
| register_commands=not is_ai_skills_enabled( | ||
| _commands.load_init_options(project_root) | ||
| ), | ||
| catalog_name=update.catalog_name, | ||
| ) |
|
|
||
| manager = ExtensionManager(project_dir) | ||
| v1_dir = self._create_extension_source(tmp_path, "1.0.0") | ||
| manager.install_from_directory(v1_dir, "0.1.0", register_commands=False) |
|
Please address Copilot feedback. If not applicable, please explain why |
d3e00c2 to
a692b35
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The tests-only diff omits the claimed runtime fix, and the regression test neither reproduces tracked-skill loss nor demonstrates failure before the fix and success afterward.
7 open issues
Update install_update test doubles for register_commands Add the runtime change before claiming to close #5105 · New Seed tracked skills and verify their state survives updates · New Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates
Review effort: Max
| def test_update_preserves_skills_mode_registration(self, tmp_path, monkeypatch): | ||
| """Updating an extension must keep Claude skills in skills mode.""" |
There was a problem hiding this comment.
🟡 Changes recommended
The production update path still lacks skills-mode handling, while the tests accept lost skill registration and fail to verify required hook rules and Claude metadata.
9 open issues
Update install_update test doubles for register_commands Assert skills remain registered after the update · New Test generated hook rules and Claude frontmatter in skills mode · New Seed tracked skills and verify their state survives updates Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates
Review effort: Max
There was a problem hiding this comment.
🟡 Changes recommended
In Auggie skills mode, the update can overwrite user or preset skill content without a recovery copy.
11 open issues
Preserve unverified user and preset skills during refresh · New Update install_update test doubles for register_commands Normalize registered_skills before iterating · New Refresh newly written native skills outside the stale allowlist · New Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test that force_names leaves unlisted skills untouched · New
2 resolved since last review
Review effort: Max
| # Derive skill name from command name using the same hyphenated | ||
| # convention as hook rendering and preset skill registration. | ||
| skill_name = self._skill_name_for_command(cmd_name) | ||
| force_skill = force and (force_names is None or skill_name in force_names) |
There was a problem hiding this comment.
🟡 Changes recommended
Claude extension add and update still produce different primary-skill content and registered_skills for the same version, while the comparison test masks this inconsistency by forcibly refreshing its fresh-install baseline.
9 open issues
Update install_update test doubles for register_commands Refresh skills and ownership metadata in the shared install path · New Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test that force_names leaves unlisted skills untouched
3 resolved since last review
Review effort: Max
| ) | ||
| ) | ||
| if skills_dir is not None: | ||
| refreshed_skills = manager._register_extension_skills( |
There was a problem hiding this comment.
🔵 Needs a closer look
The update-only forced refresh leaves skill content and registry entries inconsistent with a plain install, while the regression test masks this mismatch by force-refreshing its baseline.
9 open issues
Update install_update test doubles for register_commands Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test that force_names leaves unlisted skills untouched
Review effort: Max
There was a problem hiding this comment.
🟡 Changes recommended
Shared skill rendering can overwrite integration hook transformations and lose restored metadata when switching to Claude, while two existing Codex tests still expect the old source format.
12 open issues
Update tests for the changed extension source output · New Update install_update test doubles for register_commands Preserve skill fixes during native agent registration · New Preserve registration-hook transformations in skills mode · New Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test that force_names leaves unlisted skills untouched
Review effort: Max
| force=bool(native_skill_names), | ||
| force_names=native_skill_names, |
There was a problem hiding this comment.
🟡 Changes recommended
The refresh uses the wrong skill allowlist, risking user-skill overwrites or missing renderer flags and guidance, while the tests can pass even when the refresh is skipped.
12 open issues
Update tests for the changed extension source output Update install_update test doubles for register_commands Build the skill allowlist from commands written in this call · New Assert extension-renderer output in the regression test · New Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test that force_names leaves unlisted skills untouched
2 resolved since last review
Review effort: Max
5112670 to
75a33d0
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed to evaluate native-skill re-rendering’s effects on argument expansion, alias hook normalization, and documented output ownership.
10 open issues
Update tests for the changed extension source output Update install_update test doubles for register_commands Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test that force_names leaves unlisted skills untouched
Review effort: Max
There was a problem hiding this comment.
🟡 Changes recommended
Claude alias skills lack the hook-name rules and invocation flags applied to primary skills, leaving the hook-name bug unresolved for aliased commands.
12 open issues
Update tests for the changed extension source output Update install_update test doubles for register_commands Apply hook post-processing to alias skills · New Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Document native primary skills and ownership bookkeeping · New Test that force_names leaves unlisted skills untouched
Review effort: Max
| for command_names in registered_commands.values() | ||
| for command_name in self._valid_name_list(command_names) | ||
| } | ||
| rendered_skills = self._register_extension_skills( |
| force=bool(native_skill_names), | ||
| force_names=native_skill_names, |
|
Please address Copilot feedback |
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because native-skill refreshes can overwrite adapter-specific argument conversion, leaving primary skills inconsistent with their aliases.
12 open issues
Update tests for the changed extension source output Update install_update test doubles for register_commands Apply hook post-processing to alias skills Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Document native primary skills and ownership bookkeeping Test that force_names leaves unlisted skills untouched
Review effort: Max
|
Please address Copilot feedback |
…tions Keep native skill refresh and generic skill validation while preserving upstream resource ownership and overwrite protections. Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Cover skills-only installation and keep update test doubles aligned with the install contract. Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
There was a problem hiding this comment.
🟡 Changes recommended
A missing resource helper module and unsupported registrar arguments cause runtime failures in installation, skill rendering, integration refresh, and cleanup.
13 open issues
Update tests for the changed extension source output Update install_update test doubles for register_commands Resource-backed skills skip required integration post-processing · New Apply hook post-processing to alias skills Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Document native primary skills and ownership bookkeeping Test that force_names leaves unlisted skills untouched
Review effort: Max
There was a problem hiding this comment.
🟡 Changes recommended
Active findings identify lost integration transformations for resource-backed skills, duplicate alias post-processing, and incomplete rollback that can leave untracked skills and an installed package behind.
18 open issues
Update tests for the changed extension source output Update install_update test doubles for register_commands Avoid applying the integration hook twice to aliases · New Preserve configured argument and reference preprocessing · New Check ignore rules against the lexical command path · New Roll back generic skill installs when registration is disabled · New Resource-backed skills skip required integration post-processing Apply hook post-processing to alias skills Refresh skills and ownership metadata in the shared install path Assert skills remain registered after the update Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test allowlist preservation with a native skill registration subset · New Document native primary skills and ownership bookkeeping Test that force_names leaves unlisted skills untouched
Review effort: Max
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
There was a problem hiding this comment.
🟡 Changes recommended
Native-skills refresh can fail extension add/update due to missing name injection, while installs that skip command registration can bypass adapter overrides and reference nonexistent commands.
14 open issues
Prepare frontmatter before invoking the refresh hook · New Update tests for the changed extension source output Update install_update test doubles for register_commands Preserve adapter invocation spelling when registration is disabled · New Apply hook post-processing to alias skills Refresh skills and ownership metadata in the shared install path Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Test allowlist preservation with a native skill registration subset Document native primary skills and ownership bookkeeping Test that force_names leaves unlisted skills untouched
6 resolved since last review
Roll back generic skill installs when registration is disabled Check ignore rules against the lexical command path Preserve configured argument and reference preprocessing Avoid applying the integration hook twice to aliases Resource-backed skills skip required integration post-processing Assert skills remain registered after the update
Review effort: Max
| if integration is not None and (native_skill_layout or not copy_mode): | ||
| frontmatter, body = integration.process_registered_command( | ||
| frontmatter, body, source_id=manifest.id | ||
| ) |
| body = IntegrationBase.resolve_command_refs( | ||
| body, separator, get_invocation_prefix(selected_ai, True) | ||
| ) |
There was a problem hiding this comment.
🔵 Needs a closer look
The refresh path skips name injection before invoking hooks, causing native-skills adapters that require it to raise KeyError and fail extension add/update.
13 open issues
Prepare frontmatter before invoking the refresh hook Update tests for the changed extension source output Update install_update test doubles for register_commands Preserve adapter invocation spelling when registration is disabled Apply hook post-processing to alias skills Refresh skills and ownership metadata in the shared install path Add the runtime change before claiming to close #5105 Align fresh extension adds with update rendering Retain validation and rollback safeguards in generic skills mode Preserve skill aliases during skills-only updates Refresh Hermes global skills across consecutive updates Document native primary skills and ownership bookkeeping Test that force_names leaves unlisted skills untouched
1 resolved since last review
Review effort: Max



Closes #5105
Description
Updating an extension while Claude skills mode is enabled must preserve its skill registration without registering command files. This change passes the current skills-mode setting through the update installation paths, so updates keep the skills integration active and do not reintroduce commands.
Testing
AI Disclosure
OpenAI Codex (GPT-6 Luna high, autonomous mode) assisted with implementation and regression-test generation. The contributor reviewed and understands the submitted changes.