@deftai/directive-content 0.55.0

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 (250) hide show
  1. package/.agents/skills/deft/SKILL.md +6 -0
  2. package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
  3. package/.agents/skills/deft-directive-build/SKILL.md +10 -0
  4. package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
  5. package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
  6. package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
  7. package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
  8. package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
  9. package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
  10. package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
  11. package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
  12. package/.agents/skills/deft-directive-release/SKILL.md +12 -0
  13. package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
  14. package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
  15. package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
  16. package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
  17. package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
  18. package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
  19. package/LICENSE.md +22 -0
  20. package/QUICK-START.md +167 -0
  21. package/UPGRADING.md +517 -0
  22. package/coding/build-output.md +28 -0
  23. package/coding/coding.md +235 -0
  24. package/coding/debugging.md +110 -0
  25. package/coding/holzmann.md +96 -0
  26. package/coding/hygiene.md +127 -0
  27. package/coding/security.md +158 -0
  28. package/coding/testing.md +162 -0
  29. package/coding/toolchain.md +44 -0
  30. package/commands.md +300 -0
  31. package/context/context.md +57 -0
  32. package/context/deterministic-split.md +67 -0
  33. package/context/examples.md +26 -0
  34. package/context/fractal-summaries.md +69 -0
  35. package/context/long-horizon.md +46 -0
  36. package/context/spec-deltas.md +177 -0
  37. package/context/tool-design.md +34 -0
  38. package/context/working-memory.md +62 -0
  39. package/contracts/boundary-maps.md +65 -0
  40. package/contracts/deterministic-questions.md +59 -0
  41. package/contracts/hierarchy.md +77 -0
  42. package/conventions/content-manifest.json +399 -0
  43. package/conventions/machine-generated-banner.md +130 -0
  44. package/conventions/references.md +120 -0
  45. package/conventions/rule-ownership.json +382 -0
  46. package/conventions/task-caching.md +43 -0
  47. package/conventions/vbrief-filenames.md +70 -0
  48. package/deployments/README.md +37 -0
  49. package/deployments/agentuity/README.md +138 -0
  50. package/deployments/agentuity/via-cli.md +380 -0
  51. package/deployments/agentuity/via-cloud.md +425 -0
  52. package/deployments/agentuity/via-github-actions.md +664 -0
  53. package/deployments/agentuity/via-gravity-network.md +606 -0
  54. package/deployments/agentuity/via-vpc.md +607 -0
  55. package/deployments/aws/README.md +38 -0
  56. package/deployments/aws/via-app-runner.md +612 -0
  57. package/deployments/aws/via-ecs-fargate.md +561 -0
  58. package/deployments/aws/via-elastic-beanstalk.md +628 -0
  59. package/deployments/aws/via-lambda.md +649 -0
  60. package/deployments/azure/README.md +37 -0
  61. package/deployments/azure/via-aks.md +390 -0
  62. package/deployments/azure/via-app-service.md +564 -0
  63. package/deployments/azure/via-container-apps.md +599 -0
  64. package/deployments/azure/via-functions.md +552 -0
  65. package/deployments/cloud-gov/README.md +63 -0
  66. package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
  67. package/deployments/cloud-gov/agents.md +39 -0
  68. package/deployments/cloud-gov/cicd.md +64 -0
  69. package/deployments/cloud-gov/deployment.md +150 -0
  70. package/deployments/cloud-gov/logging.md +43 -0
  71. package/deployments/cloud-gov/manifest.md +121 -0
  72. package/deployments/cloud-gov/overview.md +58 -0
  73. package/deployments/cloud-gov/security.md +46 -0
  74. package/deployments/cloud-gov/services.md +72 -0
  75. package/deployments/cloud-gov/upstream/README.md +18 -0
  76. package/deployments/cloudflare/README.md +33 -0
  77. package/deployments/cloudflare/via-dashboard.md +83 -0
  78. package/deployments/cloudflare/via-git.md +90 -0
  79. package/deployments/cloudflare/via-github-actions.md +185 -0
  80. package/deployments/cloudflare/via-terraform.md +157 -0
  81. package/deployments/cloudflare/via-wrangler.md +165 -0
  82. package/deployments/fly-io/README.md +37 -0
  83. package/deployments/fly-io/via-dockerfile.md +648 -0
  84. package/deployments/fly-io/via-flyctl.md +653 -0
  85. package/deployments/fly-io/via-github-actions.md +695 -0
  86. package/deployments/fly-io/via-multi-region.md +598 -0
  87. package/deployments/google/README.md +34 -0
  88. package/deployments/google/via-app-engine.md +42 -0
  89. package/deployments/google/via-cloud-functions.md +23 -0
  90. package/deployments/google/via-cloud-run.md +330 -0
  91. package/deployments/google/via-gke.md +23 -0
  92. package/deployments/netlify/README.md +99 -0
  93. package/deployments/netlify/via-cli.md +17 -0
  94. package/deployments/netlify/via-functions.md +19 -0
  95. package/deployments/netlify/via-git.md +25 -0
  96. package/deployments/vercel/README.md +90 -0
  97. package/deployments/vercel/via-api.md +16 -0
  98. package/deployments/vercel/via-cli.md +17 -0
  99. package/deployments/vercel/via-git.md +24 -0
  100. package/docs/BROWNFIELD.md +179 -0
  101. package/docs/getting-started.md +137 -0
  102. package/docs/good-agents-md.md +137 -0
  103. package/events/README.md +89 -0
  104. package/events/event-record.schema.json +26 -0
  105. package/events/registry.json +166 -0
  106. package/events/registry.schema.json +71 -0
  107. package/glossary.md +145 -0
  108. package/incidents/README.md +81 -0
  109. package/incidents/_template.md +38 -0
  110. package/interfaces/cli.md +104 -0
  111. package/interfaces/rest.md +212 -0
  112. package/interfaces/tui.md +242 -0
  113. package/interfaces/web.md +123 -0
  114. package/languages/6502-DASM.md +132 -0
  115. package/languages/c.md +235 -0
  116. package/languages/commands.md +23 -0
  117. package/languages/cpp.md +132 -0
  118. package/languages/csharp.md +259 -0
  119. package/languages/dart.md +183 -0
  120. package/languages/delphi.md +218 -0
  121. package/languages/elixir.md +208 -0
  122. package/languages/go.md +78 -0
  123. package/languages/java.md +278 -0
  124. package/languages/javascript.md +163 -0
  125. package/languages/julia.md +175 -0
  126. package/languages/kotlin.md +193 -0
  127. package/languages/markdown.md +168 -0
  128. package/languages/mermaid.md +146 -0
  129. package/languages/officejs.md +392 -0
  130. package/languages/python.md +209 -0
  131. package/languages/r.md +163 -0
  132. package/languages/rust.md +216 -0
  133. package/languages/sql.md +216 -0
  134. package/languages/swift.md +153 -0
  135. package/languages/typescript.md +132 -0
  136. package/languages/vba.md +279 -0
  137. package/languages/vhdl.md +180 -0
  138. package/languages/visual-basic.md +151 -0
  139. package/languages/zig.md +196 -0
  140. package/meta/SOUL.md +27 -0
  141. package/meta/code-field.md +44 -0
  142. package/meta/morals.md +40 -0
  143. package/meta/philosophy.md +39 -0
  144. package/meta/project.md +49 -0
  145. package/meta/ralph.md +223 -0
  146. package/meta/security.md +80 -0
  147. package/meta/versioning.md +326 -0
  148. package/package.json +22 -0
  149. package/packs/lessons/lessons-pack-0.1.json +553 -0
  150. package/packs/patterns/patterns-pack-0.1.json +57 -0
  151. package/packs/rules/rules-pack-0.1.json +4767 -0
  152. package/packs/skills/skills-pack-0.1.json +262 -0
  153. package/packs/strategies/strategies-pack-0.1.json +167 -0
  154. package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
  155. package/patterns/executor-layer-credentials.md +227 -0
  156. package/patterns/llm-app.md +156 -0
  157. package/patterns/multi-agent.md +278 -0
  158. package/patterns/prompt-assembly-layer-ordering.md +154 -0
  159. package/patterns/role-as-overlay.md +179 -0
  160. package/platforms/2600.md +137 -0
  161. package/platforms/unity.md +329 -0
  162. package/references/composer-skill-porting.md +152 -0
  163. package/references/cost-models.md +163 -0
  164. package/references/ip-risk.md +246 -0
  165. package/references/plain-english-ux.md +275 -0
  166. package/resilience/context-pruning.md +67 -0
  167. package/resilience/continue-here.md +62 -0
  168. package/scm/changelog.md +276 -0
  169. package/scm/git.md +139 -0
  170. package/scm/github.md +265 -0
  171. package/secrets/.gitkeep +0 -0
  172. package/skills/deft-build/SKILL.md +20 -0
  173. package/skills/deft-directive-article-review/SKILL.md +156 -0
  174. package/skills/deft-directive-build/SKILL.md +302 -0
  175. package/skills/deft-directive-cost/SKILL.md +201 -0
  176. package/skills/deft-directive-debug/SKILL.md +140 -0
  177. package/skills/deft-directive-decompose/SKILL.md +96 -0
  178. package/skills/deft-directive-gh-arch/SKILL.md +160 -0
  179. package/skills/deft-directive-gh-slice/SKILL.md +199 -0
  180. package/skills/deft-directive-glossary/SKILL.md +118 -0
  181. package/skills/deft-directive-interview/SKILL.md +528 -0
  182. package/skills/deft-directive-pre-pr/SKILL.md +131 -0
  183. package/skills/deft-directive-probe/SKILL.md +127 -0
  184. package/skills/deft-directive-refinement/SKILL.md +403 -0
  185. package/skills/deft-directive-release/SKILL.md +266 -0
  186. package/skills/deft-directive-review-cycle/SKILL.md +401 -0
  187. package/skills/deft-directive-setup/SKILL.md +717 -0
  188. package/skills/deft-directive-swarm/SKILL.md +989 -0
  189. package/skills/deft-directive-sync/SKILL.md +288 -0
  190. package/skills/deft-directive-triage/SKILL.md +137 -0
  191. package/skills/deft-directive-write-skill/SKILL.md +169 -0
  192. package/skills/deft-interview/SKILL.md +16 -0
  193. package/skills/deft-pre-pr/SKILL.md +16 -0
  194. package/skills/deft-review-cycle/SKILL.md +16 -0
  195. package/skills/deft-roadmap-refresh/SKILL.md +16 -0
  196. package/skills/deft-setup/SKILL.md +20 -0
  197. package/skills/deft-swarm/SKILL.md +16 -0
  198. package/skills/deft-sync/SKILL.md +16 -0
  199. package/strategies/README.md +83 -0
  200. package/strategies/artifact-guards.md +85 -0
  201. package/strategies/bdd.md +115 -0
  202. package/strategies/brownfield.md +7 -0
  203. package/strategies/discuss.md +129 -0
  204. package/strategies/emit-hints.md +69 -0
  205. package/strategies/enterprise.md +193 -0
  206. package/strategies/interview.md +551 -0
  207. package/strategies/map.md +179 -0
  208. package/strategies/probe.md +151 -0
  209. package/strategies/rapid.md +155 -0
  210. package/strategies/research.md +155 -0
  211. package/strategies/roadmap.md +9 -0
  212. package/strategies/speckit.md +437 -0
  213. package/strategies/v0-20-contract.md +134 -0
  214. package/strategies/yolo.md +169 -0
  215. package/swarm/swarm.md +300 -0
  216. package/templates/COST-ESTIMATE.md +114 -0
  217. package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
  218. package/templates/agent-prompt-preamble.md +409 -0
  219. package/templates/agents-entry.md +211 -0
  220. package/templates/agents-entry.placeholders.md +75 -0
  221. package/templates/embed.go +20 -0
  222. package/templates/embed_test.go +36 -0
  223. package/templates/make-spec-example.md +9 -0
  224. package/templates/make-spec.md +246 -0
  225. package/templates/project.md.template +52 -0
  226. package/templates/specification.md +1 -0
  227. package/templates/swarm-greptile-poller-prompt.md +556 -0
  228. package/templates/user.md.template +31 -0
  229. package/tools/RWLDL.md +80 -0
  230. package/tools/greptile.md +141 -0
  231. package/tools/installer.md +23 -0
  232. package/tools/taskfile-migration.md +32 -0
  233. package/tools/taskfile.md +185 -0
  234. package/tools/telemetry.md +285 -0
  235. package/vbrief/schemas/cache-meta.schema.json +137 -0
  236. package/vbrief/schemas/candidates.schema.json +130 -0
  237. package/vbrief/schemas/codebase-map.schema.json +213 -0
  238. package/vbrief/schemas/lessons-pack.schema.json +134 -0
  239. package/vbrief/schemas/patterns-pack.schema.json +84 -0
  240. package/vbrief/schemas/rules-pack.schema.json +105 -0
  241. package/vbrief/schemas/skills-pack.schema.json +94 -0
  242. package/vbrief/schemas/slices.schema.json +87 -0
  243. package/vbrief/schemas/strategies-pack.schema.json +89 -0
  244. package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
  245. package/vbrief/schemas/vbrief-core.schema.json +1022 -0
  246. package/vbrief/vbrief.md +684 -0
  247. package/verification/integration.md +76 -0
  248. package/verification/plan-checking.md +85 -0
  249. package/verification/uat.md +60 -0
  250. package/verification/verification.md +117 -0
