# Initial Multi Search Engine Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Replace the initial `web-operation` skill with SkillHub `multi-search-engine` while keeping `web_fetch` reliably available when the skill is selected.

**Architecture:** Initial skills are copied from the repository `skills/` directory into each instance workspace by `create-instance.sh` and `entrypoint.sh`. This change updates the seed catalog, not existing user workspace state.

**Tech Stack:** Python skill catalog storage, JSON seed metadata, Markdown `SKILL.md`, pytest.

---

### Task 1: Update Initial Skill Contract

**Files:**
- Modify: `app-instance/backend/tests/unit/test_initial_skill_tool_hints.py`

- [ ] **Step 1: Write the failing test**

Change `EXPECTED_INITIAL_SKILL_TOOLS` so it expects:

```python
"multi-search-engine": ["web_fetch"],
```

and no longer expects:

```python
"web-operation": ["web_fetch", "web_search"],
```

- [ ] **Step 2: Run test to verify it fails**

Run:

```bash
cd app-instance/backend
pytest tests/unit/test_initial_skill_tool_hints.py -q
```

Expected: FAIL because `skills/multi-search-engine/versions/v0001/SKILL.md` does not exist yet.

### Task 2: Replace Seed Skill

**Files:**
- Create: `skills/multi-search-engine/current.json`
- Create: `skills/multi-search-engine/skill.json`
- Create: `skills/multi-search-engine/versions/v0001/SKILL.md`
- Create: `skills/multi-search-engine/versions/v0001/version.json`
- Create: `skills/multi-search-engine/versions/v0001/CHANGELOG.md`
- Create: `skills/multi-search-engine/versions/v0001/CHANNELLOG.md`
- Create: `skills/multi-search-engine/versions/v0001/config.json`
- Create: `skills/multi-search-engine/versions/v0001/metadata.json`
- Create: `skills/multi-search-engine/versions/v0001/references/advanced-search.md`
- Create: `skills/multi-search-engine/versions/v0001/references/international-search.md`
- Modify: `skills/_index/published.json`

- [ ] **Step 1: Add SkillHub content**

Fetch `global/multi-search-engine@20260413.065325` from SkillHub and store it as seed version `v0001`.

- [ ] **Step 2: Add tool hint**

Ensure `SKILL.md` frontmatter contains:

```yaml
tools:
  - web_fetch
```

- [ ] **Step 3: Update published index**

Remove `web-operation` and add `multi-search-engine`.

### Task 3: Verify

**Files:**
- Test: `app-instance/backend/tests/unit/test_initial_skill_tool_hints.py`

- [ ] **Step 1: Run targeted tests**

Run:

```bash
cd app-instance/backend
pytest tests/unit/test_initial_skill_tool_hints.py tests/unit/test_marketplace_and_mcp.py -q
```

Expected: PASS.

- [ ] **Step 2: Inspect seed metadata**

Run:

```bash
python - <<'PY'
import json
from pathlib import Path
print(json.loads(Path('skills/_index/published.json').read_text())['items'])
print(json.loads(Path('skills/multi-search-engine/versions/v0001/version.json').read_text())['tool_hints'])
PY
```

Expected: `multi-search-engine` is published, `web-operation` is absent, and tool hints are `["web_fetch"]`.
