# Testing Suite — Uninstall Instructions

## Step 1: Interview the User

Ask what to remove:

1. **Processes and skills only** — Remove babysitter testing processes/skills/agents but keep all test frameworks, configs, lint rules, git hooks, and existing tests
2. **Everything including frameworks** — Remove processes, skills, agents, AND uninstall test frameworks, lint configs, git hooks, and CI/CD test stages
3. **Selective** — Let the user choose which components to remove

**Warning**: Removing test frameworks, lint rules, or git hooks may break existing tests, CI/CD, and quality enforcement. Confirm with the user.

## Step 2: Remove Processes, Skills, and Agents

```bash
rm -rf .a5c/processes/testing
rm -rf .a5c/skills/testing
rm -rf .a5c/agents/testing
```

## Step 3: Remove Git Hooks (if user chose "Everything")

### husky + lint-staged (TypeScript/JavaScript):

```bash
# Remove husky hooks
rm -rf .husky/

# Remove lint-staged config from package.json (the "lint-staged" key)
# Or remove .lintstagedrc if it exists as a separate file
rm -f .lintstagedrc .lintstagedrc.json .lintstagedrc.yml

# Remove commitlint (if installed)
rm -f .commitlintrc .commitlintrc.json

# Uninstall packages
npm uninstall husky lint-staged @commitlint/cli @commitlint/config-conventional
```

### pre-commit (Python):

```bash
pre-commit uninstall
pre-commit uninstall --hook-type pre-push
rm -f .pre-commit-config.yaml
pip uninstall pre-commit
```

### lefthook (Go):

```bash
lefthook uninstall
rm -f lefthook.yml
```

**Important**: Only remove git hooks that were installed by this plugin. If the project had pre-existing hooks, restore them from git history.

## Step 4: Remove Lint Configuration (if user chose "Everything")

Only remove lint configs that were created by this plugin — check git history to verify:

```bash
# TypeScript/JavaScript
rm -f eslint.config.mjs .eslintrc.cjs .eslintrc.json
rm -f .prettierrc .prettierrc.json .prettierignore
npm uninstall eslint @eslint/js typescript-eslint prettier eslint-config-prettier

# Python
rm -f ruff.toml pyproject.toml  # Only remove if created by this plugin
pip uninstall ruff

# Go
rm -f .golangci.yml
```

**Do not remove** lint configs that existed before the plugin was installed.

## Step 5: Remove CI/CD Test Pipeline (if user chose "Everything")

Only remove test-specific CI/CD workflows that were created by this plugin:

```bash
rm -f .github/workflows/test.yml
```

If the test stages were added to an existing workflow, remove only the test-related jobs — do not delete the entire workflow file. Also remove any lint-typecheck jobs that were added.

## Step 6: Uninstall Test Frameworks (if user chose "Everything")

```bash
# JavaScript/TypeScript
npm uninstall vitest @vitest/coverage-v8 @playwright/test @storybook/test @storybook/test-runner @storybook/addon-coverage

# Remove Storybook (if installed by this plugin)
# npx storybook@latest remove  # or manual removal

# Remove Playwright browsers
npx playwright uninstall
```

## Step 7: Remove Generated Config Files (if user chose "Everything")

Only remove files generated by this plugin — check git history:

```bash
# Only if generated during install
rm -f vitest.config.ts
rm -f playwright.config.ts
rm -rf .storybook/  # Only if created by this plugin
rm -rf e2e/         # Only if created by this plugin and no user tests exist
rm -rf test/        # Only if created by this plugin and no user tests exist
```

**Do not remove** user-written test files or pre-existing test configurations.

## Step 8: Remove from Registry

```bash
babysitter plugin:remove-from-registry --plugin-name testing-suite --project --json
```

## Notes

- Existing test files written by developers are never removed
- Coverage reports and test artifacts in `coverage/`, `playwright-report/`, etc. are not removed — clean them manually if desired
- If mutation testing was configured (Stryker), uninstall separately: `npm uninstall @stryker-mutator/core`
- If removing git hooks breaks your workflow, you can reinstall them independently: `npx husky init`
