---
name: configure-ecc
description: Install, update, or set up ECC in Claude Code, Codex, or Kimi. Use only the plugin, scope, and hook features that each tool supports.
metadata:
  origin: ECC
---

# Set Up Everything Claude Code

Run the setup flow inside the current tool.

First, check what is already installed. Ask only for choices that the tool supports. Show a preview. Ask for approval one time. Then apply the same plan without prompts and check the result.

Show the welcome message only after all checks pass.

Do not clone ECC into a temp folder. Do not copy plugin files by hand.

When a person runs setup in their own terminal, the main commands are:

```bash
ecc setup
npx ecc-universal setup
```

Do not use these prompt-based commands inside a tool shell. Tool shells often have no TTY. Use the full commands below instead.

## Find the Current Tool

Use the right path for the current tool:

- Claude Code: Use the full scope and hook setup flow.
- Codex: Use the Codex plugin system. Do not offer Claude scopes or Claude hook modes.
- Kimi: Install project files in `./.kimi-code`. Kimi does not support the ECC Claude hook modes.
- Unknown tool: Show how you tried to detect it. Ask which tool to set up before you run any command that makes changes.

This skill is for setup after the tool is installed. It does not replace a provider's first-install screen.

Do not mix commands from two tools in one setup run.

## Claude Code

### 1. Check the Current State

Run both commands before making changes:

```bash
claude plugin list --json
claude plugin marketplace list --json
```

Report:

- Where ECC is installed
- Whether ECC is on
- Which marketplace provides ECC
- Whether exactly one `ecc@ecc` entry exists

If exactly one valid `ecc@ecc` entry exists, treat this as a new setup of its options.

Do not use the Claude-owned "Open home page" control as proof that ECC is installed.

Stop if setup reports any of these cases:

- ECC exists in more than one scope
- ECC was copied by hand
- An old install method is present
- The config is not valid
- Two marketplaces claim the same plugin
- The current state cannot be read

Show the repair steps returned by ECC. Do not guess which files or entries to remove.

### 2. Ask for Two Choices

Ask for the install scope one time. The user must choose one value:

- `user`: Use ECC in all projects for this user.
- `project`: Share ECC through this repo's settings.
- `local`: Use ECC only in this project. Keep the setting private.

Show only the chosen scope as selected.

If ECC is already in one scope and the user picks another scope, say that setup will move ECC. Add `--move-scope` to both the preview and apply commands.

Next, ask for the hook mode one time. The user must choose one value:

- `off`: Keep ECC skills and commands. Turn off ECC hook tasks.
- `minimal`: Use only the lightest life-cycle and safety tasks.
- `standard`: Use a normal mix of quality and safety checks.
- `strict`: Use the strongest checks and reminders.

Hook mode is stored in the user's Claude plugin settings. It does not move with the install scope.

Do not choose a value for the user unless they already gave it in the current request.

### 3. Preview the Plan

Use the setup script inside the installed plugin when `CLAUDE_PLUGIN_ROOT` is set:

```bash
node "$CLAUDE_PLUGIN_ROOT/scripts/setup.js" --mode claude-plugin \
  --scope <scope> --hooks <hooks> [--move-scope] --dry-run --json
```

If `CLAUDE_PLUGIN_ROOT` is not set, use the public npm package:

```bash
npx --yes --package ecc-universal ecc setup --mode claude-plugin \
  --scope <scope> --hooks <hooks> [--move-scope] --dry-run --json
```

Replace `<scope>` and `<hooks>` with the exact choices. Include `--move-scope` only for a scope move.

If the preview fails, stop. Show the error and safe repair steps. Do not apply a partial plan.

Show one approval summary. It must list:

- The planned actions
- The one chosen scope
- The one chosen hook mode
- Any marketplace change
- The old and new scopes, if ECC will move

Ask one yes-or-no question. Do not ask again unless the plan changes.

If the user says no, stop without making changes. Do not show the welcome message.

### 4. Apply the Approved Plan

After approval, run the same command without `--dry-run`. Keep every choice clear.

Preferred command:

```bash
node "$CLAUDE_PLUGIN_ROOT/scripts/setup.js" --mode claude-plugin \
  --scope <scope> --hooks <hooks> [--move-scope] --yes --json
```

Fallback command:

```bash
npx --yes --package ecc-universal ecc setup --mode claude-plugin \
  --scope <scope> --hooks <hooks> [--move-scope] --yes --json
```

Do not switch from the plugin script to npm after approval unless the first path is no longer present. If the path changes, explain why before running the fallback.

Treat setup as successful only when:

- The exit code is `0`
- The JSON can be read
- The returned `scope` matches the chosen scope
- The returned `hooks` value matches the chosen hook mode

### 5. Check the Install

