Skip to content

Hand the Menu's Skills Install to the Bootstrap's Kept Tree - #1923

Merged
ptr727 merged 5 commits into
developfrom
fix/menu-skills-kept-tree
Sep 27, 2026
Merged

ptr727 merged 5 commits into
developfrom
fix/menu-skills-kept-tree

Conversation

@ptr727

@ptr727 ptr727 commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Part of #1771.

Problem

Run from a downstream repo or from no checkout at all, the menu's "Install or update the fleet Skills" task ran install-skills from the hub clone the menu fetched into $DIR/hub. The installer registers the directory it runs from as the projecttemplate-fleet Claude Code marketplace, which Claude Code loads in place. The menu removes that clone on exit unless --keep is given, so every later session found a registration naming a missing directory and loaded no fleet skills. Observed on a Windows host: skills_install.py --report read live.reason: the registered checkout does not exist, so this channel serves nothing, with %LOCALAPPDATA%\host-setup\ empty.

Change

  • menu.sh and menu.ps1: when the hub is the menu's own fetched clone (HUB_FETCHED), the skills task runs that clone's bootstrap.sh --skills --ref "$REF" / bootstrap.ps1 -Skills -Ref $REF, whose kept skills-tree outlives the run, per Keep the Bootstrap's Skills Tree So the Claude Code Plugin Outlives the Run #1773. A hub checkout the menu runs from still installs from itself. The menu's own --dir is not forwarded, since it is a cache for the clone and the bootstrap keeps its tree under its own directory.
  • The shared "run a script inside the hub" body is split out of host_tool_locked / Invoke-HostTool as run_in_hub / Invoke-InHub, so the skills task can target host-setup/ as well as host-setup/<platform>/.
  • host-setup/README.md says why the task hands off, and names what that handoff needs: curl and tar on Linux, and codeload.github.com reachable (api.github.com only records the installed commit).
  • scripts/tests/test_bootstrap.py: TestMenuSkillsInstall sources menu.sh's functions against stub scripts and asserts which installer runs, with which arguments, for a fetched clone and for a hub checkout.

Out of scope: a host already carrying a dangling registration is not re-pointed by a later install, since marketplace add of a registered name is a no-op. That is #1769.

The comments label covers one existing comment line in menu.ps1 (the Out-Host note), moved unchanged with the body it explains into Invoke-InHub.

Verification

  • TestMenuSkillsInstall (3) and TestKeptTreeHandling pass on Linux (python:3.12-slim container). The task against develop's menu.sh fails (install_skills_locked: command not found).
  • menu.ps1's Invoke-SkillsInstall and the refactored Invoke-HostTool driven under pwsh 7 on Windows against stub scripts: fetched clone -> bootstrap.ps1 -Skills -Ref <ref> [-Yes], hub checkout -> install-skills.ps1, missing tool -> exit 1 with the existing message.
  • docker_lint.py: shellcheck, shfmt, PSScriptAnalyzer, markdownlint, editorconfig-checker all pass. ruff check/format, mypy, prose gate, and the eol gate pass.
  • Local strict review recorded over the final content (two README wording findings, both fixed, final pass clean).

🤖 Generated with Claude Code

ptr727 and others added 3 commits September 27, 2026 11:14
Run from a downstream repo or from no checkout at all, the menu's
install-skills task ran the installer from the hub clone it fetched,
which registered that clone as the Claude Code marketplace. The menu
removes the clone on exit, so every later session found the
registration naming a directory that no longer existed and loaded no
fleet skills.

From a fetched clone, the task now runs that clone's bootstrap
--skills / -Skills at the same ref, whose kept tree outlives the run.
A hub checkout the menu runs from still installs from itself. The
menu's own --dir is not passed on, since it is a cache for the clone.

The one flagged comment line is the existing Out-Host note, moved
with the body it explains.

Fixes #1771

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 27, 2026 18:40
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Sep 27, 2026
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cc9dc274-af7a-43a9-ae09-bbd95622dee2


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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 review overview

🟢 Approval recommended

The change correctly redirects Skills installation away from the transient fetched clone to the bootstrap’s kept tree, updates both bash and PowerShell implementations consistently, and includes targeted regression tests for the new menu behavior.

Review effort: Lite
Findings: None

What changed in this PR

This PR fixes the menu-driven Skills install path so it no longer registers a Claude Code marketplace pointing at a transient hub clone that the menu deletes on exit. When the menu had to fetch the hub (HUB_FETCHED), it now delegates the install to the hub clone’s bootstrap --skills path so the registration targets the bootstrap’s kept skills-tree instead of the soon-to-be-removed checkout.

Changes:

  • Refactors menu script execution helpers to support running tools from host-setup/ (not only host-setup/<platform>/) via run_in_hub (bash) / Invoke-InHub (PowerShell).
  • Updates the “Install or update the fleet Skills” menu action to use bootstrap.(sh|ps1) --skills when the hub was fetched, and keep the direct installer path when running from a hub checkout.
  • Adds Linux-only unit tests that source menu.sh functions and assert the correct installer path/arguments are chosen for fetched-vs-local hub scenarios; updates host-setup/README.md to document the rationale and prerequisites.
File Description
scripts/​tests/​test_bootstrap.py Adds TestMenuSkillsInstall to assert the menu’s skills install delegates to bootstrap for fetched hubs and uses the in-checkout installer otherwise.
host-setup/​README.md Documents why the menu hands off Skills install to bootstrap when using a freshly fetched clone, and notes required network/tooling prerequisites.
host-setup/​menu.sh Introduces run_in_hub and a dedicated install_skills action that delegates to bootstrap.sh --skills --ref ... for fetched hubs.
host-setup/​menu.ps1 Introduces Invoke-InHub and updates Skills install to delegate to bootstrap.ps1 -Skills -Ref ... for fetched hubs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 27, 2026 18: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.

Copilot review overview

🟡 Changes recommended

Invoke-InHub uses Test-Path without -LiteralPath, which can break tool detection when paths contain wildcard characters like [ and ].

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread host-setup/menu.ps1 Resolved
Test-Path and Remove-Item read a bare path as a wildcard pattern, so a
-Dir or hub root holding [ or ] missed the tool it looked for and
left the fetched clone behind on exit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI review requested due to automatic review settings September 27, 2026 18:53

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 review overview

🟢 Approval recommended

The changes consistently route skills installation through the bootstrap’s durable tree for transient hub clones and add targeted tests to lock in the intended behavior.

Review effort: Lite
Findings: None

Resolved since last review (1)

@ptr727
ptr727 merged commit 705abd8 into develop Sep 27, 2026
9 checks passed
@ptr727
ptr727 deleted the fix/menu-skills-kept-tree branch September 27, 2026 18:57
ptr727 added a commit that referenced this pull request Sep 27, 2026
…to Main (#1924)

## Summary

Promotes `develop` to `main`, carrying two changes:

- #1922, Type the Hub Python and Run Its Suite Through the Shared
Validator. The hub now declares the `python` type with the `lint-only`
profile and `.` in `python-directories`. Its unittest suite moves from
`scripts/tests` to a root `tests/`, which the shared validator's Python
leg runs under coverage and uploads to Codecov. Both callers pass the
input and `CODECOV_TOKEN`. The hub gains `codecov.yml` and a lint-only
`.vscode/tasks.json`, and the GOVERNANCE.md layout and README.md
describe it as it now is.
- #1923, Hand the Menu's Skills Install to the Bootstrap's Kept Tree.
Run from outside a hub checkout, the menu's skills task installed from
the clone it then removed on exit, leaving the Claude Code marketplace
registered against a missing directory. From a fetched clone it now
hands off to that clone's `bootstrap.sh --skills` / `bootstrap.ps1
-Skills`, whose kept tree outlives the run, and every path cmdlet in
`menu.ps1` reads its path literally.

Closes #1913
Fixes #1771

## Maintainer follow-ups

- Store `CODECOV_TOKEN` in the hub's actions and dependabot secret
stores. Until then the audit reports it missing and the best-effort
upload sends nothing.
- Add the Python extensions to the workspace file. An agent may not edit
an active `.code-workspace`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants