Skip to content
Back to skills

Decisions

ASecurity

- Status: Accepted - Date: 2026-10-12 - Decision register: D51

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
ai-agentsrustshellnodegit

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add evoelsewhere/kintsugi --skill decisions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Decisions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Decisions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/evoelsewhere-decisions/badge)](https://www.skillsdirectory.com/skills/evoelsewhere-decisions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# ADR-0032: Mermaid for every diagram, drawn by a built-in skill and checked by a lint

- Status: Accepted
- Date: 2026-10-12
- Decision register: D51

## Context
The runtime stages write diagrams: `assess` the domain diagram (`ARCHITECTURE.mmd`), `map` a call graph, a data lineage and a critical path, `understand` the flows of each unit, the AS-IS architecture and the data model ([ADR-0031](0031-understand-stage-as-is-specification.md)); members write a target architecture and a phase plan in the brief. Until now each command said only "a Mermaid graph" with a rough edge limit. Agents wrote `graph TD` or `flowchart`, quoted labels or not, and pasted legacy names (with dots, brackets, quotes, keywords such as `end`) as node ids. Such diagrams fail to render, and a name crafted in the source could carry a `click` link into a committed document.

Constraints: runtime agents have no shell ([ADR-0029](0029-job-workspaces-instead-of-os-sandboxes.md)) and receive only `SKILL.md` text in their system prompt ([ADR-0023](0023-runtime-as-generic-agent-kernel.md), [ADR-0026](0026-runtime-agents-and-agent-builder.md)); Kintsugi ships no stack-specific content and adds no infrastructure dependency (no Node renderer or headless browser in the worker).

Options: write the rules into every command (repeated, drifts); render with the Mermaid CLI in the worker (a browser dependency); a shared skill plus a standard-library lint.

## Decision
1. **Every diagram in Kintsugi is Mermaid**: a `.mmd` file with one diagram, or a `mermaid` fence in Markdown. No PlantUML, ASCII art or images.
2. A built-in shared skill, `packages/agents/builtin/plugins/reverse_engineering/skills/mermaid-diagrams/`, says how: the diagram type per artifact (domain architecture `flowchart TB` with a subgraph per domain and classes by kind; call graph `flowchart TD`; data lineage `flowchart LR`; critical path `flowchart TD`; unit flows `sequenceDiagram`; data model `erDiagram`; lifecycles `stateDiagram-v2`; target architecture `C4Container`; phases `flowchart LR`, never `gantt`), syntax-safety rules for untrusted names (sanitized and prefixed ids, quoted and escaped labels, no keywords, no theming, no `click`/`href`), and size limits (40 edges, about 25 nodes, 12 participants; collapse or split beyond them). It is adapted from softaworks/agent-toolkit (MIT, pinned commit, see the package `NOTICE`); its `references/` hold condensed syntax per type and stay on disk for people and members, since the kernel loads `SKILL.md` only.
3. The runtime agents that draw (`legacy-analyst`, `business-rules-extractor`, `architecture-critic`) load the skill; commands name it in `metadata.skills`, and a test checks that a runtime stage's agents carry every skill the stage names. The member plugin gets the same skill.
4. `scripts/mermaid_lint.py` (standard library, offline) checks the rules; it renders with `mmdc` only when that is installed. Members run it before they commit. The JobOutput hook runs it over every `.mmd` and Markdown output and reports **warnings** that never block: agents cannot run it themselves, the lint is a heuristic subset of the grammar, and a diagram problem is not worth discarding a valid output. The worker keeps the count and the first warnings on the step summary.

## Consequences
- Diagrams render predictably and legacy names cannot break or inject into them; reviewers see lint warnings on the job.
- Every runtime job of the three agents carries the skill text (about 10 KB) in its system prompt.
- The skill amends the "no new skill" note of ADR-0031: the understand stage's diagrams follow it.
- Follow-up: the Harness Hub copies the skill and the lint into the generated member plugin; the portal may show the step's diagram warnings.

## Alternatives considered
- **Mermaid CLI in the worker** as a blocking check: a Node and headless-browser dependency in every installation for a cosmetic check.
- **Blocking on lint problems**: would discard expensive analysis for a quoting mistake the agent cannot detect without a shell.
- **Other diagram languages** (PlantUML, D2, Structurizr): need renderers the portal and the Git hosts do not have.

Files in this skill

  • 0001-pi-as-kintsugi-runtime.md1.9 KB
  • 0002-typescript-monorepo.md578 B
  • 0003-postgres-job-queue.md1.2 KB
  • 0004-runner-container-per-job.md3.2 KB
  • 0005-canonical-asset-format.md1.2 KB
  • 0006-self-hosted-package.md929 B
  • 0007-git-as-source-of-truth.md2.1 KB
  • 0008-authentication.md1.3 KB
  • 0009-llm-provider-config.md2.6 KB
  • 0010-postgres-only.md731 B
  • 0011-project-rulebook.md3.3 KB
  • 0012-work-items-as-files-in-git.md3.8 KB
  • 0013-composable-open-rulebook.md6.5 KB
  • 0014-no-code-graph-no-agent-config.md3.1 KB
  • 0015-member-assets-as-agent-plugins.md6 KB
  • 0016-nestjs-api-framework.md3.3 KB
  • 0017-portal-vite-react-shadcn.md2.6 KB
  • 0018-pin-pi-exact-version.md3 KB
  • 0019-workspace-repo-write-path.md5.7 KB
  • 0020-docker-api-via-socket-proxy.md3.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.