termdraw
AGENTS.md338 starsChanged 7 months agoMITView on GitHub
termDRAW is a Bun-based TypeScript workspace for terminal-native diagramming. Run the smallest relevant set first, then the broader workspace checks before finishing larger changes.
- Reads credentials
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 0 are common, 11 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Default to using Bun instead of Node.js.
- Very specific: line 36
Use bun <file> instead of node <file> or ts-node <file>.
- Very specific: line 37
Use bun test instead of Jest or Vitest commands.
- Very specific: line 38
Use bun build <file.html|file.ts|file.css> instead of bundlers like webpack or esbuild.
- Very specific: line 39
Use bun install instead of npm, yarn, or pnpm.
- Very specific: line 40
Use bun run <script> instead of npm/yarn/pnpm script runners.
- Very specific: line 41
Use bunx <package> <command> instead of npx <package> <command>.
- Distinctive: line 43
Prefer Bun-native APIs when adding platform code:
- Very specific: line 50
Keep the workspace split intact: reusable editor behavior belongs in packages/opentui, the standalone CLI belongs in packages/app, and …
- Distinctive: line 51
Prefer targeted changes over broad rewrites.
- Very specific: line 52
When changing editor behavior, add or update tests in packages/opentui.
- Distinctive: line 53
Run the Pi smoke flow when modifying Pi embed behavior, save messaging, or bridge wiring.
- Distinctive: line 57
Run the smallest relevant set first, then the broader workspace checks before finishing larger changes.
- Very specific: line 70
Keep upcoming work under ## [Unreleased] with these subsections:
- Very specific: line 75
When cutting a release, move the relevant unreleased entries into a new immutable version section and then start a fresh ## [Unreleased] …
- Distinctive: line 76
Use the released changelog section as the starting point for GitHub release notes.
- Very specific: line 77
Prefer gh release create/edit --notes-file for multi-line release notes.
- Distinctive: line 78
Do not trust autogenerated GitHub release notes blindly.
- Distinctive: line 79
Prefer concise user-visible changelog entries over internal refactor details unless behavior changed.
- Distinctive: line 80
Keep all publishable packages on the exact same version at release time.
- Distinctive: line 81
When bumping versions, update every publishable package together and also update internal workspace dependency pins to the same version.
- Very specific: line 83
Use repo-level coordinated releases: create one root Git tag and one GitHub release per shared version, in the form vX.Y.Z.
- Very specific: line 85
Do not use package-specific release tags like app-vX.Y.Z, opentui-vX.Y.Z, or pi-vX.Y.Z for official releases.
- Distinctive: line 86
Before publishing, verify package versions are identical across all publishable packages.
- Very specific: line 90
Use Conventional Commit titles when practical: <type>[scope]: <description>.
- Distinctive: line 91
Keep commits focused and easy to review.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
AGENTS.md
What this project is
termDRAW is a Bun-based TypeScript workspace for terminal-native diagramming.
packages/opentuicontains the published@termdraw/opentuiembeddable OpenTUI library.packages/appcontains the published@termdraw/appstandalone CLI.packages/picontains the published@termdraw/piPi integration package that mounts termDRAW throughopentui-island.- The repo root provides shared workspace scripts for formatting, linting, testing, typechecking, build checks, packaging checks, and Pi smoke coverage.
Important file entry points
package.json— workspace scripts and maintenance commandstsconfig.json— shared TypeScript defaults for the workspacepackages/opentui/src/draw-state.ts— retained object model, selection, transforms, undo/redo, exportpackages/opentui/src/app.ts— renderable chrome/editor surface and input handlingpackages/opentui/src/react.ts— OpenTUI React component bindingspackages/app/src/main.tsx— standalone CLI runtime entrypointpackages/app/src/cli.tsx— Bun executable wrapper for the standalone apppackages/pi/extensions/overlay.ts— Pi/termdrawcommand and editor insertion flowpackages/pi/islands/termdraw.island.tsx— Pi island bridge component.github/workflows/*— CI and publishing automation
Architecture / mental model
DrawStateowns the drawing document, tool state, selection state, history, and exported output.TermDrawRenderablerenders either the full app chrome or the bare editor surface on top of the shared state model.react.tsexposesTermDrawApp,TermDrawEditor, andTermDrawas OpenTUI React components.cli.tsxwraps the full app for local CLI usage.- The Pi package adapts the same core UI through an island bridge and returns saved art back into the Pi editor.
Working rules
- Default to using Bun instead of Node.js.
- Use
bun <file>instead ofnode <file>orts-node <file>. - Use
bun testinstead of Jest or Vitest commands. - Use
bun build <file.html|file.ts|file.css>instead of bundlers like webpack or esbuild. - Use
bun installinstead of npm, yarn, or pnpm. - Use
bun run <script>instead of npm/yarn/pnpm script runners. - Use
bunx <package> <command>instead ofnpx <package> <command>. - Bun already loads
.env; do not adddotenv. - Prefer Bun-native APIs when adding platform code:
Bun.serve()instead of Expressbun:sqliteinstead ofbetter-sqlite3Bun.redisinstead ofioredisBun.sqlinstead ofpgorpostgres.js- built-in
WebSocketinstead ofws Bun.fileinstead offs.readFile/writeFilewhen practical
- Keep the workspace split intact: reusable editor behavior belongs in
packages/opentui, the standalone CLI belongs inpackages/app, and Pi-specific integration logic belongs inpackages/pi. - Prefer targeted changes over broad rewrites.
- When changing editor behavior, add or update tests in
packages/opentui. - Run the Pi smoke flow when modifying Pi embed behavior, save messaging, or bridge wiring.
Validation commands
Run the smallest relevant set first, then the broader workspace checks before finishing larger changes.
bun run format:checkbun run lintbun testbun run typecheckbun run buildbun run checkbun run smoke:pifor Pi integration changes
Release / changelog rules
- Maintain the top-level
CHANGELOG.mdas the source of truth for user-visible changes. - Keep upcoming work under
## [Unreleased]with these subsections:### Added### Changed### Fixed
- Append to existing subsections instead of creating duplicates.
- When cutting a release, move the relevant unreleased entries into a new immutable version section and then start a fresh
## [Unreleased]block. - Use the released changelog section as the starting point for GitHub release notes.
- Prefer
gh release create/edit --notes-filefor multi-line release notes. - Do not trust autogenerated GitHub release notes blindly; review and edit them.
- Prefer concise user-visible changelog entries over internal refactor details unless behavior changed.
- Keep all publishable packages on the exact same version at release time.
- When bumping versions, update every publishable package together and also update internal workspace dependency pins to the same version.
- For this repo, release
@termdraw/opentui,@termdraw/app, and@termdraw/pias a coordinated set unless there is an explicit reason not to. - Use repo-level coordinated releases: create one root Git tag and one GitHub release per shared version, in the form
vX.Y.Z. - Publish all three packages for every coordinated release, even if one package had no code changes in that cut.
- Do not use package-specific release tags like
app-vX.Y.Z,opentui-vX.Y.Z, orpi-vX.Y.Zfor official releases. - Before publishing, verify package versions are identical across all publishable packages.
Commit conventions
- Use Conventional Commit titles when practical:
<type>[scope]: <description>. - Keep commits focused and easy to review.
- Mention the validation commands you ran in PR descriptions or handoff notes.
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
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.

