{"slug": "install-once-run-anywhere-a-four-phase-claude-code-plugin-migration", "title": "Install once, run anywhere: a four-phase Claude Code plugin migration", "summary": "A developer migrated the Relay six-role multi-agent frontend pipeline (PM, Architect, Implementer, Reviewer, Prod-Readiness, Verifier) into a distributable Claude Code plugin, collapsing per-repo scaffolding into a single install command. The four-phase migration moved slash commands, role contracts, orchestrators, conventions and a JSONL memory helper out of target repos and into the plugin, relying on Claude Code's auto-namespacing so plugin commands like /frontend-team:pipeline coexist with repo-local ones. The work shipped across PRs #7 and #8, taking the plugin from version 0.5.0 to 0.6.0.", "body_md": "**Before** — to use my Claude Code pipeline in a new frontend repo:\n\n```\n  claude plugin marketplace add rgadda/frontend-eng-team --scope user\n  claude plugin install frontend-team@frontend-team-marketplace --scope user\n  cd /path/to/your-frontend-project\n  ft-bootstrap   # a shell script that copies roles, slash commands, memory helper, conventions\n```\n\n**After** — four PRs later:\n\n```\n  claude plugin marketplace add rgadda/frontend-eng-team --scope user\n  claude plugin install frontend-team@frontend-team-marketplace --scope user\n```\n\nDone. In any git repo: `/frontend-team:pipeline <task>`. No per-repo setup.\n\nThis post walks through the four-phase migration that got me there, the Claude Code plugin-spec details I had to figure out along the way (some are\n\n  not well-documented), and what I learned about the shape of plugin-distributed tooling.\n\n**Relay** is a six-role multi-agent pipeline for shipping frontend changes with AI assistance — PM → Architect → Implementer → Reviewer →\n\n  Prod-Readiness → Verifier, each a focused role contract with bounded self-critique (RCC) inner loops. It's tuned for React 18 + TS 5 strict + Vite +\n\n   Axios + CSS Modules + Jest/RTL + Playwright, but the role contracts are stack-agnostic.\n\nPre-migration, the plugin shipped only the subagents and skills. The pipeline itself — role contracts, slash commands, JSONL memory helper, stack\n\n  conventions — lived inside each target repo, copied there by `scripts/ft-bootstrap.sh`. That meant every new project needed scaffolding before\n\n  anything would work.\n\nIf you've distributed a Claude Code plugin yourself, you know the pattern: easy to start with subagents + skills, hard to keep everything else out\n\n  of the user's repo. This migration is the \"hard part.\"\n\nSix things ended up in every repo that ran `ft-bootstrap`:\n\n`.agents/roles/*.md` — role contracts (PM, Architect, etc.)`.agents/pipeline.md`, `pipeline-lite.md` — orchestrators`.agents/conventions.md` — stack conventions`.agents/memory/{schema.md,append.sh,*.jsonl}` — JSONL memory + helper`.claude/commands/*.md` — slash commands (`/pipeline`, `/architect`, etc.)` AGENTS.md` — the cross-tool entry point\nEvery team repo carried a ~2-3K-line chunk of scaffolding that wasn't really \"theirs.\" When I updated a role contract in the central repo, every\n\n  project needed to re-run `ft-bootstrap`. Users had a `~/bin/ft-bootstrap` symlink and a shell rc entry pointing at the team repo. It worked, but it\n\n  was heavy.\n\nI wanted to collapse all of that to **one command**.\n\n**PR**: [#7](https://github.com/rgadda/frontend-eng-team/pull/7) · **version**: 0.5.0\n\nThis was the load-bearing uncertainty. Could Claude Code plugins actually ship slash commands at all? The docs said yes, but I needed to confirm the\n\n   specifics.\n\nThe key findings (worth documenting because they weren't obvious):\n\n`commands/` directory. `commands/architect.md` becomes the slash command.`frontend-team` becomes `/frontend-team:architect`, not\n`${CLAUDE_PLUGIN_ROOT}` substitutes to the plugin's install directory at load time. Use it exactly like\nthat — curly-brace form, literal.\nThe auto-namespacing was the breakthrough. It meant `/frontend-team:pipeline` (plugin) and `/pipeline` (repo-local from `ft-bootstrap`) could\n\n**coexist cleanly** — no collision. Users of bootstrapped repos keep their un-namespaced commands; new users get the namespaced plugin ones. No\n\n  forced migration.\n\nThe actual move was mechanical:\n\n`.claude/commands/` into `.agents/roles/<role>.md` →\n`${CLAUDE_PLUGIN_ROOT}/roles/<role>.md`.`.agents/roles/` into `roles/` verbatim.`pipeline.md`, Tested by running `/frontend-team:architect <small task>` in a clean repo that had never been bootstrapped. The Architect role loaded from the\n\n  plugin, produced its plan, and wrote `branch-plan.md` to the repo root. Works.\n\n**PR**: [#8](https://github.com/rgadda/frontend-eng-team/pull/8) · **version**: 0.6.0\n\nThe pipeline's roles write persistent branch-scoped JSONL summaries that downstream phases read instead of re-parsing full artifacts. This is where\n\n90% of the token discipline comes from across a branch's lifecycle.\n\nPre-migration, memory lived at `.agents/memory/*.jsonl` in each repo via a `append.sh` helper copied by bootstrap. I wanted memory to work for\n\n  non-bootstrapped repos without creating per-repo directories.\n\n**Design decision: where does memory live?**\n\nThree options I considered:\n\n`basename(git toplevel)` as the key — readable but collides when you have two repos with the same folder name (common with worktrees or multiple\nclones).`sha256(toplevel)` — collision-safe but unreadable: `ls ~/.claude/memory/a8f3c91b.../` means nothing.`basename + first 8 chars of sha256` — readable AND unique.\nI went with the hybrid. Example key for my own repo: `frontend-eng-team-fcb7bad0`. You can `ls ~/.claude/memory/` and know which memory belongs to\n\n  which project.\n\n**Shape of the helper:**\n\n```\n  # bin/append.sh — plugin-shipped\n  # Resolves target to $HOME/.claude/memory/<slug>-<hash>/<file>.jsonl\n\n  ./bin/append.sh --resolve-dir                                    # prints the dir\n  ./bin/append.sh plans.jsonl architect 1 final \"...\" --tags \"...\" # appends a record\n```\n\nRoles call `--resolve-dir` to get the current repo's memory path, then grep as before (filtering by branch via the existing `\"branch\":\"<name>\"` JSON\n\n   field). I kept one file per phase and filtered by branch in the grep, rather than sharding files by branch — simpler migration, no schema change,\n\n  and plans.jsonl growing to a few hundred records doesn't hurt grep performance.\n\nThe helper exits cleanly outside a git repo (slug can't be computed), and every role has graceful degradation if memory writes fail — a warning\n\n  line, no stall.\n\n**What stayed per-repo:** `branch-plan.md` and `branch-prd.md` still land at the repo working-tree root. Users paste from these into PR\n\n  descriptions; stuffing them under `~/.claude/scratch/` would hurt the UX more than it would clean the repo. They're already gitignored, and that's\n\n  good enough.\n\n**PR**: [#9](https://github.com/rgadda/frontend-eng-team/pull/9) · **version**: 0.7.0\n\nRole files reference \"conventions\" — the stack-specific rules about TypeScript strictness, no raw `fetch`, no inline styles, Jest+RTL co-located,\n\n  etc. Each rule tagged CRITICAL / RECOMMENDED / OPTIONAL by severity. Historically these lived at `.agents/conventions.md`.\n\nThe design decision here was about **overridability**. I wanted:\n\nI settled on: **plugin default, optional repo override, repo wins on direct conflict.** Not merge — too fiddly. Each role's Conventions section\n\n  says:\n\n`${CLAUDE_PLUGIN_ROOT}/conventions.md` first (plugin default).\nAdded a short \"Conventions\" section to each of the 8 role files, mandating this load order. Fixed one hardcoded `.agents/conventions.md` reference\n\n  in the Verifier that had been living below my grep. Cleaned up remaining `.agents/roles/`, `.agents/pipeline.md`, and `.agents/pipeline-lite.md`\n\n  prose references that Phase 1 missed.\n\n`ft-bootstrap` to narrow legacy\nAlso in [#9](https://github.com/rgadda/frontend-eng-team/pull/9) · **version**: 0.8.0\n\nWith commands, roles, memory, and conventions all plugin-shipped, `ft-bootstrap` had nothing load-bearing left to do in the default flow. I didn't\n\n  want to delete it, though — three use cases still need it:\n\nSo the script body is **unchanged** — anyone's `~/bin/ft-bootstrap` symlink still works. I just added a prominent deprecation-and-use-cases header\n\n  at the top so new readers know when to reach for it. Docs (`README.md`, `scripts/setup-global.md`, `AGENTS.md`, `docs/architecture.md`,\n\n`docs/plugin.md`) got rewritten to lead with the plugin-only install and relegate bootstrap to an optional section.\n\nThree things that aren't well-documented but are worth knowing if you're shipping a plugin:\n\n**1. Command namespacing is automatic and non-configurable.** If your plugin is named `my-plugin` and ships `commands/foo.md`, users call it as\n\n`/my-plugin:foo`. This is great for coexistence with repo-local commands, but it means your plugin's command names are permanently prefixed — plan\n\n  your naming accordingly.\n\n**2. `${CLAUDE_PLUGIN_ROOT}` is substituted at load time, not at exec time.** When a command or role file is loaded into Claude's context, the\n\n  variable is replaced with the absolute path to the plugin's install directory. In code blocks and prose it reads a bit ugly\n\n  (`$(${CLAUDE_PLUGIN_ROOT}/bin/append.sh --resolve-dir)/plans.jsonl` is not pretty), but functionally it's clean. In shell-form hooks, wrap it in\n\n  double quotes to preserve as one argument.\n\n**3. Local-vs-plugin command precedence is undocumented.** If a user has both a project-scoped `.claude/commands/foo.md` and a plugin that ships\n\n`commands/foo.md`, which wins? The official docs don't say. In my case, auto-namespacing sidestepped this entirely — the two have different names.\n\n  If you can't rely on namespacing, test both-present carefully before relying on precedence.\n\nThe script lives on as the escape hatch for:\n\nMost users don't need it. If you're not on that list, skip it.\n\n```\n  # Claude Code — full pipeline\n  claude plugin marketplace add rgadda/frontend-eng-team --scope user\n  claude plugin install frontend-team@frontend-team-marketplace --scope user\n```\n\nThen in any git repo: `/frontend-team:pipeline <task>`.\n\nThe four skills (`component-conventions`, `pr-prep`, `pm-clarify`, `loop-engineering`) also install standalone via [skills.sh](https://skills.sh)\n\n  for Cursor, Copilot, Windsurf, Gemini, Cline, and any other skills-compatible agent:\n\n```\n  npx skills add rgadda/frontend-eng-team\n```\n\nSubagents and the full pipeline require Claude Code.\n\nOpen questions I'd love outside eyes on: whether the `basename + sha256[:8]` memory-key scheme holds up for people juggling many clones of the same\n\n  repo, and whether the plugin-default + repo-override pattern for conventions is a reasonable convention or if someone has a sharper model. Replies\n\n  welcome.", "url": "https://wpnews.pro/news/install-once-run-anywhere-a-four-phase-claude-code-plugin-migration", "canonical_source": "https://dev.to/rajiv_gadda/install-once-run-anywhere-a-four-phase-claude-code-plugin-migration-281e", "published_at": "2026-12-01 21:39:29+00:00", "updated_at": "2026-12-01 21:43:47.927374+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Claude Code", "Anthropic", "Relay", "rgadda/frontend-eng-team", "React", "Vite"], "also_reported_by": [], "takeaway": "Claude Code plugins auto-namespace slash commands from a commands/ directory (commands/architect.md becomes /frontend-team:architect) and substitute ${CLAUDE_PLUGIN_ROOT} at load time, letting plugin commands coexist with repo-local ones without forced migration.", "recommendation": {"advice": "Package agent roles, orchestrators and slash commands inside the plugin using ${CLAUDE_PLUGIN_ROOT} paths and namespaced commands so users install once and skip per-repo bootstrap.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/install-once-run-anywhere-a-four-phase-claude-code-plugin-migration", "markdown": "https://wpnews.pro/news/install-once-run-anywhere-a-four-phase-claude-code-plugin-migration.md", "text": "https://wpnews.pro/news/install-once-run-anywhere-a-four-phase-claude-code-plugin-migration.txt", "jsonld": "https://wpnews.pro/news/install-once-run-anywhere-a-four-phase-claude-code-plugin-migration.jsonld"}}