From lazycortex-diagram
Audit the lazycortex-diagram plugin: verify template well-formedness, exemplar conformance against the authoring rule, and role + init-block coverage in styles-*.json schemes. Parallel-scan coordinator dispatching 3 read-only Explore agents (A2, A3, A5). Read-first; presents findings, asks before fixing. Severity: PASS / WARN / FAIL / INFO. TODO: re-add fixture-related scans (A1, A4) when the final dev-vs-shipped split is decided.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lazycortex-diagram:lazy-diagram.auditThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit the `lazycortex-diagram` plugin for template well-formedness and contract conformance on exemplars. Read-first; nothing is mutated until the user approves.
Audit the lazycortex-diagram plugin for template well-formedness and contract conformance on exemplars. Read-first; nothing is mutated until the user approves.
This skill is a parallel-scan coordinator per lazy-core.skill-writing § 5. Phase 1 dispatches Explore agents in a single message; Phase 2+ merges their structured reports.
TODO: fixture-side scans (A1 fixture-template coverage, A4 fixture freshness) were removed because the dev-vs-shipped split for
tests/diagram/is still unsettled. Re-add when that split is finalized.
This skill has 7 ordered steps. The executor MUST NOT skip, merge, reorder, or silently omit any step. To make dropped steps structurally impossible:
TaskCreate with exactly one task per step below — no merging, no abbreviation, no renaming. The canonical list (use these titles verbatim):
Step 1 — Pre-flightStep 2 — Dispatch A2–A3 + A5 in parallelStep 3 — Merge structured reportsStep 4 — Present unified reportStep 5 — Ask which to fixStep 6 — Apply confirmed fixesStep 7 — Log the runin_progress on enter and completed on exit. "Completed" means "I executed the step's logic AND produced an outcome word for it".TaskList shows steps 1–3 completed. Reports without merge are a bug.~/.claude/plugins/installed_plugins.json. If absent → [FAIL] plugin not installed. Stop.${CLAUDE_PLUGIN_ROOT} for the dispatch prompts in Step 2.Outcome: asserted (root=<path>) or [FAIL].
In a SINGLE assistant message, dispatch three Agent calls with subagent_type: "Explore" and mode: "dontAsk". Each agent's prompt embeds the structured-report contract from claude/lazycortex-core/references/lazy-core.parallel-scan.md. Word budget: under 300 words per agent.
Scope:
<root>/templates/diagram.*/diagram-*.md.For each template, verify (a) frontmatter parses and contains
kind:+purpose:, (b) body has## IdiomsH2, (c) for mermaid templates only: body has## RolesH2 and## Color bindingH2, (d) body has## ExemplarH2, (e)## Exemplarcontains exactly one fenced code block, (f) the code block's info-string matches the format folder (mermaidfortemplates/diagram.mermaid/,textfortemplates/diagram.ascii/).Missing section or info-string mismatch →
FAIL. Frontmatter parse error →FAIL. Multiple fences in## Exemplar→WARN.Return the structured
## scan: A2-template-wellformednessblock.
Scope:
<root>/templates/diagram.*/diagram-*.md.For each mermaid exemplar fence, verify the structural sanity-check items the drawer agent enforces (see
claude/lazycortex-diagram/agents/lazy-diagram.draw-mermaid.md§ sanity checks). Init directive content is not applicable in templates — templates ship structure-only and the drawer composes the directive from the scheme; the init check runs at fixture time, not template time. Items checked:
- No single-letter IDs: every node, participant, state, entity, class, region ID is camelCase / PascalCase domain vocabulary.
- Every edge labelled: no unlabelled edges (bare
-->, bare->>, etc.).Additionally for mermaid templates:
- The
## Exemplarfence's first non-blank line MUST be the literal<<init>>sentinel. Any other init literal (a%%{init:line, athemeVariablesblock, etc.) anywhere in the file →FAIL— init lines must live instyles-*.json:blocks.init.<kind>only.- Any literal style value anywhere in the template →
FAIL— literals must live instyles-*.jsononly. Detection regexes:
- Hex colours:
#[0-9a-fA-F]{3,8}\b(covers#fff,#ffffff,#ffffff80).- Pixel sizes:
\b\d+(\.\d+)?px\b.- Raw
themeCSS-shaped strings: anythemeCSStoken anywhere in the file body.- Mermaid layout-config keys quoted as literal values: any of
'?diagramPadding'?\s*:\s*\d,'?padding'?\s*:\s*\d,'?diagramMarginX'?\s*:\s*\d,'?diagramMarginY'?\s*:\s*\d,'?topPadding'?\s*:\s*\d,'?leftPadding'?\s*:\s*\d,'?rightPadding'?\s*:\s*\d,'?leftMargin'?\s*:\s*\d,'?fontSize'?\s*:\s*\d. (These are scheme-owned; templates must not pin them.)- Literal
'theme':\s*'base'anywhere in the file →FAIL(forbidden by the drawer agent's OUTPUT CONTRACT and sanity check 8; must not leak into template prose either).- Any
classDef/class <id> <role>/ per-elementstyle <id>line in the## Exemplarfence →WARN— exemplars are structure-only.False-positive guard: hex/CSS regex matches inside fenced code blocks marked
\``jsonare part of an example/illustrative scheme snippet, not a template literal — exempt those matches from FAIL but emitINFO` so an author can verify the snippet is genuinely illustrative and not a smuggled scheme.Each violation → severity above with file:line.
Return the structured
## scan: A3-exemplar-conformanceblock.
Scope:
<root>/templates/diagram.mermaid/styles-*.jsonand every<root>/templates/diagram.mermaid/diagram-*.md(frontmatterkind:+## Color binding+## Rolessections).For each styles-*.json, parse the JSON. Three sub-checks:
- Role coverage. For each role name referenced in any template's
## Color binding(the right-hand side after←, before any.fill/.stroke/.strokeWidthaccessor), verify it has a hex entry underroles(or undertextConstantsfor text tokens liketextOnPlate,textOnCanvas,loopText,lineOnCanvas). Missing entry →FAILwith<scheme-file> missing role <role>.- Init-block coverage. For every kind referenced by a template (collect from
templates/diagram.mermaid/diagram-*.mdfrontmatterkind:), verify the scheme'sblocks.init.<kind>entry exists and is a non-empty string. Missing or empty →FAILwith<scheme-file> missing blocks.init.<kind>.- Init-block sanity per kind. Each
blocks.init.<kind>value MUST: (a) start with%%{init:and end with}%%; (b) contain'useMaxWidth':true(per drawer agent sanity check 10 — layout config); (c) NOT contain the literal'theme':'base'; (d) NOT contain'darkMode':true. Any failure →FAILwith<scheme-file> blocks.init.<kind>: <which check>.Also verify: every role listed in any template's
## Rolessection is referenced by that template's## Color binding. Declared-but-unused →WARN.Return the structured
## scan: A5-coverageblock.
Outcome: dispatched (3 agents).
## scan: headings.<path>:<line> + title = one)..guard-waivers.json if present (none expected for this plugin in v1).Outcome: merged (<n> findings).
Render to the user:
# lazy-diagram.audit report
## A2 — Template well-formedness
[<sev>] <title> | <path>
...
## A3 — Contract conformance on exemplars
...
## A5 — Role + init-block coverage in styles-*.json
...
## Summary
pass: <n> warn: <n> fail: <n> info: <n>
Outcome: presented.
fail + warn == 0 → nothing-to-fix. Skip to Step 7.AskUserQuestion (single multi-select) listing each WARN/FAIL finding as an option. Capture the user's selection.Outcome: confirmed (<n> selected) or nothing-to-fix.
For each selected finding, the coordinator (this session, not the agents) applies the fix. Fix vocabulary:
lazy-diagram.fix against the offending file.roles{} or textConstants{}.blocks.init.<kind> entry under templates/diagram.mermaid/styles-*.json.useMaxWidth missing, theme:base present, darkMode:true present, malformed wrapper); ask the user to fix the scheme entry.## Roles line or extend ## Color binding to reference it.Outcome: per-finding fix-outcome word (fixed / deferred / skipped-per-user-choice).
/lazy-diagram.audit aborts: "[FAIL] plugin not installed" — lazycortex-diagram is not found in ~/.claude/plugins/installed_plugins.json → install the plugin via /lazy-core.install, restart Claude Code, then re-run.Two separate calls:
Bash: mkdir -p ./.logs/claude/lazy-diagram.auditWrite: ./.logs/claude/lazy-diagram.audit/<UTC-timestamp>.md with frontmatter (git_sha, git_branch, date, input) and the unified report from Step 4 plus the fix outcomes from Step 6.Outcome: logged.
npx claudepluginhub mebius-san/lazy-cortex --plugin lazycortex-diagramProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.