# Implementation Plan: REQ-015 — Branding Renames

## Domain Research

- Problem type: pure refactoring (rename files, update references)
- Approaches evaluated: single-pass rename vs incremental rename. Incremental is safer -- tests pass after each step.
- Recommended approach: three independent rename tracks executed sequentially, each with tests first (TDD).
- Libraries/tools: none new. Standard file renames + search-and-replace.
- Known pitfalls:
  - `uninstall.py` imports `IEVO_LINE` from `ievo.commands.init` -- must update import path.
  - `agent.py` has default `skills: ["evo"]` -- must update to `["ievo"]`.
  - `conftest.py` test fixture references `"evo"` as skill name -- must update.
  - `registry.yaml` has skill entry for `evo` -- must update.
  - Godfather symlink `.claude/skills/evo` must be recreated as `ievo` (manual step, outside CLI codebase).

## Architecture Assessment

- Fits existing architecture: yes (pure rename, no new patterns)
- New patterns introduced: none
- Modules affected: `commands/init.py`, `commands/init_templates.py`, `commands/uninstall.py`, `cli.py`, `core/agent.py`, `marketplace/skills/evo/`, `marketplace/agents/debugger.md`, `marketplace/skills/extract-best-practices/SKILL.md`, `marketplace/registry.yaml`
- Risk level: low
- Estimated complexity: M (many files touched, but each change is mechanical)

## Pre-conditions

- [x] REQ-000 implemented
- [x] Git workflow confirmed (trunk-based, `feat/REQ-015-branding-renames`)

## Sub-tasks

### TASK-015-1: Rename skill `evo` to `ievo`

Scope: rename the bundled skill directory, update SKILL.md frontmatter, update all references in marketplace agents/skills/registry, update `core/agent.py` defaults, update test fixtures and test assertions.

Tests: ~8 (update existing tests in `test_marketplace.py`, `test_init.py`, `test_uninstall.py`, `test_agent.py`, `conftest.py`)

Files:
- `src/ievo/marketplace/skills/evo/` -> `src/ievo/marketplace/skills/ievo/` (rename directory)
- `src/ievo/marketplace/skills/ievo/SKILL.md` (update frontmatter `name: ievo`, body `/ievo`)
- `src/ievo/marketplace/agents/debugger.md` (frontmatter `skills: - ievo`, body `/ievo`)
- `src/ievo/marketplace/skills/extract-best-practices/SKILL.md` (body `/ievo`)
- `src/ievo/marketplace/registry.yaml` (skill name + file path)
- `src/ievo/core/agent.py` (default `skills: ["ievo"]`, line 66 and line 98)
- `tests/test_marketplace.py` (update `"evo"` -> `"ievo"` in skill parametrize, skill path test)
- `tests/test_init.py` (update `test_init_deploys_evo_skill`, `test_init_skill_content_verbatim`, `test_init_skills_idempotent_evo`)
- `tests/test_uninstall.py` (update all `"evo"` skill path references)
- `tests/test_agent.py` (update default skills assertions)
- `tests/conftest.py` (update `"evo"` in fixture)

### TASK-015-2: Rename command `init` to `install`

Scope: rename `init.py` -> `install.py`, rename function `init()` -> `install()`, remove deprecation wrapper, update `cli.py` imports and registration, update `uninstall.py` import of `IEVO_LINE`, rename test file `test_init.py` -> `test_install.py`, update `test_cli_app.py`.

Tests: ~6 (rename and update existing tests, add no-deprecation assertion, update cli app test)

Files:
- `src/ievo/commands/init.py` -> `src/ievo/commands/install.py` (rename file)
- In `install.py`: function `init()` -> `install()`, remove `deprecated_command()` call, update docstring and help text
- `src/ievo/cli.py` (import `install` instead of `init`, register `"install"` command, update `main()` callback)
- `src/ievo/commands/uninstall.py` (update `from ievo.commands.init import IEVO_LINE` -> `from ievo.commands.install import IEVO_LINE`)
- `tests/test_init.py` -> `tests/test_install.py` (rename file, update all imports and references)
- `tests/test_cli_app.py` (update `"init"` -> `"install"` in expected commands, update mock paths)

### TASK-015-3: Add `contextPaths` to `CLAUDE_SETTINGS_LOCAL_JSON`

Scope: update the template constant, update template test, update init/install integration test assertion.

Tests: ~2 (update existing `test_install_creates_settings_local`, add `contextPaths` assertion to `test_templates.py`)

Files:
- `src/ievo/commands/init_templates.py` (add `"contextPaths"` to JSON template)
- `tests/test_install.py` (update `test_install_creates_settings_local` to assert `contextPaths`)

## Micro-Steps

### Step 1: Rename skill directory `evo` -> `ievo` and update SKILL.md

