living-documentation 7.46.0 → 7.48.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/bin/cli.js +87 -18
- package/dist/bin/cli.js.map +1 -1
- package/dist/src/lib/config.js +2 -2
- package/dist/src/lib/config.js.map +1 -1
- package/dist/starting-doc/.living-doc.json +1 -1
- 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/dist/starting-doc-fr/.living-doc.json +52 -0
- package/dist/starting-doc-fr/ADRS/2026_01_01_[ADR]_example_architecture_decision.md +58 -0
- package/dist/starting-doc-fr/AI/HOW_TO.md +338 -0
- package/dist/starting-doc-fr/AI/default/AGENTS.md +14 -0
- package/dist/starting-doc-fr/AI/default/CLAUDE.md +14 -0
- package/dist/starting-doc-fr/AI/default/MEMORY.md +7 -0
- package/dist/starting-doc-fr/AI/flavors/project-instructions-backend-api.md +41 -0
- package/dist/starting-doc-fr/AI/flavors/project-instructions-frontend-app.md +42 -0
- package/dist/starting-doc-fr/AI/flavors/project-instructions-library-cli.md +41 -0
- package/dist/starting-doc-fr/AI/flavors/project-instructions-monorepo.md +41 -0
- package/dist/starting-doc-fr/AI/project-instructions.md +78 -0
- package/dist/starting-doc-fr/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
package/dist/bin/cli.js
CHANGED
|
@@ -7,12 +7,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const promises_1 = require("readline/promises");
|
|
10
11
|
const server_1 = require("../src/server");
|
|
11
12
|
// Handle SIGTERM gracefully so V8 flushes NODE_V8_COVERAGE (used by c8 in tests).
|
|
12
13
|
// Also good hygiene — without this, process exits with code 143 and Express sockets
|
|
13
14
|
// may be dropped mid-flight. process.exit(0) runs pending exit handlers.
|
|
14
15
|
process.once("SIGTERM", () => process.exit(0));
|
|
15
16
|
const program = new commander_1.Command();
|
|
17
|
+
function parseInitLanguage(value) {
|
|
18
|
+
const normalized = value.trim().toLowerCase();
|
|
19
|
+
if (normalized === "en" || normalized === "fr") {
|
|
20
|
+
return normalized;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
16
24
|
function copyDir(src, dest) {
|
|
17
25
|
fs_1.default.mkdirSync(dest, { recursive: true });
|
|
18
26
|
for (const entry of fs_1.default.readdirSync(src)) {
|
|
@@ -26,32 +34,103 @@ function copyDir(src, dest) {
|
|
|
26
34
|
}
|
|
27
35
|
}
|
|
28
36
|
}
|
|
37
|
+
function validateRelativeFolder(folder) {
|
|
38
|
+
if (path_1.default.isAbsolute(folder) || folder.startsWith("~")) {
|
|
39
|
+
console.error(`\nError: The docs folder must be a relative path (got: ${folder}).\n` +
|
|
40
|
+
` Example: npx living-documentation ./mydocs\n` +
|
|
41
|
+
` Absolute paths are rejected so .living-doc.json stays portable across machines.\n`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function scaffoldStarter(docsPath, initLanguage) {
|
|
46
|
+
const starterDir = initLanguage === "fr" ? "starting-doc-fr" : "starting-doc";
|
|
47
|
+
const startingDocPath = path_1.default.join(__dirname, "..", starterDir);
|
|
48
|
+
if (!fs_1.default.existsSync(startingDocPath)) {
|
|
49
|
+
console.error(`\nError: Starter template not found: ${starterDir}\n`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
copyDir(startingDocPath, docsPath);
|
|
53
|
+
console.log(`\nInitialized ${initLanguage} documentation project in ${docsPath}\n`);
|
|
54
|
+
}
|
|
55
|
+
async function runInitWizard(options) {
|
|
56
|
+
const rl = (0, promises_1.createInterface)({ input: process.stdin, output: process.stdout });
|
|
57
|
+
try {
|
|
58
|
+
const folderAnswer = await rl.question("Documentation folder to create / Dossier de documentation à créer: ");
|
|
59
|
+
const folder = folderAnswer.trim();
|
|
60
|
+
if (!folder) {
|
|
61
|
+
console.error("\nError: Documentation folder is required.\n");
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
validateRelativeFolder(folder);
|
|
65
|
+
const docsPath = path_1.default.resolve(process.cwd(), folder);
|
|
66
|
+
if (fs_1.default.existsSync(docsPath)) {
|
|
67
|
+
const stat = fs_1.default.statSync(docsPath);
|
|
68
|
+
if (!stat.isDirectory()) {
|
|
69
|
+
console.error(`\nError: Not a directory: ${docsPath}\n`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
const existing = fs_1.default.readdirSync(docsPath);
|
|
73
|
+
if (existing.length > 0) {
|
|
74
|
+
console.error(`\nError: Folder is not empty: ${docsPath}\n`);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
fs_1.default.mkdirSync(docsPath, { recursive: true });
|
|
80
|
+
}
|
|
81
|
+
if (options.starterLanguage && !parseInitLanguage(options.starterLanguage)) {
|
|
82
|
+
console.error("\nError: Invalid init language. Expected en or fr.\n");
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
let initLanguage = options.starterLanguage ? parseInitLanguage(options.starterLanguage) : null;
|
|
86
|
+
if (!initLanguage && !process.stdin.isTTY) {
|
|
87
|
+
initLanguage = "en";
|
|
88
|
+
}
|
|
89
|
+
while (!initLanguage) {
|
|
90
|
+
const answer = await rl.question("Choose starter language / Choisissez la langue du starter [en/fr] (en): ");
|
|
91
|
+
initLanguage = answer.trim() === "" ? "en" : parseInitLanguage(answer);
|
|
92
|
+
if (!initLanguage) {
|
|
93
|
+
console.log("Please answer en or fr.");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
scaffoldStarter(docsPath, initLanguage);
|
|
97
|
+
const port = parseInt(options.port, 10);
|
|
98
|
+
if (isNaN(port) || port < 1 || port > 65535) {
|
|
99
|
+
console.error("\nError: Invalid port number\n");
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
await (0, server_1.startServer)({ docsPath, port, openBrowser: options.open ?? false });
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
rl.close();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
29
108
|
program
|
|
30
109
|
.name("living-documentation")
|
|
31
110
|
.description("Serve a local Markdown documentation viewer over HTTP on your machine.")
|
|
32
111
|
.version("1.0.0")
|
|
33
|
-
.argument("[folder]", "Relative path to
|
|
34
|
-
.option("-
|
|
112
|
+
.argument("[folder]", "Relative path to an existing documentation folder. Omit it to start the interactive initializer.")
|
|
113
|
+
.option("--starter-language <language>", "Starter language for the interactive initializer: en or fr")
|
|
35
114
|
.option("-p, --port <number>", "HTTP port to listen on (1-65535)", "4321")
|
|
36
115
|
.option("-o, --open", "Open the viewer in the default browser after startup")
|
|
37
116
|
.addHelpText("after", `
|
|
38
117
|
Examples:
|
|
118
|
+
$ npx living-documentation Create a new documentation project interactively
|
|
39
119
|
$ npx living-documentation ./mydocs Serve existing docs at http://localhost:4321
|
|
40
120
|
$ npx living-documentation ./mydocs -p 5000 -o Serve on port 5000 and open the browser
|
|
41
|
-
$ npx living-documentation ./newdocs --init Scaffold a demo project into an empty folder
|
|
42
121
|
|
|
43
122
|
Notes:
|
|
44
123
|
- The folder argument must be a relative path. Absolute paths (/abs/...) and ~-expansion are rejected
|
|
45
124
|
so .living-doc.json can be checked into git and shared across machines.
|
|
125
|
+
- When no folder is provided, the initializer asks for the target folder and starter language.
|
|
46
126
|
- Configuration is persisted to <folder>/.living-doc.json. Edit it via the admin panel at /admin.
|
|
47
127
|
`)
|
|
48
128
|
.action(async (folder, options) => {
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
` Absolute paths are rejected so .living-doc.json stays portable across machines.\n`);
|
|
53
|
-
process.exit(1);
|
|
129
|
+
if (!folder) {
|
|
130
|
+
await runInitWizard(options);
|
|
131
|
+
return;
|
|
54
132
|
}
|
|
133
|
+
validateRelativeFolder(folder);
|
|
55
134
|
const docsPath = path_1.default.resolve(process.cwd(), folder);
|
|
56
135
|
if (!fs_1.default.existsSync(docsPath)) {
|
|
57
136
|
console.error(`\nError: Folder not found: ${docsPath}\n`);
|
|
@@ -62,16 +141,6 @@ Notes:
|
|
|
62
141
|
console.error(`\nError: Not a directory: ${docsPath}\n`);
|
|
63
142
|
process.exit(1);
|
|
64
143
|
}
|
|
65
|
-
if (options.init) {
|
|
66
|
-
const existing = fs_1.default.readdirSync(docsPath);
|
|
67
|
-
if (existing.length > 0) {
|
|
68
|
-
console.error(`\nError: Folder is not empty: ${docsPath}\n`);
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
const startingDocPath = path_1.default.join(__dirname, "..", "starting-doc");
|
|
72
|
-
copyDir(startingDocPath, docsPath);
|
|
73
|
-
console.log(`\nInitialized demo project in ${docsPath}\n`);
|
|
74
|
-
}
|
|
75
144
|
const port = parseInt(options.port, 10);
|
|
76
145
|
if (isNaN(port) || port < 1 || port > 65535) {
|
|
77
146
|
console.error("\nError: Invalid port number\n");
|
package/dist/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,0CAA4C;AAE5C,kFAAkF;AAClF,oFAAoF;AACpF,yEAAyE;AACzE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,gDAAoD;AACpD,0CAA4C;AAE5C,kFAAkF;AAClF,oFAAoF;AACpF,yEAAyE;AACzE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAG9B,SAAS,iBAAiB,CAAC,KAAa;IACtC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QAC/C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,OAAO,CAAC,GAAW,EAAE,IAAY;IACxC,YAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC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AE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,6BAA6B,QAAQ,IAAI,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAA,oBAAW,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/src/lib/config.js
CHANGED
|
@@ -59,12 +59,12 @@ const STORAGE_DEFAULTS = {
|
|
|
59
59
|
showDiagramDebug: false,
|
|
60
60
|
diagramNodePalette: DEFAULT_DIAGRAM_NODE_PALETTE,
|
|
61
61
|
diagramEdgePalette: DEFAULT_DIAGRAM_EDGE_PALETTE,
|
|
62
|
-
sourceRoot:
|
|
62
|
+
sourceRoot: "..",
|
|
63
63
|
blockedFileExtensions: DEFAULT_BLOCKED_FILE_EXTENSIONS,
|
|
64
64
|
exclusiveFolderExpansion: false,
|
|
65
65
|
exclusiveCategoryExpansion: false,
|
|
66
66
|
codeBlockMaxHeight: 400,
|
|
67
|
-
markdownSoftBreaks:
|
|
67
|
+
markdownSoftBreaks: true,
|
|
68
68
|
};
|
|
69
69
|
function getConfigPath(docsPath) {
|
|
70
70
|
return path_1.default.join(docsPath, CONFIG_FILENAME);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib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B,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":";;;;;AAgGA,sCAEC;AAuGD,gCAmBC;AAID,kCAkBC;AAlPD,4CAAoB;AACpB,gDAAwB;AAgCxB,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C,mGAAmG;AACnG,yFAAyF;AACzF,MAAM,4BAA4B,GAAG;IACnC,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,MAAM,4BAA4B,GAAG;IACnC,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC;AAEF,MAAM,+BAA+B,GAAG;IACtC,KAAK;IACL,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AAEF,MAAM,gBAAgB,GAAiB;IACrC,eAAe,EAAE,mCAAmC;IACpD,KAAK,EAAE,sBAAsB;IAC7B,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,EAAE;IACd,gBAAgB,EAAE,KAAK;IACvB,kBAAkB,EAAE,4BAA4B;IAChD,kBAAkB,EAAE,4BAA4B;IAChD,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,+BAA+B;IACtD,wBAAwB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F,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
**date:** 2026-01-01
|
|
3
|
+
**status:** Example
|
|
4
|
+
**description:** Example ADR template showing how to record a project decision with enough context, consequences, and tags for an AI assistant to discover and reuse it later.
|
|
5
|
+
**tags:** adr, template, architecture-decision, ai-context, documentation
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Example Architecture Decision
|
|
9
|
+
|
|
10
|
+
## Context
|
|
11
|
+
|
|
12
|
+
Replace this section with the situation that led to the decision.
|
|
13
|
+
|
|
14
|
+
Explain the problem in concrete terms:
|
|
15
|
+
|
|
16
|
+
- what was hard to understand, maintain, scale, test, or operate;
|
|
17
|
+
- which existing constraints mattered;
|
|
18
|
+
- which alternatives were considered;
|
|
19
|
+
- which user or developer workflow was affected.
|
|
20
|
+
|
|
21
|
+
An ADR should capture the reason behind the change, not only the final code shape. This is what makes it useful later for humans and for AI assistants that need to understand why the project works this way.
|
|
22
|
+
|
|
23
|
+
## Decision
|
|
24
|
+
|
|
25
|
+
Replace this section with the decision that was made.
|
|
26
|
+
|
|
27
|
+
Be specific enough that another developer or AI assistant can apply the same rule later. Mention the files, modules, data contracts, commands, or conventions that carry the decision when they are relevant.
|
|
28
|
+
|
|
29
|
+
Example:
|
|
30
|
+
|
|
31
|
+
- store project-level AI instructions in `AI/project-instructions.md`;
|
|
32
|
+
- expose tool-specific entry points through `AGENTS.md` and `CLAUDE.md`;
|
|
33
|
+
- keep reusable AI rules in `AI/rules/*.md`;
|
|
34
|
+
- use symbolic links when a document must appear in Living Documentation without duplicating the source of truth.
|
|
35
|
+
|
|
36
|
+
## Consequences
|
|
37
|
+
|
|
38
|
+
### PROS
|
|
39
|
+
|
|
40
|
+
- The decision is discoverable from the documentation, not only from code.
|
|
41
|
+
- AI assistants can read the ADR frontmatter first, then load the full ADR only when it matches the current task.
|
|
42
|
+
- Future changes can preserve the original intent instead of re-discovering it from implementation details.
|
|
43
|
+
|
|
44
|
+
### CONS
|
|
45
|
+
|
|
46
|
+
- The ADR must be maintained when the decision changes.
|
|
47
|
+
- A vague ADR is worse than no ADR because it gives future readers false confidence.
|
|
48
|
+
- If the same rule is repeated in too many places, the project can drift. Prefer one source of truth and link to it.
|
|
49
|
+
|
|
50
|
+
## Follow-up
|
|
51
|
+
|
|
52
|
+
When turning this example into a real ADR:
|
|
53
|
+
|
|
54
|
+
- rename the file with the actual date, category, and decision title;
|
|
55
|
+
- set `status` to `Proposed`, `Accepted`, `Superseded`, or the status convention used by the project;
|
|
56
|
+
- replace `description` with a one-sentence summary that is useful during ADR discovery;
|
|
57
|
+
- replace `tags` with searchable themes;
|
|
58
|
+
- remove this follow-up section if it is no longer useful.
|
|
@@ -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.
|