verify-diag
Skill5 starsChanged 6 months agoMITView on GitHub
Verify an architecture diagram against the actual codebase. Checks component existence, connection accuracy, and read/write directionality. Use when user says "verify diagram", "verify diag", "check diagram", or wants to validate diagram accuracy.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Trecek/useful-claude-skillsword for word, first seen Mar 26, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Trecek/useful-claude-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- audit-archSkill
- audit-bugsSkill
- audit-cohesionSkill
- audit-defense-standardsSkill
- audit-testsSkill
- chart-courseSkill
- check-bearingSkill
- design-guardsSkill
- elaborate-phaseSkill
- id-slopSkill
- make-arch-diagSkill
- make-reqSkill
- make-scenariosSkill
- promote-to-mainSkill
- render-recipeSkill
- review-promotionSkill
- update-architectureSkill
- update-reqsSkill
- update-specsSkill
- validate-auditSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Verify an architecture diagram's factual accuracy against the actual codebase.
- Distinctive: line 12
After generating an arch lens diagram
- Distinctive: line 14
Before finalizing diagram examples or documentation
- Distinctive: line 23
Verify every named component exists in the codebase
- Very specific: line 42
Check: scan all [...] and (...) node definitions for " inside content
- Very specific: line 45
Every [ has a matching ] on the same line (for node definitions)
- Very specific: line 46
Every ( has a matching ) on the same line
- Distinctive: line 88
Read the diagram file. Extract every verifiable claim:
- Distinctive: line 119
Import direction (A imports B) != data flow direction
- Distinctive: line 124
If showing it would change a reader's understanding of the architecture → flag it
- Distinctive: line 125
If it's obvious or doesn't affect understanding → note but don't flag
- Distinctive: line 131
Only flag things that matter at the diagram's abstraction level
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Verify Diagram Skill
Verify an architecture diagram's factual accuracy against the actual codebase. Adapted from the dry-walkthrough methodology for diagram validation.
When to Use
- After generating an arch lens diagram
- User says "verify diagram", "verify diag", "check diagram"
- Before finalizing diagram examples or documentation
Critical Constraints
NEVER:
- Modify source code files
- Modify the diagram during verification (report findings only)
ALWAYS:
- Verify every named component exists in the codebase
- Trace actual code paths for every connection
- Determine read/write directionality for every connection
- Report findings to terminal, not to files
Verification Workflow
Step 0: Validate Mermaid Syntax (Rendering Check)
This step runs BEFORE semantic verification. Extract every mermaid code block and check for syntax errors that would prevent rendering.
For each ```mermaid block, validate:
1. Node label quoting:
[...]node content must NOT contain unescaped double quotes- BAD:
A["value = "hello""]— inner quotes break the parser - GOOD:
A["value = hello"]orA[value = hello] - Check: scan all
[...]and(...)node definitions for"inside content
2. Bracket balance:
- Every
[has a matching]on the same line (for node definitions) - Every
(has a matching)on the same line - Exception:
([...])stadium shapes have nested brackets — count outer pair
3. Special characters in node labels:
- Parentheses
()inside[...]labels break parsing — rephrase or remove - Pipe
|inside node labels conflicts with edge label syntax - Curly braces
{}inside node labels conflict with rhombus/decision syntax - Hash
#at start of label can be misinterpreted
4. Edge label syntax:
- Edge labels must use
-->|"label"|or-->|label|format - Unmatched pipe chars on edge lines break parsing
5. Subgraph naming:
subgraph NAME ["Display Title"]— the["..."]is valid mermaid syntax- But
subgraph NAME [Display Title]without quotes is NOT valid if title has spaces
6. Class definition syntax:
classDeflines must end with semicolons only if using shorthandclass A,B,C className;— verify referenced node IDs exist in the diagram
7. Node ID rules:
- Node IDs must not start with numbers
- Node IDs must not contain spaces, hyphens (use underscores), or dots
- Reserved words (
end,subgraph,graph,flowchart) cannot be node IDs
Quick validation approach:
For each mermaid block:
1. Extract all node definitions (ID[label], ID(label), ID{label}, ID([label]))
2. Check each label for unescaped quotes, pipes, unbalanced brackets
3. Extract all edge definitions, verify pipe-delimited labels are balanced
4. Extract all node IDs, check for reserved words and invalid characters
5. Extract all class assignments, verify referenced IDs exist as nodesIf syntax errors are found: Report them in a ### Rendering Errors section BEFORE the semantic findings. These are blocking — a diagram that won't render is worse than one with inaccurate connections.
Step 1: Load the Diagram
Read the diagram file. Extract every verifiable claim:
- Named components (modules, functions, classes)
- Connections (arrows between components)
- Descriptions of what components do
- Metrics (counts, classifications)
Step 2: Verify Components Exist
For each named component, check the codebase:
- Does the referenced file/module/function/class exist?
- Is the description of what it does accurate?
- Is it a real standalone component, or an inline operation within another component?
Flag phantom components — things in the diagram that don't exist as discrete entities in code (e.g., showing an inline dict lookup as a separate "BuildKey" node).
Step 3: Verify Connections — Read/Write Directionality
This is the most important step. For EVERY arrow/connection in the diagram:
- Trace the actual code path — find the function call, import, or data handoff
- Classify the relationship:
| Type | Description | Example |
| READ | A reads/queries/receives from B | A calls B.get(), B returns data |
| WRITE | A writes/mutates/sends to B | A calls B.save(data) |
| READ+WRITE | Bidirectional data exchange | A calls B.process(input) → B returns output |
| CALL | A invokes B, no significant data transfer | A calls B.init() |
- Check arrow direction matches reality:
- Import direction (A imports B) != data flow direction
- A calling B.process(x) → y means data flows A→B (args) AND B→A (return)
- A generator yielding to B means data flows A→B on each yield
- Assess relevance: Does the read/write distinction matter for this connection?
- If showing it would change a reader's understanding of the architecture → flag it
- If it's obvious or doesn't affect understanding → note but don't flag
Step 4: Check for Missing Components
- Significant functions/classes in the traced code paths NOT in the diagram
- Decision points, error paths, or data transformations omitted
- Only flag things that matter at the diagram's abstraction level
Step 5: Verify Metrics and Classifications
- Fan-in/fan-out counts: grep imports and count
- Layer assignments: check actual import directions
- Solid vs dashed arrows: verify the classification rationale
- "Write-only" claims: verify nothing reads the output back
Output Format
Report findings to terminal only. Use this structure:
## Diagram Verification: {diagram name}
**Status:** PASS | RENDER ERROR | NEEDS CORRECTIONS
**Mermaid Syntax:** {PASS | X errors found}
**Components:** {X}/{Y} verified
**Connections:** {X}/{Y} accurate
### Rendering Errors (if any — BLOCKING)
| Line | Error | Fix |
|------|-------|-----|
| {line in mermaid block} | {what breaks} | {how to fix} |
### Corrections Needed
1. **{Component/Connection}**: {what's wrong} → {what it should be}
2. ...
### Directionality Findings
| Connection | Diagram Shows | Actual | Impact |
|------------|--------------|--------|--------|
| A → B | A flows to B | A calls B, B returns result (bidirectional) | Low/Medium/High |
### Missing
- {significant omissions}
### Phantom Components
- {things in diagram that aren't discrete code entities}Directionality Quick Reference
Common patterns and how to represent them:
| Code Pattern | Correct Arrow | Why | |
result = B.process(data) | A →|"calls" | B | Call direction; data flows both ways but call initiates from A |
A.save(data, B) | A →|"writes" | B | A produces, B stores |
data = B.read() | A →|"reads" | B | A consumes from B |
for x in generator() | Gen →|"yields" | Consumer | Data flows from generator |
A imports B | A →|"imports" | B | Dependency direction (module diagrams) |
A.callback(B.on_event) | B -.->|"notifies" | A | Event/callback reverses apparent direction |
Launching Verification
Spawn one Explore subagent per diagram. Each agent:
- Reads the full diagram file
- Reads the relevant source files in the codebase
- Performs all 5 verification steps
- Returns structured findings
For multiple diagrams, launch agents in parallel.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

