← ClaudeAtlas

diagram-gen-speclisted

Generate a top-down diagram of intended architecture from a mache schema file — what the PR proposes, not what the code does. Local reviewer context only; pair with diagram-gen-emergent for spec-vs-reality drift.
jamestexas/agents · ★ 2 · AI & Automation · score 61
Install: claude install-skill jamestexas/agents
# diagram-gen-spec — Spec-Driven Structural Diagram Generate a top-down diagram from a mache schema. Shows what the author intended to build. This is reviewer-local context only — never post this output to GitHub. ## Arguments `$ARGUMENTS` — `<schema-path-or-pr-number> [source-path]` - First argument: path to a mache schema JSON file, OR a PR number (to find the schema in the PR's changed files) - Second argument (optional): source directory to serve against the schema ## What To Do ### Step 1: Find the schema **If first argument looks like a PR number (all digits or owner/repo#N):** ```bash # Look for schema files changed in the PR gh pr diff $ARG --name-only 2>/dev/null | grep -E "(schema\.json|mache\.json|\.schema\.json)" ``` **If first argument is a file path:** use it directly. **If no schema found from PR, look in the repo root:** ```bash ls examples/*.json 2>/dev/null | head -5 ls *.json 2>/dev/null | grep -i schema | head -3 ``` If no schema found anywhere, return: ``` status: unavailable type: spec-driven reason: no mache schema found in PR changed files or repo root ``` Stop here. ### Step 2: Determine source path If a second argument was provided, use it as `SOURCE`. Otherwise, if argument was a PR number, derive source from the repo: ```bash gh pr view $ARG --json headRepository --jq '.headRepository.nameWithOwner' 2>/dev/null ``` Fall back to current working directory if detection fails. ### Step 3: Start mache with the schema on port 7534 ```bash M