- Tests to write FIRST: update `test_bundled_skill_path_exists` to use `"ievo"`, update `test_every_skill_has_bundled_file` parametrize from `"evo"` to `"ievo"`, update `test_init_deploys_evo_skill` -> `test_init_deploys_ievo_skill` (name change + path assertions for `"ievo"`), update `test_init_skill_content_verbatim` and `test_init_skills_idempotent_evo` -> `test_init_skills_idempotent_ievo`.
- Criteria covered: AC-1 (skill directory renamed), AC-9 (deploy as `ievo` not `evo`)
- Files:
  - `git mv src/ievo/marketplace/skills/evo src/ievo/marketplace/skills/ievo`
  - Edit `src/ievo/marketplace/skills/ievo/SKILL.md`: `name: evo` -> `name: ievo`, `/evo` -> `/ievo` in body
  - Edit `tests/test_marketplace.py`: `"evo"` -> `"ievo"` in skill references
  - Edit `tests/test_init.py`: rename test functions and update `"evo"` -> `"ievo"` in skill paths
- Commit: `REQ-015: step 1 - rename skill evo to ievo`

### Step 2: Update skill references in marketplace agents, registry, and core

- Tests to write FIRST: update `tests/test_agent.py` to expect `skills: ["ievo"]` as default, update `tests/conftest.py` fixture to use `"ievo"`.
- Criteria covered: AC-2 (debugger.md updated), AC-3 (extract-best-practices updated)
- Files:
  - Edit `src/ievo/marketplace/agents/debugger.md`: frontmatter `- evo` -> `- ievo`, body `/evo` -> `/ievo`
  - Edit `src/ievo/marketplace/skills/extract-best-practices/SKILL.md`: `/evo` -> `/ievo`
  - Edit `src/ievo/marketplace/registry.yaml`: skill name `evo` -> `ievo`, file path `skills/evo/SKILL.md` -> `skills/ievo/SKILL.md`
  - Edit `src/ievo/core/agent.py`: default `["evo"]` -> `["ievo"]` (lines 66 and 98)
  - Edit `tests/conftest.py`: `"evo"` -> `"ievo"` in fixture
  - Edit `tests/test_agent.py`: update default skills assertions
- Commit: `REQ-015: step 2 - update evo references to ievo in marketplace and core`

### Step 3: Update uninstall tests for `ievo` skill name

- Tests to write FIRST: update all `"evo"` skill path references in `tests/test_uninstall.py` to `"ievo"`.
- Criteria covered: AC-9 (deploy as `ievo` not `evo` -- uninstall side)
- Files:
  - Edit `tests/test_uninstall.py`: all `"evo"` -> `"ievo"` in skill path strings (approximately 15 occurrences)
- Commit: `REQ-015: step 3 - update uninstall tests for ievo skill name`

### Step 4: Rename `init.py` to `install.py` and update function

- Tests to write FIRST: rename `tests/test_init.py` -> `tests/test_install.py`, update all imports from `ievo.commands.init` -> `ievo.commands.install`, rename function references `init(` -> `install(`, rename test functions `test_init_*` -> `test_install_*`, add `test_install_shows_no_deprecation_warning` (assert `warn` is NOT called), remove old `test_init_shows_deprecation_warning`.
- Criteria covered: AC-4 (install command works), AC-5 (init command gone), AC-10 (test file renamed)
- Files:
  - `git mv src/ievo/commands/init.py src/ievo/commands/install.py`
  - Edit `src/ievo/commands/install.py`:
    - Module docstring: `"""ievo install — set up iEvo in a project."""`
    - Function `init(` -> `install(`
    - Remove `deprecated_command()` call and its import
    - Docstring: `"""Set up iEvo in the current project."""` (no `[DEPRECATED]`)
  - `git mv tests/test_init.py tests/test_install.py`
  - Edit `tests/test_install.py`:
    - All `from ievo.commands.init import` -> `from ievo.commands.install import`
    - All `init(name=` -> `install(name=`
    - All `patch("ievo.commands.init.` -> `patch("ievo.commands.install.`
    - Test function names `test_init_*` -> `test_install_*`
    - Replace `test_init_shows_deprecation_warning` with `test_install_shows_no_deprecation_warning` that asserts `warn` is NOT called
- Commit: `REQ-015: step 4 - rename init command to install`

### Step 5: Update cli.py imports and registration

- Tests to write FIRST: update `tests/test_cli_app.py`:
  - `test_app_has_commands`: replace `"init"` with `"install"` in expected set
  - `test_main_with_subcommand`: change `ctx.invoked_subcommand = "init"` -> `"install"`
  - `test_main_no_project_confirms_then_inits`: update mock path `"ievo.commands.init.init"` -> `"ievo.commands.install.install"`, and assertion `mock_init` -> `mock_install`
  - `test_main_no_project_user_declines_exits`: same mock path update
  - `test_auto_init_creates_project`: update `patch("ievo.commands.init.ensure_home"` -> `patch("ievo.commands.install.ensure_home"`
