add-diagram-component
Skill15 starsChanged 5 months agoMITView on GitHub
Create an editorial HTML/CSS/SVG diagram component (Editorial Interactive Asset) and embed it in-body via MDX. Use proactively when adding a diagram/figure to a methodology, spec, or kit page instead of a raster image.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- add-componentSkill
- add-languageSkill
- add-pageSkill
- ai-diff-reviewerSkill
- dailybotSkill
- deepworkplanSkill
- doc-editSkill
- fix-lintSkill
- git-commit-pushSkill
- pr-review-liteSkill
- quick-fixSkill
- refactor-safeSkill
- responsive-lighthouse-auditSkill
- security-checkSkill
- translate-syncSkill
- type-fixSkill
- update-stylesSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Create a diagram as a component (not an image) in the "Broadsheet" editorial style, with text in the codebase so translation to more …
- Very specific: line 31
Do NOT: use this for hero illustrations / atmospheric or line-art images — those stay AI-generated rasters (see docs/visuals/).
- Very specific: line 45
No hardcoded copy (including aria-label).
- Very specific: line 53
Embed in-body via MDX: ensure the target doc is .mdx (collections glob /*.{md,mdx}).
- Very specific: line 59
Keep the agent .md endpoint in sync (pnpm run md:check).
- Very specific: line 66
Add one key to each component's i18n map (seeded from the EN keys) — no new image assets.
- Distinctive: line 73
Never place a diagram before the document title.
≈ “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
add-diagram-component
Create a diagram as a component (not an image) in the "Broadsheet" editorial style, with text in the codebase so translation to more languages is nearly free, then embed it in-body via MDX at the right point in the narrative.
Read first (mandatory):
docs/DIAGRAM_COMPONENTS.md— the full standard (rules, visual style, i18n convention, a11y, embedding, catalog). The reference implementation issrc/components/diagrams/methodology/CoreLoop.astro. Match it.
When to use
- A page would benefit from a flow, sequence, loop, tree, comparison, lifecycle, or architecture figure. Build it as a component.
- Do NOT use this for hero illustrations / atmospheric or line-art images — those
stay AI-generated rasters (see
docs/visuals/).
Procedure
- Pick the technique (best tool per diagram): inline SVG for geometric diagrams (loops, arrows, radial); HTML/CSS grid/flex for panels, trees, comparisons, sequences.
- Create the component under
src/components/diagrams/{methodology,spec,kit,home}/as.astro(zero JS). Only use.svelte+client:visibleif a genuine low-cognitive interaction (hover/toggle) adds value.interface Props { lang?: Language; class?: string }, defaultlang = 'en'.- Inline i18n map keyed by language code with an
enfallback:const t = i18n[lang as keyof typeof i18n] ?? i18n.en; - No hardcoded copy (including
aria-label). Brand/technical terms stay English. ES strings need correct diacritics. - Root
<figure class="editorial-asset …" role="img" aria-label={t.ariaLabel}>with.editorial-asset__grid+.editorial-asset__body; optional<figcaption class="fig-caption">. Use only--color-*tokens (dark mode follows automatically; SVG usesfill/stroke: currentColor). Explicitaspect-ratio(no CLS). Decorative inner labels are<p>/<span>, never headings (the figure isrole="img").
- Embed in-body via MDX: ensure the target doc is
.mdx(collections glob**/*.{md,mdx}). Import the component and place it at the narrative anchor — after the title and a short lead (overview), or at the heading of the section that explains it (section figure). Becauseen//es/are separate files, hardcode the language per file:<X lang="en" class="not-prose my-10" />(andlang="es"in the ES file). Wrap withnot-proseso prose styles don't bleed in. Keep the agent.mdendpoint in sync (pnpm run md:check). - Validate:
pnpm run biome:check,pnpm run astro:check,pnpm run build; confirm it renders inen,es, and dark mode, reads like a printed figure, and the title appears before the diagram.
Adding a language later
Add one key to each component's i18n map (seeded from the EN keys) — no new image
assets. Suitable for /translate-sync or the i18n-guardian agent.
Guardrails
- One component per use case — no
mode/variantprops (shared layout helpers are fine, e.g. the kit command family'sCommandSequence). - Never place a diagram before the document title.
- WCAG AA tokens only; never
text-gray-400/500.
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.

