Skip to content

fix(plugin): SKILL.md self-bootstrap and substitute name placeholder (closes #83)#85

Merged
fujibee merged 1 commit into
mainfrom
fix/plugin-install-bootstrap
Jun 7, 2026
Merged

fix(plugin): SKILL.md self-bootstrap and substitute name placeholder (closes #83)#85
fujibee merged 1 commit into
mainfrom
fix/plugin-install-bootstrap

Conversation

@fujibee

@fujibee fujibee commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

The plugin marketplace install path (/plugin install agmsg@fujibee-agmsg) has two coupled problems that the ./install.sh path hides:

  1. No state bootstrap. Plugin install drops the repo into ~/.claude/plugins/cache/ but never creates ~/.agents/skills/agmsg/, where the scripts expect the SQLite DB, team registry, and runtime state. The first scripts/send.sh (or anything reading from that tree) would fail on a clean machine.
  2. Unsubstituted __SKILL_NAME__. install.sh runs sed s/__SKILL_NAME__/<cmd>/ when generating the installed SKILL.md from templates/cmd.codex.md. The plugin install path bypasses that substitution and ships the repo's SKILL.md verbatim, so every script path inside it was literally ~/.agents/skills/__SKILL_NAME__/scripts/....

This PR addresses both — minimal, no script changes, ready to ship before the EN buzz week.

Changes

  • SKILL.md:
    • Replace every __SKILL_NAME__ with the literal agmsg (the plugin name is fixed by plugin.json; no per-user customisation on the plugin path).
    • New Step 0: First-run bootstrap at the top of "How to use" — a single shell snippet the agent runs once. It detects the canonical install dir, locates the plugin-shipped install.sh via a glob over the cache path, and runs it with --cmd agmsg. Idempotent: skipped on subsequent invocations.

Tests

  • tests/test_install.bats:
    • New: a bats case that materialises a fake plugin cache ($FAKE_HOME/.claude/plugins/cache/fujibee-agmsg/agmsg/1.0.0/), runs the Step 0 snippet from SKILL.md, and asserts the canonical install dir is populated end-to-end (DB present, scripts present, no leftover __SKILL_NAME__).
    • New regression guard: fails if __SKILL_NAME__ ever reappears in the repo SKILL.md itself.

All 11 install tests pass locally.

Out of scope

Cross-links

…83)

Two coupled problems on the plugin install path that the install.sh path
hides:

1. Step 0 bootstrap. The marketplace install (/plugin install agmsg@fujibee-agmsg)
   drops the repo into ~/.claude/plugins/cache/ but never creates
   ~/.agents/skills/agmsg/ where the scripts expect their DB, teams, and
   runtime state. The first ./scripts/send.sh would fail. Add a Step 0
   to SKILL.md that detects the missing canonical dir and runs the
   plugin's own install.sh once to bootstrap it. Idempotent on
   subsequent invocations.

2. Name placeholder. install.sh substitutes __SKILL_NAME__ when it
   generates the installed SKILL.md from templates/cmd.codex.md (or
   the agent-type variant). The plugin install bypasses that step
   entirely and ships the repo's SKILL.md verbatim, so every script
   path the SKILL.md printed was literally
   ~/.agents/skills/__SKILL_NAME__/scripts/... Replace the placeholder
   with the literal 'agmsg' in the repo SKILL.md — the plugin's name
   is fixed by plugin.json regardless.

Tests: a bats case that materialises a fake plugin cache, runs the
Step 0 snippet from SKILL.md, and asserts the canonical install dir
is populated; plus a regression guard that fails if __SKILL_NAME__
ever reappears in the repo SKILL.md.

Closes #83.
@fujibee fujibee merged commit 908a2aa into main Jun 7, 2026
fujibee added a commit that referenced this pull request Jun 10, 2026
Adds two install paths the README didn't cover after the PH-launch
rework:

- **npm / npx** — published since #89 via npm Trusted Publisher (OIDC)
  with SLSA provenance. `npx agmsg` is the lowest-friction path for
  Node-having users.
- **Claude Code plugin marketplace** — `/plugin marketplace add fujibee/agmsg`
  + `/plugin install agmsg@fujibee-agmsg` + `/reload-plugins` + `/agmsg`.
  Verified end-to-end against a fresh Debian-based Claude Code container
  today: the in-CC slash command flow runs the SKILL.md Step 0 bootstrap
  (added in #85) and lands on the same `~/.agents/skills/agmsg/`
  runtime as the direct-script install.

Also surfaces the `bash + sqlite3` prerequisite at the top of Quick Start.
The dogfood revealed that minimal Linux images (Debian slim, etc.) don't
include sqlite3 by default; the bootstrap installer surfaces a clear
error, but it's worth flagging up front. macOS users are unaffected.

The Install section is restructured into subsections (npm, plugin
marketplace, direct script) so each path stands on its own. A note in
the direct-script subsection clarifies that `--cmd` / `--agent-type`
flags are direct-script only — the other paths always install as `agmsg`
with auto-detected agent type.
fujibee added a commit that referenced this pull request Jun 15, 2026
Adds two install paths the README didn't cover after the PH-launch
rework:

- **npm / npx** — published since #89 via npm Trusted Publisher (OIDC)
  with SLSA provenance. `npx agmsg` is the lowest-friction path for
  Node-having users.
- **Claude Code plugin marketplace** — `/plugin marketplace add fujibee/agmsg`
  + `/plugin install agmsg@fujibee-agmsg` + `/reload-plugins` + `/agmsg`.
  Verified end-to-end against a fresh Debian-based Claude Code container
  today: the in-CC slash command flow runs the SKILL.md Step 0 bootstrap
  (added in #85) and lands on the same `~/.agents/skills/agmsg/`
  runtime as the direct-script install.

Also surfaces the `bash + sqlite3` prerequisite at the top of Quick Start.
The dogfood revealed that minimal Linux images (Debian slim, etc.) don't
include sqlite3 by default; the bootstrap installer surfaces a clear
error, but it's worth flagging up front. macOS users are unaffected.

The Install section is restructured into subsections (npm, plugin
marketplace, direct script) so each path stands on its own. A note in
the direct-script subsection clarifies that `--cmd` / `--agent-type`
flags are direct-script only — the other paths always install as `agmsg`
with auto-detected agent type.
fujibee added a commit that referenced this pull request Jun 15, 2026
* docs(readme): document npm and Claude Code plugin install paths

Adds two install paths the README didn't cover after the PH-launch
rework:

- **npm / npx** — published since #89 via npm Trusted Publisher (OIDC)
  with SLSA provenance. `npx agmsg` is the lowest-friction path for
  Node-having users.
- **Claude Code plugin marketplace** — `/plugin marketplace add fujibee/agmsg`
  + `/plugin install agmsg@fujibee-agmsg` + `/reload-plugins` + `/agmsg`.
  Verified end-to-end against a fresh Debian-based Claude Code container
  today: the in-CC slash command flow runs the SKILL.md Step 0 bootstrap
  (added in #85) and lands on the same `~/.agents/skills/agmsg/`
  runtime as the direct-script install.

Also surfaces the `bash + sqlite3` prerequisite at the top of Quick Start.
The dogfood revealed that minimal Linux images (Debian slim, etc.) don't
include sqlite3 by default; the bootstrap installer surfaces a clear
error, but it's worth flagging up front. macOS users are unaffected.

The Install section is restructured into subsections (npm, plugin
marketplace, direct script) so each path stands on its own. A note in
the direct-script subsection clarifies that `--cmd` / `--agent-type`
flags are direct-script only — the other paths always install as `agmsg`
with auto-detected agent type.

* docs(readme): note which install path tracks main vs tagged releases

git clone / setup.sh install from main (always current); the npm package and
Claude Code plugin are cut from tagged releases and can lag. Point readers at
`/agmsg version` to see exactly what they're running (#117 provenance).

* docs(readme): add clone step to Direct script; credit new contributors

- Direct script section now shows the `git clone` + `cd` it assumed, and notes
  it's the path that tracks latest main.
- Community: credit @lucianlamp (native Windows PowerShell helpers, #103) and
  @tatsuya6502 (sandboxed Bash tool support, #106) — merged but uncredited.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin install via marketplace doesn't initialize DB/teams — first send.sh call fails

1 participant