Conversation
{{REPO_NAME}} is a Tier 1 install-time substitution. When the skill is
globally installed (e.g. ~/.claude/skills/), the token gets baked in as
the install-time repo name and produces the wrong worktree base path in
all other repos.
Replace with a runtime instruction: derive repo name at execution time
via `basename $(git rev-parse --show-toplevel)`. This is portable and
correct regardless of where or how the skill is installed.
Changes:
- skills/sc-git-worktree/SKILL.md: dynamic runtime derivation
- agents/sc-git-worktree-update.md: same fix for default worktree_base
- commands/sc-git-worktree.md: same fix for both path references
- manifest.yaml: remove REPO_NAME variable (no longer consumed by any artifact)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codex CLI (~/.codex) only has a skills directory relevant to us and no commands/agents concept, so a --codex install should skip commands, agents, and registry.yaml maintenance entirely rather than mimicking the ~/.claude layout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ating - --claude/--codex are now independent target flags under a scope (--global/--local/--user/--project), symmetric with each other: either alone installs only that target, neither installs both .claude and .codex. --dest remains a single, explicit .claude-only path and now rejects --codex outright instead of silently ignoring it. - Installing to both targets shares one code path (_resolve_install_scope + _resolve_install_targets + a single install_target() closure) instead of duplicating the artifact-copy loop per target. - Any artifact in any category with a sibling <path>.local.j2 file is rendered through sc-compose (auto-installed on first use) instead of copied verbatim, for any install that isn't --global/--user; .codex never consults .local.j2, matching --global/--user. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…dex-target # Conflicts: # src/sc_cli/install.py
) - Any package artifact (any category) with a sibling <path>.local.j2 file is rendered through sc-compose (auto-installed on first use) instead of copied verbatim, for local/project-style installs only. Global/user installs never consult .local.j2, since install-time repo-specific customization isn't meaningful there. - Fix sc-git-worktree's SKILL.md frontmatter name (sc-managing-worktrees -> sc-git-worktree) to match its directory and references. - Close the last {{REPO_NAME}}-token gap in README.md: point at the runtime-derivation instructions already shipped in SKILL.md/commands/ agents (basename $(git rev-parse --show-toplevel)) instead of the install-time token that silently no-ops for global installs (#112). - Swap test_token_expansion_repo_name to a synthetic fixture package, since sc-git-worktree itself no longer consumes {{REPO_NAME}}. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-path' into feat/sc-install-codex-target # Conflicts: # src/sc_cli/install.py # tests/test_sc_install_phase1_2.py
randlee
added this pull request to stack #115
September 23, 2026 21:47
randlee
removed this pull request from stack #115
September 23, 2026 22:09
Packages may ship an optional install.py with prepare()/complete()/ cleanup() hooks, run around the artifact-copy step and on uninstall. Adds --set KEY=VALUE (repeatable) so a hook can request info sc-install has no generic way to know, failing with an actionable message when a required value is missing. sc-git-worktree's install.py is the first consumer, rendering .j2 templates with the repo name for local installs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Covers the new Tier 3 install-time hook mechanism (prepare/complete/ cleanup, --set KEY=VALUE) in CONTRIBUTING.md, MARKETPLACE-INFRASTRUCTURE.md, the marketplace skill's README/SKILL/TROUBLESHOOTING/USE-CASES, and the marketplace-package-installer agent, pointing to src/sc_cli/README.md as the normative reference. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This branch has not been deployed
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
Fixes #112: the naive
{{REPO_NAME}}install-time string-replace silently no-ops for global/user installs (sincedest_dir.parentisn't a git repo there), leaking the literal token into shipped docs/commands.<path>.local.j2file is rendered throughsc-compose(auto-installed on first use) instead of copied verbatim, for local/project-style installs only. Global/user installs never consult.local.j2.sc-git-worktree's docs (SKILL.md, commands/, agents/, README.md) now carry explicit runtime-derivation instructions (basename $(git rev-parse --show-toplevel)) instead of relying on install-time token substitution, so the package is safe to install globally.sc-git-worktree'sSKILL.mdfrontmattername(sc-managing-worktrees→sc-git-worktree) to match its directory and cross-references.test_token_expansion_repo_namenow exercises the legacy{{REPO_NAME}}mechanism via a synthetic fixture package, sincesc-git-worktreeitself no longer consumes it.Also added:
install.pyprepare/complete/cleanup hooks (Tier 3)A package root may optionally ship
install.pydefiningprepare()/complete()/cleanup(), run once per install target (.claude/.codex) around the artifact-copy step, and once on uninstall. This covers repo-specific rendering, conditional cleanup of prior-version files, and anything.local.j2can't (multiple templates, conditional logic, non-trivial failure messages).--set KEY=VALUECLI flag (bothinstallanduninstall) forwards arbitrary key/value pairs intooptions["args"];sc-installitself never interprets these, only a package's own hook does. Lets a hook fail with an actionable message when it needs infosc-installhas no generic way to know.{"result": "success"}or{"result": "fail", "message": "<reason, instructions to fix>"}; anything else (exception, wrong shape) is treated as ansc-install-level bug, not a caller input error.packages/sc-git-worktree/install.pyis the first consumer: renders.j2templates with the consuming repo's name for--local/--projectinstalls when a repo is found, no-ops otherwise.src/sc_cli/README.md.CONTRIBUTING.md,docs/MARKETPLACE-INFRASTRUCTURE.md, the marketplace skill's README/SKILL/TROUBLESHOOTING/USE-CASES, andmarketplace-package-installer.md(Tier 3, not a manifest field — discovered by file presence).Test plan
python3 -m pytest tests/ -q— 1403 passedpython3 scripts/validate-all.py— 9/9 validators passed