[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71SXYZ48SPEEQF0BHA5EM32":3,"skill-same:01M71SXYZ48SPEEQF0BHA5EM32":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":53,"ownerDescription":54,"updatedAt":55,"install":56,"resources":68},"01M71SXYZ48SPEEQF0BHA5EM32","cleanup-legacy-install",null,"Use when upgrading from a pre-plugin clauDNA install (install.sh, claudefather, or claudfather) to the marketplace plugin. Detects and removes the legacy ~\u002F.claude\u002F overlay so plugin-installed skills don't get shadowed by stale copies.","Claudfather\u002FclauDNA","Claudfather","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F281278891?v=4","01M71SX82K0TBGQ394AB2G1T5Z","01M71SX83CE1S8YC06K9P3P962",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Fskills\u002Fcleanup-legacy-install\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"cleanup legacy install","Legacy","install","cleanup","marketplace","rmdir","cp","plugin","test","code","Bash","when","cat","use","true","mkdir","overlay","diff","get","ls","2026-11-10 13:02:02",false,"---\nname: cleanup-legacy-install\nuser-invocable: true\ndescription: \"Use when upgrading from a pre-plugin clauDNA install (install.sh, claudefather, or claudfather) to the marketplace plugin. Detects and removes the legacy ~\u002F.claude\u002F overlay so plugin-installed skills don't get shadowed by stale copies.\"\nhosts: [claude-code]\ndisable-model-invocation: true\nallowed-tools: Read(*), Bash(ls *), Bash(cat *), Bash(diff *), Bash(cp *), Bash(rm -rf ~\u002F.claude\u002F*), Bash(rm ~\u002F.claude\u002F*), Bash(rmdir *), Bash(mkdir *), Bash(date *), Bash(find *), Bash(test *)\n---\n\n# Cleanup Legacy Install\n\nRemoves the pre-plugin clauDNA overlay from `~\u002F.claude\u002F` so plugin-installed skills don't get shadowed by stale copies. Works for users who previously installed via clauDNA's `install.sh`, or via the sibling `claudefather` \u002F `claudfather` projects.\n\nBackups belong under the effective clauDNA state root `R\u002Fbackups\u002Flegacy-install\u002F\u003Crun>\u002F`. In this native Claude Code skill, `\u003Crun>` must use this invocation's actual native Claude session ID. Never invent or infer a session ID. If the skill does not receive a usable native ID, stop; standalone maintainer backup operations are separate operator-run operations outside any Claude, Codex, or Cursor workflow and are not a fallback for this skill. The local skill mechanism documents `${CLAUDE_SESSION_ID}` substitution, but native acceptance of its rendered value remains pending. This skill remains discovery-first and requires the explicit confirmations below before source deletion.\n\nThe skill is **discovery-based**: it enumerates the names this plugin would now install (skills, agents, hook scripts) and only removes matching-name files in `~\u002F.claude\u002F`. Anything you added yourself with a different name is untouched.\n\n## Procedure\n\nFollow these steps exactly in order.\n\n### Step 1: Detect Legacy Install\n\nLook for breadcrumb files written by the old install scripts:\n\n```bash\nls -la ~\u002F.claude\u002F.clauDNA-repo ~\u002F.claude\u002F.claudfather-repo ~\u002F.claude\u002F.claudefather-repo 2>\u002Fdev\u002Fnull\n```\n\nAlso check the actual overlay directories — a breadcrumb may be absent if the user removed it manually, but the overlay still exists:\n\n```bash\nls -d ~\u002F.claude\u002Fskills ~\u002F.claude\u002Fhooks ~\u002F.claude\u002Fcommands 2>\u002Fdev\u002Fnull\n```\n\nIf none of these exist and no breadcrumbs are present, print:\n\n> No legacy clauDNA \u002F claudfather \u002F claudefather install detected. Nothing to clean up.\n\nAnd stop.\n\nOtherwise, continue.\n\n### Step 2: Enumerate the Plugin's Own Components\n\nLocate the plugin's installed directory. The plugin is at `~\u002F.claude\u002Fplugins\u002Fcache\u002FClaudfather\u002Fclaudna\u002F\u003Cversion>\u002F`. Find the version:\n\n```bash\nls -d ~\u002F.claude\u002Fplugins\u002Fcache\u002FClaudfather\u002Fclaudna\u002F*\u002F 2>\u002Fdev\u002Fnull | sort -V | tail -1\n```\n\nCall this `PLUGIN_ROOT`. Then list what the plugin ships:\n\n```bash\nls \"$PLUGIN_ROOT\u002Fskills\u002F\" | grep -v '^_'    # skill names (skip _shared)\nls \"$PLUGIN_ROOT\u002Fagents\u002F\"                   # agent file names\nls \"$PLUGIN_ROOT\u002Fplugin-hooks\u002F\"*.sh         # hook script names\n```\n\nIf `PLUGIN_ROOT` doesn't exist (plugin not installed yet), tell the user:\n\n> The plugin must be installed before this cleanup runs. Please run:\n>   \u002Fplugin marketplace add Claudfather\u002FclauDNA\n>   \u002Fplugin install claudna@Claudfather\n> Then re-run this skill.\n\nAnd stop.\n\n### Step 3: Build the Cleanup Manifest\n\nFor each component the plugin ships, check whether a matching file exists in the legacy overlay location.\n\n**Skills:** for each `\u003Cname>` in the plugin's `skills\u002F` directory, check if `~\u002F.claude\u002Fskills\u002F\u003Cname>\u002FSKILL.md` exists.\n\n**Agents:** for each `\u003Cname>.md` in the plugin's `agents\u002F` directory, check if `~\u002F.claude\u002Fagents\u002F\u003Cname>.md` exists.\n\n**Hook scripts:** for each `\u003Cbasename>.sh` in the plugin's `plugin-hooks\u002F` directory, check if `~\u002F.claude\u002Fhooks\u002F\u003Cbasename>.sh` exists.\n\n**Commands:** check for known-legacy command files in `~\u002F.claude\u002Fcommands\u002F`:\n- `clauDNA-sync.md`\n- `clauDNA-setup.md`\n- `clauDNA-migrate.md`\n- `claudfather-sync.md`\n- `claudefather-sync.md`\n(These were never plugin components — they're install.sh artifacts that the plugin doesn't replace.)\n\n**Breadcrumb files:** `.clauDNA-repo`, `.claudfather-repo`, `.claudefather-repo` in `~\u002F.claude\u002F`.\n\n**Docs:** check `~\u002F.claude\u002Fdocs\u002FSETUP_GUIDE.md` and `~\u002F.claude\u002Fdocs\u002FCLAUDE_MD_TEMPLATE.md` — install.sh copied these. They're stale once the plugin is in place.\n\nBuild a manifest of full paths to be removed.\n\n### Step 4: Detect Customizations (Safety Check)\n\nFor each candidate file in the manifest, compare its content to the plugin's version:\n\n```bash\ndiff -q ~\u002F.claude\u002Fskills\u002F\u003Cname>\u002FSKILL.md \"$PLUGIN_ROOT\u002Fskills\u002F\u003Cname>\u002FSKILL.md\"\n```\n\nCategorize:\n- **Identical to plugin version** → safe to remove without question.\n- **Differs from plugin version** → may be user customization. Flag for explicit confirmation.\n\nSkills with subdirectories (e.g., `references\u002F`) — diff the full tree using `diff -rq`.\n\nFor hook scripts, agents, docs: same approach — `diff -q` against the plugin's copy.\n\nBreadcrumb files and legacy command files have no plugin equivalent, so they're always safe to remove.\n\n### Step 5: Present the Plan\n\nShow the user what will happen, grouped by category:\n\n```\nCleanup Plan\n═══════════════════════════════════════════════════════════════\n\nBreadcrumbs (always safe to remove):\n  ~\u002F.claude\u002F.clauDNA-repo\n\nLegacy command files (no plugin equivalent — safe):\n  ~\u002F.claude\u002Fcommands\u002FclauDNA-sync.md\n  ~\u002F.claude\u002Fcommands\u002FclauDNA-setup.md\n\nSkills (N total: M identical to plugin, K differ — see below):\n  Identical (safe):\n    ~\u002F.claude\u002Fskills\u002Faccess-path-audit\u002F      (matches plugin)\n    ~\u002F.claude\u002Fskills\u002Fcache-audit\u002F            (matches plugin)\n    ...\n  Differ (you may have customized these — confirm individually):\n    ~\u002F.claude\u002Fskills\u002Ftech-debt\u002F              (differs from plugin)\n\nHooks (N total: M identical, K differ):\n  Identical (safe):\n    ~\u002F.claude\u002Fhooks\u002Fauto-format.sh           (matches plugin)\n    ...\n  Differ:\n    ~\u002F.claude\u002Fhooks\u002Fpretooluse-permissions.sh  (differs from plugin)\n\nAgents (N total: M identical, K differ):\n  ...\n\nDocs:\n  ~\u002F.claude\u002Fdocs\u002FSETUP_GUIDE.md   (stale copy of plugin's SETUP_GUIDE.md — safe to remove)\n  ~\u002F.claude\u002Fdocs\u002FCLAUDE_MD_TEMPLATE.md   (stale copy — safe to remove)\n\n═══════════════════════════════════════════════════════════════\nSummary: N files\u002Fdirectories total, M safe, K need confirmation.\n```\n\n### Step 6: Confirm Differing Items One-by-One\n\nFor each item flagged as \"differs\":\n\n1. Show the diff (`diff -u` between the user's copy and the plugin's copy).\n2. Ask: **Keep \u002F Remove \u002F Show full diff**.\n3. If **Keep**: drop from the manifest, leave the file in place. Note that this file will shadow the plugin's `\u002Fclaudna:\u003Cname>` version under its bare `\u002F\u003Cname>` invocation. The user can later rename or delete it manually.\n4. If **Remove**: keep in the manifest.\n\nDo not auto-resolve. Ambiguous cases must be the user's call.\n\n### Step 7: statusLine Check\n\nIf `~\u002F.claude\u002Fsettings.json` exists, check whether `statusLine.command` points at `~\u002F.claude\u002Fhooks\u002Fstatusline.sh` (the old install location):\n\n```bash\ngrep -l '~\u002F.claude\u002Fhooks\u002Fstatusline.sh' ~\u002F.claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n```\n\nIf yes, the user's statusLine will break once `~\u002F.claude\u002Fhooks\u002Fstatusline.sh` is removed. Ask:\n\n1. **Update path to plugin cache** — rewrite the command to `bash ~\u002F.claude\u002Fplugins\u002Fcache\u002FClaudfather\u002Fclaudna\u002F\u003Cversion>\u002Fplugin-hooks\u002Fstatusline.sh`. Warn that this version is pinned and will need updating on plugin bumps.\n2. **Remove statusLine entirely** — delete the `statusLine` key from settings.json. User can re-add later.\n3. **Skip** — leave settings.json alone; user will fix it manually.\n\nUse Read + Edit (not Bash) to modify settings.json. Never use `>` redirect to overwrite — that can race with other writers.\n\n### Step 8: Final Confirmation\n\nPrint the full final manifest (after Step 6 user choices), identify the current native Claude session as the run owner, and ask one last time:\n\n> Will remove N files\u002Fdirectories. Continue? [y\u002FN]\n\nRequire explicit `y` or `yes`. Anything else aborts. If the loaded local skill does not provide a usable native session ID, stop this workflow; do not rename it standalone or switch to an operation ID.\n\n### Step 9: Backup\n\nBefore any destructive operation, back up the entire manifest beneath the effective clauDNA root. The documented local Claude Code skill mechanism renders `${CLAUDE_SESSION_ID}`; native acceptance of that substitution remains pending. Resolve `R` with the phase-01 path resolver and use that exact validated native ID:\n\n```bash\nSESSION_ID='${CLAUDE_SESSION_ID}'\ncase \"$SESSION_ID\" in\n  ''|*CLAUDE_SESSION_ID*) echo \"No resolved native Claude session ID; stop before cleanup.\"; exit 1 ;;\nesac\nSESSION_ARTIFACTS=$(python3 -B \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fclaudna\u002Fsession_store\" paths \\\n  --host claude --session \"$SESSION_ID\" --kind artifacts) || exit 1\nSTATE_ROOT=${SESSION_ARTIFACTS%\u002Fsessions\u002F*}\nRUN=\"session-$SESSION_ID\"\nBACKUP_DIR=\"$STATE_ROOT\u002Fbackups\u002Flegacy-install\u002F$RUN\"\nif [ -e \"$BACKUP_DIR\" ]; then\n  echo \"Backup path already exists; stop without overwriting it: $BACKUP_DIR\"\n  exit 1\nfi\numask 077\nmkdir -p -m 700 \"$STATE_ROOT\u002Fbackups\u002Flegacy-install\"\nmkdir -m 700 \"$BACKUP_DIR\" || exit 1\n```\n\nWhen `${CLAUDE_PLUGIN_ROOT}` is unavailable, substitute the absolute package `\u003Cclaudna-root>` resolved from the loaded skill per [`..\u002F_shared\u002Fclaudna-root.md`](..\u002F_shared\u002Fclaudna-root.md). Do not replace a missing native session ID with a standalone operation ID. A maintainer who is explicitly operating outside all native Claude, Codex, and Cursor workflows must run the separate standalone operation contract (`session_store operation-dir --label legacy-cleanup --create`) as its own operation; this skill's manifest and source-deletion workflow do not perform that operation.\n\nFor each path in the manifest, `cp -r` (or `cp` for files) into a mirror structure under `$BACKUP_DIR`. Preserve the original path structure so restoration is `cp -r` back.\n\nIf any backup copy fails or the copied count does not match the manifest, stop before Step 10. Keep the partial backup for review; do not remove source files or silently reuse this run path.\n\nPrint:\n> Backed up N items to R\u002Fbackups\u002Flegacy-install\u002F\u003Crun>\u002F\n\n### Step 10: Execute\n\nRemove each item in the manifest:\n\n- Skills: `rm -rf ~\u002F.claude\u002Fskills\u002F\u003Cname>` (skill dirs are subdirectories)\n- Agents: `rm ~\u002F.claude\u002Fagents\u002F\u003Cname>.md`\n- Hooks: `rm ~\u002F.claude\u002Fhooks\u002F\u003Cname>.sh`\n- Commands: `rm ~\u002F.claude\u002Fcommands\u002F\u003Cname>.md`\n- Breadcrumbs: `rm ~\u002F.claude\u002F.clauDNA-repo` etc.\n- Docs: `rm ~\u002F.claude\u002Fdocs\u002FSETUP_GUIDE.md` etc.\n\nAfter removing all items, prune now-empty parent directories:\n\n```bash\nrmdir ~\u002F.claude\u002Fskills ~\u002F.claude\u002Fhooks ~\u002F.claude\u002Fagents ~\u002F.claude\u002Fcommands ~\u002F.claude\u002Fdocs 2>\u002Fdev\u002Fnull\n```\n\n(`rmdir` only succeeds if the directory is empty — don't add `-rf`.)\n\n### Step 11: Print Next Steps\n\n```\nCleanup complete.\n═══════════════════════════════════════════════════════════════\n  Removed:  N files\u002Fdirectories\n  Backup:   R\u002Fbackups\u002Flegacy-install\u002F\u003Crun>\u002F\n  \nRestore any file with:\n  cp -r \"$BACKUP_DIR\u002F\u003Cpath>\" \"$HOME\u002F.claude\u002F\u003Cpath>\"\n\nNext:\n  - Run \u002Freload-plugins (or restart Claude Code) to pick up the cleanup.\n  - Invoke any claudna skill as \u002Fclaudna:\u003Cskill-name> to verify the plugin is the only source.\n═══════════════════════════════════════════════════════════════\n```\n\n## Safety Notes\n\n- **Never run without an installed plugin.** Step 2 enforces this. Without the plugin, the discovery step has no manifest to work from.\n- **Never auto-resolve customized files.** Step 6 requires per-file confirmation for anything that differs from the plugin's version.\n- **Always back up before removing.** Step 9 is mandatory.\n- **Keep existing backups read-only.** Existing `~\u002F.local\u002Fshare\u002FclauDNA\u002Fbackups\u002Fcleanup-legacy-install-\u003Ctimestamp>\u002F` directories are not migrated or removed. To restore an item from an old backup, copy its mirrored path back, for example `cp -r \"$HOME\u002F.local\u002Fshare\u002FclauDNA\u002Fbackups\u002Fcleanup-legacy-install-\u003Ctimestamp>\u002Fskills\u002F\u003Cname>\" \"$HOME\u002F.claude\u002Fskills\u002F\u003Cname>\"`. From a new backup, restore using the same relative path beneath `$BACKUP_DIR`; restoration is an explicit operator action.\n- **Never overwrite a run backup.** If the new backup path already exists, stop and retain it. Do not use a timestamp, PID, cwd, or fabricated session as a fallback identity.\n- **Never modify `permissions.allow` entries in settings.json.** Old `Bash(...)` patterns added by install.sh are additive and still useful in the plugin world. Leaving them alone is correct.\n- **Use Read + Edit for settings.json edits.** Never `>` overwrite — that races with concurrent Claude sessions writing to the same file.\n","# Cleanup Legacy Install\n\nRemoves the pre-plugin clauDNA overlay from `~\u002F.claude\u002F` so plugin-installed skills don't get shadowed by stale copies. Works for users who previously installed via clauDNA's `install.sh`, or via the sibling `claudefather` \u002F `claudfather` projects.\n\nBackups belong under the effective clauDNA state root `R\u002Fbackups\u002Flegacy-install\u002F\u003Crun>\u002F`. In this native Claude Code skill, `\u003Crun>` must use this invocation's actual native Claude session ID. Never invent or infer a session ID. If the skill does not receive a usable native ID, stop; standalone maintainer backup operations are separate operator-run operations outside any Claude, Codex, or Cursor workflow and are not a fallback for this skill. The local skill mechanism documents `${CLAUDE_SESSION_ID}` substitution, but native acceptance of its rendered value remains pending. This skill remains discovery-first and requires the explicit confirmations below before source deletion.\n\nThe skill is **discovery-based**: it enumerates the names this plugin would now install (skills, agents, hook scripts) and only removes matching-name files in `~\u002F.claude\u002F`. Anything you added yourself with a different name is untouched.\n\n## Procedure\n\nFollow these steps exactly in order.\n\n### Step 1: Detect Legacy Install\n\nLook for breadcrumb files written by the old install scripts:\n\n```bash\nls -la ~\u002F.claude\u002F.clauDNA-repo ~\u002F.claude\u002F.claudfather-repo ~\u002F.claude\u002F.claudefather-repo 2>\u002Fdev\u002Fnull\n```\n\nAlso check the actual overlay directories — a breadcrumb may be absent if the user removed it manually, but the overlay still exists:\n\n```bash\nls -d ~\u002F.claude\u002Fskills ~\u002F.claude\u002Fhooks ~\u002F.claude\u002Fcommands 2>\u002Fdev\u002Fnull\n```\n\nIf none of these exist and no breadcrumbs are present, print:\n\n> No legacy clauDNA \u002F claudfather \u002F claudefather install detected. Nothing to clean up.\n\nAnd stop.\n\nOtherwise, continue.\n\n### Step 2: Enumerate the Plugin's Own Components\n\nLocate the plugin's installed directory. The plugin is at `~\u002F.claude\u002Fplugins\u002Fcache\u002FClaudfather\u002Fclaudna\u002F\u003Cversion>\u002F`. Find the version:\n\n```bash\nls -d ~\u002F.claude\u002Fplugins\u002Fcache\u002FClaudfather\u002Fclaudna\u002F*\u002F 2>\u002Fdev\u002Fnull | sort -V | tail -1\n```\n\nCall this `PLUGIN_ROOT`. Then list what the plugin ships:\n\n```bash\nls \"$PLUGIN_ROOT\u002Fskills\u002F\" | grep -v '^_'    # skill names (skip _shared)\nls \"$PLUGIN_ROOT\u002Fagents\u002F\"                   # agent file names\nls \"$PLUGIN_ROOT\u002Fplugin-hooks\u002F\"*.sh         # hook script names\n```\n\nIf `PLUGIN_ROOT` doesn't exist (plugin not installed yet), tell the user:\n\n> The plugin must be installed before this cleanup runs. Please run:\n>   \u002Fplugin marketplace add Claudfather\u002FclauDNA\n>   \u002Fplugin install claudna@Claudfather\n> Then re-run this skill.\n\nAnd stop.\n\n### Step 3: Build the Cleanup Manifest\n\nFor each component the plugin ships, check whether a matching file exists in the legacy overlay location.\n\n**Skills:** for each `\u003Cname>` in the plugin's `skills\u002F` directory, check if `~\u002F.claude\u002Fskills\u002F\u003Cname>\u002FSKILL.md` exists.\n\n**Agents:** for each `\u003Cname>.md` in the plugin's `agents\u002F` directory, check if `~\u002F.claude\u002Fagents\u002F\u003Cname>.md` exists.\n\n**Hook scripts:** for each `\u003Cbasename>.sh` in the plugin's `plugin-hooks\u002F` directory, check if `~\u002F.claude\u002Fhooks\u002F\u003Cbasename>.sh` exists.\n\n**Commands:** check for known-legacy command files in `~\u002F.claude\u002Fcommands\u002F`:\n- `clauDNA-sync.md`\n- `clauDNA-setup.md`\n- `clauDNA-migrate.md`\n- `claudfather-sync.md`\n- `claudefather-sync.md`\n(These were never plugin components — they're install.sh artifacts that the plugin doesn't replace.)\n\n**Breadcrumb files:** `.clauDNA-repo`, `.claudfather-repo`, `.claudefather-repo` in `~\u002F.claude\u002F`.\n\n**Docs:** check `~\u002F.claude\u002Fdocs\u002FSETUP_GUIDE.md` and `~\u002F.claude\u002Fdocs\u002FCLAUDE_MD_TEMPLATE.md` — install.sh copied these. They're stale once the plugin is in place.\n\nBuild a manifest of full paths to be removed.\n\n### Step 4: Detect Customizations (Safety Check)\n\nFor each candidate file in the manifest, compare its content to the plugin's version:\n\n```bash\ndiff -q ~\u002F.claude\u002Fskills\u002F\u003Cname>\u002FSKILL.md \"$PLUGIN_ROOT\u002Fskills\u002F\u003Cname>\u002FSKILL.md\"\n```\n\nCategorize:\n- **Identical to plugin version** → safe to remove without question.\n- **Differs from plugin version** → may be user customization. Flag for explicit confirmation.\n\nSkills with subdirectories (e.g., `references\u002F`) — diff the full tree using `diff -rq`.\n\nFor hook scripts, agents, docs: same approach — `diff -q` against the plugin's copy.\n\nBreadcrumb files and legacy command files have no plugin equivalent, so they're always safe to remove.\n\n### Step 5: Present the Plan\n\nShow the user what will happen, grouped by category:\n\n```\nCleanup Plan\n═══════════════════════════════════════════════════════════════\n\nBreadcrumbs (always safe to remove):\n  ~\u002F.claude\u002F.clauDNA-repo\n\nLegacy command files (no plugin equivalent — safe):\n  ~\u002F.claude\u002Fcommands\u002FclauDNA-sync.md\n  ~\u002F.claude\u002Fcommands\u002FclauDNA-setup.md\n\nSkills (N total: M identical to plugin, K differ — see below):\n  Identical (safe):\n    ~\u002F.claude\u002Fskills\u002Faccess-path-audit\u002F      (matches plugin)\n    ~\u002F.claude\u002Fskills\u002Fcache-audit\u002F            (matches plugin)\n    ...\n  Differ (you may have customized these — confirm individually):\n    ~\u002F.claude\u002Fskills\u002Ftech-debt\u002F              (differs from plugin)\n\nHooks (N total: M identical, K differ):\n  Identical (safe):\n    ~\u002F.claude\u002Fhooks\u002Fauto-format.sh           (matches plugin)\n    ...\n  Differ:\n    ~\u002F.claude\u002Fhooks\u002Fpretooluse-permissions.sh  (differs from plugin)\n\nAgents (N total: M identical, K differ):\n  ...\n\nDocs:\n  ~\u002F.claude\u002Fdocs\u002FSETUP_GUIDE.md   (stale copy of plugin's SETUP_GUIDE.md — safe to remove)\n  ~\u002F.claude\u002Fdocs\u002FCLAUDE_MD_TEMPLATE.md   (stale copy — safe to remove)\n\n═══════════════════════════════════════════════════════════════\nSummary: N files\u002Fdirectories total, M safe, K need confirmation.\n```\n\n### Step 6: Confirm Differing Items One-by-One\n\nFor each item flagged as \"differs\":\n\n1. Show the diff (`diff -u` between the user's copy and the plugin's copy).\n2. Ask: **Keep \u002F Remove \u002F Show full diff**.\n3. If **Keep**: drop from the manifest, leave the file in place. Note that this file will shadow the plugin's `\u002Fclaudna:\u003Cname>` version under its bare `\u002F\u003Cname>` invocation. The user can later rename or delete it manually.\n4. If **Remove**: keep in the manifest.\n\nDo not auto-resolve. Ambiguous cases must be the user's call.\n\n### Step 7: statusLine Check\n\nIf `~\u002F.claude\u002Fsettings.json` exists, check whether `statusLine.command` points at `~\u002F.claude\u002Fhooks\u002Fstatusline.sh` (the old install location):\n\n```bash\ngrep -l '~\u002F.claude\u002Fhooks\u002Fstatusline.sh' ~\u002F.claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n```\n\nIf yes, the user's statusLine will break once `~\u002F.claude\u002Fhooks\u002Fstatusline.sh` is removed. Ask:\n\n1. **Update path to plugin cache** — rewrite the command to `bash ~\u002F.claude\u002Fplugins\u002Fcache\u002FClaudfather\u002Fclaudna\u002F\u003Cversion>\u002Fplugin-hooks\u002Fstatusline.sh`. Warn that this version is pinned and will need updating on plugin bumps.\n2. **Remove statusLine entirely** — delete the `statusLine` key from settings.json. User can re-add later.\n3. **Skip** — leave settings.json alone; user will fix it manually.\n\nUse Read + Edit (not Bash) to modify settings.json. Never use `>` redirect to overwrite — that can race with other writers.\n\n### Step 8: Final Confirmation\n\nPrint the full final manifest (after Step 6 user choices), identify the current native Claude session as the run owner, and ask one last time:\n\n> Will remove N files\u002Fdirectories. Continue? [y\u002FN]\n\nRequire explicit `y` or `yes`. Anything else aborts. If the loaded local skill does not provide a usable native session ID, stop this workflow; do not rename it standalone or switch to an operation ID.\n\n### Step 9: Backup\n\nBefore any destructive operation, back up the entire manifest beneath the effective clauDNA root. The documented local Claude Code skill mechanism renders `${CLAUDE_SESSION_ID}`; native acceptance of that substitution remains pending. Resolve `R` with the phase-01 path resolver and use that exact validated native ID:\n\n```bash\nSESSION_ID='${CLAUDE_SESSION_ID}'\ncase \"$SESSION_ID\" in\n  ''|*CLAUDE_SESSION_ID*) echo \"No resolved native Claude session ID; stop before cleanup.\"; exit 1 ;;\nesac\nSESSION_ARTIFACTS=$(python3 -B \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fclaudna\u002Fsession_store\" paths \\\n  --host claude --session \"$SESSION_ID\" --kind artifacts) || exit 1\nSTATE_ROOT=${SESSION_ARTIFACTS%\u002Fsessions\u002F*}\nRUN=\"session-$SESSION_ID\"\nBACKUP_DIR=\"$STATE_ROOT\u002Fbackups\u002Flegacy-install\u002F$RUN\"\nif [ -e \"$BACKUP_DIR\" ]; then\n  echo \"Backup path already exists; stop without overwriting it: $BACKUP_DIR\"\n  exit 1\nfi\numask 077\nmkdir -p -m 700 \"$STATE_ROOT\u002Fbackups\u002Flegacy-install\"\nmkdir -m 700 \"$BACKUP_DIR\" || exit 1\n```\n\nWhen `${CLAUDE_PLUGIN_ROOT}` is unavailable, substitute the absolute package `\u003Cclaudna-root>` resolved from the loaded skill per [`..\u002F_shared\u002Fclaudna-root.md`](..\u002F_shared\u002Fclaudna-root.md). Do not replace a missing native session ID with a standalone operation ID. A maintainer who is explicitly operating outside all native Claude, Codex, and Cursor workflows must run the separate standalone operation contract (`session_store operation-dir --label legacy-cleanup --create`) as its own operation; this skill's manifest and source-deletion workflow do not perform that operation.\n\nFor each path in the manifest, `cp -r` (or `cp` for files) into a mirror structure under `$BACKUP_DIR`. Preserve the original path structure so restoration is `cp -r` back.\n\nIf any backup copy fails or the copied count does not match the manifest, stop before Step 10. Keep the partial backup for review; do not remove source files or silently reuse this run path.\n\nPrint:\n> Backed up N items to R\u002Fbackups\u002Flegacy-install\u002F\u003Crun>\u002F\n\n### Step 10: Execute\n\nRemove each item in the manifest:\n\n- Skills: `rm -rf ~\u002F.claude\u002Fskills\u002F\u003Cname>` (skill dirs are subdirectories)\n- Agents: `rm ~\u002F.claude\u002Fagents\u002F\u003Cname>.md`\n- Hooks: `rm ~\u002F.claude\u002Fhooks\u002F\u003Cname>.sh`\n- Commands: `rm ~\u002F.claude\u002Fcommands\u002F\u003Cname>.md`\n- Breadcrumbs: `rm ~\u002F.claude\u002F.clauDNA-repo` etc.\n- Docs: `rm ~\u002F.claude\u002Fdocs\u002FSETUP_GUIDE.md` etc.\n\nAfter removing all items, prune now-empty parent directories:\n\n```bash\nrmdir ~\u002F.claude\u002Fskills ~\u002F.claude\u002Fhooks ~\u002F.claude\u002Fagents ~\u002F.claude\u002Fcommands ~\u002F.claude\u002Fdocs 2>\u002Fdev\u002Fnull\n```\n\n(`rmdir` only succeeds if the directory is empty — don't add `-rf`.)\n\n### Step 11: Print Next Steps\n\n```\nCleanup complete.\n═══════════════════════════════════════════════════════════════\n  Removed:  N files\u002Fdirectories\n  Backup:   R\u002Fbackups\u002Flegacy-install\u002F\u003Crun>\u002F\n  \nRestore any file with:\n  cp -r \"$BACKUP_DIR\u002F\u003Cpath>\" \"$HOME\u002F.claude\u002F\u003Cpath>\"\n\nNext:\n  - Run \u002Freload-plugins (or restart Claude Code) to pick up the cleanup.\n  - Invoke any claudna skill as \u002Fclaudna:\u003Cskill-name> to verify the plugin is the only source.\n═══════════════════════════════════════════════════════════════\n```\n\n## Safety Notes\n\n- **Never run without an installed plugin.** Step 2 enforces this. Without the plugin, the discovery step has no manifest to work from.\n- **Never auto-resolve customized files.** Step 6 requires per-file confirmation for anything that differs from the plugin's version.\n- **Always back up before removing.** Step 9 is mandatory.\n- **Keep existing backups read-only.** Existing `~\u002F.local\u002Fshare\u002FclauDNA\u002Fbackups\u002Fcleanup-legacy-install-\u003Ctimestamp>\u002F` directories are not migrated or removed. To restore an item from an old backup, copy its mirrored path back, for example `cp -r \"$HOME\u002F.local\u002Fshare\u002FclauDNA\u002Fbackups\u002Fcleanup-legacy-install-\u003Ctimestamp>\u002Fskills\u002F\u003Cname>\" \"$HOME\u002F.claude\u002Fskills\u002F\u003Cname>\"`. From a new backup, restore using the same relative path beneath `$BACKUP_DIR`; restoration is an explicit operator action.\n- **Never overwrite a run backup.** If the new backup path already exists, stop and retain it. Do not use a timestamp, PID, cwd, or fabricated session as a fallback identity.\n- **Never modify `permissions.allow` entries in settings.json.** Old `Bash(...)` patterns added by install.sh are additive and still useful in the plugin world. Leaving them alone is correct.\n- **Use Read + Edit for settings.json edits.** Never `>` overwrite — that races with concurrent Claude sessions writing to the same file.\n",{"name":5,"hosts":43,"description":7,"allowed-tools":45,"user-invocable":46,"disable-model-invocation":46},[44],"claude-code","Read(*), Bash(ls *), Bash(cat *), Bash(diff *), Bash(cp *), Bash(rm -rf ~\u002F.claude\u002F*), Bash(rm ~\u002F.claude\u002F*), Bash(rmdir *), Bash(mkdir *), Bash(date *), Bash(find *), Bash(test *)",true,"main","17096951d140527accf05a94d7269b77e64a9197","skills\u002Fcleanup-legacy-install",1,"https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA","https:\u002F\u002Fgithub.com\u002FClaudfather","https:\u002F\u002Fcrog.gg","Rise of the machines","2026-11-15 02:10:52",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":46},[58,61,64],{"tool":59,"command":60},"npx","npx skills add Claudfather\u002FclauDNA --skill cleanup-legacy-install",{"tool":62,"command":63},"bunx","bunx skills add Claudfather\u002FclauDNA --skill cleanup-legacy-install",{"tool":65,"command":66},"pnpm","pnpm dlx skills add Claudfather\u002FclauDNA --skill cleanup-legacy-install","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Fskills\u002Fcleanup-legacy-install\u002FSKILL.md",[],[70,92,102,126,151,167],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":38},"01M71T1STJ99BE1C0JYHCQW0XN","example-review","Use when you want to review pull requests with detailed, actionable feedback on code quality, correctness, and maintainability.","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid-package\u002FSKILL.md",[],[77,78,79,80,81,82,27,83,28,84,29,31,85,86,35,87,88,89,90,91],"review","example","example review","actionable","pull requests","with","correctness","you","gh","gh pr","view","pr","code quality","feedback","pull",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":38},"01M71T1RMCD30MAJC954JC7580","bad-skill","Too short","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ffailing-package\u002FSKILL.md",[],[99,100,101],"bad","bad skill","short",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":38},"01M71T1NS97NJ2MQ993V7FBES7","worktree","Use when starting feature work that needs isolation from the current workspace, or when running multiple Claude sessions in parallel on different branches — creates and manages git worktrees. For fetching latest main into every existing worktree and branch across your sibling repos, use \u002Fclaudna:sync-branches instead.","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Fskills\u002Fworktree\u002FSKILL.md",[],[104,109,110,111,112,113,114,115,116,117,118,119,29,120,47,121,122,123,124,125],"sync","repos","git","isolation","running","sessions","worktrees","work","across","needs","git worktrees","claude sessions","branches","branch","parallel","for","feature",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":38},"01M71T1HNVG1CZY8P904P6RB7P","weigh-development-paths","Use when at a development junction with multiple viable approaches — architecture choices, refactoring strategies, where to put new code, or which pattern to follow. Triggers on 'which approach', 'how should I', 'Option A vs B', or any point where the next step isn't obvious and the wrong choice creates rework.","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Fskills\u002Fweigh-development-paths\u002FSKILL.md",[],[133,134,135,136,137,138,139,140,141,142,143,144,145,27,29,146,147,148,149,150],"development","weigh development paths","paths","next step","path","refactoring","choice","pattern","at","how","next","strategies","architecture","auto","new","junction","option","which",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":38},"01M71T1ECV1T5E168GH70AY5B3","verify-completion","Use when about to claim work is complete, fixed, or passing -- requires running verification commands and confirming output before making any success claims.","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Fskills\u002Fverify-completion\u002FSKILL.md",[],[158,159,160,161,113,32,162,163,116,164,165,166,29,31],"verify completion","verify","claim","complete","commands","about","verification","claims","output",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":38},"01M71T1BC1HA7XQH0Q1H574FYS","vercel","Use for Vercel operations — deploy to production or preview (or roll back), view, filter, or debug deployment logs, or check project status (deployments, domains, env vars, config). Replaces \u002Fvercel-deploy, \u002Fvercel-logs, \u002Fvercel-status.","https:\u002F\u002Fgithub.com\u002FClaudfather\u002FclauDNA\u002Fblob\u002Fmain\u002Fskills\u002Fvercel\u002FSKILL.md",[],[169,174,175,176,177,178,179,180,181,31,182,32,183,184,185,186,124,87,187,188],"inspection","check","filter","env","logs","preview","debug deployment","debug","deployments","domains","deployment","env vars","project","project status","back"]