Multi-instance management for @forgeplan/web — make it possible to run several forgeplan-web instances simultaneously across projects, install once per user (instead of per project), and switch between running instances from the UI.
Original idea
- Remove
init from the project flow and move the dist directory to a user-level scope.
- Instances should use incremental ports automatically.
- Add a persistent store to track all running instances.
- If more than one instance is running, display tabs in the active instance for switching between them, including information about which project each instance belongs to.
Refined plan (post-decomposition)
After Shape-phase routing, the literal "remove init" is replaced with dual-scope (--scope user|project) — backwards compatible, no breakage for existing users. Project-scope keeps the current behavior; user-scope (~/.forgeplan-web/) is the new default for fresh installs. The "tabs" requirement becomes a Combobox (searchable, scales beyond 5+ instances) in the existing HealthBar.
Sub-issues
Forgeplan artifacts (Shape phase)
| Artifact |
Scope |
| ADR-003 |
Amend .claude/rules/23-bin-zero-deps.md to permit citty (~5KB ESM, zero transitive deps) by name. Gates 109a. |
| ADR-004 |
Registry path + JSON-format choice (~/.forgeplan-web/instances.json + atomic rename writes). Gates 109d. |
| PRD-024 + RFC-020 |
citty integration + bin/ split (bin/cli.mjs + bin/commands/*.mjs). |
| PRD-025 + RFC-021 |
--scope flag + interactive prompt + user-scope path resolver. |
| PRD-026 + RFC-022 |
start resolution algorithm + error UX. |
| PRD-027 + SPEC-003 + RFC-023 |
Registry schema + port allocator + pid-liveness probe + /api/instances endpoint. Rule 22 amendment captured here. |
| PRD-028 + RFC-024 |
Combobox primitive. |
| PRD-029 + RFC-025 |
HealthBar wiring. |
Dependency order
ADR-003 ─┐
├─ 109a ─┬─ 109b ─ 109c ─ 109d ─┐
└─ 109e ────────────────├─ 109f
ADR-004 ─────────────────────────────────┘
109a is the gating refactor (citty + arg parser). After it: 109b/109c/109e parallel. 109d serializes after 109c (needs user-scope path conventions). 109f closes the loop after 109d (needs /api/instances) + 109e (needs Combobox).
Out-of-scope (deferred to follow-ups)
- Cross-host federation (talking to instances on other machines).
- Auth / per-instance access control.
- Migration tool for existing project-scope
.forgeplan-web/ → user-scope.
- Full XDG compliance (
XDG_CONFIG_HOME etc.) — RFC-021 keeps ~/.forgeplan-web/ for predictability.
Acceptance
- All 6 sub-issues closed via PRs merged into
develop.
- 3-OS smoke (
npm run smoke) green.
- 3 concurrent instances on incremental ports, all visible from each other's HealthBar Combobox.
R_eff > 0 and active for every PRD/RFC/ADR/Spec before the parent issue closes.
- A user installing
@forgeplan/web for the first time can npx @forgeplan/web init (interactive prompt picks scope), then start works in any project directory.
Multi-instance management for
@forgeplan/web— make it possible to run severalforgeplan-webinstances simultaneously across projects, install once per user (instead of per project), and switch between running instances from the UI.Original idea
initfrom the project flow and move thedistdirectory to a user-level scope.Refined plan (post-decomposition)
After Shape-phase routing, the literal "remove init" is replaced with dual-scope (
--scope user|project) — backwards compatible, no breakage for existing users. Project-scope keeps the current behavior; user-scope (~/.forgeplan-web/) is the new default for fresh installs. The "tabs" requirement becomes a Combobox (searchable, scales beyond 5+ instances) in the existingHealthBar.Sub-issues
bin/). Gating refactor: subcommands, prompts,--scopeflag plumbing.--scope user/projectfor init + interactive prompt fallback when omitted.startresolution chain (project → user → prompt-init) +--scopeoverride.~/.forgeplan-web/instances.json: incremental ports, project metadata (name/path/pid/port/heartbeat), stale invalidation on everystartviaprocess.kill(pid, 0)liveness probe.shared/ui/(bits-ui port), showcased on/playground. Reusable across widgets.http://host:port. Instance ID =host:port.Forgeplan artifacts (Shape phase)
.claude/rules/23-bin-zero-deps.mdto permitcitty(~5KB ESM, zero transitive deps) by name. Gates 109a.~/.forgeplan-web/instances.json+ atomicrenamewrites). Gates 109d.bin/split (bin/cli.mjs+bin/commands/*.mjs).--scopeflag + interactive prompt + user-scope path resolver.startresolution algorithm + error UX./api/instancesendpoint. Rule 22 amendment captured here.Dependency order
109a is the gating refactor (citty + arg parser). After it: 109b/109c/109e parallel. 109d serializes after 109c (needs user-scope path conventions). 109f closes the loop after 109d (needs
/api/instances) + 109e (needs Combobox).Out-of-scope (deferred to follow-ups)
.forgeplan-web/→ user-scope.XDG_CONFIG_HOMEetc.) — RFC-021 keeps~/.forgeplan-web/for predictability.Acceptance
develop.npm run smoke) green.R_eff > 0andactivefor every PRD/RFC/ADR/Spec before the parent issue closes.@forgeplan/webfor the first time cannpx @forgeplan/web init(interactive prompt picks scope), thenstartworks in any project directory.