$npx -y skills add haoxiang-xu/PuPu --skill gitnexus-exploringUse when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\"
| 1 | # Exploring Codebases with GitNexus |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - "How does authentication work?" |
| 6 | - "What's the project structure?" |
| 7 | - "Show me the main components" |
| 8 | - "Where is the database logic?" |
| 9 | - Understanding code you haven't seen before |
| 10 | |
| 11 | ## Workflow |
| 12 | |
| 13 | ``` |
| 14 | 1. READ gitnexus://repos → Discover indexed repos |
| 15 | 2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness |
| 16 | 3. query({search_query: "<what you want to understand>"}) → Find related execution flows |
| 17 | 4. context({name: "<symbol>"}) → Deep dive on specific symbol |
| 18 | 5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow |
| 19 | ``` |
| 20 | |
| 21 | > If step 2 says "Index is stale" → run `node .gitnexus/run.cjs analyze` in terminal. |
| 22 | |
| 23 | ## Checklist |
| 24 | |
| 25 | ``` |
| 26 | - [ ] READ gitnexus://repo/{name}/context |
| 27 | - [ ] query for the concept you want to understand |
| 28 | - [ ] Review returned processes (execution flows) |
| 29 | - [ ] context on key symbols for callers/callees |
| 30 | - [ ] READ process resource for full execution traces |
| 31 | - [ ] Read source files for implementation details |
| 32 | ``` |
| 33 | |
| 34 | ## Resources |
| 35 | |
| 36 | | Resource | What you get | |
| 37 | | --------------------------------------- | ------------------------------------------------------- | |
| 38 | | `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) | |
| 39 | | `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) | |
| 40 | | `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) | |
| 41 | | `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) | |
| 42 | |
| 43 | ## Tools |
| 44 | |
| 45 | **query** — find execution flows related to a concept: |
| 46 | |
| 47 | ``` |
| 48 | query({search_query: "payment processing"}) |
| 49 | → Processes: CheckoutFlow, RefundFlow, WebhookHandler |
| 50 | → Symbols grouped by flow with file locations |
| 51 | ``` |
| 52 | |
| 53 | **context** — 360-degree view of a symbol: |
| 54 | |
| 55 | ``` |
| 56 | context({name: "validateUser"}) |
| 57 | → Incoming calls: loginHandler, apiMiddleware |
| 58 | → Outgoing calls: checkToken, getUserById |
| 59 | → Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3) |
| 60 | ``` |
| 61 | |
| 62 | ## Example: "How does payment processing work?" |
| 63 | |
| 64 | ``` |
| 65 | 1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes |
| 66 | 2. query({search_query: "payment processing"}) |
| 67 | → CheckoutFlow: processPayment → validateCard → chargeStripe |
| 68 | → RefundFlow: initiateRefund → calculateRefund → processRefund |
| 69 | 3. context({name: "processPayment"}) |
| 70 | → Incoming: checkoutHandler, webhookHandler |
| 71 | → Outgoing: validateCard, chargeStripe, saveTransaction |
| 72 | 4. Read src/payments/processor.ts for implementation details |
| 73 | ``` |