living-documentation 7.45.0 → 7.47.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.
- package/dist/src/frontend/context.html +420 -0
- package/dist/src/frontend/i18n/en.json +46 -0
- package/dist/src/frontend/i18n/fr.json +46 -0
- package/dist/src/frontend/index.html +9 -0
- package/dist/src/lib/config.js +2 -2
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/routes/context.d.ts +3 -0
- package/dist/src/routes/context.d.ts.map +1 -0
- package/dist/src/routes/context.js +245 -0
- package/dist/src/routes/context.js.map +1 -0
- package/dist/src/routes/documents.d.ts.map +1 -1
- package/dist/src/routes/documents.js +2 -1
- package/dist/src/routes/documents.js.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +3 -0
- package/dist/src/server.js.map +1 -1
- package/dist/starting-doc/.living-doc.json +3 -3
- package/dist/starting-doc/ADRS/2026_01_01_[ADR]_example_architecture_decision.md +58 -0
- package/dist/starting-doc/AI/HOW_TO.md +338 -0
- package/dist/starting-doc/AI/default/AGENTS.md +14 -0
- package/dist/starting-doc/AI/default/CLAUDE.md +14 -0
- package/dist/starting-doc/AI/default/MEMORY.md +7 -0
- package/dist/starting-doc/AI/flavors/project-instructions-backend-api.md +41 -0
- package/dist/starting-doc/AI/flavors/project-instructions-frontend-app.md +42 -0
- package/dist/starting-doc/AI/flavors/project-instructions-library-cli.md +41 -0
- package/dist/starting-doc/AI/flavors/project-instructions-monorepo.md +41 -0
- package/dist/starting-doc/AI/project-instructions.md +78 -0
- package/dist/starting-doc/AI/rules/no-magic-numbers.md +18 -0
- package/package.json +1 -1
- package/dist/starting-doc/.annotations.json +0 -1
- package/dist/starting-doc/.diagrams.json +0 -2049
- package/dist/starting-doc/.metadata.json +0 -12
- package/dist/starting-doc/1_tutorial/2026_04_11_13_25_[General]_crer_vos_dossiers.md +0 -16
- package/dist/starting-doc/1_tutorial/2026_04_11_18_58_[General]_creer_un_document_dans_un_dossier.md +0 -8
- package/dist/starting-doc/1_tutorial/2026_04_12_09_00_[General]_editer_et_sauvegarder.md +0 -39
- package/dist/starting-doc/1_tutorial/2026_04_12_10_00_[General]_utiliser_les_snippets.md +0 -71
- package/dist/starting-doc/2026_04_08_20_52_[General]_welcome.md +0 -17
- package/dist/starting-doc/2026_04_11_12_55_[General]_premiers_pas.md +0 -271
- package/dist/starting-doc/2_guide/2026_04_08_00_04_[DOCUMENT]_utilisation_des_images_plein_ecran_lien_clickable.md +0 -40
- package/dist/starting-doc/2_guide/2026_04_08_23_38_[Configuration]_demarrage_de_living_documentation.md +0 -32
- package/dist/starting-doc/2_guide/2026_04_09_09_00_[NAVIGATION]_recherche_plein_texte.md +0 -65
- package/dist/starting-doc/2_guide/2026_04_09_10_00_[EXPORT]_exporter_en_pdf.md +0 -43
- package/dist/starting-doc/2_guide/2026_04_09_11_00_[Configuration]_configurer_le_panneau_admin.md +0 -55
- package/dist/starting-doc/2_guide/2026_04_09_12_00_[Configuration]_extra_files.md +0 -68
- package/dist/starting-doc/2_guide/2026_04_09_13_00_[WORDCLOUD]_word_cloud.md +0 -54
- package/dist/starting-doc/2_guide/2026_04_09_14_00_[DIAGRAM]_creer_et_lier_un_diagramme.md +0 -77
- package/dist/starting-doc/3_concept/2026_04_08_20_58_[DOCUMENTING]_ADRS.md +0 -20
- package/dist/starting-doc/3_concept/2026_04_08_22_15_[DOCUMENTING]_living_documentation.md +0 -17
- package/dist/starting-doc/3_concept/2026_04_08_22_46_[METHODOLOGY]_diataxis_architecture_du_contenu.md +0 -16
- package/dist/starting-doc/4_reference/2026_04_08_23_14_[FUNDAMENTALS]_the_living_documentation_tool.md +0 -41
- package/dist/starting-doc/4_reference/2026_04_09_01_00_[REFERENCE]_raccourcis_clavier.md +0 -61
- package/dist/starting-doc/4_reference/2026_04_09_02_00_[REFERENCE]_tokens_pattern_nommage.md +0 -75
- package/dist/starting-doc/4_reference/2026_04_09_03_00_[REFERENCE]_types_de_snippets.md +0 -68
- package/dist/starting-doc/4_reference/2026_04_11_17_31_[FUNDAMENTALS]_architecturer_une_documentation.md +0 -12
- package/dist/starting-doc/4_reference/2026_04_12_14_07_[FUNDAMENTALS]_dossiers_et_catgories.md +0 -89
- package/dist/starting-doc/5_talks/2026_04_28_09_48_[CONFERENCE]_demo_living_documentation_mcp_en_conference.md +0 -312
- package/dist/starting-doc/images/admin_screenshot.png +0 -0
- package/dist/starting-doc/images/ajout-document.png +0 -0
- package/dist/starting-doc/images/ajouter-document-categorie.png +0 -0
- package/dist/starting-doc/images/ajouter_un_document_dans_un_dossier.png +0 -0
- package/dist/starting-doc/images/architecturer_une_documentation_reference.png +0 -0
- package/dist/starting-doc/images/cr_er_un_document.png +0 -0
- package/dist/starting-doc/images/creation-nouveau-dossier.png +0 -0
- package/dist/starting-doc/images/creer-document-context-engineering.png +0 -0
- package/dist/starting-doc/images/creer-dossier-only-tutoriel.png +0 -0
- package/dist/starting-doc/images/creer-dossier-tutoriel.png +0 -0
- package/dist/starting-doc/images/creer-dossiers-done.png +0 -0
- package/dist/starting-doc/images/creer-un-document.png +0 -0
- package/dist/starting-doc/images/creer-vos-dossiers-tutoriel.png +0 -0
- package/dist/starting-doc/images/creer-vos-dossiers.png +0 -0
- package/dist/starting-doc/images/decouverte_adrs.png +0 -0
- package/dist/starting-doc/images/diataxis.png +0 -0
- package/dist/starting-doc/images/diataxis_callout.png +0 -0
- package/dist/starting-doc/images/document-cree.png +0 -0
- package/dist/starting-doc/images/liens_snippets.png +0 -0
- package/dist/starting-doc/images/living_documentation.png +0 -0
- package/dist/starting-doc/images/living_documentation_context_demo_conf.png +0 -0
- package/dist/starting-doc/images/npm_logo.png +0 -0
- package/dist/starting-doc/images/popup-creer-document.png +0 -0
- package/dist/starting-doc/images/popup-creer-dossier.png +0 -0
- package/dist/starting-doc/images/popup-dossier-cree.png +0 -0
- package/dist/starting-doc/images/quatre-dossiers-crees.png +0 -0
- package/dist/starting-doc/images/screenshot-living-doc.png +0 -0
- package/dist/starting-doc/images/the_living_documentation_tool.png +0 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
# HOW TO - Initialize AI Context
|
|
2
|
+
|
|
3
|
+
This folder contains a starter setup for AI-assisted development.
|
|
4
|
+
|
|
5
|
+
The goal is to give AI tools a deterministic entry point:
|
|
6
|
+
|
|
7
|
+
- `AGENTS.md` for Codex and agent-style tools
|
|
8
|
+
- `CLAUDE.md` for Claude
|
|
9
|
+
- `memory/MEMORY.md` for project-local memory
|
|
10
|
+
- `AI/project-instructions.md` for shared project instructions
|
|
11
|
+
- `AI/rules/*.md` for rules that must be applied while editing
|
|
12
|
+
|
|
13
|
+
Codex looks for `AGENTS.md`. Claude looks for `CLAUDE.md`. Both files should point to the same project instructions so different tools follow the same rules.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
This starter separates AI context into deterministic layers:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
AGENTS.md / CLAUDE.md
|
|
21
|
+
-> tool-specific entry points at the project root
|
|
22
|
+
|
|
23
|
+
AI/project-instructions.md
|
|
24
|
+
-> shared operating instructions for every AI tool
|
|
25
|
+
|
|
26
|
+
AI/rules/*.md
|
|
27
|
+
-> small reusable rules that must be applied when matching files are changed
|
|
28
|
+
|
|
29
|
+
ADRS/*.md
|
|
30
|
+
-> durable decisions explaining why the project works this way
|
|
31
|
+
|
|
32
|
+
memory/MEMORY.md
|
|
33
|
+
-> project-local memory index for frequently reused context
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The entry-point files should stay small. Their job is to tell the AI where to look, not to duplicate all project knowledge.
|
|
37
|
+
|
|
38
|
+
Living Documentation then makes these files visible as regular documents. When the same file must be visible from several places, prefer symbolic links so there is still one source of truth.
|
|
39
|
+
|
|
40
|
+
The expected AI workflow is:
|
|
41
|
+
|
|
42
|
+
1. Read `AGENTS.md` or `CLAUDE.md`, depending on the tool.
|
|
43
|
+
2. Follow the link to `AI/project-instructions.md`.
|
|
44
|
+
3. Read `memory/MEMORY.md` and load only relevant memory files.
|
|
45
|
+
4. Read the matching rules from `AI/rules/*.md`.
|
|
46
|
+
5. Inspect ADR frontmatter when the task may touch an existing decision.
|
|
47
|
+
6. Make the change.
|
|
48
|
+
7. At the end of a coherent feature, update durable documentation when needed.
|
|
49
|
+
8. Attach Living Documentation metadata to created or updated documents when source files prove their content.
|
|
50
|
+
|
|
51
|
+
## 1. Choose Your Project Instructions Flavor
|
|
52
|
+
|
|
53
|
+
The default file is:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
AI/project-instructions.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
You can keep it, or replace it with one of the examples in:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
AI/flavors/
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Available examples:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
AI/flavors/project-instructions-frontend-app.md
|
|
69
|
+
AI/flavors/project-instructions-backend-api.md
|
|
70
|
+
AI/flavors/project-instructions-library-cli.md
|
|
71
|
+
AI/flavors/project-instructions-monorepo.md
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
To use one flavor, copy it over the default file:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cp AI/flavors/project-instructions-frontend-app.md AI/project-instructions.md
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If you want to rename the selected example instead of keeping it in `AI/flavors/`, move it to the canonical location:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
mv AI/flavors/project-instructions-frontend-app.md AI/project-instructions.md
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then edit `AI/project-instructions.md`:
|
|
87
|
+
|
|
88
|
+
- replace `DOCS_FOLDER` with your real documentation folder name, for example `documentation`, `docs`, or `example`
|
|
89
|
+
- replace example commands with real project commands
|
|
90
|
+
- remove sections that do not apply to your project
|
|
91
|
+
- add project-specific architecture notes
|
|
92
|
+
|
|
93
|
+
## 2. Install Agent Entry Points
|
|
94
|
+
|
|
95
|
+
Templates are provided in:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
AI/default/AGENTS.md
|
|
99
|
+
AI/default/CLAUDE.md
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Create symbolic links from your project root to those templates.
|
|
103
|
+
|
|
104
|
+
If your documentation folder is named `documentation`:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
ln -s documentation/AI/default/AGENTS.md AGENTS.md
|
|
108
|
+
ln -s documentation/AI/default/CLAUDE.md CLAUDE.md
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
If your documentation folder has another name, adapt the path:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
ln -s <docs-folder>/AI/default/AGENTS.md AGENTS.md
|
|
115
|
+
ln -s <docs-folder>/AI/default/CLAUDE.md CLAUDE.md
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Use both files when the project may be used by different AI tools. Use only one if your team standardizes on one tool.
|
|
119
|
+
|
|
120
|
+
After creating the links, open `AGENTS.md` and `CLAUDE.md` from the project root and verify that their paths point to the correct documentation folder.
|
|
121
|
+
|
|
122
|
+
## 3. Install Project Memory
|
|
123
|
+
|
|
124
|
+
Memory should live in the project, not in a global AI-tool folder.
|
|
125
|
+
|
|
126
|
+
Create a project-local memory folder:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
mkdir -p memory
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Then create a symbolic link to the starter memory index:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
ln -s ../<docs-folder>/AI/default/MEMORY.md memory/MEMORY.md
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Example when the docs folder is `documentation`:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
ln -s ../documentation/AI/default/MEMORY.md memory/MEMORY.md
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Then edit `memory/MEMORY.md` and add the memory files that matter for your project.
|
|
145
|
+
|
|
146
|
+
Typical memory files:
|
|
147
|
+
|
|
148
|
+
```text
|
|
149
|
+
memory/project-overview.md
|
|
150
|
+
memory/architecture.md
|
|
151
|
+
memory/testing.md
|
|
152
|
+
memory/domain-language.md
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 4. Review AI Rules
|
|
156
|
+
|
|
157
|
+
Rules live in:
|
|
158
|
+
|
|
159
|
+
```text
|
|
160
|
+
AI/rules/
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The starter includes:
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
AI/rules/no-magic-numbers.md
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Keep it if useful, edit it for your project, or remove it.
|
|
170
|
+
|
|
171
|
+
Add more rules when you want behavior that every AI tool should apply consistently, for example:
|
|
172
|
+
|
|
173
|
+
- i18n rules
|
|
174
|
+
- testing strategy
|
|
175
|
+
- public API compatibility
|
|
176
|
+
- security boundaries
|
|
177
|
+
- architecture constraints
|
|
178
|
+
|
|
179
|
+
## 5. Understand ADRs
|
|
180
|
+
|
|
181
|
+
ADRs live in:
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
ADRS/
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The starter includes an example ADR:
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
ADRS/2026_01_01_[ADR]_example_architecture_decision.md
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Use it as a template when an important decision needs to be recorded.
|
|
194
|
+
|
|
195
|
+
An ADR is not a task log. It should explain a decision that future humans or AI assistants must understand before changing related code.
|
|
196
|
+
|
|
197
|
+
Good ADR candidates:
|
|
198
|
+
|
|
199
|
+
- choosing a framework, storage format, or protocol;
|
|
200
|
+
- defining an architecture boundary;
|
|
201
|
+
- changing a public API contract;
|
|
202
|
+
- adopting a testing, release, or deployment strategy;
|
|
203
|
+
- creating a rule that explains why code must be written a certain way.
|
|
204
|
+
|
|
205
|
+
Avoid ADRs for small implementation details that are obvious from the code.
|
|
206
|
+
|
|
207
|
+
Recommended AI workflow:
|
|
208
|
+
|
|
209
|
+
1. List files in `ADRS/`.
|
|
210
|
+
2. Read only the frontmatter first: `description` and `tags`.
|
|
211
|
+
3. Load the full ADR only when it is relevant to the current task.
|
|
212
|
+
4. At the end of a coherent feature or meaningful refactor, decide whether an ADR must be created or updated.
|
|
213
|
+
5. If the feature changed a durable decision, create or update the ADR autonomously.
|
|
214
|
+
6. After writing the ADR, attach metadata to the source files that prove or implement the decision.
|
|
215
|
+
|
|
216
|
+
This is intentional: ADR writing should not depend on the user asking for it every time. The AI should keep the decision log current when it finishes a meaningful feature.
|
|
217
|
+
|
|
218
|
+
Recommended filename format:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
YYYY_MM_DD_[CATEGORY]_short_decision_title.md
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Example:
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
2026_01_01_[ADR]_example_architecture_decision.md
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Keep the frontmatter useful for discovery:
|
|
231
|
+
|
|
232
|
+
```markdown
|
|
233
|
+
---
|
|
234
|
+
**date:** 2026-01-01
|
|
235
|
+
**status:** Accepted
|
|
236
|
+
**description:** One sentence explaining the decision and why it matters.
|
|
237
|
+
**tags:** architecture, testing, api
|
|
238
|
+
---
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Use `status` consistently. Common values are:
|
|
242
|
+
|
|
243
|
+
- `Proposed`
|
|
244
|
+
- `Accepted`
|
|
245
|
+
- `Superseded`
|
|
246
|
+
- `To be validated`
|
|
247
|
+
|
|
248
|
+
## 6. Understand Metadata And Reliability
|
|
249
|
+
|
|
250
|
+
Living Documentation can bind a document to source files. Each binding stores a hash of the source file. The reliability gauge then shows whether the document may have drifted from the code.
|
|
251
|
+
|
|
252
|
+
For AI-assisted development, this is part of the documentation workflow:
|
|
253
|
+
|
|
254
|
+
- when an AI creates or updates an ADR, attach the source files that implement or prove the decision;
|
|
255
|
+
- when an AI creates or updates a technical guide, attach the source files that the guide describes;
|
|
256
|
+
- after the document is correct, refresh or re-baseline the metadata hashes;
|
|
257
|
+
- if the AI cannot update metadata directly, it must say so and list the files that should be attached manually.
|
|
258
|
+
|
|
259
|
+
If the AI has access to the Living Documentation MCP tools, it should prefer:
|
|
260
|
+
|
|
261
|
+
```text
|
|
262
|
+
add_metadata
|
|
263
|
+
refresh_metadata
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
If it does not have MCP access, use the document metadata UI in Living Documentation.
|
|
267
|
+
|
|
268
|
+
## 7. Register Instruction Files In Living Documentation
|
|
269
|
+
|
|
270
|
+
Start Living Documentation:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
npx living-documentation <docs-folder>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Open:
|
|
277
|
+
|
|
278
|
+
```text
|
|
279
|
+
http://localhost:4321/context
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Use **Add AI instruction file** to link instruction files such as `AGENTS.md`, `CLAUDE.md`, `memory/MEMORY.md`, or other project-level instruction documents.
|
|
283
|
+
|
|
284
|
+
Living Documentation creates symbolic links under:
|
|
285
|
+
|
|
286
|
+
```text
|
|
287
|
+
AI/
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
This makes instruction files visible in the main documentation without creating duplicate sources of truth.
|
|
291
|
+
|
|
292
|
+
## 8. Clean Up The Starter
|
|
293
|
+
|
|
294
|
+
After setup, remove what you do not need.
|
|
295
|
+
|
|
296
|
+
Usually remove unused flavors:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
rm -rf AI/flavors
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Remove unused entry-point templates if you do not use both tools:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
rm AI/default/CLAUDE.md
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
or:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
rm AI/default/AGENTS.md
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Keep `AI/default/MEMORY.md` only if `memory/MEMORY.md` links to it. If you copied the file instead of linking it, remove the unused template.
|
|
315
|
+
|
|
316
|
+
Keep `AI/HOW_TO.md` only if you want future contributors to see the setup process. Otherwise, remove it after initialization.
|
|
317
|
+
|
|
318
|
+
Keep the example ADR only if you want an in-project template. Otherwise, copy it when needed and remove the example.
|
|
319
|
+
|
|
320
|
+
## 9. Final Expected Shape
|
|
321
|
+
|
|
322
|
+
A minimal initialized project usually ends with:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
AGENTS.md -> <docs-folder>/AI/default/AGENTS.md
|
|
326
|
+
CLAUDE.md -> <docs-folder>/AI/default/CLAUDE.md
|
|
327
|
+
memory/
|
|
328
|
+
MEMORY.md -> ../<docs-folder>/AI/default/MEMORY.md
|
|
329
|
+
<docs-folder>/
|
|
330
|
+
AI/
|
|
331
|
+
project-instructions.md
|
|
332
|
+
rules/
|
|
333
|
+
no-magic-numbers.md
|
|
334
|
+
ADRS/
|
|
335
|
+
2026_01_01_[ADR]_example_architecture_decision.md
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Adapt the shape to your project. The important part is that AI tools have deterministic files to read and that the source of truth is not duplicated.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AGENTS.md — Living Documentation
|
|
2
|
+
|
|
3
|
+
This file is the Codex entry point for this repository.
|
|
4
|
+
|
|
5
|
+
Before making changes:
|
|
6
|
+
|
|
7
|
+
1. Read `DOCS_FOLDER/AI/project-instructions.md`.
|
|
8
|
+
2. Read `memory/MEMORY.md` and load the relevant memory files listed there.
|
|
9
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md` and apply the rules whose `appliesTo` patterns match files you touch.
|
|
10
|
+
4. To understand existing decisions, glob the ADR folder, read only each ADR frontmatter `description` and `tags`, then load the full ADR only when relevant.
|
|
11
|
+
|
|
12
|
+
Replace `DOCS_FOLDER` with the real documentation folder path for this project.
|
|
13
|
+
|
|
14
|
+
If an AI rule conflicts with the user request or another project instruction, state the conflict explicitly before proceeding.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# CLAUDE.md — Living Documentation
|
|
2
|
+
|
|
3
|
+
This file is the Claude entry point for this repository.
|
|
4
|
+
|
|
5
|
+
Before making changes:
|
|
6
|
+
|
|
7
|
+
1. Read `DOCS_FOLDER/AI/project-instructions.md`.
|
|
8
|
+
2. Read `memory/MEMORY.md` and load the relevant memory files listed there.
|
|
9
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md` and apply the rules whose `appliesTo` patterns match files you touch.
|
|
10
|
+
4. To understand existing decisions, glob the ADR folder, read only each ADR frontmatter `description` and `tags`, then load the full ADR only when relevant.
|
|
11
|
+
|
|
12
|
+
Replace `DOCS_FOLDER` with the real documentation folder path for this project.
|
|
13
|
+
|
|
14
|
+
If an AI rule conflicts with the user request or another project instruction, state the conflict explicitly before proceeding.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Memory Index
|
|
2
|
+
|
|
3
|
+
Toujours stocker les fichiers mémoire dans le dossier `memory/` du projet courant, pas dans `~/.claude`.
|
|
4
|
+
|
|
5
|
+
**Why:** L'utilisateur préfère avoir tout le contexte dans le projet lui-même pour plus de visibilité et de contrôle.
|
|
6
|
+
|
|
7
|
+
**How to apply:** Écrire les fichiers mémoire dans `<project_root>/memory/` au lieu de `~/.claude/projects/.../memory/`. Mettre à jour `memory/MEMORY.md` en conséquence.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Project AI Instructions - Backend API
|
|
2
|
+
|
|
3
|
+
Use this flavor for HTTP APIs, workers, services, and server-side applications.
|
|
4
|
+
|
|
5
|
+
## Startup Routine
|
|
6
|
+
|
|
7
|
+
1. Read this file.
|
|
8
|
+
2. Read `memory/MEMORY.md`.
|
|
9
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md`.
|
|
10
|
+
4. Inspect ADR frontmatter before opening full ADRs.
|
|
11
|
+
|
|
12
|
+
Replace `DOCS_FOLDER` with the real docs folder path.
|
|
13
|
+
|
|
14
|
+
## Backend Rules
|
|
15
|
+
|
|
16
|
+
- Identify request validation, authorization, persistence, and error handling before editing routes.
|
|
17
|
+
- Preserve API compatibility unless the user explicitly requests a breaking change.
|
|
18
|
+
- Prefer structured parsing and validation over ad hoc string handling.
|
|
19
|
+
- Keep filesystem and database path boundaries explicit.
|
|
20
|
+
- Add focused tests around changed behavior and failure paths.
|
|
21
|
+
|
|
22
|
+
## Continuous Documentation
|
|
23
|
+
|
|
24
|
+
At the end of every coherent feature or meaningful refactor:
|
|
25
|
+
|
|
26
|
+
- create or update an ADR when the change affects an architecture boundary, public contract, storage format, protocol, workflow, or durable convention;
|
|
27
|
+
- skip ADRs for trivial fixes and implementation details that are obvious from code;
|
|
28
|
+
- when you create or update an ADR or durable documentation page, attach Living Documentation metadata to the source files that prove or implement it;
|
|
29
|
+
- if MCP tools are available, prefer `add_metadata` and `refresh_metadata`;
|
|
30
|
+
- if metadata cannot be updated from the current environment, state which source files should be attached.
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
|
|
34
|
+
Use the project's actual commands, for example:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
npm run test
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For API changes, include at least one test that exercises the route or public contract.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Project AI Instructions - Frontend Application
|
|
2
|
+
|
|
3
|
+
Use this flavor for React, Vue, Svelte, Angular, or static frontend applications.
|
|
4
|
+
|
|
5
|
+
## Startup Routine
|
|
6
|
+
|
|
7
|
+
1. Read this file.
|
|
8
|
+
2. Read `memory/MEMORY.md`.
|
|
9
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md`.
|
|
10
|
+
4. Inspect ADR frontmatter before opening full ADRs.
|
|
11
|
+
|
|
12
|
+
Replace `DOCS_FOLDER` with the real docs folder path.
|
|
13
|
+
|
|
14
|
+
## Frontend Rules
|
|
15
|
+
|
|
16
|
+
- Keep user-visible strings in the project's i18n system when one exists.
|
|
17
|
+
- Preserve existing design system conventions before adding new UI patterns.
|
|
18
|
+
- Verify responsive layouts at small and desktop widths.
|
|
19
|
+
- Avoid layout shifts caused by dynamic text, icons, and loading states.
|
|
20
|
+
- Prefer existing shared components and utilities over new abstractions.
|
|
21
|
+
|
|
22
|
+
## Continuous Documentation
|
|
23
|
+
|
|
24
|
+
At the end of every coherent feature or meaningful refactor:
|
|
25
|
+
|
|
26
|
+
- create or update an ADR when the change affects an architecture boundary, public contract, storage format, protocol, workflow, or durable convention;
|
|
27
|
+
- skip ADRs for trivial fixes and implementation details that are obvious from code;
|
|
28
|
+
- when you create or update an ADR or durable documentation page, attach Living Documentation metadata to the source files that prove or implement it;
|
|
29
|
+
- if MCP tools are available, prefer `add_metadata` and `refresh_metadata`;
|
|
30
|
+
- if metadata cannot be updated from the current environment, state which source files should be attached.
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
|
|
34
|
+
Use the project's actual commands, for example:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
npm run lint
|
|
39
|
+
npm run test
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For visual changes, add a browser or screenshot verification when practical.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Project AI Instructions - Library Or CLI
|
|
2
|
+
|
|
3
|
+
Use this flavor for packages, SDKs, CLIs, and developer tools.
|
|
4
|
+
|
|
5
|
+
## Startup Routine
|
|
6
|
+
|
|
7
|
+
1. Read this file.
|
|
8
|
+
2. Read `memory/MEMORY.md`.
|
|
9
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md`.
|
|
10
|
+
4. Inspect ADR frontmatter before opening full ADRs.
|
|
11
|
+
|
|
12
|
+
Replace `DOCS_FOLDER` with the real docs folder path.
|
|
13
|
+
|
|
14
|
+
## Library And CLI Rules
|
|
15
|
+
|
|
16
|
+
- Treat public APIs, command flags, output formats, and config files as compatibility surfaces.
|
|
17
|
+
- Keep error messages actionable and stable when tests or users may depend on them.
|
|
18
|
+
- Prefer small focused helpers over broad abstractions.
|
|
19
|
+
- Update docs or examples when behavior changes.
|
|
20
|
+
- Test both success paths and invalid input paths.
|
|
21
|
+
|
|
22
|
+
## Continuous Documentation
|
|
23
|
+
|
|
24
|
+
At the end of every coherent feature or meaningful refactor:
|
|
25
|
+
|
|
26
|
+
- create or update an ADR when the change affects an architecture boundary, public contract, storage format, protocol, workflow, or durable convention;
|
|
27
|
+
- skip ADRs for trivial fixes and implementation details that are obvious from code;
|
|
28
|
+
- when you create or update an ADR or durable documentation page, attach Living Documentation metadata to the source files that prove or implement it;
|
|
29
|
+
- if MCP tools are available, prefer `add_metadata` and `refresh_metadata`;
|
|
30
|
+
- if metadata cannot be updated from the current environment, state which source files should be attached.
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
|
|
34
|
+
Use the project's actual commands, for example:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
npm run test
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For CLI changes, verify the command with realistic arguments.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Project AI Instructions - Monorepo
|
|
2
|
+
|
|
3
|
+
Use this flavor for repositories with multiple apps, packages, or services.
|
|
4
|
+
|
|
5
|
+
## Startup Routine
|
|
6
|
+
|
|
7
|
+
1. Read this file.
|
|
8
|
+
2. Read `memory/MEMORY.md`.
|
|
9
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md`.
|
|
10
|
+
4. Inspect ADR frontmatter before opening full ADRs.
|
|
11
|
+
|
|
12
|
+
Replace `DOCS_FOLDER` with the real docs folder path.
|
|
13
|
+
|
|
14
|
+
## Monorepo Rules
|
|
15
|
+
|
|
16
|
+
- Identify the package or app owning the files before editing.
|
|
17
|
+
- Use the nearest package scripts and config where possible.
|
|
18
|
+
- Avoid cross-package refactors unless required by the task.
|
|
19
|
+
- Check workspace dependency boundaries before importing across packages.
|
|
20
|
+
- Prefer focused tests for the affected package first, then broader tests if shared contracts changed.
|
|
21
|
+
|
|
22
|
+
## Continuous Documentation
|
|
23
|
+
|
|
24
|
+
At the end of every coherent feature or meaningful refactor:
|
|
25
|
+
|
|
26
|
+
- create or update an ADR when the change affects an architecture boundary, public contract, storage format, protocol, workflow, or durable convention;
|
|
27
|
+
- skip ADRs for trivial fixes and implementation details that are obvious from code;
|
|
28
|
+
- when you create or update an ADR or durable documentation page, attach Living Documentation metadata to the source files that prove or implement it;
|
|
29
|
+
- if MCP tools are available, prefer `add_metadata` and `refresh_metadata`;
|
|
30
|
+
- if metadata cannot be updated from the current environment, state which source files should be attached.
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
|
|
34
|
+
Use the project's actual commands, for example:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build --workspace <package>
|
|
38
|
+
npm run test --workspace <package>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Adapt commands to the package manager used by the repository.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Project AI Instructions
|
|
2
|
+
|
|
3
|
+
This file is the shared operating guide for AI assistants working on this project.
|
|
4
|
+
|
|
5
|
+
Keep this file short, concrete, and project-specific. `AGENTS.md` and `CLAUDE.md` should point here instead of duplicating the same instructions.
|
|
6
|
+
|
|
7
|
+
## Startup Routine
|
|
8
|
+
|
|
9
|
+
Before making changes:
|
|
10
|
+
|
|
11
|
+
1. Read this file.
|
|
12
|
+
2. Read `memory/MEMORY.md` and load the relevant memory files listed there.
|
|
13
|
+
3. Read every rule in `DOCS_FOLDER/AI/rules/*.md`.
|
|
14
|
+
4. To understand existing decisions, inspect ADR frontmatter first: read only `description` and `tags`, then open the full ADR only when relevant.
|
|
15
|
+
|
|
16
|
+
Replace `DOCS_FOLDER` with the real documentation folder path used by this project, for example `documentation` or `docs`.
|
|
17
|
+
|
|
18
|
+
## AI Rules
|
|
19
|
+
|
|
20
|
+
Rules live in `DOCS_FOLDER/AI/rules/*.md`.
|
|
21
|
+
|
|
22
|
+
Each rule uses frontmatter:
|
|
23
|
+
|
|
24
|
+
- `id` - stable rule identifier
|
|
25
|
+
- `title` - short human-readable name
|
|
26
|
+
- `severity` - `guideline`, `warning`, or `required`
|
|
27
|
+
- `description` - concise summary
|
|
28
|
+
- `tags` - themes used for discovery
|
|
29
|
+
- `appliesTo` - file globs describing where the rule applies
|
|
30
|
+
|
|
31
|
+
Apply every rule whose `appliesTo` patterns match files you touch. If a rule conflicts with the user request or another project instruction, state the conflict explicitly before proceeding.
|
|
32
|
+
|
|
33
|
+
## ADRs
|
|
34
|
+
|
|
35
|
+
ADRs are the durable record of important decisions.
|
|
36
|
+
|
|
37
|
+
When you need to understand why something exists:
|
|
38
|
+
|
|
39
|
+
1. List ADR files.
|
|
40
|
+
2. Read only frontmatter `description` and `tags`.
|
|
41
|
+
3. Open the full ADR only when it is relevant to the current task.
|
|
42
|
+
4. If you make or change an important decision, create or update an ADR.
|
|
43
|
+
|
|
44
|
+
## Continuous Documentation
|
|
45
|
+
|
|
46
|
+
At the end of every coherent feature or meaningful refactor, update the durable documentation autonomously when the change created knowledge that future work must preserve.
|
|
47
|
+
|
|
48
|
+
Do create or update an ADR when the feature:
|
|
49
|
+
|
|
50
|
+
- changes an architecture boundary, public contract, storage format, protocol, or workflow;
|
|
51
|
+
- introduces a convention that future changes must follow;
|
|
52
|
+
- resolves a trade-off that would be hard to infer from code alone;
|
|
53
|
+
- supersedes or invalidates a previous decision.
|
|
54
|
+
|
|
55
|
+
Do not create ADRs for trivial fixes, mechanical renames, formatting-only changes, or implementation details that are obvious from the changed code.
|
|
56
|
+
|
|
57
|
+
When you create or update an ADR or another durable documentation page, attach source-file metadata so Living Documentation can show reliability drift:
|
|
58
|
+
|
|
59
|
+
1. Link the document to the source files that prove or implement what it describes.
|
|
60
|
+
2. After the document is correct, refresh/re-baseline its metadata hashes.
|
|
61
|
+
3. If MCP tools are available, prefer `add_metadata` and `refresh_metadata`.
|
|
62
|
+
4. If metadata cannot be updated from the current environment, state that explicitly and list the source files that should be attached.
|
|
63
|
+
|
|
64
|
+
## Memory
|
|
65
|
+
|
|
66
|
+
Memory files live in the project under `memory/`.
|
|
67
|
+
|
|
68
|
+
Do not store project memory in a tool-specific global folder if the user expects project-local memory. Update `memory/MEMORY.md` whenever you add or remove memory files.
|
|
69
|
+
|
|
70
|
+
## Verification
|
|
71
|
+
|
|
72
|
+
Before finishing a task, run the smallest useful verification:
|
|
73
|
+
|
|
74
|
+
- build command if build files or typed code changed
|
|
75
|
+
- focused tests when behavior changed
|
|
76
|
+
- lint or formatting command if this project has one
|
|
77
|
+
|
|
78
|
+
If a verification command cannot be run, say why.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: no-magic-numbers
|
|
3
|
+
title: Avoid magic numbers
|
|
4
|
+
severity: warning
|
|
5
|
+
description: Numeric values with domain meaning must be named constants instead of repeated raw literals.
|
|
6
|
+
tags: ["code-quality", "maintainability"]
|
|
7
|
+
appliesTo: ["src/**/*.ts", "src/frontend/**/*.js"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Numeric values with domain meaning should be named where they are introduced.
|
|
11
|
+
|
|
12
|
+
Prefer a constant whose name explains the intent:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
const DEFAULT_CUSTOM_SHAPE_SIZE = 65;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Avoid repeating raw values in code when the value carries product, rendering, sizing, timing, or protocol meaning.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|