Skip to content

ucsahinn/agentchef / plugins/agentchef/skills/offline-diagram-triplet

offline-diagram-triplet

Verified

Create editable offline diagrams from an English description or Mermaid source. Use when the agent should emit a triplet: Mermaid source, an editable .excalidraw file for excalidraw.com, and rendered SVG/PNG assets with zero network access.

FileKindSize
SKILL.mdskill md2.6 KB
agents/openai.yamlconfig295 B
references/diagram-contract.mdmarkdown2.5 KB
scripts/render-diagram-triplet.mjsscript24.4 KB

references/diagram-contract.md

View on GitHub
# Offline Diagram Contract

Use this reference when creating, validating, or extending the offline diagram
triplet workflow.

## Output Contract

For each diagram request, the workflow should be able to produce:

- Mermaid source: `.mmd`
- Editable Excalidraw scene: `.excalidraw`
- Rendered vector asset: `.svg`
- Rendered raster asset: `.png`
- Markdown snippet: `.md`

All outputs must be generated locally. Do not call remote Mermaid or Excalidraw
rendering services.

## Supported Mermaid Subset

The bundled renderer is intentionally smaller than Mermaid itself. Use:

- `flowchart TD`
- `flowchart TB`
- `flowchart BT`
- `flowchart LR`
- `flowchart RL`
- Node forms:
  - `A[Rectangle]`
  - `B(Rounded)`
  - `C((Ellipse))`
  - `D{Decision}`
  - bare identifiers, converted to rectangles
- Edge forms:
  - `A --> B`
  - `A -->|label| B`
  - `A -.-> B`
  - `A ==> B`
  - `A --- B`
- Mermaid comments beginning with `%%`
- Optional trailing semicolons

The renderer rejects cyclic graphs and enforces input, node, edge, and pixel
limits to keep local rendering predictable.

## Unsupported Unless Implemented

Do not imply support for these without extending and validating the renderer:

- Subgraphs
- Class definitions and theme blocks
- HTML labels
- Icons and font-awesome markers
- Click handlers
- Sequence, state, ER, class, Gantt, or mind-map diagrams
- Remote images or external renderers
- Advanced Mermaid shape syntax beyond the supported forms

## Excalidraw Scene Contract

The `.excalidraw` output should remain an editable JSON scene with:

- top-level `type: "excalidraw"`
- numeric `version`
- `source`
- `elements`
- `appState`
- `files`

Use Excalidraw element types that map cleanly from the supported Mermaid subset:
rectangle, diamond, ellipse, text, and arrow elements. Preserve editability; do
not flatten the scene into an image.

## Safety

- Keep labels short and public-safe.
- Do not include secrets, tokens, credential material, private hostnames, or
  private local paths in labels, filenames, or snippets.
- Keep artifacts local unless the user explicitly asks to version them.
- If a diagram describes a sensitive system, summarize trust boundaries without
  leaking implementation secrets.

## Validation

Run:

```bash
npm run validate:diagram
```

For manual checks:

- Parse the `.excalidraw` file as JSON.
- Confirm the SVG starts with `<svg`.
- Confirm the PNG has a valid PNG signature.
- Open the `.excalidraw` file on excalidraw.com only when the user wants a
  manual editability check.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall