fastdraw 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -17
- package/agents/AGENTS-snippet.md +2 -1
- package/agents/README.md +9 -5
- package/dist/cli.js +4 -2
- package/guide/guide.md +28 -9
- package/package.json +4 -2
- package/plugins/fastdraw/.claude-plugin/plugin.json +18 -0
- package/plugins/fastdraw/skills/fastdraw/SKILL.md +21 -0
- package/agents/claude-skill/fastdraw/SKILL.md +0 -19
package/README.md
CHANGED
|
@@ -43,34 +43,52 @@ line number, so an agent can fix its own layout before anyone looks at it.
|
|
|
43
43
|
|
|
44
44
|
## Getting started
|
|
45
45
|
|
|
46
|
-
FastDraw needs Node 20 or later.
|
|
46
|
+
FastDraw needs Node 20 or later. Install the skill for your coding agent once; it then works in every
|
|
47
|
+
repository.
|
|
48
|
+
|
|
49
|
+
**Claude Code**, typed in a session:
|
|
47
50
|
|
|
48
51
|
```
|
|
49
|
-
|
|
50
|
-
npx fastdraw check docs/example.fdraw # report problems, with line numbers
|
|
51
|
-
npx fastdraw render docs/example.fdraw # write example.png next to the file
|
|
52
|
-
npx fastdraw open docs/example.fdraw # edit in the browser; changes save to the file
|
|
52
|
+
/plugin install fastdraw --marketplace coccor/fastdraw
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
On Claude Code older than 2.1.275, run `/plugin marketplace add coccor/fastdraw`, then
|
|
56
|
+
`/plugin install fastdraw@fastdraw`.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
**Codex, OpenCode, Cursor and other agents**, in a terminal:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
npx skills add coccor/fastdraw -g
|
|
62
|
+
```
|
|
59
63
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`npx fastdraw` that is the newest release, so most of an update arrives by itself.
|
|
64
|
+
It asks which of your agents to install for. Without `-g` the skill goes into the current repository
|
|
65
|
+
instead, for a team to commit.
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
**GitHub Copilot** reads only its instructions file, so run this in the repository:
|
|
68
|
+
`npx fastdraw setup copilot`. Chat assistants without a shell can read the language from
|
|
69
|
+
https://fastdraw.dev/llms.txt.
|
|
70
|
+
|
|
71
|
+
Then ask your agent for a diagram. It runs the command-line tool through `npx`, so there is nothing
|
|
72
|
+
else to install:
|
|
68
73
|
|
|
69
74
|
```
|
|
70
|
-
npx fastdraw
|
|
71
|
-
npx fastdraw
|
|
75
|
+
npx fastdraw check docs/example.fdraw # report problems, with line numbers
|
|
76
|
+
npx fastdraw render docs/example.fdraw # write example.png next to the file
|
|
77
|
+
npx fastdraw open docs/example.fdraw # edit in the browser; changes save to the file
|
|
72
78
|
```
|
|
73
79
|
|
|
80
|
+
### Updating
|
|
81
|
+
|
|
82
|
+
The skill is short: it tells the agent to run `fastdraw guide`, and the guide, the kinds of diagram, the
|
|
83
|
+
looks, `check` and `render` all come from the fastdraw that runs. Through `npx fastdraw` that is the
|
|
84
|
+
newest release, so most of an update arrives by itself. The skill itself updates with
|
|
85
|
+
`/plugin marketplace update fastdraw` in Claude Code (or turn on auto-update for the fastdraw marketplace
|
|
86
|
+
under `/plugin`), and with `npx skills update` elsewhere.
|
|
87
|
+
|
|
88
|
+
Files written by `npx fastdraw setup` (an older way to install, still used for Copilot) carry the version
|
|
89
|
+
that wrote them. When they are older than the fastdraw running, `fastdraw guide` starts with a note asking
|
|
90
|
+
the agent to tell you; run `npx fastdraw@latest setup` in the repository to update them.
|
|
91
|
+
|
|
74
92
|
If fastdraw is installed on the PATH (`npm install -g fastdraw`), agents use that copy instead of `npx`.
|
|
75
93
|
`fastdraw guide` checks npm for a newer release at most once a day and says so when there is one; update
|
|
76
94
|
with `npm install -g fastdraw@latest`. Set `FASTDRAW_NO_UPDATE_CHECK=1` to turn the check off; it is off on CI.
|
package/agents/AGENTS-snippet.md
CHANGED
|
@@ -6,7 +6,8 @@ Diagrams in this repo are FastDraw files (`.fdraw`), drawn with the look in `.lo
|
|
|
6
6
|
|
|
7
7
|
- Save a new diagram in `docs/diagrams/` unless the person names another place or the repo already keeps its `.fdraw` files somewhere; never at the top of the repo.
|
|
8
8
|
- Before writing or changing one, run `fastdraw guide` and follow it; it is the only reference for the language.
|
|
9
|
-
-
|
|
9
|
+
- For a diagram of the code, learn the system first: every project or service, how each talks to the others (HTTP clients, queues, shared stores, config), and the paths a request or event takes. Read every project, not only the first. Do not shrink a big system into a few vague boxes; propose an overview plus one diagram per main path, or the one path the person cares about.
|
|
10
|
+
- Choose the kind of diagram by what the reader has to understand, not by a word in the request ("request flow" is not a flowchart; "architecture diagram" is said of any system picture); `fastdraw guide list` says what each kind shows. Unless the request names exactly one kind and nothing in it pulls toward another, ask before drawing: the kind you would draw and the closest other kind, which path when there are several, and the split when the system is too big for one picture.
|
|
10
11
|
- Finish with `fastdraw check <file>` clean, then run `fastdraw render <file>` and look at the PNG.
|
|
11
12
|
- `fastdraw check <folder>` and `fastdraw render <folder>` work on every `.fdraw` file under a folder. `fastdraw render <file> --dark` also writes `<file>-dark.png` with the look's dark version, for sites with a dark theme; `--look <name|file.look>` draws with another look without changing the file.
|
|
12
13
|
- When the diagram is done, always ask the person what to do next: open it in fastdraw.dev (run `fastdraw open <file>` in the background, then give them the link it prints in case no browser window appeared; edits save back to the file), preview the PNG (open it in their image viewer), or nothing. Do not open anything before they choose.
|
package/agents/README.md
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
# Telling agents about FastDraw
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
There is one skill, in [`../plugins/fastdraw/skills/fastdraw/SKILL.md`](../plugins/fastdraw/skills/fastdraw/SKILL.md).
|
|
4
|
+
It is a thin pointer to `fastdraw guide`, so there is one place to maintain. It reaches agents three ways:
|
|
5
5
|
|
|
6
|
-
| Agent |
|
|
6
|
+
| Agent | How | What it installs |
|
|
7
7
|
|---|---|---|
|
|
8
|
-
| Claude Code |
|
|
9
|
-
| Codex, OpenCode | `npx fastdraw
|
|
8
|
+
| Claude Code | `/plugin install fastdraw --marketplace coccor/fastdraw` | the `fastdraw` plugin from [`.claude-plugin/marketplace.json`](../.claude-plugin/marketplace.json), for the user |
|
|
9
|
+
| Codex, OpenCode, Cursor and others | `npx skills add coccor/fastdraw -g` | the skill in `~/.agents/skills/fastdraw/` and each chosen agent's folder ([skills.sh](https://skills.sh) finds it through the plugin manifest) |
|
|
10
10
|
| GitHub Copilot | `npx fastdraw setup copilot` | `AGENTS-snippet.md` as a section of `.github/copilot-instructions.md` |
|
|
11
|
+
| A repository that commits its instructions | `npx fastdraw setup claude` or `setup agents` | the skill as `.claude/skills/fastdraw/`, or `AGENTS-snippet.md` as a section of `AGENTS.md` |
|
|
11
12
|
| Chat assistants | none | Ask it to read https://fastdraw.dev/llms.txt first (or paste that file in), then paste the reply into the editor with "Paste diagram text" |
|
|
12
13
|
|
|
14
|
+
The plugin has no `version`, so Claude Code users follow the commits on `main` when they update.
|
|
15
|
+
`claude plugin validate .` checks the marketplace and the plugin.
|
|
16
|
+
|
|
13
17
|
## Diagrams on a docs site
|
|
14
18
|
|
|
15
19
|
A README on GitHub can only show the PNG from `fastdraw render`. A docs site (Starlight, Docusaurus,
|
package/dist/cli.js
CHANGED
|
@@ -15371,7 +15371,7 @@ function setup(root2, dir, targets, global = false) {
|
|
|
15371
15371
|
const was = existsSync3(file);
|
|
15372
15372
|
if (global) mkdirSync(base, { recursive: true });
|
|
15373
15373
|
prepare(base, file);
|
|
15374
|
-
const skill = readFileSync3(join3(root2, "
|
|
15374
|
+
const skill = readFileSync3(join3(root2, "plugins", "fastdraw", "skills", "fastdraw", "SKILL.md"), "utf8");
|
|
15375
15375
|
writeFileSync3(file, skill.replace(/^(---\r?\n[\s\S]*?\r?\n---\r?\n)/, `$1${stamp(version)}
|
|
15376
15376
|
`));
|
|
15377
15377
|
lines.push(`${was ? "updated" : "wrote"} ${show(file)} (Claude Code skill)`);
|
|
@@ -15520,7 +15520,9 @@ function usage() {
|
|
|
15520
15520
|
tell this repo's coding agents about FastDraw: a Claude Code
|
|
15521
15521
|
skill, a section in AGENTS.md, or in Copilot's instructions.
|
|
15522
15522
|
With no name, sets up the agents the repo already uses.
|
|
15523
|
-
--global puts the Claude Code skill in ~/.claude for every repo
|
|
15523
|
+
--global puts the Claude Code skill in ~/.claude for every repo.
|
|
15524
|
+
Most people install the skill instead: npx skills add coccor/fastdraw,
|
|
15525
|
+
or /plugin install fastdraw --marketplace coccor/fastdraw in Claude Code`);
|
|
15524
15526
|
process.exit(2);
|
|
15525
15527
|
}
|
|
15526
15528
|
function report(file) {
|
package/guide/guide.md
CHANGED
|
@@ -5,13 +5,14 @@ FastDraw draws diagrams from a small text file (`.fdraw`). You place every eleme
|
|
|
5
5
|
## How to work
|
|
6
6
|
|
|
7
7
|
1. To create or change a look (how styles are drawn), run `fastdraw guide look` instead of the steps below.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
11
|
-
5.
|
|
12
|
-
6.
|
|
13
|
-
7. Run `fastdraw
|
|
14
|
-
8.
|
|
8
|
+
2. When the diagram is of something in the code (a system, a request, a pipeline), first learn it as described in "Know the system first" below. Do not pick a kind from the request's wording alone.
|
|
9
|
+
3. Choose the kind of diagram and its scope as described in "Choosing the kind" below (`fastdraw guide list` says what each kind shows), and agree them with the person before drawing. If the kind has its own guide, run `fastdraw guide <kind>` and follow it; where it differs from the general rules in this guide, the kind's guide wins.
|
|
10
|
+
4. Run `fastdraw sizes <look file>` to see the styles you can use, their default sizes, and the look's own guidance. Follow that guidance. A diagram with no `look` line uses the built-in look: run `fastdraw sizes` with no file to see it.
|
|
11
|
+
5. Plan the composition on paper first: rows and columns, where the main thing sits.
|
|
12
|
+
6. Write the file. A new diagram goes in `docs/diagrams/` (create the folder) unless the person names another place or the repo already keeps its `.fdraw` files somewhere. Never put it at the top of the repo: `fastdraw open` lends the diagram's whole folder to the editor.
|
|
13
|
+
7. Run `fastdraw check <file>`. Fix every error and warning. Read the hints and fix the ones that are real.
|
|
14
|
+
8. Run `fastdraw render <file>` and **look at the PNG**. Fix what looks wrong: cramped labels, uneven gaps, lopsided composition, a label sitting on a border. Repeat from 7 until it is clean and looks good.
|
|
15
|
+
9. When the diagram is done, tell the person where the file is and **ask what they want to do next**, with these three choices (use your tool for asking a question if you have one). Always ask; do not stop without it.
|
|
15
16
|
- **Open in fastdraw.dev**: run `fastdraw open <file>` in the background. It opens the web editor at the diagram, with its look, and saves their edits into the same file. Read its output and give the person the link it prints, in case no browser window appeared. Read the file again before you change it after that.
|
|
16
17
|
- **Preview as PNG**: open the PNG from `fastdraw render` in their image viewer (`xdg-open <file.png>` on Linux, `wslview` or `explorer.exe` under WSL, `open` on macOS, `start ""` on Windows).
|
|
17
18
|
- **Nothing**: stop there.
|
|
@@ -20,9 +21,21 @@ FastDraw draws diagrams from a small text file (`.fdraw`). You place every eleme
|
|
|
20
21
|
|
|
21
22
|
When you change an existing diagram: do not move, resize or restyle anything that is already there unless asked. Place only what you add, in free space.
|
|
22
23
|
|
|
24
|
+
## Know the system first
|
|
25
|
+
|
|
26
|
+
A diagram of a real system is only as good as your knowledge of it. Before choosing a kind, read enough of the code to list:
|
|
27
|
+
|
|
28
|
+
- **The parts.** Every project, service, app, worker, job and store involved, and what each is for. A repo with several projects (a `src/` per service, a solution with many projects, a monorepo's `apps/` and `packages/`) means several parts: open each one, not only the first.
|
|
29
|
+
- **How they talk.** For each connection: who calls whom, and how (HTTP or gRPC client, queue or topic, shared database, file, webhook, SDK of an outside service). Find it in the code that sends: HTTP clients and their base URLs, message publishers and subscribers, connection strings, configuration and deployment files.
|
|
30
|
+
- **The paths through it.** Where a request or event enters, which parts it passes in which order, and where it ends. A system usually has several (a user request, a background job, an incoming webhook); note each one.
|
|
31
|
+
|
|
32
|
+
If you can hand work to helpers that read code, give each project to one. Keep the list in your notes; the diagram is drawn from it.
|
|
33
|
+
|
|
34
|
+
Then judge the size. When the list has more parts or paths than one readable picture holds (about a dozen boxes), do not shrink it to a few vague boxes such as "Backend" and "Services". Propose either an overview that names every part plus one diagram per main path, or one diagram of the path the person cares about.
|
|
35
|
+
|
|
23
36
|
## Choosing the kind
|
|
24
37
|
|
|
25
|
-
Choose by what the reader has to understand, not by a word in the request: a "request flow" or a "user flow" is not a flowchart. `fastdraw guide list` says what every kind shows. The usual choices:
|
|
38
|
+
Choose by what the reader has to understand, not by a word in the request: a "request flow" or a "user flow" is not a flowchart, and "architecture diagram" is often said of any picture of a system. `fastdraw guide list` says what every kind shows. The usual choices:
|
|
26
39
|
|
|
27
40
|
| The reader has to see | Kind |
|
|
28
41
|
|---|---|
|
|
@@ -42,7 +55,13 @@ Choose by what the reader has to understand, not by a word in the request: a "re
|
|
|
42
55
|
- Draw a flowchart only when there are real yes/no questions. Steps in a row with no decision are a swimlane, or a process.
|
|
43
56
|
- If a three-column table would say the same thing, write the table instead.
|
|
44
57
|
|
|
45
|
-
**Agree the kind before drawing.**
|
|
58
|
+
**Agree the kind and the scope before drawing.** Skip this only when the request names exactly one kind and nothing in it pulls toward another ("a sequence diagram of the login"). A request that mixes words of two kinds ("request flow architecture diagram": the order of a request, or the parts and their links?) names neither; ask. In one short message, using what you learned about the system:
|
|
59
|
+
|
|
60
|
+
- the kind you would draw and the closest other kind, with a line on what each would show of *this* system;
|
|
61
|
+
- when the system has several paths, which one to draw (name them);
|
|
62
|
+
- when it is too big for one picture, the split you propose (an overview plus one per path).
|
|
63
|
+
|
|
64
|
+
Use your tool for asking a question if you have one, your pick first. If you cannot ask, draw your pick and say which other kind, path or split would also have worked.
|
|
46
65
|
|
|
47
66
|
## The file
|
|
48
67
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastdraw",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Diagrams that an AI agent writes as text and a person edits on a canvas",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"diagram",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"guide",
|
|
33
33
|
"fonts",
|
|
34
34
|
"agents",
|
|
35
|
+
"plugins",
|
|
35
36
|
"README.md",
|
|
36
37
|
"LICENSE",
|
|
37
38
|
"licenses"
|
|
@@ -47,7 +48,8 @@
|
|
|
47
48
|
"test:e2e": "playwright test",
|
|
48
49
|
"build:cli": "esbuild src/cli.ts --bundle --platform=node --format=esm --target=node20 --external:@resvg/resvg-js --banner:js=\"#!/usr/bin/env node\" --outfile=dist/cli.js",
|
|
49
50
|
"prepack": "npm run build:cli && npm run build:embed",
|
|
50
|
-
"build:embed": "vite build -c vite.embed.config.ts"
|
|
51
|
+
"build:embed": "vite build -c vite.embed.config.ts",
|
|
52
|
+
"version": "node tools/syncPluginVersion.ts && git add plugins/fastdraw/.claude-plugin/plugin.json"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
53
55
|
"@resvg/resvg-js": "^2.6.2"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fastdraw",
|
|
3
|
+
"description": "Draw diagrams as small .fdraw text files that people can edit visually afterwards. The skill runs the fastdraw CLI through npx to check and render each diagram.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "coccor"
|
|
6
|
+
},
|
|
7
|
+
"homepage": "https://fastdraw.dev",
|
|
8
|
+
"repository": "https://github.com/coccor/fastdraw",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"diagram",
|
|
12
|
+
"architecture",
|
|
13
|
+
"flowchart",
|
|
14
|
+
"sequence",
|
|
15
|
+
"fdraw"
|
|
16
|
+
],
|
|
17
|
+
"version": "0.2.2"
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fastdraw
|
|
3
|
+
description: Draw or change a diagram (architecture, request flow, sequence, flowchart, swimlane, data model, chart, or any boxes-and-arrows picture) as a FastDraw .fdraw file that people can later edit visually. Use when asked to draw, create, update or fix a diagram, or when a .fdraw or .look file is involved.
|
|
4
|
+
allowed-tools: Bash(npx -y fastdraw *) Bash(npx fastdraw *) Bash(fastdraw *)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# FastDraw
|
|
8
|
+
|
|
9
|
+
FastDraw diagrams are small text files (`.fdraw`). You place every element yourself; a look file (`.look`) decides how styles are drawn. People edit the same file in a browser editor afterwards.
|
|
10
|
+
|
|
11
|
+
Run FastDraw's commands as `npx -y fastdraw <command>` (for example `npx -y fastdraw guide`), or as `fastdraw <command>` when it is on the PATH. Below and in the guide they are written `fastdraw <command>`.
|
|
12
|
+
|
|
13
|
+
1. Save a new diagram in `docs/diagrams/` (create the folder), unless the person names another place or the repo already keeps its `.fdraw` files somewhere. Never at the top of the repo: `fastdraw open` lends the diagram's whole folder to the editor.
|
|
14
|
+
2. Run `fastdraw guide` and follow it. It is the single source for the language and the way of working, and it points to `fastdraw guide list` (what each kind of diagram shows), `fastdraw guide <kind>` and `fastdraw sizes`.
|
|
15
|
+
For a diagram of the code, learn the system before choosing anything: every project or service, how each talks to the others (HTTP clients, queues, shared stores, config), and the paths a request or event takes. With several projects, read all of them; if you can hand work to subagents (Explore agents in Claude Code), give each project to one. Do not shrink a big system into a few vague boxes: propose an overview plus one diagram per main path, or the one path the person cares about.
|
|
16
|
+
Choose the kind by what the reader has to understand, not by a word in the request ("request flow" is not a flowchart; "architecture diagram" is said of any system picture). Unless the request names exactly one kind and nothing in it pulls toward another, ask before drawing with your tool for asking a question (AskUserQuestion in Claude Code), your pick first: the kind you would draw and the closest other kind, which path when there are several, and the split when the system is too big for one picture. A request like "request flow architecture diagram" names two and must be asked. If you cannot ask, draw your pick and say what else would have worked.
|
|
17
|
+
3. Always finish with `fastdraw check <file>` clean and a look at the PNG from `fastdraw render <file>`.
|
|
18
|
+
4. When the diagram is done, always ask the person what to do next, with your tool for asking a question; do not end your turn without asking. The choices: **Open in fastdraw.dev** (run `fastdraw open <file>` in the background, then read its output and give the person the link it prints, in case no browser window appeared; it saves their edits back to the file), **Preview as PNG** (open the rendered PNG in their image viewer) or **Nothing**. Do not open anything before they choose.
|
|
19
|
+
5. For a site with light and dark themes, `fastdraw render <file or folder> --dark` writes `x.png` and `x-dark.png` (the look's dark version, Night for the built-in look). Do not copy the file to swap its look line; `--look <name|file.look>` draws with another look. A folder means every `.fdraw` file under it, for `check` too.
|
|
20
|
+
6. When changing an existing diagram, do not move, resize or restyle what is already there unless asked. A person may have arranged it by hand.
|
|
21
|
+
7. For a docs site (a web page, not a GitHub README), put the diagram on the page with `<fastdraw-diagram src="....fdraw">` from https://fastdraw.dev/embed.js, with the rendered PNG inside it as the fallback image. It draws the file live, pannable and zoomable, and follows the page's dark mode.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastdraw
|
|
3
|
-
description: Draw or change a diagram (architecture, flowchart, sequence, or any boxes-and-arrows picture) as a FastDraw .fdraw file that people can later edit visually. Use when asked to create, update or fix a diagram in a repo that uses FastDraw, or when a .fdraw or .look file is involved.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# FastDraw
|
|
7
|
-
|
|
8
|
-
FastDraw diagrams are small text files (`.fdraw`). You place every element yourself; a look file (`.look`) decides how styles are drawn. People edit the same file in a browser editor afterwards.
|
|
9
|
-
|
|
10
|
-
1. Save a new diagram in `docs/diagrams/` (create the folder), unless the person names another place or the repo already keeps its `.fdraw` files somewhere. Never at the top of the repo: `fastdraw open` lends the diagram's whole folder to the editor.
|
|
11
|
-
2. Run `fastdraw guide` and follow it. It is the single source for the language and the way of working, and it points to `fastdraw guide list` (what each kind of diagram shows), `fastdraw guide <kind>` and `fastdraw sizes`.
|
|
12
|
-
Choose the kind by what the reader has to understand, not by a word in the request ("request flow" is not a flowchart). Unless the request names the kind, tell the person which kind you would draw and the closest other kind, and ask with AskUserQuestion (your pick first) before drawing. If you cannot ask, draw your pick and say which other kind would also have worked.
|
|
13
|
-
3. Always finish with `fastdraw check <file>` clean and a look at the PNG from `fastdraw render <file>`.
|
|
14
|
-
4. When the diagram is done, always ask the person what to do next with AskUserQuestion; do not end your turn without asking. The choices: **Open in fastdraw.dev** (run `fastdraw open <file>` with `run_in_background`, then read its output and give the person the link it prints, in case no browser window appeared; it saves their edits back to the file), **Preview as PNG** (open the rendered PNG in their image viewer) or **Nothing**. Do not open anything before they choose.
|
|
15
|
-
5. For a site with light and dark themes, `fastdraw render <file or folder> --dark` writes `x.png` and `x-dark.png` (the look's dark version, Night for the built-in look). Do not copy the file to swap its look line; `--look <name|file.look>` draws with another look. A folder means every `.fdraw` file under it, for `check` too.
|
|
16
|
-
6. When changing an existing diagram, do not move, resize or restyle what is already there unless asked. A person may have arranged it by hand.
|
|
17
|
-
7. For a docs site (a web page, not a GitHub README), put the diagram on the page with `<fastdraw-diagram src="....fdraw">` from https://fastdraw.dev/embed.js, with the rendered PNG inside it as the fallback image. It draws the file live, pannable and zoomable, and follows the page's dark mode.
|
|
18
|
-
|
|
19
|
-
If the `fastdraw` command is not on the PATH, run it as `npx fastdraw` (for example `npx fastdraw guide`).
|