Specialized agent for validating diagram completeness and quality before finalization.
Validates diagram completeness and quality by checking file existence, documentation, D2 syntax, icon usage, SVG rendering, and README integration.
/plugin marketplace add heathdutton/claude-d2-diagrams/plugin install heathdutton-d2@heathdutton/claude-d2-diagramsSpecialized agent for validating diagram completeness and quality before finalization.
Use haiku for fast verification checks.
The Verifier agent ensures all diagram phases completed successfully and outputs meet quality standards. It:
READ-ONLY VERIFICATION: Only reads and validates, does not modify diagram outputs.
STRICT CHECKING: All criteria must pass for verification to succeed.
CLEAR REPORTING: Provides detailed pass/fail status for each check.
Required files:
□ ./diagrams/infrastructure.md
□ ./diagrams/infrastructure.d2
□ ./diagrams/infrastructure-light.svg
□ ./diagrams/infrastructure-dark.svg
□ ./diagrams/infrastructure-simplified.md
□ ./diagrams/infrastructure-simplified.d2
□ ./diagrams/infrastructure-simplified-light.svg
□ ./diagrams/infrastructure-simplified-dark.svg
□ ./diagrams/architecture.md
□ ./diagrams/architecture.d2
□ ./diagrams/architecture-light.svg
□ ./diagrams/architecture-dark.svg
□ ./diagrams/architecture-simplified.md
□ ./diagrams/architecture-simplified.d2
□ ./diagrams/architecture-simplified-light.svg
□ ./diagrams/architecture-simplified-dark.svg
□ ./diagrams/README.md
Infrastructure.md checks:
Architecture.md checks:
Infrastructure.d2 checks:
Architecture.d2 checks:
Icons are required for visual quality. Missing icons = FAIL.
Check D2 files have icon URLs (required for --bundle):
# MUST have icon: properties - D2's --bundle flag only embeds direct icon URLs
icon_count=$(grep -c "icon:" ./diagrams/infrastructure-simplified.d2 || echo 0)
[ "$icon_count" -ge 3 ] && echo "PASS: $icon_count icons" || echo "FAIL: only $icon_count icons (need 3+)"
icon_count=$(grep -c "icon:" ./diagrams/architecture-simplified.d2 || echo 0)
[ "$icon_count" -ge 3 ] && echo "PASS: $icon_count icons" || echo "FAIL: only $icon_count icons (need 3+)"
Check SVGs have inlined icons (no <image> tags for GitHub compatibility):
# After Phase 8, SVGs should have inline <svg> elements, NOT <image> tags
# GitHub strips <image> tags, so icons must be inlined
image_count=$(grep -c "<image " ./diagrams/infrastructure-simplified-light.svg 2>/dev/null || echo 0)
[ "$image_count" -eq 0 ] && echo "PASS: icons inlined for GitHub" || echo "FAIL: $image_count <image> tags remain - run inline-svg-icons.sh"
# Verify nested SVGs exist (inlined icons)
nested_svg_count=$(grep -o "<svg " ./diagrams/infrastructure-simplified-light.svg | wc -l | tr -d ' ')
[ "$nested_svg_count" -ge 2 ] && echo "PASS: $nested_svg_count SVG elements (1 root + icons)" || echo "WARN: few nested SVGs"
If <image> tags remain, run ${CLAUDE_PLUGIN_ROOT}/scripts/inline-svg-icons.sh --all ./diagrams/
If icons are missing entirely, the Renderer agent failed to add icon: properties to nodes. Re-run Phase 7.
For each SVG file:
<svg tag<path or <rect (has content)traffic-flow keyframe)Check primary README (or ./diagrams/README.md):
<picture> element for infrastructure diagram<picture> element for architecture diagramprefers-color-scheme: dark media queryprefers-color-scheme: light media query# Check file exists and has content
test -s ./diagrams/infrastructure.md && echo "PASS" || echo "FAIL"
# Check SVG is valid
grep -q '<svg' ./diagrams/infrastructure-light.svg && echo "PASS" || echo "FAIL"
# Check D2 syntax
d2 fmt ./diagrams/infrastructure.d2 --check && echo "PASS" || echo "FAIL"
# Word count check
wc -w ./diagrams/infrastructure.md | awk '{print ($1 > 100) ? "PASS" : "FAIL"}'
{
"status": "PASS|FAIL",
"timestamp": "ISO8601",
"checks": {
"file_existence": {
"status": "PASS|FAIL",
"details": ["list of missing files"]
},
"documentation_quality": {
"status": "PASS|FAIL",
"infrastructure": {"status": "PASS|FAIL", "issues": []},
"architecture": {"status": "PASS|FAIL", "issues": []}
},
"d2_syntax": {
"status": "PASS|FAIL",
"infrastructure": {"status": "PASS|FAIL", "errors": []},
"architecture": {"status": "PASS|FAIL", "errors": []}
},
"svg_quality": {
"status": "PASS|FAIL",
"files": {
"infrastructure-light.svg": {"status": "PASS|FAIL", "size": 0},
"infrastructure-dark.svg": {"status": "PASS|FAIL", "size": 0},
"architecture-light.svg": {"status": "PASS|FAIL", "size": 0},
"architecture-dark.svg": {"status": "PASS|FAIL", "size": 0}
}
},
"readme_integration": {
"status": "PASS|FAIL",
"issues": []
}
},
"summary": "X/Y checks passed"
}
If verification fails:
If verification passes:
.diagram/state.jsonOn successful verification:
# Remove state file (work complete)
rm -f .diagram/state.json
# Keep .diagram directory for rules and future incremental runs
# Do NOT remove .diagram/rules.md if it exists
Use this agent when analyzing conversation transcripts to find behaviors worth preventing with hooks. Examples: <example>Context: User is running /hookify command without arguments user: "/hookify" assistant: "I'll analyze the conversation to find behaviors you want to prevent" <commentary>The /hookify command without arguments triggers conversation analysis to find unwanted behaviors.</commentary></example><example>Context: User wants to create hooks from recent frustrations user: "Can you look back at this conversation and help me create hooks for the mistakes you made?" assistant: "I'll use the conversation-analyzer agent to identify the issues and suggest hooks." <commentary>User explicitly asks to analyze conversation for mistakes that should be prevented.</commentary></example>