$npx -y skills add haoxiang-xu/PuPu --skill gitnexus-guideUse when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\"
| 1 | # GitNexus Guide |
| 2 | |
| 3 | Quick reference for all GitNexus MCP tools, resources, and the knowledge graph schema. |
| 4 | |
| 5 | ## Always Start Here |
| 6 | |
| 7 | For any task involving code understanding, debugging, impact analysis, or refactoring: |
| 8 | |
| 9 | 1. **Read `gitnexus://repo/{name}/context`** — codebase overview + check index freshness |
| 10 | 2. **Match your task to a skill below** and **read that skill file** |
| 11 | 3. **Follow the skill's workflow and checklist** |
| 12 | |
| 13 | > If step 1 warns the index is stale, run `node .gitnexus/run.cjs analyze` in the terminal first. |
| 14 | |
| 15 | ## Skills |
| 16 | |
| 17 | | Task | Skill to read | |
| 18 | | -------------------------------------------- | ------------------- | |
| 19 | | Understand architecture / "How does X work?" | `gitnexus-exploring` | |
| 20 | | Blast radius / "What breaks if I change X?" | `gitnexus-impact-analysis` | |
| 21 | | Trace bugs / "Why is X failing?" | `gitnexus-debugging` | |
| 22 | | Rename / extract / split / refactor | `gitnexus-refactoring` | |
| 23 | | Tools, resources, schema reference | `gitnexus-guide` (this file) | |
| 24 | | Index, status, clean, wiki CLI commands | `gitnexus-cli` | |
| 25 | |
| 26 | ## Tools Reference |
| 27 | |
| 28 | | Tool | What it gives you | |
| 29 | | ---------------- | ------------------------------------------------------------------------ | |
| 30 | | `query` | Process-grouped code intelligence — execution flows related to a concept | |
| 31 | | `context` | 360-degree symbol view — categorized refs, processes it participates in | |
| 32 | | `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence | |
| 33 | | `trace` | Shortest path between two symbols — "how does A reach B?" in one call | |
| 34 | | `detect_changes` | Git-diff impact — what do your current changes affect | |
| 35 | | `rename` | Multi-file coordinated rename with confidence-tagged edits | |
| 36 | | `cypher` | Raw graph queries (read `gitnexus://repo/{name}/schema` first) | |
| 37 | | `explain` | Persisted taint findings — source→sink data flows (needs `analyze --pdg`) | |
| 38 | | `pdg_query` | Control/data dependence — what gates X (CDG) / where Y flows (REACHING_DEF); needs `analyze --pdg` | |
| 39 | | `check` | Check graph invariants such as circular imports | |
| 40 | | `route_map` | API route map — which components/hooks fetch which endpoints, and the handler files that serve them | |
| 41 | | `shape_check` | Response-shape drift — keys each route returns vs keys its consumers access (flags MISMATCH) | |
| 42 | | `api_impact` | Pre-change report for an API route — consumers, middleware, shape mismatches, risk level | |
| 43 | | `tool_map` | MCP/RPC tool definitions and the files that handle them | |
| 44 | | `group_list` | List configured multi-repo groups, or one group's config | |
| 45 | | `group_sync` | Rebuild a group's Contract Registry (cross-repo HTTP contract links); run after `group.yaml` changes or member re-index | |
| 46 | | `list_repos` | Discover indexed repos (paginated — `limit`/`offset`) | |
| 47 | |
| 48 | ### Paginating `list_repos` |
| 49 | |
| 50 | `list_repos` is paginated so a large registry is not truncated by MCP/LLM token limits. It takes optional `limit` (default **50**, max **200**) and `offset`, and returns: |
| 51 | |
| 52 | ```jsonc |
| 53 | { |
| 54 | "repositories": [ |
| 55 | { "name": "...", "path": "...", "indexedAt": "...", "lastCommit": "...", "stats": { } } |
| 56 | ], |
| 57 | "pagination": { |
| 58 | "total": 437, |
| 59 | "limit": 50, |
| 60 | "offset": 0, |
| 61 | "returned": 50, |
| 62 | "hasMore": true, |
| 63 | "nextOffset": 50 |
| 64 | } |
| 65 | } |
| 66 | ``` |
| 67 | |
| 68 | To enumerate **every** repository, keep calling with `offset` set to `pagination.nextOffset` until `hasMore` is `false`: |
| 69 | |
| 70 | ```text |
| 71 | list_repos {} → repos 1–50, nextOffset 50, hasMore true |
| 72 | list_repos { offset: 50 } → repos 51–100, nextOffset 100, hasMore true |
| 73 | … |
| 74 | list_repos { offset: 400 } → repos 401–437, hasMore false (done) |
| 75 | ``` |
| 76 | |
| 77 | Notes: `offset` ≥ `total` returns an empty page (with `total` still reported). Out-of-range or malformed `limit`/`offset` (non-integer, `limit` outside `[1, 200]`, `offset < 0`) are rejected with a clear error — `limit` above the max is rejected, not silently capped. The order is deterministic (lower-cased name, then path), so paging never skips or duplicates an entry while the registry is unchanged. |
| 78 | |
| 79 | ### Taint findings (`explain`) |
| 80 | |
| 81 | `explain` returns taint findings recorded by `gitnexus analyze --pdg` — intra-procedural `TAINTED` edges plus cross-function `TAINT_PATH` hops where the interprocedural taint phase found a function-level source→sink chain. Each finding includes a sink category (command-injection, code-injection, path-traversa |