Run this as a separate check:

```bash
claude plugin list --json
```

Continue only if exactly one active `ecc@ecc` entry exists in the chosen scope.

Stop if the result is missing, has more than one entry, uses the wrong scope, or cannot be checked. Report the error and repair steps. Do not show the welcome message.

### 6. Show the Welcome Message

Show the welcome message only once.

When `CLAUDE_PLUGIN_ROOT` is set, use the `action` from the successful setup result. Allowed actions are:

- `installed`
- `updated`
- `migrated`
- `resumed`
- `already-migrated`

Before running the welcome code, check that the provider's version matches `ECC_VERSION_PATTERN` from:

```text
scripts/lib/terminal-welcome.js
```

Reject a bad or unknown version. Never place an unchecked value into a shell command.

After all checks pass, run:

```bash
node -e 'const { renderTerminalWelcome } = require(process.env.CLAUDE_PLUGIN_ROOT + "/scripts/lib/terminal-welcome"); process.stdout.write(renderTerminalWelcome({ action: process.argv[1], version: process.argv[2], color: process.stdout.isTTY }));' "<action>" "<installed-version>"
```

Do not show the welcome message after:

- A failed command
- A preview
- A canceled plan
- A scope or hook mismatch
- A result that cannot be checked
- A bad action or version value

After success, tell the user to run `/reload-plugins` or restart Claude Code.

## Codex

Use the Codex plugin system.

First, check the marketplace and available plugins:

```bash
codex plugin marketplace list --json
codex plugin list --available --json
```

Codex does not use Claude's `user`, `project`, or `local` choices. Do not ask for them.

Do not ask for Claude's `off`, `minimal`, `standard`, or `strict` hook modes. Codex has its own provider hooks and trust screen. Let Codex show that trust choice. Never claim that a Claude hook mode was set in Codex.

If the ECC marketplace is missing, plan to add it:

```bash
codex plugin marketplace add affaan-m/ECC
```

If the marketplace exists, plan to update its saved copy:

```bash
codex plugin marketplace upgrade ecc --json
```

Show one summary. Say whether setup will add or update the marketplace and install or update ECC. Ask for approval one time.

After approval, run only the needed marketplace command. Then run:

```bash
codex plugin add ecc@ecc --json
codex plugin list --json
```

Do not show the welcome message unless the final JSON says ECC is installed and gives an absolute `installedPath`.

Reject `installedPath` if it:

- Is not absolute
- Has control chars
- Does not point to the checked ECC bundle

Check the version with `ECC_VERSION_PATTERN`.

Run Node with a program path and a separate argument list:

```text
program: node
arguments:
[
  "<installedPath>/scripts/welcome.js",
  "--action",
  "configured",
  "--version",
  "<installed-version>"
]
```

Do not build a shell command from JSON values.

If the current tool cannot pass a program and argument list as separate values, skip the welcome message. Explain that setup passed but the welcome screen was skipped for safety.

## Kimi

Before approval, explain these facts:

- ECC will install project files in `./.kimi-code`.
- Claude hook modes are not supported.
- The result will use `hooks=unsupported`.

Do not ask for Claude scope or hook choices.

Preview the install:

```bash
npx --yes --package ecc-universal ecc install --profile core --target kimi --dry-run
```

If the preview fails, stop and show the error. Do not apply the install.

Show one summary of the files and changes under `./.kimi-code`. Ask for approval one time.

After approval, run the same command without `--dry-run`:

```bash
npx --yes --package ecc-universal ecc install --profile core --target kimi
```

Check the result:

```bash
npx --yes --package ecc-universal ecc doctor --target kimi
```

Continue only if doctor passes and all installed instructions and skills stay inside `./.kimi-code`.

Then show the welcome message:

```bash
npx --yes --package ecc-universal ecc welcome --action configured
```

Never say that Kimi installed or set up ECC life-cycle hooks.

## Example

A Claude Code user already has ECC in `user` scope. They choose `project` scope and `standard` hooks.

Preview:

```bash
node "$CLAUDE_PLUGIN_ROOT/scripts/setup.js" --mode claude-plugin \
  --scope project --hooks standard --move-scope --dry-run --json
```

Show this one summary:

```text
ECC will move from user scope to project scope.
Hook mode: standard
Marketplace action: no change
No changes have been made yet.
Apply this plan? yes/no
```

If the user says yes, apply the same plan:

```bash
node "$CLAUDE_PLUGIN_ROOT/scripts/setup.js" --mode claude-plugin \
  --scope project --hooks standard --move-scope --yes --json
```

Then check that the command passed, the JSON says `scope=project` and `hooks=standard`, and exactly one active `ecc@ecc` entry exists in project scope. Show the welcome message only after those checks pass.