74 lines
3.2 KiB
Markdown
74 lines
3.2 KiB
Markdown
---
|
||
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 /gw-triage:map-repo, $map-repo, "mappa questo repo", "aggiorna il profilo di triage".
|
||
---
|
||
|
||
# Map-repo — profilo di triage del codebase
|
||
|
||
You generate a triage knowledge profile for the repo the user is in,
|
||
and guide them to publish it to the gw-triage plugin repo.
|
||
|
||
**All interaction with the user happens in Italian.** The generated
|
||
profile is written in English (it is read by the triage model, not by
|
||
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
|
||
|
||
- `git rev-parse --show-toplevel` — if not a git repo, ask (Italian)
|
||
to cd into the repo to map and stop.
|
||
- Repo name = basename of the toplevel, lowercased.
|
||
|
||
## Step 2 — Survey
|
||
|
||
Read `<root>/knowledge/README.md` (the profile format).
|
||
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.
|
||
> Report back, with file evidence: (1) what the system does — main
|
||
> responsibility in one line; (2) user-visible surfaces: screens /
|
||
> pages / endpoints / dashboards a user might screenshot, with their
|
||
> on-screen titles and labels; (3) error presentation: how failures
|
||
> appear to users — banners, dialogs, toasts, their exact wording in
|
||
> every language present, HTTP/gRPC codes surfaced, what a crash looks
|
||
> like; (4) the domain vocabulary users see (menu labels, entity
|
||
> names, Italian terms); (5) integrations that fail visibly (payments,
|
||
> chat, auth, push notifications); (6) what this system does NOT do —
|
||
> adjacent systems it talks to and symptoms that belong to them.
|
||
> Return a structured report; do not write any file.
|
||
|
||
## Step 3 — Write the profile
|
||
|
||
Write `<repo-name>.md` following the six headings of
|
||
`knowledge/README.md`, all sections non-empty, 100–200 lines, English.
|
||
Write it to a temporary location first (the session scratchpad or
|
||
/tmp). Present a short Italian summary to the user with the file path.
|
||
|
||
## Step 4 — Publish
|
||
|
||
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
|
||
the URL from `git remote get-url origin` run in
|
||
`<root>` if available, otherwise ask).
|
||
|
||
With the user's confirmation, in the checkout:
|
||
1. Copy the profile to `knowledge/<repo-name>.md` (overwrite if
|
||
refreshing).
|
||
2. Bump the patch version in `.claude-plugin/plugin.json`
|
||
(e.g. 0.1.0 → 0.1.1).
|
||
3. `git add knowledge/<repo-name>.md .claude-plugin/plugin.json`
|
||
then `git commit -m "knowledge: add/update <repo-name> profile"`
|
||
— ask before committing, and ask again before `git push`.
|
||
4. Tell the user (Italian) that teammates receive the update with
|
||
`/plugin marketplace update gw-triage` on Claude Code, or with
|
||
`git pull` in their gw-triage clone on Codex.
|