From cape
Guided codebase walkthrough that builds understanding progressively. Use whenever the user asks to understand code — "explain", "how does X work", "walk me through", "what does this module do", "give me an overview", "I'm new to this part of the codebase", "teach me", or any question about how code flows, connects, or is structured. Covers everything from single functions to full system architecture. Do NOT use for investigating bugs (use debug-issue) or for internal agent queries about codebase state (that's codebase-investigator).
npx claudepluginhub sqve/cape --plugin capeThis skill uses the workspace's default tool permissions.
<skill_overview> Explain code by building understanding progressively — from entry points through
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
<skill_overview> Explain code by building understanding progressively — from entry points through data flow to key decisions. Produces a narrative walkthrough with ASCII flow diagrams, not just a file listing. Adapts depth to scope: a function gets a focused explanation, a system gets a layered overview.
Core contract: every explanation traces real code paths. No hand-waving, no "it probably does X." Read the code, then explain what it actually does. </skill_overview>
<rigidity_level> MEDIUM FREEDOM — Adapt structure, depth, and diagram use to what the user asked. Rigid rules: always read code before explaining it, always anchor claims to file:line references, always match depth to scope. </rigidity_level>
<when_to_use>
Don't use for:
</when_to_use>
<critical_rules>
</critical_rules>
<the_process>
Determine what the user is asking about and how deep they need to go.
| Scope | Signal | Depth |
|---|---|---|
| NARROW | Specific function, file, or code block | Read it, explain inline, trace one level out |
| MEDIUM | Module, feature, or component | Entry points, key files, internal flow |
| BROAD | System, architecture, or cross-cutting concern | Layered overview, major boundaries, key paths |
Scope detection cues:
If scope is ambiguous, start MEDIUM and offer to zoom in or out.
Use code-review-graph when available to map relationships before reading files — see
resources/graph-tools-instructions.md for the tool catalog and fallback behavior. For NARROW
scope, query_graph_tool with callers_of/callees_of maps the immediate context. For
MEDIUM/BROAD, get_impact_radius_tool and query_graph_tool with file_summary reveal structure
faster than reading every file.
Dispatch cape:codebase-investigator to gather the raw material. Tailor the investigation prompt to
the detected scope:
NARROW — Read the target code. Identify callers, callees, and the data types flowing through.
MEDIUM — Find entry points, map the module's file structure, identify the key abstractions and their relationships, trace the primary happy path.
BROAD — Map top-level directory structure, identify system boundaries (API layers, data stores, external integrations), find the main entry points, trace one representative end-to-end flow.
If the investigator's findings leave gaps (unclear connections, missing context), dispatch a second focused query or read the files directly. Don't explain what you haven't verified.
Structure the explanation to build understanding progressively. The exact structure adapts to scope, but the pattern is always: orient → trace → illuminate.
For a function or small code block:
For a module or feature:
For system or architecture:
Use ASCII diagrams when explaining how components connect or data flows. Prefer simple box-and-arrow diagrams. Always place the diagram near the explanation it supports, not at the end.
Flow diagram for a request path:
Request
│
▼
┌─────────┐ ┌──────────┐ ┌────────┐
│ Router │───▶│ Handler │───▶│ Store │
└─────────┘ └──────────┘ └────────┘
│
▼
┌─────────┐
│ Response │
└─────────┘
Component boundary diagram:
┌─── api ──────────────────┐
│ routes/ → handlers/ │
│ ↓ │
│ middleware/ │
└──────────┬───────────────┘
│
┌──────────▼───────────────┐
│ services/ │
│ (business logic) │
└──────────┬───────────────┘
│
┌──────────▼───────────────┐
│ store/ │
│ (data access) │
└──────────────────────────┘
Keep diagrams compact. If a system has 15 components, show the 4-5 that matter for the explanation and note what's omitted.
Present the walkthrough. End by offering to go deeper on specific parts:
This turns a single explanation into a conversation that follows the user's curiosity.
</the_process>
<agent_references>
cape:codebase-investigator for MEDIUM and BROAD scope</agent_references>
User asks about a specific functionUser: "What does the resolveConfig function in src/config.ts do?"
Wrong: Dispatch a full codebase investigation, produce a 200-line architectural overview. The user asked about one function.
Right:
defaults → file config → env vars → CLI flags
↓ ↓ ↓ ↓
└──────────┴───────────┴──────────┘
│
Final config
User: "Walk me through how the auth system works"
Wrong: Read one file, explain just the login handler, miss the token refresh flow and middleware chain.
Right:
User: "I'm new to this repo, give me an overview of the architecture"
Wrong: List every file in the repo. Or give a surface-level "it's a web app with a frontend and backend" without tracing actual code paths.
Right:
<key_principles>
</key_principles>