diegomarino/claude-toolshed/d2-validate

Claude Code and agent skill by diegomarino/claude-toolshed

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Validate D2 syntax in .d2 files or directories

Install

npx vskill@latest install diegomarino/claude-toolshed/d2-validate

SKILL.md

/d2-validate

User request: "$ARGUMENTS"

Task

Validate D2 syntax in .d2 files or .md files containing D2 code blocks.

Process

Step 1: Resolve Plugin Path
bash
PLUGIN_DIR=$(find "$HOME/.claude/plugins/cache" -type d -name "d2" -path "*/skills/d2" 2>/dev/null | head -1)
[ -z "$PLUGIN_DIR" ] && PLUGIN_DIR=$(find "$HOME" -maxdepth 8 -type d -name "d2" -path "*/skills/d2" 2>/dev/null | head -1)
Step 2: Ensure D2 is installed
bash
bash "$PLUGIN_DIR/scripts/ensure-deps.sh"
Step 3: Determine Input

From $ARGUMENTS:

  • `.d2` file → validate directly
  • `.md` file → extract D2 blocks first with extract_d2.sh, then validate each
  • Directory → find all .d2 files and .md files with D2 blocks
  • No argument → ask: "Which file or directory should I validate?"
Step 4: Collect Files to Validate

For `.d2` files:

bash
# Validate directly
d2 validate {file.d2}

For `.md` files:

bash
# Extract D2 blocks to temp files
bash "$PLUGIN_DIR/scripts/extract_d2.sh" {file.md}
# Then validate each extracted temp file
d2 validate {temp_file}

For directories:

bash
# Find all .d2 files
find {dir} -name "*.d2" -not -path "*/node_modules/*" -not -path "*/.git/*"
# Find .md files containing d2 blocks
grep -rl '```d2' {dir} --include="*.md" 2>/dev/null
Step 5: Validate Each File

For each file:

bash
d2 validate {file} 2>&1
# Exit 0 = valid, non-zero = error

Track: filename, pass/fail, error message (if any).

Step 6: Report Results
Validated {N} diagrams:
✅ diagrams/architecture-services-20260310.d2
✅ diagrams/sequence-auth-flow-20260310.d2
❌ docs/design.md (block 2) — unexpected token at line 14: missing closing brace

If any failures:

{N} validation error(s) found.
See $PLUGIN_DIR/references/guides/troubleshooting.md for fixes.

If all pass:

All {N} diagrams valid ✅

Output Summary Format

D2 Validation Summary
─────────────────────
Path: {input_path}
Files checked: {N}
Passed: {N} Failed: {N}
{per-file results}
{troubleshooting hint if any failures}

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
58
Repository forks
5
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/diegomarino/claude-toolshed/d2-validate/badge)](https://verified-skill.com/skills/diegomarino/claude-toolshed/d2-validate)

Something wrong with this skill or its page? Tell us.