Receber por email
← Voltar para o catálogo

brain-uninstall

Use when users want to remove or disconnect the mybrain plugin's persistent memory layer. Handles teardown for all database strategies (Docker, local PostgreSQL, remote PostgreSQL), config file removal, and offers a disconnect-only option that preserves the database.

23estrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: Apache-2.0

Como adicionar

/plugin marketplace add robertsfeir/atelier-pipeline

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/brain-uninstall/svg)](https://www.skillteca.com.br/skills/brain-uninstall)

Skills relacionadas

Ver todas de Dados e Análise →

Alerta por categoria

Receba novas skills de Dados e Análise toda segunda

1 email curto, só com as skills novas de Dados e Análise. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Brain Plugin -- Uninstall

This skill guides the user through removing or disconnecting the brain plugin's persistent memory layer. Per ADR-0055, the brain ships as a standalone mybrain plugin (separate from atelier-pipeline). This skill targets the brain config and database — it does NOT uninstall the mybrain plugin itself (use claude plugin uninstall mybrain for that). Run this conversationally -- ask questions one at a time, not as a list. Present what will be removed BEFORE doing anything destructive.

<contract> <requires>

  • At least one brain config file exists: .claude/brain-config.json (shared) or ${CLAUDE_PLUGIN_DATA}/brain-config.json (personal).
  • Explicit user "yes" confirmation before any destructive action (config removal, container/volume removal, database drop, table drop).
  • For full-uninstall paths: matching tooling reachable for the chosen strategy (docker for Docker, pg_isready + dropdb for local, psql with credentials for remote).

</requires> <produces>

  • Removal of .claude/brain-config.json and/or ${CLAUDE_PLUGIN_DATA}/brain-config.json.
  • Optionally (Path B, per user choice): stopped/removed Docker container brain-db, deleted brain-data volume, dropped local database, or dropped public schema on remote.

</produces> <invalidates>

  • brain-hydrate <requires>: brain is no longer reachable / brain_enabled no longer true after disconnect.
  • Pre-approved brain MCP tools in permissions.allow remain in settings.json but are inert until a new brain is configured (not removed by this skill).

</invalidates> </contract>

<protocol id="config-detection">

Detection: Locate Config

Before asking anything, find the brain config file:

  1. Check if .claude/brain-config.json exists in the project root (shared config).
  2. Check if ${CLAUDE_PLUGIN_DATA}/brain-config.json exists (personal config).
  3. If both exist, note both. The shared config is the project-level config; the personal config is the user's local override.
  4. If neither exists, stop:
No brain configuration found. There is nothing to uninstall.
If a brain was set up but the config was already removed, the database
may still exist. Use your database tools directly to clean it up.
  1. If a config file is found, read it to determine:
  2. Database strategy: Infer from the database_url field:
  3. Contains localhost with port 5432 and user atelier -- likely Docker
  4. Contains localhost -- likely Local PostgreSQL
  5. Contains a remote host -- Remote PostgreSQL
  6. Config type: personal (${CLAUDE_PLUGIN_DATA}) or shared (.claude/)
  7. Scope: from the scope field
  8. Brain name: from the brain_name field (if present)

</protocol>

<procedure id="uninstall">

Uninstall Procedure

Step 1: Present Current Setup

Display what the brain setup looks like based on the config file:

Brain Uninstall -- Current Setup
================================

Config type:     [personal | shared]
Config location: [file path]
Database:        [Docker | Local PostgreSQL | Remote PostgreSQL]
Database URL:    [URL with password masked as ****]
Scope:           [scope path]
Brain name:      [name, or "Brain" if not set]

Step 2: Offer Uninstall Options

Ask the user which level of removal they want:

How would you like to proceed?
1. Disconnect only -- Remove the config file but leave the database untouched. The brain data stays intact and can be reconnected later.
2. Full uninstall -- Remove the config file AND clean up the database. Brain data will be permanently deleted.

Wait for the user's answer before proceeding.

Path A -- Disconnect Only

This path removes the config file without touching the database.

A1: Present Removal Plan

Disconnect Plan
===============

WILL REMOVE:
  [config file path]    -- brain configuration file

WILL NOT TOUCH:
  Database at [masked URL]    -- data remains intact
  mybrain plugin              -- the plugin itself stays installed (use `claude plugin uninstall mybrain` to remove it)

If the config is shared (.claude/brain-config.json), add:

NOTE: This file is committed to git. You will need to commit the deletion.

A2: Get Confirmation

Remove the config file? The database will remain untouched and can be
reconnected by running brain-setup again. (yes/no)

Do not proceed without explicit "yes" from the user.

A3: Remove Config File

Delete the config file.

A4: Print Summary

Brain disconnected.

Removed: [config file path]
Database: untouched at [masked URL]

To reconnect later, run /brain-setup.

If shared config was removed:

The deletion of .claude/brain-config.json needs to be committed to git.

Path B -- Full Uninstall

This path removes both the config file and cleans up the database. The procedure varies by database strategy.

B1: Data Loss Warning

Before anything else, warn clearly:

WARNING: This will permanently delete all brain data.
This includes all captured thoughts, decisions, patterns, lessons, and
relations stored in the brain. This cannot be undone.
The brain currently contains data under scope: [scope path]

B2: Database Cleanup (varies by strategy)

Docker

Note: mybrain ships its own docker-compose.yml whose container and volume names may differ from the legacy bundled brain (brain-db / brain-data). Before running the commands below, inspect the mybrain compose file to confirm the actual names. The placeholders in this section reflect the legacy naming for users migrating from the bundled brain — substitute mybrain's actual container/volume names when applicable.
  1. Check if the Docker container is running. The mybrain plugin ships its own docker-compose.yml (see the mybrain plugin's installation directory — typically ${CLAUDE_PLUGIN_DATA}/mybrain/docker-compose.yml or wherever claude plugin show mybrain reports its files). Run:

`` docker compose -f <mybrain-compose-path> ps ``

  1. Present the Docker removal plan:

``` Docker Cleanup Plan ===================

WILL STOP AND REMOVE: Container: brain-db

WILL REMOVE (config): [config file path]

DOCKER VOLUME: brain-data -- contains all brain database files ```

  1. Ask about the Docker volume:

> The Docker volume brain-data contains the actual database files. > Would you like to: > 1. Delete the volume -- Permanently removes all data > 2. Keep the volume -- Stops the container but preserves data on disk

  1. Get explicit confirmation:

If user chose to delete the volume: > This will stop the container, remove it, and delete all data in the > brain-data volume. Proceed? (yes/no)

If user chose to keep the volume: > This will stop and remove the container but keep the data volume. > You can start a new container later that reattaches to this volume. > Proceed? (yes/no)

Do not proceed without explicit "yes" from the user.

  1. Execute:

`` docker compose -f <mybrain-compose-path> down ``

If user chose to delete the volume: `` docker volume rm brain-data ``

If the container is not running or Docker is not available, skip container removal and note it: > Container was not running (or Docker is unavailable). Skipping container > cleanup. Proceeding with config removal.

Local PostgreSQL

  1. Check if PostgreSQL is reachable by running pg_isready.
  1. Extract the database name from the database_url in the config.
  1. Ask the user:

> The brain database [database_name] exists on your local PostgreSQL. > Would you like to: > 1. Drop the database -- Permanently deletes the database and all its data > 2. Keep the database -- Remove config only, leave the database in place

  1. If user chose to drop:

Get explicit confirmation:

Compartilhar X LinkedIn