Remove legacy asha/ nested repo installation files
Removes legacy asha/ nested repo installation files and migrates to plugin-based setup.
/plugin marketplace add pknull/asha-marketplace/plugin install asha@asha-marketplaceOptional: --dry-run (show what would be removed without removing)Removes files from the old nested-repo installation pattern.
Arguments: $ARGUMENTS
Legacy files from before Asha was a plugin:
asha/ directory (nested repo or submodule).claude/hooks/hooks.json (if contains asha references).claude/commands/*.md symlinks (if point to asha/).opencode/ directory (OpenCode support was dropped).gitmodules entry for asha (if was a submodule)DRY_RUN=false
[[ "$ARGUMENTS" == *"--dry-run"* ]] && DRY_RUN=true
echo "Scanning for legacy Asha files..."
# Check for asha/ directory
if [[ -d "${CLAUDE_PROJECT_DIR}/asha" ]]; then
echo "Found: asha/ directory"
fi
# Check for hooks.json with asha refs
if [[ -f "${CLAUDE_PROJECT_DIR}/.claude/hooks/hooks.json" ]]; then
if grep -q "asha/" "${CLAUDE_PROJECT_DIR}/.claude/hooks/hooks.json" 2>/dev/null; then
echo "Found: .claude/hooks/hooks.json (contains asha references)"
fi
fi
# Check for command symlinks pointing to asha/
for cmd in "${CLAUDE_PROJECT_DIR}/.claude/commands/"*.md; do
if [[ -L "$cmd" ]] && [[ "$(readlink "$cmd")" == *"asha/"* ]]; then
echo "Found: $cmd (symlink to asha/)"
fi
done
# Check for .opencode directory
if [[ -d "${CLAUDE_PROJECT_DIR}/.opencode" ]]; then
echo "Found: .opencode/ directory"
fi
# Check for .gitmodules with asha
if [[ -f "${CLAUDE_PROJECT_DIR}/.gitmodules" ]]; then
if grep -q "asha" "${CLAUDE_PROJECT_DIR}/.gitmodules" 2>/dev/null; then
echo "Found: .gitmodules contains asha entry"
fi
fi
If --dry-run, just show what would be removed and exit.
Otherwise:
# Remove asha/ directory
if [[ -d "${CLAUDE_PROJECT_DIR}/asha" ]]; then
rm -rf "${CLAUDE_PROJECT_DIR}/asha"
echo "Removed: asha/"
fi
# Remove hooks.json if it contains asha refs
if [[ -f "${CLAUDE_PROJECT_DIR}/.claude/hooks/hooks.json" ]]; then
if grep -q "asha/" "${CLAUDE_PROJECT_DIR}/.claude/hooks/hooks.json" 2>/dev/null; then
rm "${CLAUDE_PROJECT_DIR}/.claude/hooks/hooks.json"
echo "Removed: .claude/hooks/hooks.json"
fi
fi
# Remove command symlinks pointing to asha/
for cmd in "${CLAUDE_PROJECT_DIR}/.claude/commands/"*.md; do
if [[ -L "$cmd" ]] && [[ "$(readlink "$cmd")" == *"asha/"* ]]; then
rm "$cmd"
echo "Removed: $cmd"
fi
done
# Remove .opencode directory
if [[ -d "${CLAUDE_PROJECT_DIR}/.opencode" ]]; then
rm -rf "${CLAUDE_PROJECT_DIR}/.opencode"
echo "Removed: .opencode/"
fi
If .gitmodules contains asha entry:
if [[ -f "${CLAUDE_PROJECT_DIR}/.gitmodules" ]]; then
if grep -q "asha" "${CLAUDE_PROJECT_DIR}/.gitmodules" 2>/dev/null; then
echo ""
echo "WARNING: .gitmodules contains asha entry"
echo "Manual removal required:"
echo " git submodule deinit asha"
echo " git rm asha"
echo " rm -rf .git/modules/asha"
fi
fi
echo ""
echo "Cleanup complete!"
echo ""
echo "Next steps:"
echo " 1. Run /asha:init to set up plugin-based Asha"
echo " 2. Commit the cleanup: git add -A && git commit -m 'chore: migrate from nested asha to plugin'"
--dry-run first to see what will be removed