drawio-ai-kit: Instructions file for Codex

AGENTS.md

drawio-ai-kit AGENTS.md is an instructions file for Codex, OpenCode from sparklabx/drawio-ai-kit. It costs 1,224 tokens per session, scanned A, original, MIT.

Project instructions for drawio-ai-kit, a toolkit that helps an AI create draw.io diagrams. They describe its runtime, code style, layout patterns, and rules for where generated diagram files may be written.

In plain words
What is it for?
Use them when developing the kit, running its checks, or generating diagrams with its layout and icon conventions.
Why use it?
They keep changes compatible with the repository and prevent generated diagrams from being written into the toolkit’s own source folder.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is sparklabx/drawio-ai-kit's own configuration. It tells Codex and OpenCode how to work on drawio-ai-kit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything drawio-ai-kit configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sparklabx/drawio-ai-kit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sparklabx/drawio-ai-kit/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/sparklabx/drawio-ai-kit

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drawio-ai-kit AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/sparklabx/drawio-ai-kit/agents-md/github.svg)](https://agentmods.dev/instructions/sparklabx/drawio-ai-kit/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/sparklabx/drawio-ai-kit/agents-md"><img src="https://agentmods.dev/badge/instructions/sparklabx/drawio-ai-kit/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for drawio-ai-kit AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/sparklabx/drawio-ai-kit/agents-md"><img src="https://agentmods.dev/badge/instructions/sparklabx/drawio-ai-kit/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,224 This file is loaded in full into every session.
When invoked 1,224 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01224 $0.01224
Opus 5.5 $0.00490 $0.00490
Sonnet 5.5 $0.00245 $0.00245
Haiku 4.5 $0.00122 $0.00122

Measured 9d ago against content hash 6e7d072cc5af, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

drawio-ai-kit AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 39 lines

How it starts

The opening of the file, as written. The whole thing — 39 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repository Guidelines

drawio-ai-kit helps an AI draw correct, beautiful draw.io diagrams.

[!IMPORTANT] Hard rule (see skills/drawio/SKILL.md): The kit is read-only infrastructure. Write generated .drawio/.xml output into the user's cwd, never into the repo folder.

Tech Stack & Runtime

  • Node.js ≥20.6 or Bun (ESM, .nvmrc = 22; running TS tests natively needs ≥22.18) is the user runtime. "type": "module"; zero default exports (named exports only).
  • Dependencies: add libraries as devDependencies; Bun bundles them into dist/, so users install nothing extra. Add a real dependencies entry only if the library cannot be bundled (native addon, WASM file, dynamic require). Today minisearch is bundled this way. Never add a postinstall hook.
  • Bun 1.4+ is the maintainer toolchain:
    • bun test runs the node:test suites. npm test runs the same suites on plain Node, and both must pass.
    • bun run build (scripts/build.mjs, Bun.build) bundles src/cli.ts + src/kit.ts into the minified dist/, which ships in the npm tarball. dist/ is gitignored: CI and the release job build it; never commit it.
    • bun run build:check rebuilds into a temp dir and fails if the build is non-deterministic.
  • package-lock.json is the only lockfile. Run npm install after changing dependencies. Never commit bun.lock.
  • For the architecture, directories, and files, see docs/developer-guide.md.

Code Conventions & Common Patterns

  • Erasable-syntax TypeScript in src/ and test/ (.ts, no enums/namespaces/parameter properties); npm run typecheck must pass. Bun is the only bundler, and it is used only to build dist/. Import local files with the .ts extension. Use import type for types.
  • Shared types live in src/model.ts (types only, erased at build). A type used by one module stays in that module.
  • src/ must run on Node. No Bun.* APIs in src/; they are allowed only in scripts/ and CI. Sole exception: src/run-hook.ts uses Bun.plugin behind a runtime check (it only runs under Bun).
  • After any src/ change: run bun run build before tests/benches (they exercise dist/). Do not commit dist/.
  • One skill: skills/drawio/ (SKILL.md + references/ + workflows/). There are no per-domain skills; a new domain is a new reference file (see docs/adding-a-domain.md). Write skill docs in short, explicit steps that small models (Haiku-class) can follow.
  • Catalog injection: loadCatalog() returns the merged catalog; every core.ts function takes catalog as first arg; builder.ts stores it as this.c.
  • Declarative layout > coordinates: Build node trees with layout-engine.ts factories (group/frame/grid + icon/box) → renderTree(d, root) → Diagram. Hardcoding x/y coordinates violates the design pattern.
  • Color = Identity: Never recolor AWS icons away from their category color (colorFor: entry.color → categoryColors[category] → #232F3E).
  • Nesting Hierarchy: Group nesting order is enforced by GROUP_LEVEL: Cloud/Account/Region=0 → VPC=2 → AZ=3 → Subnet=4 → SG=5.
  • Edge Rounding Policy: Tree/fanout roles → sharp (rounded=0); flow → type's edgeCorner.
  • Icon search is src/search.ts (minisearch, bundled). Curated shorthand and synonyms live in data/aliases.json (entry name → phrases). To fix a bad search, add an alias there. Do not edit scoring code first.
  • Imports in user scripts: always import { ... } from "drawio-ai-kit", never a path into the kit. Run scripts with drawio-ai run build.mjs. Examples and scaffold output follow this rule.

Read the full file on GitHub · 39 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago Changed · +19 lines · +797 tokens per session 6e7d072cc5af
  2. 1mo ago First seen · 20 lines · 427 tokens per session scan A 693157423e42

Subscribe to this mod's changes

drawio-ai-kit AGENTS.md is an instructions file published in the GitHub repository sparklabx/drawio-ai-kit (659 stars, last pushed 10d ago), licensed MIT. It adds 1,224 tokens to every session, about $0.0049 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,384 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens