Commit Graph

2 Commits

Author SHA1 Message Date
Chris Phillipson dbd88254e3 fix(migrate): correct removed-agent install suggestion and add 'migrate fix --agents' restore (#2985) (#2986)
The suggestion printed by 'migrate status' (ADR-382 Part B) could not
succeed: 'ruflo plugins install <plugin>' fails on syntax (--name is
required) and targets the npm-package PluginManager, while the owning
plugins are Claude Code marketplace plugins (not npm packages). The
detection module's own header documents that split.

- point installCommand at the marketplace flow the registry check
  actually verifies: /plugin install <plugin>@ruflo
- add 'migrate fix --agents' (with --dry-run): restores missing agents
  from canonical plugin content — marketplace clone, then repo checkout,
  then GitHub raw pinned to the CLI's version tag with main fallback —
  rewriting the plugin-only mcp__plugin_ruflo-core_ruflo__ namespace to
  the canonical claude-flow server key (#2206) and recording provenance
  after the frontmatter. Never overwrites existing files.
- status now hints at the fix command when gaps are found
2026-08-12 11:33:21 -04:00
rUv 2c8f863583 fix(migrate): implement ADR-128's promised removed-agent detection (ADR-382 Part B) (#2973)
ADR-128 Phase 2 deleted 9 forked agent files from the init template
(coder.md, researcher.md, reviewer.md, tester.md, memory-specialist.md,
security-auditor.md, sparc-orchestrator.md, goal-planner.md,
adr-architect.md), making each plugin canonical. Its Consequences
section promised "`ruflo migrate` should detect removed agents and
print install suggestions" — never implemented until now.

Adds detectRemovedAgentGaps() (new sibling module
migrate-agent-detection.ts, kept out of the already-783-line migrate.ts
per the file-size budget) which, for each of the 9 agents, checks
whether the basename is missing from the project's .claude/agents/
tree and whether the owning plugin is installed per Claude Code's
global ~/.claude/plugins/installed_plugins.json registry (the only
real on-disk signal for marketplace-plugin install state; ruflo's own
PluginManager manifest tracks a separate npm-package-based system).
Pure filesystem checks, no CLI version comparison, per ADR-382 Part B
scope.

`ruflo migrate status` now prints a second table naming any such gap,
its owning plugin, and the exact `ruflo plugins install <plugin>`
command to restore it (JSON output via ctx.flags.format === 'json'
gains a removedAgentGaps field, matching this file's existing
patterns).

See v3/docs/adr/ADR-382-init-scaffold-content-drift-remediation.md
(PR #2972) and https://github.com/ruvnet/ruflo/issues/2971.
2026-08-11 18:26:21 -04:00