@stacksjs/defaults 0.74.41 → 0.74.43

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.
Files changed (81) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-cms/SKILL.md +4 -4
  3. package/ai/skills/stacks-composables/SKILL.md +51 -2
  4. package/ai/skills/stacks-config/SKILL.md +1 -1
  5. package/ai/skills/stacks-dashboard/SKILL.md +1 -1
  6. package/ai/skills/stacks-database/SKILL.md +1 -1
  7. package/ai/skills/stacks-migrations/SKILL.md +2 -2
  8. package/ai/skills/stacks-models/SKILL.md +16 -2
  9. package/ai/skills/stacks-orm/SKILL.md +1 -1
  10. package/ai/skills/stacks-technical-diagrams/LICENSE +1 -1
  11. package/ai/skills/stacks-technical-diagrams/SKILL.md +257 -229
  12. package/ai/skills/stacks-technical-diagrams/THIRD_PARTY_NOTICES.md +69 -0
  13. package/ai/skills/stacks-technical-diagrams/assets/JetBrainsMono-OFL.txt +93 -0
  14. package/ai/skills/stacks-technical-diagrams/assets/template.html +14588 -929
  15. package/ai/skills/stacks-technical-diagrams/bin/diagrams +10 -0
  16. package/ai/skills/stacks-technical-diagrams/bin/open-artifact.mjs +86 -0
  17. package/ai/skills/stacks-technical-diagrams/bin/preview.mjs +654 -0
  18. package/ai/skills/stacks-technical-diagrams/bin/technical-diagrams.mjs +1898 -89
  19. package/ai/skills/stacks-technical-diagrams/bin/visual-check.mjs +829 -0
  20. package/ai/skills/stacks-technical-diagrams/brand-marks/README.md +31 -0
  21. package/ai/skills/stacks-technical-diagrams/brand-marks/catalog.json +131 -0
  22. package/ai/skills/stacks-technical-diagrams/delta/architecture-delta.mjs +1221 -0
  23. package/ai/skills/stacks-technical-diagrams/examples/agent-run.lifecycle.json +18 -22
  24. package/ai/skills/stacks-technical-diagrams/examples/agent-tool-call.workflow.json +58 -52
  25. package/ai/skills/stacks-technical-diagrams/examples/async-job-roundtrip.sequence.json +61 -0
  26. package/ai/skills/stacks-technical-diagrams/examples/brand-aware-delivery.architecture.json +47 -0
  27. package/ai/skills/stacks-technical-diagrams/examples/cache-miss-request.sequence.json +30 -23
  28. package/ai/skills/stacks-technical-diagrams/examples/checkout-platform.base.architecture.json +31 -0
  29. package/ai/skills/stacks-technical-diagrams/examples/checkout-platform.head.architecture.json +31 -0
  30. package/ai/skills/stacks-technical-diagrams/examples/deployment-release.lifecycle.json +49 -0
  31. package/ai/skills/stacks-technical-diagrams/examples/event-stream.dataflow.json +57 -0
  32. package/ai/skills/stacks-technical-diagrams/examples/incident-response.workflow.json +64 -0
  33. package/ai/skills/stacks-technical-diagrams/examples/product-analytics.dataflow.json +22 -16
  34. package/ai/skills/stacks-technical-diagrams/examples/production-deployment.architecture.json +71 -0
  35. package/ai/skills/stacks-technical-diagrams/examples/release-delivery.workflow.json +62 -0
  36. package/ai/skills/stacks-technical-diagrams/examples/web-app.architecture.json +16 -11
  37. package/ai/skills/stacks-technical-diagrams/migrations/workflow-v2.mjs +279 -0
  38. package/ai/skills/stacks-technical-diagrams/recipes/scenarios.mjs +391 -0
  39. package/ai/skills/stacks-technical-diagrams/references/authoring-contract.md +243 -0
  40. package/ai/skills/stacks-technical-diagrams/references/brand-marks.md +65 -0
  41. package/ai/skills/stacks-technical-diagrams/references/delivery-contract.md +120 -0
  42. package/ai/skills/stacks-technical-diagrams/references/viewer-runtime.md +45 -0
  43. package/ai/skills/stacks-technical-diagrams/renderers/architecture/render-architecture.mjs +780 -73
  44. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/README.md +25 -3
  45. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/render-dataflow.mjs +240 -52
  46. package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/README.md +31 -7
  47. package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/render-lifecycle.mjs +227 -50
  48. package/ai/skills/stacks-technical-diagrams/renderers/sequence/README.md +36 -6
  49. package/ai/skills/stacks-technical-diagrams/renderers/sequence/render-sequence.mjs +270 -63
  50. package/ai/skills/stacks-technical-diagrams/renderers/shared/brand-marks.mjs +563 -0
  51. package/ai/skills/stacks-technical-diagrams/renderers/shared/bun-runtime.mjs +20 -0
  52. package/ai/skills/stacks-technical-diagrams/renderers/shared/cli.mjs +186 -10
  53. package/ai/skills/stacks-technical-diagrams/renderers/shared/desktop-readability.mjs +26 -0
  54. package/ai/skills/stacks-technical-diagrams/renderers/shared/diagnostics.mjs +127 -0
  55. package/ai/skills/stacks-technical-diagrams/renderers/shared/engineering-profiles.mjs +157 -0
  56. package/ai/skills/stacks-technical-diagrams/renderers/shared/generated-brand-marks.mjs +2003 -0
  57. package/ai/skills/stacks-technical-diagrams/renderers/shared/generated-validators.mjs +3 -3
  58. package/ai/skills/stacks-technical-diagrams/renderers/shared/geometry.mjs +1195 -2
  59. package/ai/skills/stacks-technical-diagrams/renderers/shared/i18n.mjs +595 -0
  60. package/ai/skills/stacks-technical-diagrams/renderers/shared/legend.mjs +217 -0
  61. package/ai/skills/stacks-technical-diagrams/renderers/shared/output-path.mjs +340 -0
  62. package/ai/skills/stacks-technical-diagrams/renderers/shared/repository-evidence.mjs +238 -0
  63. package/ai/skills/stacks-technical-diagrams/renderers/shared/repository-location.mjs +58 -0
  64. package/ai/skills/stacks-technical-diagrams/renderers/shared/text-fit.mjs +49 -0
  65. package/ai/skills/stacks-technical-diagrams/renderers/shared/utils.mjs +163 -19
  66. package/ai/skills/stacks-technical-diagrams/renderers/shared/validator.mjs +51 -5
  67. package/ai/skills/stacks-technical-diagrams/renderers/workflow/README.md +137 -17
  68. package/ai/skills/stacks-technical-diagrams/renderers/workflow/render-workflow.mjs +24 -470
  69. package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-compiler.mjs +4400 -0
  70. package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-migration-geometry.mjs +144 -0
  71. package/ai/skills/stacks-technical-diagrams/schemas/README.md +154 -11
  72. package/ai/skills/stacks-technical-diagrams/schemas/architecture.schema.json +61 -4
  73. package/ai/skills/stacks-technical-diagrams/schemas/common.schema.json +72 -0
  74. package/ai/skills/stacks-technical-diagrams/schemas/dataflow.schema.json +40 -18
  75. package/ai/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json +43 -18
  76. package/ai/skills/stacks-technical-diagrams/schemas/sequence.schema.json +41 -4
  77. package/ai/skills/stacks-technical-diagrams/schemas/workflow.schema.json +97 -1
  78. package/ai/skills/stacks-technical-diagrams/scripts/check-render-output.mjs +551 -12
  79. package/ai/skills/stacks-technical-diagrams/scripts/render-examples.mjs +3 -4
  80. package/ide/vscode/package.json +1 -1
  81. package/package.json +2 -2
