feat(map-repo): platform-neutral root resolution and survey

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Murphy Freelance
2026-07-10 19:34:38 +02:00
parent 79834fee3f
commit bf92d05df2

View File

@@ -1,6 +1,6 @@
--- ---
name: map-repo name: map-repo
description: Use when generating or refreshing a codebase's triage profile for the gw-triage plugin — run from inside the repo to map. Triggers on /map-repo, "mappa questo repo", "aggiorna il profilo di triage". description: Use when generating or refreshing a codebase's triage profile for the gw-triage plugin — run from inside the repo to map. Triggers on /gw-triage:map-repo, $map-repo, "mappa questo repo", "aggiorna il profilo di triage".
--- ---
# Map-repo — profilo di triage del codebase # Map-repo — profilo di triage del codebase
@@ -12,6 +12,13 @@ and guide them to publish it to the gw-triage plugin repo.
profile is written in English (it is read by the triage model, not by profile is written in English (it is read by the triage model, not by
humans). humans).
## Environment
**Root**: `${CLAUDE_PLUGIN_ROOT}` if that variable is set; otherwise
the real path of this skill's own directory (resolve symlinks, e.g.
with `realpath`), two levels up. Paths below marked `<root>` are
relative to it.
## Step 1 — Identify the repo ## Step 1 — Identify the repo
- `git rev-parse --show-toplevel` — if not a git repo, ask (Italian) - `git rev-parse --show-toplevel` — if not a git repo, ask (Italian)
@@ -20,8 +27,11 @@ humans).
## Step 2 — Survey ## Step 2 — Survey
Read `${CLAUDE_PLUGIN_ROOT}/knowledge/README.md` (the profile format). Read `<root>/knowledge/README.md` (the profile format).
Dispatch ONE exploration subagent with this prompt, filling <repo-path>: If the platform supports dispatching subagents, dispatch ONE
exploration subagent with the prompt below, filling <repo-path>;
otherwise perform the same survey yourself, covering all six points
before writing anything:
> Survey the codebase at <repo-path> to build a triage profile. > Survey the codebase at <repo-path> to build a triage profile.
> Report back, with file evidence: (1) what the system does — main > Report back, with file evidence: (1) what the system does — main
@@ -48,7 +58,7 @@ Write it to a temporary location first (the session scratchpad or
Ask (Italian) for the local path of the user's gw-triage checkout; Ask (Italian) for the local path of the user's gw-triage checkout;
offer to `git clone <plugin-repo-url>` if they don't have one (read offer to `git clone <plugin-repo-url>` if they don't have one (read
the URL from `git remote get-url origin` run in the URL from `git remote get-url origin` run in
`${CLAUDE_PLUGIN_ROOT}` if available, otherwise ask). `<root>` if available, otherwise ask).
With the user's confirmation, in the checkout: With the user's confirmation, in the checkout:
1. Copy the profile to `knowledge/<repo-name>.md` (overwrite if 1. Copy the profile to `knowledge/<repo-name>.md` (overwrite if
@@ -59,4 +69,5 @@ With the user's confirmation, in the checkout:
then `git commit -m "knowledge: add/update <repo-name> profile"` then `git commit -m "knowledge: add/update <repo-name> profile"`
— ask before committing, and ask again before `git push`. — ask before committing, and ask again before `git push`.
4. Tell the user (Italian) that teammates receive the update with 4. Tell the user (Italian) that teammates receive the update with
`/plugin marketplace update gw-triage`. `/plugin marketplace update gw-triage` on Claude Code, or with
`git pull` in their gw-triage clone on Codex.