c4-diagrams
Generates C4 model architecture diagrams (System Context, Container, Component) as Mermaid for embedding in docs — picks the right C4 level for the question being answered, labels every element with its technology and responsibility, and avoids the "everything touches everything" spaghetti that makes most architecture diagrams useless. Writes to .context/architecture/diagrams/. Use when the user asks for a diagram of their system, an architecture visualization, a container/component diagram, wants to see how pieces fit together, or mentions "C4".
What this skill does
# C4 Diagrams
The C4 model gives you four levels of zoom on a software system — Context, Container, Component, Code. Most architecture diagrams try to show everything at once and end up showing nothing useful. C4 fixes that by making you pick one level and one audience.
## Current context
- Existing diagrams: !`ls .context/architecture/diagrams/ 2>/dev/null || echo "(none yet)"`
## Decision tree
- What question is the diagram answering?
- **"What does this system do and who uses it?"** → Level 1: **System Context** — the system as a black box, its users, and the external systems it talks to
- **"What are the major runnable pieces and how do they talk?"** → Level 2: **Container** — apps, services, databases, queues, each with its own process/runtime
- **"What's inside this one container?"** → Level 3: **Component** — modules/classes/packages within a single container
- **"How does this class/function work?"** → Level 4: **Code** — skip it, use the actual code or a UML class diagram tool
- **"Show me the whole system"** → push back. C4 is valuable because it forces one level at a time. Ask which level they need, or offer to produce a Context + a Container diagram.
- **"I need a sequence/flow diagram, not structure"** → C4 is for structure. Produce a Mermaid `sequenceDiagram` or `flowchart` instead, and tell the user that's what you're doing.
## The four levels
### Level 1 — System Context
**Audience:** anyone (execs, product, new hires)
**Shows:** the system as a single box, users (people), and external systems it depends on or integrates with
**Don't show:** anything *inside* the system
Use when: introducing the system to someone, scoping a conversation, defining the boundary.
### Level 2 — Container
**Audience:** engineers, architects
**Shows:** deployable/runnable units — web apps, APIs, workers, databases, queues, caches — and the protocols they use to talk
**Don't show:** classes, functions, or internal modules
Use when: explaining the runtime architecture, onboarding engineers, planning deploys, discussing scaling.
### Level 3 — Component
**Audience:** engineers working in a specific container
**Shows:** the major modules/packages/classes inside one container and how they collaborate
**Don't show:** other containers in detail — they're just labeled boxes at the edge
Use when: explaining the internals of a service, planning a refactor, documenting a module boundary.
### Level 4 — Code
Skip it. Real code diagrams go stale instantly and the IDE already shows them. If the user really wants one, produce a Mermaid `classDiagram` and call it out as "code-level, likely to drift."
## Producing a diagram
### 1. Pin down scope
Use `AskUserQuestion` if unclear:
1. **Which level** — Context, Container, or Component?
2. **Which system/container is the subject?** — C4 always has a single "system in focus"
3. **Who's the audience?** — affects how much jargon and tech detail to include
4. **What source material do you have?** — existing design docs, `.context/`, code to read, or just conversation
If `.context/architecture/` already has a design doc, read it first — diagrams should match the words.
### 2. Gather the elements
Walk through the system and list:
- **People (actors)** — only for Context level; in Container/Component, people go at the edge
- **The system in focus** — for Context, a single box; for Container, expanded into its containers; for Component, expanded into one container's components
- **External systems** — anything outside the boundary the system talks to
- **Relationships** — for each arrow, note: source, target, purpose, protocol/tech
A good rule of thumb: if you can't label the *purpose* of an arrow in ~5 words, the relationship is too vague to draw.
#### Default stack primitives
When diagramming systems built on the default stack, use these standard labels and shorthand. If the architecture skill is installed in the same package, its `references/third-party.md` and `references/deploy.md` files contain the fuller stack rationale.
|Primitive|Label format|Responsibility|
|---|---|---|
|Worker (API)|`<Name> API [Hono on Workers]`|HTTP request handling, validation, auth|
|Worker (service)|`<Name> Worker [Worker]`|Queue consumer, cron job, background processing|
|Postgres|`<Name> DB [Postgres / Neon]`|Source of truth, transactional writes|
|Queue|`<topic-name> [CF Queue]`|Async event delivery, retry/DLQ|
|Durable Object|`<Name> DO [Durable Object]`|Per-key state: rate limits, WebSocket rooms, counters|
|KV|`<Name> [CF KV]`|Key-value cache, config, feature flags|
|R2|`<Name> [CF R2]`|Object storage, file uploads, access logs|
|D1|`<Name> [CF D1]`|Lightweight SQLite for tiny projects|
|External: Neon|`Neon [Postgres]`|Managed serverless Postgres (EU region)|
|External: PostHog|`PostHog [External]`|Analytics, errors, feature flags|
|External: Resend|`Resend [External]`|Transactional email|
|External: Polar.sh|`Polar.sh [External]`|Payments and billing (web)|
|External: RevenueCat|`RevenueCat [External]`|In-app purchase management (mobile)|
|External: Better Stack|`Better Stack [External]`|Uptime monitoring and alerting|
Use `Service Binding` as the protocol label for Worker-to-Worker calls within the same CF account (no network hop). Use `Queue` for async inter-service communication.
### 3. Write the Mermaid
Use `flowchart` with subgraphs for the system boundary. Mermaid doesn't have native C4 support across all renderers, but flowchart with consistent styling works everywhere. See `references/mermaid-c4.md` for templates for each level.
Conventions to keep diagrams readable:
- **Every element has:** a short name, a type (`[Person]`, `[Web App]`, `[Database]`), and a one-line responsibility
- **Every relationship has:** a verb phrase and, where it matters, the protocol ("reads via HTTPS/JSON")
- **Boxes inside the boundary** are styled differently from external systems — use subgraphs and node styling
- **Max ~15 elements per diagram** — if you have more, you're probably mixing levels. Split or zoom out.
- **No spaghetti** — if arrows cross more than a couple of times, reorder elements. If you can't, the relationships are too dense for one diagram.
### 4. Write the file
Output to `.context/architecture/diagrams/<name>-<level>.md` (e.g., `orders-service-container.md`). The file should contain:
1. A title: `# Orders Service — Container Diagram`
2. A one-paragraph description: what it shows and what it doesn't
3. The Mermaid block
4. A legend listing each element with its responsibility (redundant with the diagram but searchable and copy-pasteable)
5. Links to related diagrams ("see also: `orders-service-context.md`")
### 5. Link from the design doc
If there's a design doc in `.context/architecture/`, add a link to the new diagram file. Diagrams that no doc references get stale fast.
## Writing principles
- **One level per diagram, always.** If you're tempted to "just add the database icon to the context diagram", stop — make a container diagram instead.
- **Label responsibility, not just names.** `Orders API (Hono on Workers)` alone is worse than `Orders API (Hono on Workers) — accepts order writes, publishes events`.
- **Show the boundary.** The whole point is to make "what's ours vs. what's theirs" visible. Subgraph the in-scope system.
- **Tech on the element or on the arrow, not both.** Pick one style and stay consistent within a diagram.
- **If it's confusing, remove elements.** A diagram that answers one question well beats one that answers several poorly.
### Write so a junior reader can use it
A diagram without prose is usually a riddle. Pair every diagram with:
1. **A one-paragraph "what this shows and doesn't show"** — so a reader knows if they're looking at the right picture for their question.
2. **A numbered walkthrough of the main flow** — "1. The customer hits the storefront. 2. The storefront calls the Orders API with the cart. 3. The API writes to Postgres and the outbox table in one transRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.