From development-codebase-tools
Generates valid Mermaid.js diagrams (flowcharts, sequences, classes, states, ER, Gantt, git graphs) with strict syntax rules for error-free rendering. Fixes broken diagrams.
npx claudepluginhub uniswap/ai-toolkit --plugin development-codebase-toolsThis skill uses the workspace's default tool permissions.
Generate valid Mermaid.js diagrams that render without syntax errors on the first attempt.
Guides strict Test-Driven Development (TDD): write failing tests first for features, bugfixes, refactors before any production code. Enforces red-green-refactor cycle.
Guides systematic root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Guides A/B test setup with mandatory gates for hypothesis validation, metrics definition, sample size calculation, and execution readiness checks.
Generate valid Mermaid.js diagrams that render without syntax errors on the first attempt.
Follow every rule below. Violating any one will produce a render failure.
%% CORRECT
A[Service A]
B[Service B]
%% WRONG
A[Service A] B[Service B]
No spaces, hyphens, or special characters in IDs. Display names go in brackets.
%% CORRECT
AuthService[Auth Service]
UserDB[User Database]
%% WRONG
Auth-Service[Auth Service]
User DB[User Database]
Wrap in double quotes if a label contains parentheses, brackets, colons, math operators, or anything that could be parsed as Mermaid syntax.
%% CORRECT
A["Process (async)"]
B["array[0]"]
C["ratio: 3/4"]
D["calculate(x, y)"]
%% WRONG
A[Process (async)]
B[array[0]]
Use commas or semicolons instead of <br> or \n.
%% CORRECT
A["Input: raw data, Output: processed"]
%% WRONG
A[Input: raw data<br>Output: processed]
Write each connection on its own line.
%% CORRECT
A --> B
B --> C
%% WRONG
A --> B --> C
%% comments must not appear at the end of code lines.
%% CORRECT
%% This is a comment
A --> B
%% WRONG
A --> B %% connection
Apply style directives only after the node has been defined.
%% CORRECT
A[Server]
style A fill:#f9f,stroke:#333
%% WRONG
style A fill:#f9f,stroke:#333
A[Server]
Use underscores or wrap in quotes — no bare spaces.
%% CORRECT
subgraph Backend_Services
subgraph "Backend Services"
%% WRONG
subgraph Backend Services
Trace through the diagram to confirm:
| Type | Directive | Use For |
|---|---|---|
| Flowchart | flowchart TD / flowchart LR | Architecture, data flow, decisions |
| Sequence | sequenceDiagram | API calls, request/response |
| Class | classDiagram | Type relationships, OOP |
| State | stateDiagram-v2 | State machines, lifecycles |
| ER | erDiagram | Database schemas, entities |
| Gantt | gantt | Timelines, schedules |
| Git | gitGraph | Branch strategies, merges |
flowchart TD
Client[Browser Client]
API[API Gateway]
Auth[Auth Service]
DB[(Database)]
Client --> API
API --> Auth
Auth --> DB
sequenceDiagram
participant C as Client
participant S as Server
participant D as Database
C->>S: POST /api/data
S->>D: INSERT query
D-->>S: Result
S-->>C: 201 Created