Repository navigation
Single-source skills (core/extra), replace Claude Code commands with skills, de-hardcode installers - #850
Merged
Conversation
…ith skills, de-hardcode installers
- apps/skills/core/{review,annotate,last,archive}: single authoritative
source for the always-installed skills (archive is new); all carry
disable-model-invocation + agents/openai.yaml sidecars
- apps/skills/extra/{compound,setup-goal,visual-explainer}: no longer
default-installed (except Kiro); installers print an
`npx skills add backnotprop/plannotator/apps/skills/extra` suggestion
- Claude Code: apps/hook/commands/ deleted, command heredocs removed;
core skills in ~/.claude/skills are the slash commands now
- Installers: OpenCode/Gemini command files copied from an extended
sparse checkout instead of heredocs; install.cmd gains the previously
missing OpenCode command install; aggressive cleanup of legacy
~/.claude/commands and ~/.codex/skills artifacts
- Codex: core skills install to ~/.agents/skills (official path);
~/.codex/skills install removed
- Pi: extension no longer bundles skills; #670 settings filter removed
…ugin-update hint, frontmatter test - install.sh: a --version tag predating apps/skills/core no longer aborts the whole copy subshell (which also skipped OpenCode/Gemini commands); core skills now soft-skip with an accurate message, matching ps1/cmd - install.sh: subshell failure message no longer claims "git required" when git was present (clone/network errors get their own wording) - install.cmd: pre-remove skill dirs before xcopy so upgrades replace rather than merge (stale files from renamed/deleted skill files no longer linger; parity with sh/ps1) - all installers + docs: tell upgraders to run /plugin marketplace update so the plugin's old namespaced plannotator:* commands disappear (#817) - install.test.ts: assert every core SKILL.md sets disable-model-invocation: true — the load-bearing line that keeps core skills out of Pi's system prompt (#842 regression guard)
- install.ps1/install.cmd: emit the "predates the core/extra skill layout" diagnostic on old pinned tags instead of silently skipping core skills (parity with install.sh) - install.ps1: clone/network failure no longer claims "git required" (git was already verified present); the outer catch now reports the actual exception - install.sh: "Installed OpenCode/Gemini commands" echoes are guarded on the copy actually having a source, so old pinned tags don't print false success (ps1/cmd already gated this way) - AGENTS.md: opencode-plugin commands/ comment now reflects all four command stubs - install.test.ts: shared test asserts the soft-skip diagnostic exists in all three installers and pins ps1's honest failure wording
Codex stores config and state under $CODEX_HOME when set, falling back to ~/.codex (developers.openai.com/codex/config-advanced). Plannotator hardcoded ~/.codex in two places: - runtime: codex-session.ts scanned ~/.codex/sessions for rollout files, so `plannotator last` failed with "No rendered assistant message found" when CODEX_HOME pointed elsewhere. Now resolved the same way copilot-session.ts handles COPILOT_HOME and session-log.ts handles CLAUDE_CONFIG_DIR. - installers: detection, config.toml/hooks.json paths, manual-setup instructions, and the stale-skills cleanup now derive from CODEX_HOME in all three scripts. Tests: codex-session.test.ts covers rollout discovery under a CODEX_HOME temp dir; install.test.ts asserts all three installers respect the variable and that the fallback is the only hardcoded ~/.codex path left in install.sh.
…migration External review triage on PR #850 surfaced two real installer issues: P1 — commands deleted before replacement: the Claude command cleanup ran before the git-gated skill install, so a missing git, a failed clone, or an old pinned tag deleted the user's slash commands and installed nothing (a regression — the old installer needed no git). Now: - missing git is a hard failure before anything is touched ("install git, then run this installer again") - a failed fetch is a hard failure ("something went wrong — run the installer again") instead of a silent skip - the legacy command cleanup runs AFTER the install and only removes a command file when its same-name replacement skill exists on disk - old pinned tags keep the soft-skip (no deletion happens, commands survive, CI e2e against old tags stays green) P2 — recurring extras deletion: the extras cleanup ran on every invocation, deleting copies users reinstalled via the suggested `npx skills add` (the copies are byte-identical, so only provenance can tell them apart). The cleanup is now a one-time migration recorded in a migrations ledger under the Plannotator data dir (<PLANNOTATOR_DATA_DIR|~/.plannotator>/migrations/), the same record-what-you-did pattern package managers use. All three installers (sh/ps1/cmd) updated in parity; tests pin the guard condition, the ledger gating, and the hard-fail messages.
Maintainer rule: all Plannotator skills are user-invoked, never model-auto-invoked. setup-goal (missing since #665) and the three Kiro skills now carry the flag. The frontmatter test scans every SKILL.md in apps/skills/core, apps/skills/extra, and apps/kiro-cli/skills dynamically — with a floor of 10 — so a future skill cannot ship without it.
… complete on re-run
… picker Interactive terminals get a two-question wizard on first run: 1. Install the extra skills? Yes delegates to `npx skills add backnotprop/plannotator/apps/skills/extra` (its UI picks the agents), wired to /dev/tty so piped curl|bash installs still work. Skipped when extras already exist on disk. 2. Make any skills callable by the model? Yes opens a space-toggle checkbox (sh/ps1) or numbered toggles (cmd), listing all skills if extras were chosen, core-only otherwise. Chosen skills get disable-model-invocation stripped from their INSTALLED copies and the Codex sidecar's allow_implicit_invocation flipped — re-applied every run since installs replace skill folders. Repo sources stay locked. Answers persist to <data dir>/install-prefs (shared format across all three installers) and re-runs reuse them silently; --reconfigure re-opens the wizard. Automation is untouched: no terminal means no prompts and today's defaults; --extras/--no-extras/--model-invocable/ --non-interactive give scripts explicit control.
…ard interplay - install.cmd: the checkbox preselection used `echo !var! | findstr` — each side of a cmd pipe runs in a child WITHOUT delayed expansion, so the saved choices passed through as literal !var! text and preselection never matched. Replaced with a substring-replace containment test (no pipe). - all three: a wizard question whose answer was already provided by a CLI flag (--extras/--no-extras/--model-invocable) is no longer asked and then silently overridden — the flag pre-answers it. - install.cmd: unknown-option usage line now lists the wizard flags.
glimpseui (third-party npm package, PR #840) gives Plannotator a native WebView window instead of a browser tab; the runtime already auto-detects it on PATH, so a global install is all that's needed. - Wizard asks "Install Glimpse?" (default yes) after the skills questions; skipped when glimpseui is already on PATH - Yes runs `npm install -g glimpseui` (bun fallback on sh/ps1; printed instruction when neither exists) — wizard or explicit flag only, silent re-runs never install software - --glimpse / --no-glimpse flags for automation; choice persisted to install-prefs like the others - docs + tests updated (glimpse detection, install command, flags, and persist-condition assertions across all three installers)
…er junk dirs plannotator.ai serves install.sh live from main (public/ symlink, deployed on push), while the script fetches repo files at the LATEST RELEASE TAG. Between merging the core/extra restructure and cutting the release that ships it, the live script runs against the old-layout tag. Two hazards in that window: 1. The Codex stale-skill cleanup removed working ~/.codex/skills with no successor installed (core skills soft-skip on old tags). Now the cleanup runs AFTER the install and removes a core skill only once its replacement exists in ~/.agents/skills — same guard the Claude command cleanup uses. The compound/setup-goal stale copies stay unconditional (never Codex's to begin with). 2. The reverse combo (cached OLD script + NEW release tag) wholesale- copies apps/skills/* and leaves junk core/ and extra/ directory copies in ~/.claude/skills. Never valid skill names — all three installers now remove them on every run.
…modules PR #840 added glimpseui to dependencies in @plannotator/server and @plannotator/pi-extension, but nothing imports it: both runtimes detect the CLI on PATH (Bun.which / a manual PATH walk) and spawn it. The dep only ever mattered in repo development, where `bun run` prepends node_modules/.bin to PATH. For consumers it was inert download weight — OpenCode plugin installs and `pi install` pulled a third-party package that could never be detected (Pi's loader does not expose node_modules/.bin; verified). Moved to devDependencies in both: dev flows keep working, published packages stop shipping it. The sanctioned end-user path is the guided installer's global `npm install -g glimpseui`.
…out (#817) The installer already manages hooks.json inside ~/.claude/plugins/marketplaces/plannotator/apps/hook/, so the earlier "don't reach into plugin storage" rationale for leaving the old namespaced plannotator:* command files there was inconsistent. All three installers now remove them — same replacement-skill guard as the bare ~/.claude/commands cleanup — making the #817 duplicate menu entries die on a single installer run + restart instead of waiting for /plugin marketplace update. Hints/docs reworded accordingly.
…d on a real console The cmd e2e CI step still asserted the OLD contract (installer writes ~/.claude/commands/plannotator-*.md with the ! prefix). Commands are dead; the step now guards the NEW contract: a fresh install must write NO plannotator command files. The Gemini TOML assertions stay — they now verify the verbatim checkout copy delivers intact files (the tag the e2e pins, v0.17.1, contains apps/gemini/commands). The failure also exposed that install.cmd ran the wizard on redirected stdin (set /p falls through to defaults at EOF) — and Q3's default being yes meant CI silently ran `npm install -g glimpseui`. cmd now probes for a real console via `timeout /t 0` (errors when stdin is redirected), matching sh's /dev/tty and ps1's IsInputRedirected gates: no console, no wizard, no wizard-only installs.
This was referenced Jun 5, 2026
backnotprop
added a commit
that referenced
this pull request
Jun 8, 2026
…harden unattended installs (#872) Follow-up to #850 (unreleased), fixing two pre-release regressions vs v0.19.27. - Claude Code: add apps/skills/claude/* skills using `!`plannotator <sub> $ARGUMENTS`` + allowed-tools + disable-model-invocation, so /plannotator-review|annotate|last| archive auto-run with no permission prompt and pass arguments through — matching the old slash commands. Codex keeps the prose apps/skills/core/*. Installers route ~/.claude/skills <- apps/skills/claude and ~/.agents/skills <- apps/skills/core. - Installers: gate the wizard so an unattended-but-open /dev/tty can't hang (PLANNOTATOR_PROMPT_TIMEOUT, default 30s; timeout/EOF resolves to safe "no"). Don't gate on $CI (explicit --reconfigure/--extras must win). Don't persist timed-out wizard answers as install-prefs. Keep ask_yes_no's read in a tested context so set -e never aborts on a timeout. 72 installer tests pass.
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
Restructures how Plannotator ships skills and commands so each artifact has exactly one authoritative source, and aligns Claude Code with its commands→skills deprecation.
Skills: one source of truth
apps/skills/core/—plannotator-review,plannotator-annotate,plannotator-last, and newplannotator-archive. Always installed (~/.claude/skills+~/.agents/skills). All four keepagents/openai.yamlsidecars (Codex implicit-invocation gate). Every skill in the repo — core, extra, and Kiro — setsdisable-model-invocation: true(maintainer rule: Plannotator skills are user-invoked, never model-auto-invoked; a dynamic test scans all SKILL.md files so new skills can't ship without it).apps/skills/extra/—plannotator-compound,plannotator-setup-goal,plannotator-visual-explainer. No longer default-installed (except Kiro, which keeps receiving setup-goal + visual-explainer). Installers print:apps/kiro-cli/skills/stays hand-maintained (origin-bakedPLANNOTATOR_ORIGIN=kiro-cli) — the one sanctioned exception to single-sourcing, since Kiro has no env-injection mechanism.Claude Code: commands removed entirely
Claude Code merged custom commands into skills, so
apps/hook/commands/is deleted and the installer no longer writes~/.claude/commands/. The core skills provide the same bare/plannotator-*names. This also fixes the semantics drift where the skill copy (nodisable-model-invocation) shadowed the user-only command. The plugin now ships hooks only.Installers de-hardcoded
apps/skills apps/kiro-cli apps/opencode-plugin/commands apps/gemini/commands).install.cmdgains the previously missing OpenCode command install; skill copies now replace (pre-remove) rather than merge, matching sh/ps1.--version) that predate the core/extra layout skip the core-skill copy with an accurate message while still installing OpenCode/Gemini commands — consistent across all three installers.~/.claude/commands/plannotator-*.md(only once the replacement skill is on disk),~/.codex/skills/plannotator-*, and a one-time removal of extras from~/.claude/skills+~/.agents/skillsrecorded in a migrations ledger under the Plannotator data dir (PLANNOTATOR_DATA_DIRhonored) — npx-reinstalled extras are never touched again. The Codex stale-skill cleanup is guarded the same way as commands (core skills leave~/.codex/skillsonly once their~/.agents/skillsreplacement exists), and junkcore/extradirectory copies left in~/.claude/skillsby older installers running against new-layout tags are swept on every run — so the live-script↔release-tag transition is safe in both directions, in any order.Codex: official path
Core skills install to
~/.agents/skills(current official Codex location; also what vercel/skills uses). The~/.codex/skillsinstall is removed and cleaned up.Guided install (interactive terminals only)
First-run terminal installs ask two questions: install the extra skills? (yes → delegates to
npx skills add …/apps/skills/extra, wired to/dev/ttyso piped installs work; skipped if extras already exist) and make any skills callable by the model? (yes → space-toggle checkbox in sh/ps1, numbered toggles in cmd — chosen skills getdisable-model-invocationstripped from their installed copies and the Codex sidecar flipped, re-applied every run; repo sources always stay locked), and install Glimpse? (yes →npm install -g glimpseuifor a native Plannotator window — the runtime auto-detects it on PATH; skipped when already installed). Answers persist to<data dir>/install-prefsand re-runs reuse them silently (--reconfigureto change). Automation unaffected: no terminal → no prompts → today's defaults;--extras/--no-extras/--model-invocable <list>/--non-interactivefor explicit control.Published packages: glimpseui demoted to devDependency
PR #840 added
glimpseuitodependenciesof@plannotator/serverand@plannotator/pi-extension, but nothing imports it — both runtimes detect the CLI on PATH and spawn it. The dep only mattered in repo dev (bun runputsnode_modules/.binon PATH); for OpenCode/Pi consumers it was inert download weight. Moved todevDependencies; the sanctioned end-user path is the guided installer's globalnpm install -g glimpseui.Pi: zero bundled skills
@plannotator/pi-extensionno longer bundles or declares skills (pi.skills,files, build copy removed). Extension commands and theplannotator_submit_plantool are untouched. The PR #670 settings-filter workaround is deleted from all three installers (existing{skills: []}entries are inert and left alone).Related issues
~/.claude/commands/plannotator-*.mdand same-named skills; a Claude Code precedence change made the skill shadow the command. Resolved by eliminating the command channel entirely: upgrade cleanup deletes the command files and the skill is the single source. (Note: we removed commands and kept skills — the inverse of the issue's proposed fix, same collision eliminated.)disable-model-invocation: true, which Pi honors by excluding them from<available_skills>— zero system-prompt bloat in every install combination;/skill:*lazy invocation remains (verified against Pi source).!-escape hazard from Supply-chain hardening: version pinning, SLSA attestations, fix #506 #512 is structurally gone.CODEX_HOMEis now respected end-to-end: the runtime resolves Codex session rollouts under$CODEX_HOME/sessions(fixesplannotator lastfor relocated homes), and all three installers derive detection, config/hooks paths, and stale-skill cleanup from it. Audit note per the issue:CLAUDE_CONFIG_DIR,COPILOT_HOME,FACTORY_CONFIG_DIR, andXDG_CONFIG_HOME(OpenCode) were already respected; Codex was the outlier./plannotator-compoundwas never part of the marketplace plugin (it only ever arrived via the install script), and this PR makes the extras story explicit: compound/setup-goal/visual-explainer are opt-in vianpx skills add backnotprop/plannotator/apps/skills/extra, printed by the installer and documented. Related: fix(claude): install plannotator-compound skill #854 proposes bundling compound into the plugin instead — that conflicts with this PR's single-source/opt-in design (and plugin skills are namespaced, so it wouldn't restore the bare/plannotator-compoundname anyway); we'll follow up on it after merge.pi config/plannotator config is intentionally deferred; keep the issue open./plugin marketplace update, each/plannotator-*name resolves to a single skill. We deliberately do NOT delete the stale command files inside the plugin checkout: that tree is a git clone Claude Code owns, the installer's only writes there have always been byte-identical to committed content (clean tree), and deleting tracked files risks breaking/plugin marketplace updatefor pull/checkout-based update flows (upstream churn exists on exactly these files, e.g. feat(review): add jj review workflows #675).codex_home_has_user_configstill excludes the skills subdir (still needed — cleanup leaves an empty~/.codex/skillsbehind), copy-if-present tolerance verified against old tags.Verification
bash -n scripts/install.sh✅bun test scripts/install.test.ts— 70 pass / 0 fail (covers all three installers, the universal disable-model-invocation scan, hard-fail messages, migration-ledger gating, CODEX_HOME, old-tag soft-skip diagnostics, and a/dev/null-in-cmd tripwire)bun test apps/skills— 3 pass (relocated setup-goal SKILL.test.ts)Review notes / open questions
Recurring extras deletionResolved: the extras cleanup is now a one-time migration recorded in a ledger under the Plannotator data dir (<PLANNOTATOR_DATA_DIR|~/.plannotator>/migrations/), so npx-reinstalled extras survive upgrades. Additionally (external review triage): missing git / failed fetch now hard-fail with actionable messages instead of silently skipping, and the legacy Claude command cleanup only removes a command once its replacement skill exists on disk — no failure path can leave a user with neither.install.ps1was not parse-verified on a PowerShell host (authored on macOS) — needs the Windows CI smoke test before release.~/.codex/skillslose skill access until the user updates Codex (accepted risk — current official path is~/.agents/skills).