- Criteria covered: AC-5 (init not registered), AC-6 (cli.py imports updated), AC-11 (test_cli_app.py updated)
- Files:
  - Edit `src/ievo/cli.py`:
    - Import: `init,` -> `install,` in the `from ievo.commands import` block
    - Command registration: `app.command(name="init", ...)(init.init)` -> `app.command(name="install", help="Set up iEvo in the current project.")(install.install)` -- move from deprecated section to active section
    - `main()` callback: `init.init(name=".")` -> `install.install(name=".")`
  - Edit `tests/test_cli_app.py`: as described above
- Commit: `REQ-015: step 5 - update cli.py to use install command`

### Step 6: Update uninstall.py import path

- Tests to write FIRST: verify `tests/test_uninstall.py` still passes (no new tests needed -- the import path change is covered by existing uninstall tests that use `IEVO_LINE`).
- Criteria covered: AC-6 (all imports updated)
- Files:
  - Edit `src/ievo/commands/uninstall.py`: `from ievo.commands.init import IEVO_LINE` -> `from ievo.commands.install import IEVO_LINE`
- Commit: `REQ-015: step 6 - update uninstall import path to install`

### Step 7: Add `contextPaths` to `CLAUDE_SETTINGS_LOCAL_JSON` template

- Tests to write FIRST: update `tests/test_install.py::test_install_creates_settings_local` to also assert `"contextPaths" in data` and `data["contextPaths"] == [".ievo/iEVO.md"]`. Optionally add a dedicated test in `tests/test_templates.py` for the template constant.
- Criteria covered: AC-7 (template includes contextPaths), AC-8 (deployed settings has contextPaths)
- Files:
  - Edit `src/ievo/commands/init_templates.py`: add `"contextPaths"` to JSON (after `hooks` block, before closing `}`)
  - Edit `tests/test_install.py`: update settings assertion
- Commit: `REQ-015: step 7 - add contextPaths to settings.local.json template`

### Step 8: Recreate godfather symlink + run full test suite

- Tests to write: none (manual godfather-level step + full suite run)
- Criteria covered: AC-12 (full test coverage passes)
- Actions:
  - In godfather repo: `rm .claude/skills/evo && ln -s ../../repos/cli/src/ievo/marketplace/skills/ievo .claude/skills/ievo`
  - Run `uv run pytest --cov --cov-fail-under=100` in CLI repo -- must pass
  - Run pre-commit on all changed files
- Commit: `REQ-015: step 8 - recreate godfather symlink and verify coverage`

## Traceability

| Acceptance Criterion | Covered in Step |
|---------------------|-----------------|
| AC-1: Skill directory renamed | Step 1 |
| AC-2: debugger.md references updated | Step 2 |
| AC-3: extract-best-practices references updated | Step 2 |
| AC-4: `ievo install` works | Step 4 |
| AC-5: `ievo init` not registered | Step 5 |
| AC-6: cli.py imports and callback updated | Steps 5, 6 |
| AC-7: settings.local.json template includes contextPaths | Step 7 |
| AC-8: deployed settings has contextPaths | Step 7 |
| AC-9: skill deployed as `ievo` not `evo` | Steps 1, 3 |
| AC-10: test file renamed | Step 4 |
| AC-11: test_cli_app.py updated | Step 5 |
| AC-12: test coverage passes | Step 8 |

## Scope Guard

- Considered but excluded:
  - Updating `uninstall.py` to clean `contextPaths` during uninstall (separate concern -- uninstall currently only removes `hooks.PreCompact`, and adding cleanup for `contextPaths` is a behavior change, not a rename)
  - Updating the `#evo-log` CSS id and `RichLog(id="evo-log")` in `tui/app.py` -- these are internal TUI widget IDs, not user-facing branding. The "evo" in `#evo-log` refers to "evolution" (the tab name), not the skill name.
  - Updating `on_error: "evo_analyze"` in agent hooks -- this is the hook action name for the evolution analyzer, not the skill name
  - Updating `tests/test_learn.py` references to "evo log" -- these refer to `EVOLUTION_LOG.md`, not the skill

## Architecture Notes for Coder

- **File renames must use `git mv`** to preserve history.
- **Do NOT use blanket search-replace for `evo`** -- the word appears in "evolution", `#evo-log` (CSS), `evo_analyze` (hook), and `EVOLUTION_LOG`. Only replace references to the **skill name** (`/evo`, `skills: [evo]`, `skills/evo/`, `name: evo`).
- **The `install` command does the same thing `init` did**, minus the deprecation warning. No logic changes.
- **Move `install` registration to the "Active commands" section** in `cli.py` -- it is no longer deprecated.
- **`init_templates.py` keeps its filename** -- it contains templates used by the install command. Renaming it to `install_templates.py` is out of scope (would touch more imports for no user-facing benefit). Update only its module docstring.
- **`uninstall.py` imports `IEVO_LINE` from the renamed module** -- this is a hard dependency that will break if not updated in Step 6.
- **`conftest.py` and `test_agent.py`** reference `"evo"` as the default skill name in AgentPackage -- these are part of the legacy agent format and must be updated to `"ievo"`.
