Skip to content

Single-source skills (core/extra), replace Claude Code commands with skills, de-hardcode installers - #850

Merged
backnotprop merged 19 commits into
mainfrom
fix/skills
Jun 5, 2026
Merged

backnotprop merged 19 commits into
mainfrom
fix/skills

Conversation

@backnotprop

@backnotprop backnotprop commented Jun 4, 2026 •

Copy link
Copy Markdown
Owner

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 new plannotator-archive. Always installed (~/.claude/skills + ~/.agents/skills). All four keep agents/openai.yaml sidecars (Codex implicit-invocation gate). Every skill in the repo — core, extra, and Kiro — sets disable-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:
    npx skills add backnotprop/plannotator/apps/skills/extra
    
    (subpath form verified against the vercel/skills CLI — finds exactly the extras)
  • apps/kiro-cli/skills/ stays hand-maintained (origin-baked PLANNOTATOR_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 (no disable-model-invocation) shadowed the user-only command. The plugin now ships hooks only.

Behavior change: /plannotator-review no longer pre-executes the binary via the command's !` injection — the skill instructs the model to run it via Bash. Same UX in practice, but invocation is model-driven now.

Installers de-hardcoded

  • All Claude/OpenCode/Gemini command heredocs deleted. OpenCode stubs and Gemini TOMLs are copied verbatim from an extended sparse checkout (apps/skills apps/kiro-cli apps/opencode-plugin/commands apps/gemini/commands).
  • install.cmd gains the previously missing OpenCode command install; skill copies now replace (pre-remove) rather than merge, matching sh/ps1.
  • Old pinned tags (--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.
  • git is a hard requirement: a missing git or a failed fetch fails the install loudly with an actionable message ("install git / run again") instead of silently skipping — and the legacy Claude command cleanup only runs after its replacement skill is on disk, so no failure path can strand a user with neither. Old pinned tags that predate the core/extra layout still soft-skip the core-skill copy (no deletion happens, so nothing is lost).
  • Upgrade cleanup (echoed per removal): legacy ~/.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/skills recorded in a migrations ledger under the Plannotator data dir (PLANNOTATOR_DATA_DIR honored) — npx-reinstalled extras are never touched again. The Codex stale-skill cleanup is guarded the same way as commands (core skills leave ~/.codex/skills only once their ~/.agents/skills replacement exists), and junk core/extra directory copies left in ~/.claude/skills by 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/skills install 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/tty so 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 get disable-model-invocation stripped 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 glimpseui for a native Plannotator window — the runtime auto-detects it on PATH; skipped when already installed). Answers persist to <data dir>/install-prefs and re-runs reuse them silently (--reconfigure to change). Automation unaffected: no terminal → no prompts → today's defaults; --extras / --no-extras / --model-invocable <list> / --non-interactive for explicit control.

Published packages: glimpseui demoted to devDependency

PR #840 added glimpseui to dependencies of @plannotator/server and @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 run puts node_modules/.bin on PATH); for OpenCode/Pi consumers it was inert download weight. Moved to devDependencies; the sanctioned end-user path is the guided installer's global npm install -g glimpseui.

Pi: zero bundled skills

@plannotator/pi-extension no longer bundles or declares skills (pi.skills, files, build copy removed). Extension commands and the plannotator_submit_plan tool are untouched. The PR #670 settings-filter workaround is deleted from all three installers (existing {skills: []} entries are inert and left alone).

Related issues

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)
  • Multi-agent implementation review (spec-compliance, correctness, fresh-install simulation): 2 must-fix + 4 should-fix found and applied
  • Six-agent issue-resolution review (one per linked issue, including tracing Pi source and reproducing the old-tag path against v0.19.7): found and fixed the install.sh old-pinned-tag hard-abort, the install.cmd merge-vs-replace gap, and the misleading git-failure message

Review notes / open questions

  1. Recurring extras deletion Resolved: 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.
  2. install.ps1 was not parse-verified on a PowerShell host (authored on macOS) — needs the Windows CI smoke test before release.
  3. Marketplace-plugin-only Claude users get hooks but no slash commands until they run the install script (documented in installation.md).
  4. Codex builds that only scan legacy ~/.codex/skills lose skill access until the user updates Codex (accepted risk — current official path is ~/.agents/skills).

…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.
… 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.
@backnotprop
backnotprop merged commit 26ca4e0 into main Jun 5, 2026
13 checks passed
@backnotprop
backnotprop deleted the fix/skills branch June 5, 2026 16:23
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment