#1250·diagrams

Make repo AI-agent compatible: AGENTS.md + Agent Skill (SKILL.md)

Author: arnabwithabCreated Sep 7, 2026Updated Sep 7, 2026

diagrams is a perfect agent target (Diagram-as-Code), but the repo currently has nothing that teaches an agent how to use it correctly. No AGENTS.md, no CLAUDE.md, no .github/copilot-instructions.md, no Skill. Result: agents guess, and guess wrong in predictable ways.

Observed failure modes when agents work in/against this repo:

  1. Edits generated files. CONTRIBUTING.md says never hand-edit anything under diagrams/ (all node classes are auto-generated from resources/... via autogen.sh + config.py ALIASES). Agents don't read that; it's the first thing they touch.
  2. Hallucinated node names/imports. Correct pattern is from diagrams.aws.compute import EC2, but agents invent names instead of resolving via resources//... or docs/nodes/. Aliases in config.py make this worse.
  3. show=True default + missing Graphviz. Agents run code in headless CI, leave show=True, and/or miss the system dep (brew/apt install graphviz) vs the pip package.
  4. Wrong core semantics. Diagram/Cluster context managers, >>/<</- edge operators, Edge attrs, direction/outformat - all undocumented in one agent-digestible place.
  5. autogen.sh toolchain surprise. Requires round, black, inkscape, convert - agents discover this only after failing.

Proposal (minimal, two files):

  • Add AGENTS.md at repo root: how to build/test (python -m unittest tests/.py -v, poetry install), Graphviz system dep, show=False for headless, generated-file boundary (edit resources/ + config.py, run autogen.sh; never edit diagrams/* by hand), one minimal verified Diagram example.
  • Add an Agent Skill (e.g. skills/diagrams/SKILL.md with progressive disclosure): quickstart, node lookup workflow (resources/ tree + docs/nodes/), Cluster/Edge patterns, headless rendering notes. Keep it small; link, don't duplicate, existing docs.
  • Optional follow-ups only if the above proves insufficient: llms.txt node index, CI check that rejects hand-edits to generated modules, headless/show=False lint hint.

Happy to PR the AGENTS.md + SKILL.md if you agree on location/format.