diff --git a/dist/setup-interns.skill b/dist/setup-interns.skill index 669855c..49d4fcf 100644 Binary files a/dist/setup-interns.skill and b/dist/setup-interns.skill differ diff --git a/skills/setup-interns/SKILL.md b/skills/setup-interns/SKILL.md index b935a0c..9c2401d 100644 --- a/skills/setup-interns/SKILL.md +++ b/skills/setup-interns/SKILL.md @@ -23,6 +23,7 @@ Reference: full design lives in this repo at `.wiki/concepts/interns-design.md` - Running `interns-mcp` itself — the Claude Code harness spawns it on session start. - Authoring new interns or editing `~/projects/.common/config/interns/config.yaml` — that's a content task, not a setup task. - Any other MCP server. +- Setting up the entire `common` monorepo beyond what `interns-mcp` needs. The clone step gets the full monorepo (it also contains `projects-meta-mcp` and other shared tools), but this skill only verifies the `lib/interns-mcp/` subdirectory. ## Hard rule: don't auto-mutate config @@ -47,17 +48,18 @@ Search, in order. Report only "found at ", never echo key values. **Server source.** Check whether `~/projects/.common/lib/interns-mcp/pyproject.toml` exists. - If present → report "found at ~/projects/.common/lib/interns-mcp/". Phase 4 will `pip install -e` (or skip if already importable). -- If absent → report "source not found — will clone from gitea". Phase 4 will `git clone https://git.kzntsv.site/OpeItcLoc03/interns-mcp ~/projects/.common/lib/interns-mcp` then `pip install -e`. +- If absent → check whether `~/projects/.common/.git` exists (the `common` monorepo). + - If the monorepo exists but the subdirectory is missing → report "source subdir absent — will git pull". Phase 4 will `git -C ~/projects/.common pull --ff-only` to fetch the latest content, then verify the subdirectory appeared. + - If the monorepo is absent → report "source not found — will clone common monorepo from gitea". Phase 4 will `git clone https://git.kzntsv.site/OpeItcLoc03/common.git ~/projects/.common`. -If `git clone` fails (no network, no Gitea PAT, repo doesn't exist yet), stop with a clear message: +If clone or pull fails (no network, no Gitea PAT), stop with a clear message: ``` -Failed to clone interns-mcp source. Options: +Failed to clone/pull the common monorepo. Options: 1. Check network access to https://git.kzntsv.site 2. If you need a Gitea PAT: https://git.kzntsv.site/user/settings/applications (scope: read:repository is sufficient) -3. If the repo doesn't exist yet on Gitea, initialize it manually - and re-run setup-interns. +3. If Gitea is unreachable, re-run setup-interns when it's back. ``` **Build artifact.** Run `python -c "import interns_mcp" 2>&1` against the candidate interpreter. If it fails with `ModuleNotFoundError`, Phase 4 will run `pip install -e ~/projects/.common/lib/interns-mcp/`. If it succeeds, capture the installed location and skip the install in Phase 4. @@ -81,7 +83,7 @@ The first hit wins per key. **Never echo key values in chat.** Present a single-block plan to the user: ``` -Source: +Source: Module: Config: — endpoints: Missing keys: not yet present in interns.env | none> @@ -108,16 +110,22 @@ Confirm both backups exist (when their source existed) before any further edit. ### Phase 4 — Clone (if needed) + Install Python module -**Clone.** If Phase 1 found the source absent: +**Clone or pull.** If Phase 1 found the source absent: ```bash -mkdir -p ~/projects/.common/lib -git clone https://git.kzntsv.site/OpeItcLoc03/interns-mcp ~/projects/.common/lib/interns-mcp +if [ -d ~/projects/.common/.git ]; then + # Monorepo exists but subdirectory missing — pull latest + git -C ~/projects/.common pull --ff-only +else + # Fresh clone of the common monorepo + mkdir -p ~/projects + git clone https://git.kzntsv.site/OpeItcLoc03/common.git ~/projects/.common +fi ``` -Verify `~/projects/.common/lib/interns-mcp/pyproject.toml` exists after clone. If not — abort. +Verify `~/projects/.common/lib/interns-mcp/pyproject.toml` exists after clone/pull. If the subdirectory is still missing after pull — the interns-mcp module may not have been pushed to the monorepo yet. Abort with a clear message. -If the source was already present and Phase 1 found `interns_mcp` importable, skip both clone and install. +If the source was already present and Phase 1 found `interns_mcp` importable, skip both clone/pull and install. **Install.** If Phase 1 found `interns_mcp` not importable: @@ -249,4 +257,5 @@ Path forms (`~/projects/.common/...`, `~/.config/...`, `~/.claude.json`) are ide - **Missing the gitignore rule.** Tokens commit to the repo on the next `git add .`. Always check `.gitignore` covers `.common/secrets/*.env` before writing — Phase 5 does it but it's worth double-checking. - **Treating in-session smoke test as proof.** Same as the context7 / projects-meta caveat — the active MCP connection was bound at session start. Real verification happens after restart. - **Auto-running on every "use interns".** This skill is intrusive. Trigger only on explicit "install / set up / configure interns", or when MCP tools are missing and the user is blocked. -- **Cloning over an existing source directory.** If `~/projects/.common/lib/interns-mcp/` already exists with `pyproject.toml`, don't clone — use what's there. Clone is only for the "source not found" case. \ No newline at end of file +- **Cloning over an existing source directory.** If `~/projects/.common/lib/interns-mcp/` already exists with `pyproject.toml`, don't clone — use what's there. Clone is only for the "source not found" case. +- **Cloning the wrong repo.** `interns-mcp` lives inside the `common` monorepo at `OpeItcLoc03/common.git`, not as a separate `interns-mcp` repo. Always clone `common.git` and verify the subdirectory. \ No newline at end of file