agentleFS
DailybotHQDailybotHQ/deepworkplan-website/.agents/skills/add-diagram-component/SKILL.md

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.

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
  1. Distinctive:

    Create a diagram as a component (not an image) in the "Broadsheet" editorial style, with text in the codebase so translation to more …

    line 18
  2. Very specific:

    Do NOT: use this for hero illustrations / atmospheric or line-art images — those stay AI-generated rasters (see docs/visuals/).

    line 31
  3. Very specific:

    No hardcoded copy (including aria-label).

    line 45
  4. Very specific:

    Embed in-body via MDX: ensure the target doc is .mdx (collections glob /*.{md,mdx}).

    line 53
  5. Very specific:

    Keep the agent .md endpoint in sync (pnpm run md:check).

    line 59
  6. Very specific:

    Add one key to each component's i18n map (seeded from the EN keys) — no new image assets.

    line 66
  7. Distinctive:

    Never place a diagram before the document title.

    line 73

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 is src/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

  1. Pick the technique (best tool per diagram): inline SVG for geometric diagrams (loops, arrows, radial); HTML/CSS grid/flex for panels, trees, comparisons, sequences.
  2. Create the component under src/components/diagrams/{methodology,spec,kit,home}/ as .astro (zero JS). Only use .svelte + client:visible if a genuine low-cognitive interaction (hover/toggle) adds value.
    • interface Props { lang?: Language; class?: string }, default lang = 'en'.
    • Inline i18n map keyed by language code with an en fallback: 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 uses fill/stroke: currentColor). Explicit aspect-ratio (no CLS). Decorative inner labels are <p>/<span>, never headings (the figure is role="img").
  3. 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). Because en//es/ are separate files, hardcode the language per file: <X lang="en" class="not-prose my-10" /> (and lang="es" in the ES file). Wrap with not-prose so prose styles don't bleed in. Keep the agent .md endpoint in sync (pnpm run md:check).
  4. Validate: pnpm run biome:check, pnpm run astro:check, pnpm run build; confirm it renders in en, 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/variant props (shared layout helpers are fine, e.g. the kit command family's CommandSequence).
  • Never place a diagram before the document title.
  • WCAG AA tokens only; never text-gray-400/500.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.