Skip to content

Replace LEGACY_SKILL_NAMES with manifest-based stale skill sweep #214

Description

@dean0x

Problem

LEGACY_SKILL_NAMES in src/cli/plugins.ts is a 197-entry append-only array tracking every skill rename/removal since v1. It grows with each refactor and will only get larger as rules accumulate their own LEGACY_RULE_NAMES.

Proposed Solution

Replace the static array with a manifest-based sweep during devflow init (or uninstall):

  1. Read the current manifest's installed skill list
  2. Scan ~/.claude/skills/devflow:*/ for all installed skill directories
  3. Remove any directory not in the current manifest's skill set
  4. Same pattern for ~/.claude/rules/devflow/*.md and ~/.claude/agents/devflow/*.md

This eliminates the need for LEGACY_SKILL_NAMES, LEGACY_RULE_NAMES, and any future legacy arrays entirely — the manifest is the source of truth for what should exist.

Considerations

  • Must handle partial installs (single-plugin reinstall shouldn't wipe skills from other plugins)
  • Should log what it removes for transparency
  • Could run as a migration or as part of normal init flow
  • The current array approach is harmless (~4KB, runs once during uninstall) — this is a cleanliness improvement, not urgent

Scope

  • Remove LEGACY_SKILL_NAMES array
  • Remove LEGACY_RULE_NAMES array
  • Add manifest-based sweep to init/uninstall flow
  • Add tests for the sweep logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions