@activatus/code-standards 0.0.0-stage → 2.0.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 (183) hide show
  1. package/README.md +200 -2
  2. package/docs/Guides/_category_.json +4 -0
  3. package/docs/Guides/component-library-workflow.md +182 -0
  4. package/docs/Guides/migrating.md +144 -0
  5. package/docs/Guides/setup.md +130 -0
  6. package/docs/Standards/_category_.json +4 -0
  7. package/docs/Standards/agent-skills.md +125 -0
  8. package/docs/Standards/agent-specs.md +89 -0
  9. package/docs/Standards/branch-naming.md +66 -0
  10. package/docs/Standards/conventional-commits.md +189 -0
  11. package/docs/Standards/direnv.mdx +249 -0
  12. package/docs/Standards/documentation.md +311 -0
  13. package/docs/Standards/editorconfig.md +72 -0
  14. package/docs/Standards/eslint.md +709 -0
  15. package/docs/Standards/human-readable-names.md +234 -0
  16. package/docs/Standards/lint-errors.md +139 -0
  17. package/docs/Standards/prettier.md +97 -0
  18. package/docs/Standards/readable-code.md +540 -0
  19. package/docs/Standards/stylelint.md +178 -0
  20. package/docs/Standards/styling.md +284 -0
  21. package/docs/Standards/tech-stack.md +156 -0
  22. package/docs/Structure/_category_.json +4 -0
  23. package/docs/Structure/api-routes.md +118 -0
  24. package/docs/Structure/component-organization.md +519 -0
  25. package/docs/Structure/folder-structure.md +353 -0
  26. package/docs/Structure/import-organization.md +158 -0
  27. package/docs/Structure/naming-conventions.md +336 -0
  28. package/docs/design-system-components.md +117 -0
  29. package/docs/intro.md +46 -0
  30. package/docs/ontology.md +132 -0
  31. package/docs/templates.mdx +419 -0
  32. package/docs/version-history.md +211 -0
  33. package/package.json +56 -3
  34. package/static/templates/.commitlintrc.json +3 -0
  35. package/static/templates/.editorconfig +28 -0
  36. package/static/templates/.envrc +25 -0
  37. package/static/templates/.nvmrc +1 -0
  38. package/static/templates/AGENTS.md +160 -0
  39. package/static/templates/decision-doc.md +19 -0
  40. package/static/templates/docs/ai/agent-harness.md +17 -0
  41. package/static/templates/docs/ai/agents.md +17 -0
  42. package/static/templates/docs/ai/architecture.md +17 -0
  43. package/static/templates/docs/ai/context.md +17 -0
  44. package/static/templates/docs/ai/model-routing.md +17 -0
  45. package/static/templates/docs/ai/models.md +17 -0
  46. package/static/templates/docs/ai/retrieval.md +17 -0
  47. package/static/templates/docs/ai/tools.md +17 -0
  48. package/static/templates/docs/architecture/authentication.md +17 -0
  49. package/static/templates/docs/architecture/backend.md +17 -0
  50. package/static/templates/docs/architecture/background-jobs.md +17 -0
  51. package/static/templates/docs/architecture/backups.md +17 -0
  52. package/static/templates/docs/architecture/caching.md +17 -0
  53. package/static/templates/docs/architecture/ci-cd.md +17 -0
  54. package/static/templates/docs/architecture/disaster-recovery.md +17 -0
  55. package/static/templates/docs/architecture/environments.md +17 -0
  56. package/static/templates/docs/architecture/frontend.md +17 -0
  57. package/static/templates/docs/architecture/hosting.md +17 -0
  58. package/static/templates/docs/architecture/observability.md +17 -0
  59. package/static/templates/docs/architecture/realtime.md +17 -0
  60. package/static/templates/docs/architecture/search.md +17 -0
  61. package/static/templates/docs/architecture/services.md +17 -0
  62. package/static/templates/docs/architecture/state-management.md +17 -0
  63. package/static/templates/docs/architecture/storage.md +17 -0
  64. package/static/templates/docs/architecture/system.md +17 -0
  65. package/static/templates/docs/business/buying-trigger.md +17 -0
  66. package/static/templates/docs/business/customer-value.md +17 -0
  67. package/static/templates/docs/business/customer.md +17 -0
  68. package/static/templates/docs/business/defensibility.md +17 -0
  69. package/static/templates/docs/business/growth.md +17 -0
  70. package/static/templates/docs/business/pricing.md +17 -0
  71. package/static/templates/docs/business/revenue-model.md +17 -0
  72. package/static/templates/docs/business/unit-economics.md +17 -0
  73. package/static/templates/docs/data/analytics.md +17 -0
  74. package/static/templates/docs/data/audit.md +17 -0
  75. package/static/templates/docs/data/database.md +17 -0
  76. package/static/templates/docs/data/indexing.md +17 -0
  77. package/static/templates/docs/data/migrations.md +17 -0
  78. package/static/templates/docs/data/model.md +17 -0
  79. package/static/templates/docs/data/retention.md +17 -0
  80. package/static/templates/docs/data/schema.md +17 -0
  81. package/static/templates/docs/deployment/approval.md +17 -0
  82. package/static/templates/docs/deployment/live-verification.md +17 -0
  83. package/static/templates/docs/deployment/process.md +17 -0
  84. package/static/templates/docs/deployment/rollback.md +17 -0
  85. package/static/templates/docs/design/design-system.md +17 -0
  86. package/static/templates/docs/design/errors.md +17 -0
  87. package/static/templates/docs/design/feedback.md +17 -0
  88. package/static/templates/docs/design/interactions.md +17 -0
  89. package/static/templates/docs/design/layout.md +17 -0
  90. package/static/templates/docs/design/navigation.md +17 -0
  91. package/static/templates/docs/design/principles.md +17 -0
  92. package/static/templates/docs/design/responsive.md +17 -0
  93. package/static/templates/docs/development/branching.md +17 -0
  94. package/static/templates/docs/development/code-quality.md +17 -0
  95. package/static/templates/docs/development/coding-standards.md +17 -0
  96. package/static/templates/docs/development/commits.md +17 -0
  97. package/static/templates/docs/development/merge-strategy.md +17 -0
  98. package/static/templates/docs/development/process.md +17 -0
  99. package/static/templates/docs/development/pull-requests.md +17 -0
  100. package/static/templates/docs/experience/accessibility.md +17 -0
  101. package/static/templates/docs/experience/aha-moment.md +17 -0
  102. package/static/templates/docs/experience/anti-experience.md +17 -0
  103. package/static/templates/docs/experience/friction.md +17 -0
  104. package/static/templates/docs/experience/outcomes.md +17 -0
  105. package/static/templates/docs/experience/principles.md +17 -0
  106. package/static/templates/docs/experience/retention.md +17 -0
  107. package/static/templates/docs/experience/sharing.md +17 -0
  108. package/static/templates/docs/overview/how-it-works.md +17 -0
  109. package/static/templates/docs/overview/what-is-it.md +17 -0
  110. package/static/templates/docs/overview/writing-docs.md +16 -0
  111. package/static/templates/docs/pitch/alternatives.md +17 -0
  112. package/static/templates/docs/pitch/assumptions.md +17 -0
  113. package/static/templates/docs/pitch/audience.md +17 -0
  114. package/static/templates/docs/pitch/concept.md +17 -0
  115. package/static/templates/docs/pitch/differentiators.md +17 -0
  116. package/static/templates/docs/pitch/outcomes.md +17 -0
  117. package/static/templates/docs/pitch/problem.md +17 -0
  118. package/static/templates/docs/pitch/product-market-fit.md +17 -0
  119. package/static/templates/docs/pitch/success-criteria.md +17 -0
  120. package/static/templates/docs/pitch/validation.md +17 -0
  121. package/static/templates/docs/pitch/value-proposition.md +17 -0
  122. package/static/templates/docs/pitch/vision.md +17 -0
  123. package/static/templates/docs/scope/core.md +17 -0
  124. package/static/templates/docs/scope/exclusions.md +17 -0
  125. package/static/templates/docs/scope/future.md +17 -0
  126. package/static/templates/docs/scope/launch.md +17 -0
  127. package/static/templates/docs/scope/post-launch.md +17 -0
  128. package/static/templates/docs/scope/priorities.md +17 -0
  129. package/static/templates/docs/scope/quality-bar.md +17 -0
  130. package/static/templates/docs/security/audit.md +17 -0
  131. package/static/templates/docs/security/data-access.md +17 -0
  132. package/static/templates/docs/security/logging.md +17 -0
  133. package/static/templates/docs/security/privacy.md +17 -0
  134. package/static/templates/docs/security/secrets.md +17 -0
  135. package/static/templates/docs/security/threat-model.md +17 -0
  136. package/static/templates/docs/testing/end-to-end.md +17 -0
  137. package/static/templates/docs/testing/integration.md +17 -0
  138. package/static/templates/docs/testing/regression.md +17 -0
  139. package/static/templates/docs/testing/security.md +17 -0
  140. package/static/templates/docs/testing/strategy.md +17 -0
  141. package/static/templates/docs/testing/test-data.md +17 -0
  142. package/static/templates/docs/testing/unit.md +17 -0
  143. package/static/templates/docs/uat/checks.md +17 -0
  144. package/static/templates/docs/uat/strategy.md +17 -0
  145. package/static/templates/docs/users/permissions.md +17 -0
  146. package/static/templates/docs/users/roles.md +17 -0
  147. package/static/templates/docs/users/user-types.md +17 -0
  148. package/static/templates/docs/workflows/assignment.md +17 -0
  149. package/static/templates/docs/workflows/bugfix.md +17 -0
  150. package/static/templates/docs/workflows/dependencies.md +17 -0
  151. package/static/templates/docs/workflows/deployment.md +17 -0
  152. package/static/templates/docs/workflows/development.md +17 -0
  153. package/static/templates/docs/workflows/planning.md +17 -0
  154. package/static/templates/docs/workflows/review.md +17 -0
  155. package/static/templates/docs/workflows/uat.md +17 -0
  156. package/static/templates/docsSite/docusaurus.config.ts +119 -0
  157. package/static/templates/docsSite/gitignore.txt +3 -0
  158. package/static/templates/docsSite/package.json.txt +42 -0
  159. package/static/templates/docsSite/pnpm-workspace.yaml +2 -0
  160. package/static/templates/docsSite/sidebars.ts +8 -0
  161. package/static/templates/docsSite/src/css/custom.css +1 -0
  162. package/static/templates/docsSite/src/pages/index.tsx +9 -0
  163. package/static/templates/docsSite/static/images/logo.svg +4 -0
  164. package/static/templates/docsSite/tsconfig.json +7 -0
  165. package/static/templates/eslint/base/eslint.config.mjs +79 -0
  166. package/static/templates/eslint/nextjs/eslint.config.mjs +137 -0
  167. package/static/templates/eslint/react/eslint.config.mjs +138 -0
  168. package/static/templates/eslint/typescript/eslint.config.mjs +126 -0
  169. package/static/templates/globals.css +16 -0
  170. package/static/templates/husky/commit-msg +1 -0
  171. package/static/templates/husky/pre-commit +1 -0
  172. package/static/templates/next.config.mjs +18 -0
  173. package/static/templates/prettier.config.js +17 -0
  174. package/static/templates/skills/codeReview.md +31 -0
  175. package/static/templates/skills/format.md +18 -0
  176. package/static/templates/skills/lint.md +21 -0
  177. package/static/templates/skills/lintFix.md +24 -0
  178. package/static/templates/skills/securityAudit.md +28 -0
  179. package/static/templates/skills/test.md +24 -0
  180. package/static/templates/skills/typescript.md +28 -0
  181. package/static/templates/skills/updateLayout.md +20 -0
  182. package/static/templates/stylelint/css/stylelint.config.mjs +28 -0
  183. package/static/templates/stylelint/scss/stylelint.config.mjs +10 -0
@@ -0,0 +1,249 @@
1
+ ---
2
+ sidebar_position: 4
3
+ ---
4
+
5
+ # direnv + nvm
6
+
7
+ Automatically switch to the project's Node.js version when you `cd` into the repository. No manual `nvm use` required.
8
+
9
+ ## How it works
10
+
11
+ Two files work together:
12
+
13
+ | File | Purpose |
14
+ | --- | --- |
15
+ | `.nvmrc` | Declares the required Node.js major version (e.g. `20`) |
16
+ | `.envrc` | Loaded by direnv on `cd`; sources nvm and activates the declared version |
17
+
18
+ When you enter the project directory direnv runs `.envrc`, which installs the declared Node version (if missing) and activates it for your shell session. Leaving the directory restores the previous environment automatically.
19
+
20
+ ## Installation
21
+
22
+ ### macOS
23
+
24
+ **Homebrew** (recommended):
25
+
26
+ ```bash
27
+ brew install direnv nvm
28
+ ```
29
+
30
+ Homebrew installs nvm to a prefix path rather than `$HOME/.nvm`. The `.envrc` handles this automatically by falling back to `$(brew --prefix nvm)/nvm.sh` when `$NVM_DIR/nvm.sh` is not found.
31
+
32
+ Add to the **end** of `~/.zshrc` (or `~/.bashrc` for bash):
33
+
34
+ ```bash
35
+ # nvm
36
+ export NVM_DIR="$HOME/.nvm"
37
+ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
38
+
39
+ # direnv
40
+ eval "$(direnv hook zsh)" # replace zsh with bash if needed
41
+ ```
42
+
43
+ **Manual nvm install** (alternative):
44
+
45
+ ```bash
46
+ # Install nvm
47
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
48
+
49
+ # Install direnv
50
+ brew install direnv
51
+ ```
52
+
53
+ The install script appends the nvm bootstrap to your shell profile automatically.
54
+
55
+ Then add the direnv hook to the **end** of `~/.zshrc`:
56
+
57
+ ```bash
58
+ eval "$(direnv hook zsh)"
59
+ ```
60
+
61
+ Restart your shell (or `source ~/.zshrc`) after editing the profile.
62
+
63
+ ---
64
+
65
+ ### Linux
66
+
67
+ ```bash
68
+ # Install nvm
69
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
70
+ ```
71
+
72
+ The script appends the following to your `~/.bashrc` (or `~/.zshrc`):
73
+
74
+ ```bash
75
+ export NVM_DIR="$HOME/.nvm"
76
+ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
77
+ ```
78
+
79
+ Install direnv using your package manager:
80
+
81
+ ```bash
82
+ # Debian / Ubuntu
83
+ sudo apt install direnv
84
+
85
+ # Arch
86
+ sudo pacman -S direnv
87
+
88
+ # Fedora
89
+ sudo dnf install direnv
90
+
91
+ # Or via the official install script:
92
+ curl -sfL https://direnv.net/install.sh | bash
93
+ ```
94
+
95
+ Add the direnv hook to the **end** of `~/.bashrc` (or `~/.zshrc`):
96
+
97
+ ```bash
98
+ eval "$(direnv hook bash)" # replace bash with zsh if needed
99
+ ```
100
+
101
+ Restart your shell after editing the profile.
102
+
103
+ ---
104
+
105
+ ### Windows
106
+
107
+ direnv and nvm are Unix tools. On Windows the recommended path is **WSL 2**. A Git Bash alternative is available for teams that cannot use WSL.
108
+
109
+ #### Option A — WSL 2 (recommended)
110
+
111
+ WSL 2 provides a full Linux environment. Follow the [Linux instructions](#linux) inside your WSL shell. Your editor (VS Code, JetBrains) should be configured to open projects inside WSL for the environment to be active.
112
+
113
+ Install WSL 2 if you haven't already:
114
+
115
+ ```powershell
116
+ # Run in PowerShell (Administrator)
117
+ wsl --install
118
+ ```
119
+
120
+ Then open a WSL terminal and follow the [Linux setup](#linux) above.
121
+
122
+ #### Option B — Git Bash + nvm-windows
123
+
124
+ If WSL is not available, direnv and [nvm-windows](https://github.com/coreybutler/nvm-windows) can be used together in Git Bash.
125
+
126
+ **1. Install nvm-windows**
127
+
128
+ Download and run the installer from the [nvm-windows releases page](https://github.com/coreybutler/nvm-windows/releases). This installs `nvm.exe` and adds it to `PATH`.
129
+
130
+ nvm-windows exposes `nvm` as an executable in Git Bash — no `nvm.sh` sourcing is needed. The `.envrc` detects this automatically.
131
+
132
+ **2. Install direnv**
133
+
134
+ Download the latest Windows binary from the [direnv releases page](https://github.com/direnv/direnv/releases) (`direnv.windows-amd64.exe`), rename it to `direnv.exe`, and place it somewhere on your `PATH` (e.g. `C:\Program Files\direnv\`).
135
+
136
+ **3. Hook direnv into Git Bash**
137
+
138
+ Add to `~/.bashrc` inside Git Bash:
139
+
140
+ ```bash
141
+ eval "$(direnv hook bash)"
142
+ ```
143
+
144
+ Restart Git Bash after editing.
145
+
146
+ :::note
147
+
148
+ nvm-windows reads `.nvmrc` when a version is passed explicitly. The `.envrc` in this project uses `nvm install "$version"` and `nvm use "$version"` (reading from `.nvmrc`), which is compatible with both nvm and nvm-windows.
149
+
150
+ :::
151
+
152
+ ---
153
+
154
+ ## After cloning
155
+
156
+ After cloning a project that ships `.envrc`, run once:
157
+
158
+ ```bash
159
+ direnv allow
160
+ ```
161
+
162
+ direnv prompts for this on every new `.envrc` it has not seen before — this is a security feature that prevents untrusted scripts from running automatically. Re-run `direnv allow` whenever `.envrc` changes.
163
+
164
+ ---
165
+
166
+ ## Files
167
+
168
+ ### `.nvmrc`
169
+
170
+ Contains just the Node.js major version:
171
+
172
+ ```text
173
+ 20
174
+ ```
175
+
176
+ Update this when the project requires a new minimum Node version.
177
+
178
+ ### `.envrc`
179
+
180
+ ```bash
181
+ export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
182
+
183
+ # Source the nvm shell function.
184
+ # Handles: manual install ($HOME/.nvm), Homebrew on macOS, and WSL.
185
+ # On Windows with nvm-windows, nvm is already an executable in PATH — no sourcing needed.
186
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
187
+ . "$NVM_DIR/nvm.sh"
188
+ elif [ "$(uname -s 2>/dev/null)" = "Darwin" ] && command -v brew &>/dev/null; then
189
+ _nvm_sh="$(brew --prefix nvm 2>/dev/null)/nvm.sh"
190
+ [ -s "$_nvm_sh" ] && . "$_nvm_sh"
191
+ unset _nvm_sh
192
+ fi
193
+
194
+ if [ -f ".nvmrc" ]; then
195
+ _node_version="$(tr -d '[:space:]' < .nvmrc)"
196
+ nvm install "$_node_version"
197
+ nvm use "$_node_version"
198
+ unset _node_version
199
+ fi
200
+
201
+ # Ensure the pnpm shim declared in package.json#packageManager is active via Corepack.
202
+ # `corepack enable` is idempotent — safe to run on every cd.
203
+ if command -v corepack &>/dev/null; then
204
+ corepack enable pnpm
205
+ fi
206
+ ```
207
+
208
+ The script handles four environments:
209
+
210
+ | Environment | How nvm is loaded |
211
+ | --- | --- |
212
+ | macOS — manual install | `$HOME/.nvm/nvm.sh` sourced directly |
213
+ | macOS — Homebrew | `$(brew --prefix nvm)/nvm.sh` sourced as fallback |
214
+ | Linux / WSL 2 | `$HOME/.nvm/nvm.sh` sourced directly |
215
+ | Windows — Git Bash + nvm-windows | `nvm` is already in `PATH` as an executable; no sourcing needed |
216
+
217
+ The version is read explicitly from `.nvmrc` (stripping whitespace) and passed to both `nvm install` and `nvm use`, making the script compatible with both nvm and nvm-windows.
218
+
219
+ `corepack enable pnpm` installs a global shim so that running `pnpm` always delegates to the exact version declared in `package.json#packageManager` (e.g. `pnpm@9.15.0`). It is idempotent — safe to run on every `cd`. Corepack ships with Node.js 16.9+ so no separate install is required. If `corepack` is not in `PATH`, the block is skipped safely.
220
+
221
+ :::caution[Avoid `corepack use pnpm`]
222
+
223
+ `corepack use pnpm` (without an explicit version) writes the **latest** pnpm release into `package.json#packageManager`, silently upgrading the project. Never use it in `.envrc`.
224
+
225
+ :::
226
+
227
+ ## `.gitignore`
228
+
229
+ Add the direnv cache directory — it contains compiled environment snapshots and should never be committed:
230
+
231
+ ```text
232
+ .direnv/
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Troubleshooting
238
+
239
+ **`direnv: command not found`** — direnv is not installed or not on `PATH`. Follow the installation steps for your platform above.
240
+
241
+ **`nvm: command not found` inside `.envrc`** — The `.envrc` could not locate `nvm.sh`. Check:
242
+
243
+ - Manual install: confirm `$HOME/.nvm/nvm.sh` exists.
244
+ - Homebrew (macOS): confirm `brew list nvm` shows nvm is installed.
245
+ - The `NVM_DIR` environment variable is not pointing somewhere unexpected.
246
+
247
+ **`direnv` not activating on `cd`** — The shell hook is missing or in the wrong position. Make sure `eval "$(direnv hook zsh)"` (or bash) appears at the very **end** of your shell profile, after all other tool initialisations.
248
+
249
+ **`nvm use` reports wrong version on Windows** — Ensure nvm-windows v1.1.10 or later is installed. Earlier versions do not reliably accept explicit version arguments.
@@ -0,0 +1,311 @@
1
+ ---
2
+ sidebar_position: 0.5
3
+ ---
4
+
5
+ # Documentation
6
+
7
+ Every project documents itself the same way, so a developer or an AI agent can open any Activatus project and find what they need in the same place.
8
+
9
+ This is the docs framework from Launchpad. It is used for Launchpad itself and for every other project.
10
+
11
+ ## How it works
12
+
13
+ | Part | What it is | Where it lives |
14
+ | -------------- | ------------------------------------------------- | -------------------------------------------------- |
15
+ | **The docs** | Plain Markdown files. Every one is a Decision Doc | `docs/` in the project root |
16
+ | **The viewer** | A Docusaurus site that displays those files | `docsSite/` in the project root |
17
+ | **The route** | The docs appear at `/docs` in the running project | Switched on by the `DOCS_URL` environment variable |
18
+
19
+ The docs are written once, as Markdown, and read two ways:
20
+
21
+ - **AI agents** read the files in `docs/` directly. No build, no server.
22
+ - **People** browse them at `/docs`, with a menu, search and page contents — the same layout as this site.
23
+
24
+ ---
25
+
26
+ ## 📜 Every file is a Decision Doc
27
+
28
+ **Every file in `docs/` is a Decision Doc.** There is no separate `decisions/` folder.
29
+
30
+ A design system is a decision. A scope is a decision. A database choice is a decision. Each doc states one decision and why it was made, so anyone — or any agent — can trace the work back to the reason for it, and never has to invent a product decision to unblock themselves.
31
+
32
+ - **Tickets own the _what_.** "Build GitHub authentication."
33
+ - **Decision Docs own the _why_.** "Developers are our audience and we must sync directly to their repositories."
34
+
35
+ See the [Ontology](/ontology#key-distinctions) for the terms.
36
+
37
+ ---
38
+
39
+ ## 📁 The folders
40
+
41
+ Every project has the same folders. The folder is the menu group.
42
+
43
+ ### Reusable folders
44
+
45
+ These are the same in every project:
46
+
47
+ | Folder | Holds decisions about | Files |
48
+ | --------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
49
+ | `overview/` | What the project is and how to read its docs | `what-is-it`, `how-it-works`, `writing-docs` |
50
+ | `ai/` | Agents, models and what they may do | `agent-harness`, `agents`, `architecture`, `context`, `model-routing`, `models`, `retrieval`, `tools` |
51
+ | `architecture/` | How the system is built | `authentication`, `backend`, `background-jobs`, `backups`, `caching`, `ci-cd`, `disaster-recovery`, `environments`, `frontend`, `hosting`, `observability`, `realtime`, `search`, `services`, `state-management`, `storage`, `system` |
52
+ | `business/` | The customer and the money | `buying-trigger`, `customer`, `customer-value`, `defensibility`, `growth`, `pricing`, `revenue-model`, `unit-economics` |
53
+ | `data/` | What is stored and how | `analytics`, `audit`, `database`, `indexing`, `migrations`, `model`, `retention`, `schema` |
54
+ | `deployment/` | Getting work to production | `approval`, `live-verification`, `process`, `rollback` |
55
+ | `design/` | How it looks and behaves | `design-system`, `errors`, `feedback`, `interactions`, `layout`, `navigation`, `principles`, `responsive` |
56
+ | `development/` | How code is written and merged | `branching`, `code-quality`, `coding-standards`, `commits`, `merge-strategy`, `process`, `pull-requests` |
57
+ | `experience/` | What using it should feel like | `accessibility`, `aha-moment`, `anti-experience`, `friction`, `outcomes`, `principles`, `retention`, `sharing` |
58
+ | `pitch/` | Why the product should exist | `alternatives`, `assumptions`, `audience`, `concept`, `differentiators`, `outcomes`, `problem`, `product-market-fit`, `success-criteria`, `validation`, `value-proposition`, `vision` |
59
+ | `scope/` | What is in, out and later | `core`, `exclusions`, `future`, `launch`, `post-launch`, `priorities`, `quality-bar` |
60
+ | `security/` | Keeping it safe | `audit`, `data-access`, `logging`, `privacy`, `secrets`, `threat-model` |
61
+ | `testing/` | How it is tested | `end-to-end`, `integration`, `regression`, `security`, `strategy`, `test-data`, `unit` |
62
+ | `uat/` | Checking we built the right thing | `checks`, `strategy` |
63
+ | `users/` | Who uses it and what they may do | `permissions`, `roles`, `user-types` |
64
+ | `workflows/` | How work moves | `assignment`, `bugfix`, `dependencies`, `deployment`, `development`, `planning`, `review`, `uat` |
65
+
66
+ ### Product-specific folders
67
+
68
+ Decisions that only make sense for this one product go in their own folders:
69
+
70
+ | Folder | Holds |
71
+ | ---------------------------------------- | ---------------------------------------------------- |
72
+ | `product/` | What this product is and how its main parts work |
73
+ | `integrations/` | One file per outside service the product connects to |
74
+ | `user-flows/` | One file per User Flow |
75
+ | _A folder for the product's own subject_ | For example, Launchpad has `tickets/` |
76
+
77
+ ### Which folder?
78
+
79
+ Before placing a doc in a reusable folder, ask: **would this topic make sense as a standard decision category for a completely different software product?**
80
+
81
+ - **Yes** → a reusable folder.
82
+ - **No** → a product-specific folder.
83
+
84
+ Keep these pairs distinct:
85
+
86
+ - **Authentication** (_who are you?_) belongs in `architecture/authentication.md`. **Permissions** (_what are you allowed to do?_) belong in `users/permissions.md`.
87
+ - `data/model.md` is the conceptual model, `data/database.md` is the technology and strategy, and `data/schema.md` is the concrete structure.
88
+
89
+ ### Every file exists from the start
90
+
91
+ **A new project starts with every reusable file already in place**, each marked `Status: Not started`. Copy the [doc templates](/templates#document-templates).
92
+
93
+ - When a decision is made, **write it into the matching file**.
94
+ - **Create a new file** only when a topic has no home.
95
+
96
+ A `Not started` file is a visible gap: it shows a decision that has not been made yet.
97
+
98
+ ---
99
+
100
+ ## 📄 The doc format
101
+
102
+ Every doc has the same shape:
103
+
104
+ ```md
105
+ # <Group> — <Menu item>
106
+
107
+ > One line: what this doc decides.
108
+
109
+ **Status:** Not started | Under evaluation | Current plan | Decided · **Updated:** YYYY-MM-DD
110
+
111
+ ## Decision
112
+
113
+ ## Why
114
+
115
+ ## Details (optional)
116
+
117
+ ## Alternatives considered (optional)
118
+
119
+ ## Current implementation (only when the code differs)
120
+
121
+ ## Related
122
+
123
+ ## Retro Feedback (added as tasks complete)
124
+ ```
125
+
126
+ ### Status
127
+
128
+ | Status | Means |
129
+ | -------------------- | -------------------------------------------------------------------------- |
130
+ | **Not started** | A template waiting for its first decision |
131
+ | **Under evaluation** | Not decided. The options are recorded |
132
+ | **Current plan** | The direction we are working to. It may change |
133
+ | **Decided** | An intentional current decision. Change it only with a Decision Doc update |
134
+
135
+ ### Sections
136
+
137
+ | Section | Holds |
138
+ | ------------------------- | -------------------------------------------------------------------------------- |
139
+ | `Decision` | What was decided |
140
+ | `Why` | The reasons |
141
+ | `Details` | Anything needed to act on the decision |
142
+ | `Alternatives considered` | What was rejected, and why |
143
+ | `Current implementation` | Only when the code differs from the decision: describe the gap |
144
+ | `Related` | Links to related docs |
145
+ | `Retro Feedback` | What went well and what did not, added as tasks linked to this doc are completed |
146
+
147
+ **A doc states the decision, not the code.** When the code does not match yet, the gap goes under `Current implementation`.
148
+
149
+ ### When a decision changes
150
+
151
+ Update the doc, change the **Updated** date, and add a `## History` entry: what changed, why, when, and which work was affected. Keep the original decision and its reason in the history.
152
+
153
+ ---
154
+
155
+ ## 🧭 One file, one menu item, one route
156
+
157
+ The docs menu is built straight from the `docs/` folder, so every doc is in the menu and nothing else is.
158
+
159
+ | Rule | Example |
160
+ | ------------------------------------------------------------- | --------------------------------------------------- |
161
+ | **The folder is the menu group** | `scope/` shows as **Scope** |
162
+ | **The title after the `—` is the menu item** | `# Scope — Future` shows as **Future** |
163
+ | **The file name is that title in kebab-case** | `# Scope — Future` lives in `scope/future.md` |
164
+ | **The route is the folder plus the file name**, without `.md` | `scope/future.md` is served at `/docs/scope/future` |
165
+
166
+ - **Overview comes first** in the menu. Every other group is in alphabetical order, and items are alphabetical within their group.
167
+ - **Link between docs with relative `.md` paths** — `[Future](../scope/future.md)`. The link works in the file and on the site.
168
+ - **Folder and file names are kebab-case**, because they become the route. See [Naming Conventions](/Structure/naming-conventions#when-to-use-kebab-case).
169
+
170
+ The viewer does this automatically. There is no menu file to maintain.
171
+
172
+ ---
173
+
174
+ ## ✍️ Rules for writing
175
+
176
+ - **Use the [Ontology](/ontology).** Use its terms for code, and the project's own ontology for product words.
177
+ - **One decision per file.**
178
+ - **Plain Markdown (`.md`).** No JSX or imports, so every file reads the same for an agent as it does on the page.
179
+ - **One `# Heading` per file**, at the top, in the form `# Group — Menu item`.
180
+ - **Draw diagrams with Mermaid** in a ` ```mermaid ` code block, so the diagram is text and stays in the file.
181
+ - **Write for someone who has never seen the project.** Full sentences, full English words, no shorthand.
182
+
183
+ ### Not finished until the docs are updated
184
+
185
+ **A change is not finished until the docs match it.** If a change makes a doc wrong, the doc is fixed in the same change — the same rule as [test files](/Standards/readable-code#every-function-and-component-has-a-test-file).
186
+
187
+ This applies to everyone writing code, **including AI agents**. An agent that changes how something works updates the Decision Doc that describes it.
188
+
189
+ ---
190
+
191
+ ## 🌐 The `/docs` route
192
+
193
+ The docs appear at `/docs` inside the running project — `http://localhost:3000/docs` — in the same layout as this site.
194
+
195
+ They are switched on by one environment variable:
196
+
197
+ | `DOCS_URL` | What happens at `/docs` |
198
+ | ----------------------------- | -------------------------------- |
199
+ | Set (`http://localhost:3001`) | The docs are shown |
200
+ | Not set | `404` — the route does not exist |
201
+
202
+ ### ⛔ Never in production
203
+
204
+ **`DOCS_URL` is never set in production.** With it unset, the project has no `/docs` route at all, so internal docs cannot be reached on a live site.
205
+
206
+ - Set it in `.env.local` for local development.
207
+ - Set it on a staging or preview environment only if the team wants the docs there.
208
+ - **Do not add it to the production environment.**
209
+
210
+ The docs site also sets `noIndex`, so search engines are told not to index it wherever it is running.
211
+
212
+ ### What goes in Git
213
+
214
+ **The docs are committed. They are not published.** Committing a file to the repository and serving it on the live site are two different things.
215
+
216
+ | Item | In Git? | Why |
217
+ | -------------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
218
+ | `docs/` | ✅ Committed | It is the team's shared record. Developers and AI agents on every machine need it, and it changes in the same pull request as the code |
219
+ | `docsSite/` config files | ✅ Committed | So everyone gets the same viewer |
220
+ | `docsSite/node_modules/`, `docsSite/build/`, `docsSite/.docusaurus/` | ❌ Ignored | Installed and generated files. The `docsSite/.gitignore` from the template covers them |
221
+ | `.env.local` (holds `DOCS_URL`) | ❌ Ignored | Local settings are never committed |
222
+
223
+ **Never add `docs/` to `.gitignore`.** Ignored docs exist on one machine only: the rest of the team, and every agent working from a fresh copy of the repo, would have none.
224
+
225
+ Nothing in `docs/` is shipped with the app. The build only includes files the app imports, and the app never imports from `docs/`.
226
+
227
+ :::caution[Public repositories]
228
+
229
+ Anyone who can read the repository can read its docs. Keep internal projects in a **private** repository.
230
+
231
+ :::
232
+
233
+ ### How the route is wired
234
+
235
+ The project's `next.config.mjs` forwards `/docs` to the docs site, but only when `DOCS_URL` is set:
236
+
237
+ ```js title="next.config.mjs"
238
+ const DOCS_URL = process.env.DOCS_URL;
239
+
240
+ /** @type {import("next").NextConfig} */
241
+ const nextConfig = {
242
+ async rewrites() {
243
+ // The docs are only served when DOCS_URL is set. It is never set in production.
244
+ if (!DOCS_URL) {
245
+ return [];
246
+ }
247
+
248
+ return [
249
+ { source: "/docs", destination: `${DOCS_URL}/docs/` },
250
+ { source: "/docs/:path*", destination: `${DOCS_URL}/docs/:path*` },
251
+ ];
252
+ },
253
+ };
254
+
255
+ export default nextConfig;
256
+ ```
257
+
258
+ ---
259
+
260
+ ## 🚀 Setting it up
261
+
262
+ 1. **Copy the docs.** Copy the [`docs/` templates](/templates#document-templates) into the project's `docs/` folder. Rename `overview/what-is-it.md` after the project (`what-is-launchpad.md`) and update its title.
263
+
264
+ 2. **Copy the viewer.** Copy the [`docsSite/` template](/templates#docs-site) into the project root. Rename `package.json.txt` to `package.json` and `gitignore.txt` to `.gitignore`, set `PROJECT_NAME` in `docusaurus.config.ts`, and point the home redirect in `src/pages/index.tsx` at the renamed overview file.
265
+
266
+ 3. **Add the route.** Add the rewrite above to `next.config.mjs`.
267
+
268
+ 4. **Add the scripts** to the project's `package.json`:
269
+
270
+ ```json
271
+ {
272
+ "scripts": {
273
+ "docs:install": "pnpm --dir docsSite install",
274
+ "docs:dev": "pnpm --dir docsSite start",
275
+ "docs:build": "pnpm --dir docsSite build"
276
+ }
277
+ }
278
+ ```
279
+
280
+ 5. **Set the variable** in `.env.local`:
281
+
282
+ ```text
283
+ DOCS_URL=http://localhost:3001
284
+ ```
285
+
286
+ 6. **Run it:**
287
+
288
+ ```bash
289
+ pnpm docs:install # Once
290
+ pnpm docs:dev # Starts the docs site on port 3001
291
+ pnpm dev # Starts the project on port 3000
292
+ ```
293
+
294
+ Open `http://localhost:3000/docs`.
295
+
296
+ :::caution[Do not name the script `docs`]
297
+
298
+ `pnpm docs` is a built-in pnpm command, so a script called `docs` never runs. Use `docs:dev`.
299
+
300
+ :::
301
+
302
+ ---
303
+
304
+ ## 🤖 For AI agents
305
+
306
+ - **Read `docs/` before starting work.** Start with the three `overview/` docs, then the docs for the area being changed.
307
+ - **Read the files directly.** Do not start the docs site to read them.
308
+ - **Check the Status.** `Decided` is settled. `Current plan` may change. `Under evaluation` and `Not started` are **not decisions** — do not treat them as one, and do not invent one. Ask.
309
+ - **Update the docs in the same change** as the code, and change the **Updated** date.
310
+ - **Write into the matching file.** Create a new file only when a topic has no home, in kebab-case, using the [doc format](#-the-doc-format).
311
+ - **Do not edit anything in `docsSite/`** unless the task is about the docs viewer itself.
@@ -0,0 +1,72 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
5
+ # EditorConfig
6
+
7
+ EditorConfig enforces whitespace conventions at the editor level, before any linter or formatter runs. It works across all editors and IDEs without extra plugins (VS Code, JetBrains, Vim, Neovim, etc. all support it natively or via a free extension).
8
+
9
+ ## Setup
10
+
11
+ Copy this file to your project root as `.editorconfig`:
12
+
13
+ ```ini
14
+ root = true
15
+
16
+ [*]
17
+ charset = utf-8
18
+ end_of_line = lf
19
+ indent_size = 2
20
+ indent_style = space
21
+ insert_final_newline = true
22
+ trim_trailing_whitespace = true
23
+
24
+ [*.md]
25
+ trim_trailing_whitespace = false
26
+ max_line_length = off
27
+
28
+ [*.{yml,yaml}]
29
+ indent_size = 2
30
+
31
+ [*.json]
32
+ indent_size = 2
33
+
34
+ [Makefile]
35
+ indent_style = tab
36
+
37
+ [*.go]
38
+ indent_style = tab
39
+
40
+ [*.py]
41
+ indent_size = 4
42
+ ```
43
+
44
+ No package installation required — EditorConfig is a file-based standard.
45
+
46
+ ## Rule reference
47
+
48
+ | Rule | Value | Rationale |
49
+ | --- | --- | --- |
50
+ | `charset` | `utf-8` | Universal default; avoids encoding issues on cross-platform teams |
51
+ | `end_of_line` | `lf` | Unix line endings everywhere; Windows devs should set `core.autocrlf = input` in git |
52
+ | `indent_size` | `2` | Standard for JS/TS/JSON/YAML; overridden for Python (`4`) and tab-based languages |
53
+ | `indent_style` | `space` | Consistent rendering across editors; tab width is a display preference that breaks alignment |
54
+ | `insert_final_newline` | `true` | POSIX standard; avoids noisy diffs when appending to files |
55
+ | `trim_trailing_whitespace` | `true` | Prevents invisible diff noise; **disabled for Markdown** where trailing spaces are significant |
56
+
57
+ ## Markdown exception
58
+
59
+ In Markdown, two trailing spaces before a newline produce a `<br>` (hard line break). Trimming trailing whitespace would silently corrupt Markdown documents, so `trim_trailing_whitespace = false` is set for `*.md` files.
60
+
61
+ ## Go & Makefile exception
62
+
63
+ Both Go source files (enforced by `gofmt`) and Makefiles **require** tab indentation. The config sets `indent_style = tab` for these file types to stay consistent with their tooling.
64
+
65
+ ## Alignment with other tools
66
+
67
+ The EditorConfig settings deliberately mirror the Prettier config:
68
+
69
+ - `indent_size: 2` ↔ `tabWidth: 2`
70
+ - `end_of_line: lf` ↔ `endOfLine: "lf"`
71
+
72
+ This means the editor writes the right whitespace from the start, and Prettier never has to fix it.