Skip to content

fix(extensions): preserve skills mode on update - #5120

Open
mikamikasuki wants to merge 18 commits into
github:mainfrom
mikamikasuki:fix/5105-preserve-skills-on-update
Open

mikamikasuki wants to merge 18 commits into
github:mainfrom
mikamikasuki:fix/5105-preserve-skills-on-update

Conversation

@mikamikasuki

Copy link
Copy Markdown
Contributor

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

  • 231 extension update tests passed.
  • Ruff checks passed.

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.

@mikamikasuki
mikamikasuki requested a review from mnriem as a code owner October 25, 2026 20:00
@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Oct 25, 2026
@mnriem
mnriem requested a max review from Copilot October 26, 2026 14:12

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.

🟡 Changes recommended

Unresolved skill-registration regressions and incompatible update test doubles block approval.

5 open issues
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

Comment on lines +557 to +559
register_commands=not is_ai_skills_enabled(
_commands.load_init_options(project_root)
),
Comment on lines +557 to +559
register_commands=not is_ai_skills_enabled(
_commands.load_init_options(project_root)
),
Comment on lines +557 to +559
register_commands=not is_ai_skills_enabled(
_commands.load_init_options(project_root)
),
Comment on lines 554 to 561
_ = 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)
@mnriem

mnriem commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback. If not applicable, please explain why

@mnriem mnriem added the author-awaiting Waiting on author response label Oct 26, 2026
@mikamikasuki
mikamikasuki force-pushed the fix/5105-preserve-skills-on-update branch from d3e00c2 to a692b35 Compare November 17, 2026 12:48
Copilot AI max review requested due to automatic review settings November 17, 2026 12:48

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.

🟡 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

Review effort: Max

Comment on lines +700 to +701
def test_update_preserves_skills_mode_registration(self, tmp_path, monkeypatch):
"""Updating an extension must keep Claude skills in skills mode."""
Copilot AI max review requested due to automatic review settings November 17, 2026 14:14

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.

Copilot AI max review requested due to automatic review settings November 17, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

# 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)
Copilot AI max review requested due to automatic review settings November 17, 2026 15:21

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.

)
)
if skills_dir is not None:
refreshed_skills = manager._register_extension_skills(
Copilot AI max review requested due to automatic review settings November 17, 2026 15:39

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.

Copilot AI max review requested due to automatic review settings November 17, 2026 15:58

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.

Comment on lines +3081 to +3082
force=bool(native_skill_names),
force_names=native_skill_names,
Comment thread src/specify_cli/extensions/__init__.py Resolved
Comment thread src/specify_cli/extensions/__init__.py Resolved
Copilot AI max review requested due to automatic review settings November 17, 2026 16:51

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.

Comment thread src/specify_cli/extensions/__init__.py Resolved
Comment thread tests/test_extension_skills.py Resolved
Copilot AI max review requested due to automatic review settings November 17, 2026 17:15
@mikamikasuki
mikamikasuki force-pushed the fix/5105-preserve-skills-on-update branch from 5112670 to 75a33d0 Compare November 17, 2026 18:19

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.

Copilot AI max review requested due to automatic review settings November 17, 2026 18:36

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.

for command_names in registered_commands.values()
for command_name in self._valid_name_list(command_names)
}
rendered_skills = self._register_extension_skills(
Comment on lines +3086 to +3087
force=bool(native_skill_names),
force_names=native_skill_names,
@mnriem

mnriem commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

Copilot AI max review requested due to automatic review settings November 17, 2026 19:23

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.

@mnriem

mnriem commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

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)
Copilot AI max review requested due to automatic review settings December 1, 2026 19:50
Cover skills-only installation and keep update test doubles aligned with the install contract.

Assisted-by: OpenAI Codex (model: GPT-6, autonomous)

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.

Comment thread src/specify_cli/extensions/__init__.py Resolved
Copilot AI max review requested due to automatic review settings December 1, 2026 20:07

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.

Comment thread src/specify_cli/agents.py Resolved
Comment thread src/specify_cli/extensions/__init__.py Resolved
Comment thread src/specify_cli/extensions/__init__.py Resolved
Comment thread src/specify_cli/extensions/__init__.py Resolved
Comment thread tests/test_extension_skills.py Resolved
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Copilot AI max review requested due to automatic review settings December 2, 2026 01:34
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)

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.

Comment on lines +1731 to +1734
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
)
Comment on lines +1753 to +1755
body = IntegrationBase.resolve_command_refs(
body, separator, get_invocation_prefix(selected_ai, True)
)
Copilot AI max review requested due to automatic review settings December 2, 2026 01:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

author-awaiting Waiting on author response triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: extension update renders the github extension's Claude skill differently from extension add, and its README links a missing file

3 participants