@@ -0,0 +1,65 @@
1
+ # Brand marks
2
+
3
+ Use a brand mark only when a real product, provider, model family, channel, or
4
+ service identity helps the reader. Semantic `type` still explains what the node
5
+ does; `brand` explains whose product it is.
6
+
7
+ ## Agent decision path
8
+
9
+ 1. Search the built-in catalogue when the request names a recognizable brand:
10
+
11
+ ```bash
12
+ .claude/skills/stacks-technical-diagrams/bin/diagrams brands "Claude" --json
13
+ ```
14
+
15
+ 2. Put the returned canonical ID in the node, participant, or state:
16
+
17
+ ```json
18
+ {
19
+ "id": "planner",
20
+ "type": "backend",
21
+ "label": "Claude",
22
+ "brand": "claude"
23
+ }
24
+ ```
25
+
26
+ 3. If there is no catalogue match and the user supplied the official website,
27
+ capture its icon explicitly:
28
+
29
+ ```bash
30
+ .claude/skills/stacks-technical-diagrams/bin/diagrams brands capture "https://partner.example.com" --json
31
+ ```
32
+
33
+ Put the command's digest-pinned `brand` value in the authored node:
34
+
35
+ ```json
36
+ {
37
+ "id": "partner",
38
+ "type": "external",
39
+ "label": "Partner portal",
40
+ "brand": {
41
+ "url": "https://partner.example.com",
42
+ "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
43
+ }
44
+ }
45
+ ```
46
+
47
+ 4. If there is no match and no user-provided URL, omit `brand`. Do not invent a
48
+ URL or silently assign a visually similar company.
49
+
50
+ Known-brand URLs resolve to the bundled vector instead of using the network.
51
+ Unknown URL capture accepts only bounded raster image formats, blocks
52
+ credentials, nonstandard public ports, and private or link-local destinations,
53
+ uses bounded concurrency and one total deadline, and returns the captured
54
+ content digest. Later render and validate operations require that exact digest;
55
+ blocked, unavailable, changed, oversized, or unsafe content fails closed instead
56
+ of silently changing the artifact.
57
+
58
+ The final artifact never fetches a brand asset when opened. Preset vectors and
59
+ digest-verified captured site icons remain embedded in SVG, PNG, WebP, JPEG,
60
+ Share Card, and WebM exports.
61
+
62
+ Use `.claude/skills/stacks-technical-diagrams/bin/diagrams brands --json` to inspect all canonical IDs, aliases,
63
+ categories, domains, and provenance. Current categories cover AI, cloud,
64
+ engineering, data, collaboration, business systems, channels, languages, and
65
+ frameworks.
@@ -0,0 +1,120 @@
1
+ # Delivery contract
2
+
3
+ ## Validate and deliver
4
+
5
+ Use `validate` after every candidate edit. CLI HTML output paths must end in `.html`, including after symbolic-link resolution.
6
+ Compare receipt paths must end in `.json`. Explicit CLI paths may be absolute or
7
+ outside the current working directory; authored `meta.output` remains confined
8
+ to that directory. A type mismatch fails before writing with
9
+ `output/cli-extension` or `output/cli-resolved-extension`. These checks prevent
10
+ accidental file-type overwrites; they do not sandbox explicit CLI directories
11
+ or prevent replacement of an existing artifact of the expected type.
12
+
13
+ Use final atomic delivery only after the candidate is frozen:
14
+
15
+ ```bash
16
+ .claude/skills/stacks-technical-diagrams/bin/diagrams deliver <type> <candidate.json> <output.html> --quality showcase --json
17
+ ```
18
+
19
+ Deliver reads the specification once, writes those exact bytes to a private same-directory candidate snapshot, renders that snapshot, runs the complete artifact checker, and only replaces the target after all artifact checks pass. The JSON receipt includes SHA-256 and byte counts for both `specification` and `artifact`. Renderer, checker, receipt, or commit failure exits non-zero, removes private state, preserves the previous trusted artifact, and never invokes an opener.
20
+
21
+ Run `visual-check` only after `deliver` exits zero for the current candidate. If
22
+ delivery fails and the output path already exists, that path still names the
23
+ previous trusted artifact; running `visual-check` then would measure and capture
24
+ stale output, not the rejected candidate. Report the delivery diagnostics and
25
+ repair the source before collecting new visual evidence.
26
+
27
+ The delivery interface exposes three separate claims:
28
+
29
+ 1. `deliver` proves deterministic artifact checks and byte identity.
30
+ 2. `visual-check` collects automated browser evidence from the exact artifact.
31
+ 3. Perceptual visual review records a human or image-capable reviewer's judgment.
32
+
33
+ Passing one claim never implies either of the others. Never claim that the deterministic receipt includes visual review. It does not include browser evidence either.
34
+
35
+ ## Automated browser evidence
36
+
37
+ After delivery, inspect the exact trusted HTML without rerendering or modifying
38
+ it:
39
+
40
+ ```bash
41
+ .claude/skills/stacks-technical-diagrams/bin/diagrams visual-check <output.html> --json
42
+ ```
43
+
44
+ The zero-dependency command uses Chrome/Chromium through the DevTools pipe. It
45
+ measures light-theme containment at 1440×900, 1600×1000, 1920×1080, and
46
+ 2048×1320, then captures light/dark screenshots at 1440×900 and 2048×1320. It
47
+ writes four PNG sidecars, one relative-path HTML contact sheet, and one JSON
48
+ receipt beside the artifact. The receipt binds the source artifact SHA-256 and
49
+ byte count, identifies `evidenceKind: "automated-browser"`, records READ plus
50
+ Still runtime state, and always reports `visualReview: "pending"`; automated
51
+ browser evidence cannot claim perceptual review.
52
+
53
+ `browser_evidence` in the handoff records only the outcome of this automated command:
54
+
55
+ - `passed` maps from exit 0 and receipt `status: "pass"` only after every required measurement and capture completes and passes.
56
+ - `failed` maps from exit 1 and receipt `status: "fail"` when the inspection finds a defect, the command fails, or a runtime/capture error leaves the evidence incomplete.
57
+ - `skipped` maps only from exit 2 and receipt `status: "skipped"` when Chrome/Chromium is unavailable and the inspection does not run.
58
+
59
+ Runtime or capture failures leave incomplete evidence and must not be normalized to `skipped`. Failed or skipped capture runs remove stale
60
+ image/contact-sheet sidecars rather than presenting prior evidence as current.
61
+ They do not invalidate an already successful deterministic delivery, and they
62
+ do not turn a perceptual visual review into passed or failed. Retry an
63
+ environmental failure through the supported command in a browser-capable
64
+ execution context when practical. Keep the packaged transport unchanged unless
65
+ the failure reproduces through that seam in a capable environment.
66
+
67
+ ## Optional opening
68
+
69
+ Add `--open` only when the user wants an immediate local preview. It runs after that atomic commit, uses one argument-array OS opener with a five-second bound, and records `open.status`. Keep it off for CI, unattended agents, and non-interactive environments. Failure or unsupported opening does not invalidate delivery; its status proves only whether the local opener invocation succeeded.
70
+
71
+ ## Last-Good Live Preview
72
+
73
+ For an active desktop authoring loop only:
74
+
75
+ ```bash
76
+ .claude/skills/stacks-technical-diagrams/bin/diagrams preview <type> <input>.json <output>.html --quality showcase
77
+ ```
78
+
79
+ Preview watches one explicit input on loopback, binds each stable digest to a private snapshot, and advances only after the existing verified delivery pipeline passes. Invalid, half-written, deleted, or superseded input leaves the previous verified revision on screen and on disk. Identical bytes do not rebuild or reload.
80
+
81
+ The preview runtime ships inside the zero-dependency Skill ZIP and must work without `node_modules`.
82
+
83
+ Never start it by default. Do not use it for CI, unattended agents, remote sharing, or mobile use. `--no-open` is only for a user who will open the printed local URL or for loop testing. Stop it with Ctrl-C before handoff. Server state, port, source path, diagnostics, error text, and reload tokens must never enter the generated artifact or any export.
84
+
85
+ ## Perceptual delivery gate
86
+
87
+ Automated validation and browser evidence cannot prove visual polish. After deterministic delivery, inspect the actual HTML in a capable browser or render the evidence screenshots with an image reader. Check both themes when changed, the default READ view, line crossings/corridors, label masks, node/card fit, focus/search/passport closure, and export cleanliness.
88
+
89
+ For the default standalone desktop viewer, measure 1440×900, 1600×1000, and 1920×1080. When the artifact is intended for a large desktop display, also measure 2048×1320. A first-screen pass requires `document.documentElement.scrollWidth <= window.innerWidth` and `scrollHeight <= window.innerHeight` at every checked size. At the largest checked viewport, inspect the rendered composition for a conspicuous empty lower band: the main panel and necessary conclusion cards should use the available height as a balanced whole, not collapse into a shallow strip. If a desktop viewport overflows, repair the authored composition by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. Do not hide overflow, clip content, introduce an internal diagram scroller, or reduce node/label typography to make the measurement pass. Narrow/mobile containment may retain vertical page scrolling.
90
+
91
+ A manual browser record is supplementary to the automated status. Reproducing the same coverage requires all four exact viewport measurements, both endpoint themes, and an artifact-bound record of the inspected SHA-256 and byte count. It never changes `browser_evidence`: when Chrome/Chromium is unavailable, that status remains `skipped` even when the manual browser record is complete and `visual_review: passed`; an automated `failed` result likewise remains `failed`. An unconstrained browser glance can support perceptual review only.
92
+
93
+ Report exactly one truthful status:
94
+
95
+ - `visual_review: passed` - only after inspecting the rendered artifact.
96
+ - `visual_review: skipped (image reader unavailable)` - when no capable visual surface exists.
97
+ - `visual_review: failed` - with the concrete visible defect.
98
+
99
+ Use `correction_rounds: 0`, `correction_rounds: 1`, or `correction_rounds: 2`; never exceed a maximum of two focused correction rounds. Never report `visual_review: passed` without inspecting the artifact.
100
+
101
+ If visual review changes the candidate, validation and delivery must run again because the prior frozen specification receipt is no longer current.
102
+
103
+ ## Handoff receipt
104
+
105
+ Return:
106
+
107
+ ```text
108
+ diagram_type: architecture|workflow|sequence|dataflow|lifecycle
109
+ output: /absolute/path/to/file.html
110
+ specification_sha256: <receipt value>
111
+ artifact_sha256: <receipt value>
112
+ validation: 9/9 showcase, 0 errors, 0 warnings
113
+ browser_evidence: passed|failed|skipped
114
+ visual_review: passed|skipped (image reader unavailable)|failed
115
+ correction_rounds: 0|1|2
116
+ ```
117
+
118
+ Derive `browser_evidence` only from the latest artifact-bound `visual-check` receipt. Record any manual browser work separately with its artifact binding, viewport/theme scope, and observations; never use it or `visual_review` to overwrite the automated status.
119
+
120
+ Opening, preview status, Share Cards, and other viewer exports are not validation claims.
@@ -0,0 +1,45 @@
1
+ # Viewer Runtime reference
2
+
3
+ Read this only when the user asks for a reader-facing capability. Ordinary generation does not require implementing or re-documenting these features; they are already in the generated HTML.
4
+
5
+ ## Exploration
6
+
7
+ - Diagram Guide lists current actions and shortcuts.
8
+ - Reading Depth starts at READ at the default 100% scale, reveals FULL detail at 175%, and falls back to MAP only below 100%. Focus, story, route, and semantic interactions reveal their exact facts at any scale.
9
+ - Semantic Lens summarizes selected node/relationship kinds without changing authored geometry.
10
+ - Intent Trace previews a fine-pointer or keyboard target before committed focus.
11
+ - Node Finder searches labels and stable IDs.
12
+ - Semantic Passport opens on focus, shows authored upstream/downstream facts, supports a copyable deep link, has an explicit close action, closes on true outside activation and Escape, and never enters canonical export.
13
+ - Semantic Radar mirrors the visible viewport and authored graph without becoming a second source of truth.
14
+ - Direct Relationship Pin makes a unique compiled relationship operable while preserving the authored line and stable relationship identity. It must fail closed on conflicting source/target/label/ID metadata.
15
+ - Route Probe resolves exactly two endpoints over authored directed relationships. It never infers a route from geometry.
16
+
17
+ ## Guided views and story
18
+
19
+ `meta.views` may define at most five curated chapters using stable node IDs. The Named Chapter Rail, Chapter Delta Preview, Story Beat Navigator, Story Follow Camera, Story Director Strip, Story Horizon, and Shareable Story Moment links all derive from that one authored array; none owns parallel topology or layout.
20
+
21
+ Story transitions classify only the exact relationship between adjacent authored stops: forward, reverse, multiple, or grouped/no direct link. Never infer a transitive edge, verb, causality, or runtime behavior from proximity, kinds, or story order. Playback is reader-started, bounded, stale-safe, and motion-governed.
22
+
23
+ ## Motion and presentation
24
+
25
+ `meta.animation: "trace"` enables a finite reader-controlled Live/Still trace. Static is the default. Still, reduced motion, page hiding, print, and canonical export preserve complete static meaning. Presentation Stage changes viewer chrome and framing, never authored geometry. This is not a mobile product feature; narrow layouts get containment only.
26
+
27
+ ## Canonical exports
28
+
29
+ The export menu can copy/download full-diagram PNG, download JPEG/WebP, download a dual-theme SVG, and record a trace-enabled WebM. Viewer state-Guide, Lens, finder, focus, route, story, camera, radar, presentation, motion ownership, and temporary overlays-must be removed from canonical export.
30
+
31
+ ### Share Card
32
+
33
+ The optional 1200×630 Share Card PNG is for README, release, social, or launch previews. It uses the current theme and visual preset, contains the complete canonical diagram without cropping, and never claims validation. Copy Share Card reuses the same canonical PNG when clipboard image writes are supported.
34
+
35
+ ### Route Share Card
36
+
37
+ After a real directed Route Probe resolves, the reader may use **Export → Route Share Card**. It reuses the exact ordered route snapshot and the shared Share Card seam: `format=share-card`, `variant=route`. The isolated clone may use only static `data-share-route-*` decoration. It is download-only, fails closed for stale/unreachable/conflicting routes, and never becomes the canonical artifact.
38
+
39
+ ### Reach Share Card
40
+
41
+ After a non-empty authored reachability query, the reader may use **Export → Reach Share Card**. It consumes the already resolved upstream/downstream node and edge set without rerunning traversal: `format=share-card`, `variant=reach`. The isolated clone may use only static `data-share-reach-*` decoration. It is download-only. Call it authored reachability-not impact, blast radius, breakage, or runtime causality.
42
+
43
+ ## Truth boundary
44
+
45
+ Viewer exports are communication assets. They do not replace the checked HTML, the deterministic delivery receipt, or a real visual review. Do not add a hosted service, storage surface, dependency, schema branch, or mobile product surface for these viewer-only capabilities.