flowbook 0.2.10 → 0.2.11
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/package.json +1 -1
- package/src/skills/flowbook/SKILL.md +65 -31
package/package.json
CHANGED
|
@@ -318,35 +318,66 @@ flowchart TD
|
|
|
318
318
|
G -->|Invalid| I[Show Errors]
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
-
#### Styling
|
|
321
|
+
#### Styling — Flow-Group Coloring
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
Color nodes by **logical flow group**, not by shape. Nodes on the same path or serving the same purpose share a color.
|
|
324
|
+
|
|
325
|
+
**Step 1: Identify flow groups** — Analyze the diagram and group nodes by semantic role:
|
|
326
|
+
- Happy path / success flow
|
|
327
|
+
- Error / failure / rejection path
|
|
328
|
+
- Validation / guard checks
|
|
329
|
+
- External service calls (API, third-party)
|
|
330
|
+
- Data storage operations (DB read/write, cache)
|
|
331
|
+
- User interaction points (input, redirect)
|
|
332
|
+
- Each distinct branch from a decision point
|
|
333
|
+
|
|
334
|
+
**Step 2: Assign colors using `classDef` + `class`** — One `classDef` per group, then apply with `class`:
|
|
324
335
|
|
|
325
336
|
```mermaid
|
|
326
337
|
flowchart TD
|
|
327
|
-
A([
|
|
328
|
-
B
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
D
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
338
|
+
A([POST /api/login]) --> B{{"Validate Input"}}
|
|
339
|
+
B -->|Invalid| C[\400 Bad Request/]
|
|
340
|
+
B -->|Valid| D[(Find User)]
|
|
341
|
+
D -->|Not Found| E[\401 Unauthorized/]
|
|
342
|
+
D -->|Found| F{{Compare Password}}
|
|
343
|
+
F -->|Mismatch| E
|
|
344
|
+
F -->|Match| G[Generate Token]
|
|
345
|
+
G --> H[(Save Token)]
|
|
346
|
+
H --> I[\200 OK + Token/]
|
|
347
|
+
|
|
348
|
+
classDef entry fill:#6366f1,stroke:#818cf8,color:#fff
|
|
349
|
+
classDef validation fill:#f59e0b,stroke:#fbbf24,color:#000
|
|
350
|
+
classDef success fill:#10b981,stroke:#34d399,color:#fff
|
|
351
|
+
classDef error fill:#ef4444,stroke:#f87171,color:#fff
|
|
352
|
+
classDef data fill:#3b82f6,stroke:#60a5fa,color:#fff
|
|
353
|
+
|
|
354
|
+
class A entry
|
|
355
|
+
class B,F validation
|
|
356
|
+
class G,I success
|
|
357
|
+
class C,E error
|
|
358
|
+
class D,H data
|
|
339
359
|
```
|
|
340
360
|
|
|
341
|
-
**Color
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
361
|
+
**Color palette (assign by flow group, not by shape):**
|
|
362
|
+
|
|
363
|
+
| Group | Color | Hex | Use When |
|
|
364
|
+
|-------|-------|-----|----------|
|
|
365
|
+
| Entry/Exit | Indigo | `#6366f1` | Start/end points of the flow |
|
|
366
|
+
| Success path | Green | `#10b981` | Happy path, successful operations |
|
|
367
|
+
| Error path | Red | `#ef4444` | Failures, rejections, error responses |
|
|
368
|
+
| Validation | Amber | `#f59e0b` | Guards, checks, decision points that validate |
|
|
369
|
+
| Data ops | Blue | `#3b82f6` | DB reads/writes, cache, storage |
|
|
370
|
+
| External | Purple | `#8b5cf6` | Third-party API calls, external services |
|
|
371
|
+
| User action | Cyan | `#06b6d4` | User-facing interactions, redirects |
|
|
372
|
+
| Processing | Slate | `#64748b` | Internal processing, transformation |
|
|
373
|
+
|
|
374
|
+
**Rules:**
|
|
375
|
+
- Nodes on the **same logical path** MUST share the same `classDef`
|
|
376
|
+
- A decision node (diamond) gets the color of the **flow group it guards** (e.g., validation diamond → `validation` class)
|
|
377
|
+
- If a node belongs to multiple paths, color it by its **primary purpose**
|
|
378
|
+
- Use `classDef` + `class` (NOT individual `style` per node) — it's cleaner and groups are explicit
|
|
379
|
+
- Keep to 3–5 color groups per diagram. Too many colors defeats the purpose
|
|
380
|
+
- Uncolored nodes use the theme default — only color nodes that benefit from grouping
|
|
350
381
|
#### Subgraphs for Complex Flows
|
|
351
382
|
|
|
352
383
|
Use subgraphs to group related steps:
|
|
@@ -411,14 +442,17 @@ flowchart TD
|
|
|
411
442
|
I --> J[(Save Refresh Token)]
|
|
412
443
|
J --> K[\200 OK + Tokens/]
|
|
413
444
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
445
|
+
classDef entry fill:#6366f1,stroke:#818cf8,color:#fff
|
|
446
|
+
classDef validation fill:#f59e0b,stroke:#fbbf24,color:#000
|
|
447
|
+
classDef success fill:#10b981,stroke:#34d399,color:#fff
|
|
448
|
+
classDef error fill:#ef4444,stroke:#f87171,color:#fff
|
|
449
|
+
classDef data fill:#3b82f6,stroke:#60a5fa,color:#fff
|
|
450
|
+
|
|
451
|
+
class A entry
|
|
452
|
+
class B,C,G validation
|
|
453
|
+
class H,I,K success
|
|
454
|
+
class D,F error
|
|
455
|
+
class E,J data
|
|
422
456
|
```
|
|
423
457
|
````
|
|
424
458
|
|