@@ -0,0 +1,168 @@
1
+ # Markdown Best Practices
2
+
3
+ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
4
+
5
+ **⚠️ See also**: [main.md](../../main.md) | [PROJECT.md](../../PROJECT.md)
6
+
7
+ **Stack**: CommonMark/GFM; Diagrams: Mermaid; Linting: markdownlint; Render targets: GitHub, GitLab, Obsidian, static site generators
8
+
9
+ ## Standards
10
+
11
+ ### Writing Quality
12
+ - ! Write for the reader: assume they have context on the domain but not on your specific work
13
+ - ! Lead with the most important information (inverted pyramid)
14
+ - ! One idea per paragraph; one topic per section
15
+ - ! Use active voice for instructions: "Run the script" not "The script should be run"
16
+ - ~ Keep sentences under 25 words; break complex ideas into multiple sentences
17
+ - ~ Use second person ("you") for instructions; avoid first person in technical docs
18
+ - ≉ Wall-of-text paragraphs >5 sentences — break with subheadings, lists, or diagrams
19
+ - ⊗ Ambiguous pronouns ("it", "this", "that") without clear antecedent
20
+
21
+ ### Content Organization
22
+ - ! Place a summary or purpose statement within the first 3 lines after the title
23
+ - ! Use headings as scannable signposts — reader should understand structure from headings alone
24
+ - ! Group related content under descriptive subheadings
25
+ - ! Place prerequisites and setup instructions before usage/workflow sections
26
+ - ⊗ Include mermaid charts in document line counts
27
+ - ~ Include a table of contents for documents >300 lines
28
+ - ~ Use admonitions/callouts (`> **Note:**`, `> **Warning:**`) for important asides
29
+ - ≉ Documents >700 lines — split into multiple linked files
30
+ - ⊗ Burying critical information (breaking changes, security) deep in a document
31
+
32
+ ### Links & References
33
+ - ! Use descriptive link text that makes sense out of context
34
+ - ! Use relative paths for internal project links
35
+ - ! Verify links are valid before commit (dead link checker in CI)
36
+ - ~ Use reference-style links when the same URL appears 3+ times
37
+ - ~ Link to specific headings when referencing a section (e.g. `[Testing](../coding/testing.md#testing)`)
38
+ - ⊗ Bare URLs in prose — always wrap in descriptive link text
39
+ - ⊗ "Click here" or "this link" as link text
40
+
41
+ ### Lists & Structure
42
+ - ! Use unordered lists for items without meaningful order
43
+ - ! Use ordered lists only when sequence matters (steps, rankings)
44
+ - ! Keep list items parallel in grammar and structure
45
+ - ~ Limit nesting to 2 levels; deeper nesting signals need for restructuring
46
+ - ≉ Lists >15 items without grouping — break into categorized sublists
47
+ - ≉ Mixing list styles (bullets and numbers) at the same level
48
+
49
+ ### Style Preferences
50
+ - ~ Prefer `_italic_` over `*italic*` (clearer visual distinction from `**bold**`)
51
+ - ~ Prefer `**bold**` over `__bold__`
52
+ - ! Ordered lists: use `1.` for all items (auto-numbering; matches markdownlint MD029)
53
+
54
+ ### Code in Documentation
55
+ - ! Use fenced code blocks with language identifiers for all code
56
+ - ! Keep code examples minimal: show the concept, not the entire file
57
+ - ! Ensure all code examples compile/run (test in CI where possible)
58
+ - ~ Use inline code for identifiers, file names, commands, and values
59
+ - ~ Add comments in code blocks only when the code isn't self-explanatory
60
+ - ⊗ Screenshots of code — always use text-based code blocks (searchable, accessible, copyable)
61
+
62
+ ### Tables
63
+ - ! Use tables only for genuinely tabular data (rows × columns)
64
+ - ! Include a header row with descriptive column names
65
+ - ~ Align columns in source for readability
66
+ - ~ Keep tables under 7 columns; consider alternative formats for wider data
67
+ - ≉ Tables for layout or formatting purposes
68
+ - ≉ Tables with cells containing multi-paragraph content — use definition lists or sections
69
+
70
+ ### Images & Media
71
+ - ! Include descriptive alt text on every image (accessibility)
72
+ - ! Use vector formats (SVG, Mermaid) over raster (PNG, JPG) for diagrams
73
+ - ! Store images in a dedicated directory (`images/`, `assets/`, `diagrams/`)
74
+ - ~ Include a caption or description below complex images
75
+ - ~ Optimize raster images for file size before committing
76
+ - ⊗ Images as the sole carrier of critical information — always include text equivalent
77
+ - ⊗ Screenshots of terminal output — use text-based code blocks
78
+
79
+ ## Mermaid Diagrams
80
+
81
+ - ⊗ Use mermaid in anywhere inside deft/ *.md files
82
+ - ~ Use Mermaid liberally whenever a visual would clarify relationships, flows, or architecture
83
+ - See [mermaid.md](./mermaid.md) for all Mermaid standards, theme config, and diagram examples
84
+
85
+ ## Versioning & Maintenance
86
+
87
+ - ! Date or version-stamp documents that have a shelf life (ADRs, runbooks, release notes)
88
+ - ! Review and update docs when the related code changes
89
+ - ! Mark deprecated content clearly: `> **⚠️ Deprecated**: ...`
90
+ - ~ Use `CHANGELOG.md` for project-level change tracking
91
+ - ⊗ Stale documentation — better to delete than to mislead
92
+
93
+ ## README Standards
94
+
95
+ - ! Include: project name, one-line description, quick start, prerequisites
96
+ - ~ Include: badges (CI, coverage, version), architecture overview, contributing guide link
97
+ - ~ Keep README under 300 lines; link to detailed docs for depth
98
+ - ! List all required environment variables / config without exposing secrets
99
+ - ⊗ Duplicating detailed docs in README — link instead
100
+
101
+ ## ADR (Architecture Decision Records)
102
+
103
+ - ~ Use ADRs for significant technical decisions
104
+ - ! ADR format: Title, Status, Context, Decision, Consequences
105
+ - ! Status values: Proposed, Accepted, Deprecated, Superseded
106
+ - ~ Number ADRs sequentially: `adr-001-use-postgres.md`
107
+ - ~ Store in `docs/adr/` or `docs/decisions/`
108
+
109
+ ## Tooling
110
+
111
+ ### .markdownlint.json
112
+
113
+ ```json
114
+ {
115
+ "default": true,
116
+ "MD003": { "style": "atx" },
117
+ "MD004": { "style": "dash" },
118
+ "MD007": { "indent": 2 },
119
+ "MD013": { "line_length": 100, "code_blocks": false, "tables": false },
120
+ "MD024": { "siblings_only": true },
121
+ "MD025": { "front_matter_title": "" },
122
+ "MD029": { "style": "one" },
123
+ "MD033": false,
124
+ "MD036": false,
125
+ "MD041": true,
126
+ "MD046": { "style": "fenced" },
127
+ "MD048": { "style": "backtick" }
128
+ }
129
+ ```
130
+
131
+ Key non-defaults: MD033/MD036 disabled (allow inline HTML, emphasis-as-heading); MD013 exempts code blocks/tables.
132
+
133
+ ### .markdownlintignore
134
+
135
+ `node_modules/`, `.git/`, `build/`, `dist/`, `*.min.md`, `CHANGELOG.md`
136
+
137
+ ### Editor & CI Integration
138
+
139
+ - **VS Code**: `DavidAnson.vscode-markdownlint` extension; set `"extends": "./.markdownlint.json"`, `editor.rulers: [100]`, `wordWrapColumn: 100`
140
+ - **Vim**: `dense-analysis/ale` or `coc-markdownlint`
141
+ - **Pre-commit**: `igorshubovych/markdownlint-cli` hook with `--fix`
142
+ - **GitHub Actions**: `DavidAnson/markdownlint-cli2-action@v15` with `globs: "**/*.md"`
143
+
144
+ ## Anti-Patterns
145
+
146
+ - ⊗ **Stale docs**: Delete or update — stale docs are worse than no docs
147
+ - ≉ **Documents >700 lines**: Split into focused, linked files
148
+ - ≉ **Deeply nested lists (>2 levels)**: Restructure into sections or subheadings
149
+
150
+ ## Commands
151
+
152
+ See [commands.md](./commands.md).
153
+
154
+ ## Patterns
155
+
156
+ - ~ Use templates for recurring document types (ADRs, runbooks, RFCs)
157
+ - ~ Automate link checking in CI with markdownlint or dedicated link checkers
158
+ - ~ Use reference-style links for frequently-cited URLs
159
+
160
+ ## Compliance Checklist
161
+
162
+ - ! Descriptive headings; summary in first 3 lines; scannable structure
163
+ - ! Alt text on all images; descriptive link text; no bare URLs
164
+ - ! Fenced code blocks with language identifiers; examples that compile
165
+ - ! Mermaid: see [mermaid.md](./mermaid.md)
166
+ - ! Documents <700 lines; README <500 lines
167
+ - ⊗ Screenshots of code, "click here" links, stale docs
168
+ - ! Run `task lint` before commit
@@ -0,0 +1,146 @@
1
+ # Mermaid Diagram Standards
2
+
3
+ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
4
+
5
+ **⚠️ See also**: [markdown.md](./markdown.md) | [main.md](../../main.md)
6
+
7
+ ## Two-Color Foundation
8
+
9
+ Every directive Mermaid diagram is defined by exactly two colors:
10
+
11
+ - **`bg`** = `#ffffff` (white background)
12
+ - **`fg`** = `#000000` (black foreground)
13
+
14
+ All other values are mechanically derived between these two poles. The init directive values below are not arbitrary constants — they are specific points on the bg→fg gradient:
15
+
16
+ | Element | Value | Derivation |
17
+ |---|---|---|
18
+ | Text (all labels) | `#000000` | fg at 100% |
19
+ | Lines, connectors, signals | `#404040` | fg at ~75% |
20
+ | Primary nodes, note backgrounds | `#909090` | fg at ~56% |
21
+ | Secondary nodes, actor backgrounds | `#808080` | fg at ~50% |
22
+ | Tertiary nodes | `#707070` | fg at ~44% |
23
+
24
+ To change the palette, change `bg` and `fg` — all values shift consistently. The grayscale-on-white requirement is an instance of this model with `bg=#ffffff` and `fg=#000000`.
25
+
26
+ ## Standards
27
+
28
+ - ! Include `%%{init:...}%%` theme directive at the start of every Mermaid block
29
+ - ! Use the `base` theme with the standard grayscale init directive derived from the two-color model (not built-in themes)
30
+ - ! For `sequenceDiagram` readability on GitHub/Gist renderers, do not rely on `init.background` or `themeCSS` alone
31
+ - ! For `sequenceDiagram` readability on GitHub/Gist renderers, place participant declarations inside a grey `box ... end` block
32
+ - ! When using `box` in `sequenceDiagram`, place only participant declarations inside the block; message lines and notes must remain outside
33
+ - ! Use black text with grayscale fills for documentation diagrams (bg=white, fg=black)
34
+ - ~ Keep diagrams focused: one concept per diagram
35
+ - ~ Provide a text description or caption alongside every diagram
36
+ - ~ Validate Mermaid rendering fixes with a closed-loop workflow: minimal gist, Playwright render, screenshot inspection
37
+ - ~ Use a minimal reproducer gist before patching large documents
38
+ - ~ Treat renderer quirks as diagram-type-specific; `sequenceDiagram` workarounds SHOULD NOT be generalized to other Mermaid diagram types without testing
39
+ - ≉ Create diagrams with more than 20 nodes in one block; split into focused diagrams
40
+ - ⊗ Rely solely on color to convey meaning (use labels and shapes too)
41
+ - ⊗ Ship low-contrast diagrams (for example, missing init theme or light-on-light text)
42
+ - ⊗ Set individual theme variable values without reference to the two-color derivation table above
43
+
44
+ ## Init Directive (Required)
45
+
46
+ Prepend to every Mermaid block:
47
+
48
+ ```mermaid
49
+ %%{init: {'theme': 'base', 'themeVariables': {
50
+ 'primaryColor': '#909090',
51
+ 'secondaryColor': '#808080',
52
+ 'tertiaryColor': '#707070',
53
+ 'primaryTextColor': '#000000',
54
+ 'secondaryTextColor': '#000000',
55
+ 'tertiaryTextColor': '#000000',
56
+ 'lineColor': '#404040',
57
+ 'noteTextColor': '#000000',
58
+ 'noteBkgColor': '#909090',
59
+ 'actorBkg': '#808080',
60
+ 'actorTextColor': '#000000',
61
+ 'actorLineColor': '#404040',
62
+ 'signalColor': '#404040'
63
+ }}}%%
64
+ ```
65
+
66
+ For `stateDiagram-v2`, add these keys to the existing `themeVariables` map
67
+ (do not replace the base variables above):
68
+
69
+ ```text
70
+ 'stateLabelColor': '#000000',
71
+ 'compositeBackground': '#a0a0a0'
72
+ ```
73
+
74
+ ## Commands
75
+
76
+ See [commands.md](./commands.md).
77
+
78
+ ## Patterns
79
+
80
+ - ~ Use the standard init directive (above) as a copy-paste starting point for every diagram
81
+ - ~ Keep diagrams focused: one concept per diagram, split complex flows into linked sub-diagrams
82
+ - ~ Validate rendering changes with a minimal gist before patching large documents
83
+
84
+ ## Diagram Examples
85
+
86
+ ### Flowchart
87
+
88
+ ```mermaid
89
+ %%{init: {'theme': 'base', 'themeVariables': {
90
+ 'primaryColor': '#909090',
91
+ 'primaryTextColor': '#000000',
92
+ 'lineColor': '#404040'
93
+ }}}%%
94
+ flowchart TD
95
+ A[Start] --> B{Decision}
96
+ B -->|Yes| C[Action A]
97
+ B -->|No| D[Action B]
98
+ C --> E[End]
99
+ D --> E
100
+ ```
101
+
102
+ ### Sequence Diagram (GitHub/Gist Safe)
103
+
104
+ ```mermaid
105
+ %%{init: {'theme': 'base', 'themeVariables': {
106
+ 'primaryTextColor': '#000000',
107
+ 'secondaryTextColor': '#000000',
108
+ 'tertiaryTextColor': '#000000',
109
+ 'noteTextColor': '#000000',
110
+ 'primaryColor': '#909090',
111
+ 'secondaryColor': '#808080',
112
+ 'tertiaryColor': '#707070',
113
+ 'lineColor': '#404040',
114
+ 'actorLineColor': '#404040',
115
+ 'signalColor': '#404040',
116
+ 'actorBkg': '#808080',
117
+ 'actorTextColor': '#000000',
118
+ 'noteBkgColor': '#909090'
119
+ }}}%%
120
+ sequenceDiagram
121
+ box rgb(192, 192, 192) Participants
122
+ participant A as Alice
123
+ participant B as Bob
124
+ end
125
+ A->>B: Hello
126
+ B->>A: Hi back
127
+ Note over A,B: Example
128
+ ```
129
+
130
+ ### State Diagram
131
+
132
+ ```mermaid
133
+ %%{init: {'theme': 'base', 'themeVariables': {
134
+ 'primaryColor': '#909090',
135
+ 'lineColor': '#404040',
136
+ 'primaryTextColor': '#000000',
137
+ 'stateLabelColor': '#000000',
138
+ 'compositeBackground': '#a0a0a0'
139
+ }}}%%
140
+ stateDiagram-v2
141
+ [*] --> Draft
142
+ Draft --> Review : submit
143
+ Review --> Approved : approve
144
+ Review --> Draft : reject
145
+ Approved --> [*]
146
+ ```