living-ai-documentation 3.37.0 → 3.41.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 (71) hide show
  1. package/README.fr.md +200 -251
  2. package/README.md +200 -251
  3. package/dist/bin/cli.js +61 -9
  4. package/dist/bin/cli.js.map +1 -1
  5. package/dist/frontend-svelte/assets/{index-c_1Dt9Nx.css → index-C--qu7y-.css} +1 -1
  6. package/dist/frontend-svelte/assets/index-DkgHblwj.js +181 -0
  7. package/dist/frontend-svelte/assets/{main-CgFZwst-.js → main-DchaZ2ad.js} +1 -1
  8. package/dist/frontend-svelte/i18n/en.json +1 -1
  9. package/dist/frontend-svelte/i18n/fr.json +1 -1
  10. package/dist/frontend-svelte/index.html +2 -2
  11. package/dist/src/lib/blueprint.d.ts +1 -1
  12. package/dist/src/lib/blueprint.d.ts.map +1 -1
  13. package/dist/src/lib/blueprint.js +27 -9
  14. package/dist/src/lib/blueprint.js.map +1 -1
  15. package/dist/src/lib/git-integration.js +5 -5
  16. package/dist/src/lib/git-integration.js.map +1 -1
  17. package/dist/starter-doc/000_DOCUMENTATION/2026_06_30_10_00_[DOCUMENTATION]_welcome_to_living_documentation.md +65 -0
  18. package/dist/starter-doc/000_DOCUMENTATION/2026_06_30_10_10_[DOCUMENTATION]_home_menu.md +131 -0
  19. package/dist/starter-doc/000_DOCUMENTATION/2026_06_30_10_20_[DOCUMENTATION]_markdown_document.md +163 -0
  20. package/dist/starter-doc/000_DOCUMENTATION/2026_07_01_14_04_[DOCUMENTATION]_workspace_menu.md +194 -0
  21. package/dist/starter-doc/000_DOCUMENTATION/2026_07_01_17_04_[DOCUMENTATION]_agents_menu.md +190 -0
  22. package/dist/starter-doc/000_DOCUMENTATION/2026_07_01_17_41_[DOCUMENTATION]_diagram_menu.md +227 -0
  23. package/dist/starter-doc/images/DOCUMENTATION/admin_git_integration.png +0 -0
  24. package/dist/starter-doc/images/DOCUMENTATION/concept-01-hero-produit.jpg +0 -0
  25. package/dist/starter-doc/images/DOCUMENTATION/concept-03-local-first.jpg +0 -0
  26. package/dist/starter-doc/images/DOCUMENTATION/concept-07-workspace-providers-agents.jpg +0 -0
  27. package/dist/starter-doc/images/DOCUMENTATION/execution_d_agents.png +0 -0
  28. package/dist/starter-doc/images/DOCUMENTATION/exemple_diagramme_documentation.png +0 -0
  29. package/dist/starter-doc/images/DOCUMENTATION/feedback_execution_agent.png +0 -0
  30. package/dist/starter-doc/images/DOCUMENTATION/living_documentation_context_demo_conf.png +0 -0
  31. package/dist/starter-doc/images/DOCUMENTATION/llm_provider_creation.png +0 -0
  32. package/dist/starter-doc/images/DOCUMENTATION/popup-creer-document.png +0 -0
  33. package/dist/starter-doc/images/DOCUMENTATION/popup-creer-dossier.png +0 -0
  34. package/dist/starter-doc/images/DOCUMENTATION/popup_execution_agent.png +0 -0
  35. package/dist/starter-doc/images/DOCUMENTATION/readme-sidebar.png +0 -0
  36. package/dist/starter-doc/images/DOCUMENTATION/run_agent_execution.jpg +0 -0
  37. package/dist/starter-doc/images/DOCUMENTATION/summary_agent_execution.png +0 -0
  38. package/dist/starter-doc/images/DOCUMENTATION/table_des_matieres_document.png +0 -0
  39. package/dist/starter-doc/images/DOCUMENTATION/workspace_configuration.jpg +0 -0
  40. package/dist/starter-doc-fr/000_DOCUMENTATION/2026_06_30_10_00_[DOCUMENTATION]_Bienvenue_dans_Living_Documentation.md +65 -0
  41. package/dist/starter-doc-fr/000_DOCUMENTATION/2026_06_30_10_10_[DOCUMENTATION]_menu_home.md +129 -0
  42. package/dist/starter-doc-fr/000_DOCUMENTATION/2026_06_30_10_20_[DOCUMENTATION]_document_markdown.md +163 -0
  43. package/dist/starter-doc-fr/000_DOCUMENTATION/2026_07_01_14_04_[DOCUMENTATION]_menu_workspace.md +194 -0
  44. package/dist/starter-doc-fr/000_DOCUMENTATION/2026_07_01_17_04_[DOCUMENTATION]_menu_agents.md +190 -0
  45. package/dist/starter-doc-fr/000_DOCUMENTATION/2026_07_01_17_41_[DOCUMENTATION]_menu_diagram.md +226 -0
  46. package/dist/starter-doc-fr/images/DOCUMENTATION/admin_git_integration.png +0 -0
  47. package/dist/starter-doc-fr/images/DOCUMENTATION/concept-01-hero-produit.jpg +0 -0
  48. package/dist/starter-doc-fr/images/DOCUMENTATION/concept-03-local-first.jpg +0 -0
  49. package/dist/starter-doc-fr/images/DOCUMENTATION/concept-07-workspace-providers-agents.jpg +0 -0
  50. package/dist/starter-doc-fr/images/DOCUMENTATION/execution_d_agents.png +0 -0
  51. package/dist/starter-doc-fr/images/DOCUMENTATION/exemple_diagramme_documentation.png +0 -0
  52. package/dist/starter-doc-fr/images/DOCUMENTATION/feedback_execution_agent.png +0 -0
  53. package/dist/starter-doc-fr/images/DOCUMENTATION/living_documentation_context_demo_conf.png +0 -0
  54. package/dist/starter-doc-fr/images/DOCUMENTATION/llm_provider_creation.png +0 -0
  55. package/dist/starter-doc-fr/images/DOCUMENTATION/popup-creer-document.png +0 -0
  56. package/dist/starter-doc-fr/images/DOCUMENTATION/popup-creer-dossier.png +0 -0
  57. package/dist/starter-doc-fr/images/DOCUMENTATION/popup_execution_agent.png +0 -0
  58. package/dist/starter-doc-fr/images/DOCUMENTATION/readme-sidebar.png +0 -0
  59. package/dist/starter-doc-fr/images/DOCUMENTATION/run_agent_execution.jpg +0 -0
  60. package/dist/starter-doc-fr/images/DOCUMENTATION/summary_agent_execution.png +0 -0
  61. package/dist/starter-doc-fr/images/DOCUMENTATION/table_des_matieres_document.png +0 -0
  62. package/dist/starter-doc-fr/images/DOCUMENTATION/workspace_configuration.jpg +0 -0
  63. package/images/DOCUMENTATION/concept-01-hero-produit.png +0 -0
  64. package/images/DOCUMENTATION/concept-03-local-first.png +0 -0
  65. package/images/DOCUMENTATION/concept-07-workspace-providers-agents.png +0 -0
  66. package/images/DOCUMENTATION/concept-08-git-versions-restore.png +0 -0
  67. package/images/DOCUMENTATION/concept-12-laboratoire-agentique.png +0 -0
  68. package/images/DOCUMENTATION/execution_d_agents.png +0 -0
  69. package/images/DOCUMENTATION/exemple_diagramme_documentation.png +0 -0
  70. package/package.json +1 -1
  71. package/dist/frontend-svelte/assets/index-BjHN0FJd.js +0 -181
package/README.md CHANGED
@@ -1,370 +1,319 @@
1
- ---
2
- **language:** en
3
- ---
4
-
5
1
  # Living Documentation
6
2
 
7
3
  [🇫🇷 Lire en français](./README.fr.md)
8
4
 
9
- > **Local Markdown documentation hub with a built-in MCP server , coding agents create ADRs, draw diagrams, and detect drift while you code.**
5
+ > **A local workshop to generate, maintain, version, and automate your documentation.**
10
6
 
11
- Markdown on disk, no cloud, no database, no build step. Point it at a folder, open `http://localhost:4321`. Plug any MCP-aware AI agent into it (Claude Code, Claude Desktop, Cursor…) and your documentation maintains itself as your code evolves.
7
+ **Living Documentation** is not a code generation tool. It is a documentation production tool: local Markdown, notes, processes, ADRs, diagrams, Git, AI agents, LLM providers, generated images, MCP, and automations.
8
+
9
+ Everything stays in your files. You start the tool, open the browser, and document. Then you can connect Git, your agents, your LLMs, and your workflows.
12
10
 
13
11
  ![npm](https://img.shields.io/npm/v/living-ai-documentation) ![Node.js](https://img.shields.io/badge/Node.js-20.19%2B-green) ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue) ![License](https://img.shields.io/badge/License-AGPL--3.0-blue) ![MCP](https://img.shields.io/badge/MCP-Streamable_HTTP-purple)
14
12
 
15
13
  ```bash
16
- npx living-ai-documentation@latest # interactive wizard (EN/FR)
17
- npx living-ai-documentation@latest ./docs # serve an existing folder
14
+ npx living-ai-documentation@latest
18
15
  ```
19
16
 
20
- ![Living Documentation viewer](/images/living_documentation.jpg)
17
+ ![Living Documentation workshop](./images/DOCUMENTATION/concept-01-hero-produit.png)
18
+
19
+ ---
20
+
21
+ ## Why use it?
22
+
23
+ Documentation often ends up scattered: README files, notes, tickets, screenshots, ADRs, prompts, exports, diagrams, AI conversations, and attachments. **Living Documentation** brings all of that back into one local space that is readable, versionable, and usable by agents.
24
+
25
+ | Need | What Living Documentation provides |
26
+ | --- | --- |
27
+ | Write fast | Markdown editor, snippets, tables, images, attachments, annotations. |
28
+ | Structure | Folders, categories, naming conventions, full-text search. |
29
+ | Version | Git integration, automatic commits, visual comparison, block-level restore. |
30
+ | Visualize | Diagram editor, images, exports, clickable links inside documents. |
31
+ | Automate | Workspace, LLM providers, reusable agents, internal MCP tools. |
32
+ | Stay in control | Local files, no imposed cloud, no proprietary database. |
21
33
 
22
34
  ---
23
35
 
24
- ## Two ways to use it
36
+ ## Features that change the workflow
37
+
38
+ ### Local-first documentation
39
+
40
+ Your documents are simple Markdown files in a folder.
25
41
 
26
- ### 1. With an AI coding agent , the killer feature
42
+ - readable in any editor
43
+ - versionable with Git
44
+ - usable by your LLMs
45
+ - portable from one project to another
46
+ - easy to back up
27
47
 
28
- Living Documentation ships an **MCP server** on `POST /mcp`. Any MCP-aware agent can read, create and audit your project's documentation autonomously.
48
+ ![Local-first model](./images/DOCUMENTATION/concept-03-local-first.png)
29
49
 
30
- | You say… | The agent triggers… | What happens |
31
- | ---------------------------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
32
- | _"feature done"_ / _"feature terminée"_ | `create-adr` | Searches existing ADRs, supersedes the obsolete one if any, writes a new ADR at `To be validated`, binds the source files via metadata. |
33
- | _"audit the ADRs"_ / _"vérifie la fiabilité des ADR"_ | `audit-adrs-drift` | Lists every ADR below 80% reliability and brings each back in sync , re-baseline or supersede after your confirmation. |
34
- | _"review this ADR"_ / _"vérifie la pertinence de cet ADR"_ | `review-adr-relevance` | Reviews a single ADR against the bound source files; refreshes hashes or proposes supersession. |
35
- | _"backfill ADRs from git"_ / _"retrodocumente depuis git"_ | `retrodocument-adrs-from-git` | Walks git history oldest-first and creates ADRs for the durable decisions that were never documented. |
36
- | _"give me the big picture"_ | `generate-context-diagram` | Creates a C4 context diagram **derived from the docs**, never invented. |
50
+ ### Built-in Git, versions, and restore
37
51
 
38
- **All new ADRs land at `To be validated`.** _You_ promote them. The agent never promotes on your behalf.
52
+ When Git integration is enabled, Living Documentation can create a commit after each documentation save. You can then open a document history, compare HEAD with an older commit, and restore precise blocks into the current document.
39
53
 
40
- ### 2. Solo, no AI
54
+ ![Git, versions, and restore](./images/DOCUMENTATION/concept-08-git-versions-restore.png)
41
55
 
42
- A personal docs hub: ADRs, meeting notes, dev journals, feature plans, architecture sketches , all kept as Markdown on disk, git-friendly, zero vendor lock-in. Inline editor, snippets, image paste, file attachments, diagram editor, full-text search, PDF/HTML/Notion/Confluence export.
56
+ ### Workspace, LLMs, and agents
43
57
 
44
- The two modes mix freely: jot notes solo all week, then let your agent record the ADR when the feature actually lands.
58
+ The <kbd>Workspace</kbd> lets you configure LLM providers and create documentation agents: translation, correction, summary, image generation, Markdown improvement, draft production, document audit.
59
+
60
+ Agents can work in **Chat only** mode or with Living Documentation **MCP tools** when the provider supports them.
61
+
62
+ ![Workspace providers agents](./images/DOCUMENTATION/concept-07-workspace-providers-agents.png)
63
+
64
+ ### Agents available from the whole app
65
+
66
+ Once created, agents are available from the <kbd>Agents</kbd> menu, no matter which page is open. Each execution produces a run document with status, input, response, and optional debug details.
67
+
68
+ ![Agents menu](./images/DOCUMENTATION/execution_d_agents.png)
69
+
70
+ ### Diagrams and sketches
71
+
72
+ Living Documentation includes a built-in diagram editor. You can draw manually, link diagrams to Markdown documents, export them, or let an agent propose a first version from a document.
73
+
74
+ ![Diagram example](./images/DOCUMENTATION/exemple_diagramme_documentation.png)
75
+
76
+ ### Agentic automation lab
77
+
78
+ With Workspace, MCP, LLM providers, and internal tools, Living Documentation becomes an automation lab applied to documentation. You can create agents that read a document, transform it, generate an image, write meeting notes, or enrich your documentation base.
79
+
80
+ ![Agentic lab](./images/DOCUMENTATION/concept-12-laboratoire-agentique.png)
45
81
 
46
82
  ---
47
83
 
48
84
  ## Quick start
49
85
 
86
+ Requires **Node.js 20.19 or newer**.
87
+
50
88
  ```bash
51
- # Interactive wizard , creates a starter doc folder (EN or FR), scaffolds
52
- # AGENTS.md / CLAUDE.md / memory/MEMORY.md at the project root and symlinks
53
- # them into <docs>/AI/ so AI agents can find them.
89
+ # Detect an existing project nearby or create an EN/FR starter
54
90
  npx living-ai-documentation@latest
55
91
 
56
92
  # Or serve an existing folder
57
93
  npx living-ai-documentation@latest ./docs
94
+
95
+ # Explicit port
58
96
  npx living-ai-documentation@latest ./docs --port 4000 --open
59
97
  ```
60
98
 
61
- Then open [http://localhost:4321](http://localhost:4321) (viewer) and [http://localhost:4321/admin](http://localhost:4321/admin) (config).
99
+ Then open:
62
100
 
63
- > The folder argument must be a **relative path** (`./docs`, `../shared/docs`…). Absolute paths and `~` are rejected so the generated `.living-doc.json` stays portable and can be committed.
101
+ - application: [http://localhost:4321](http://localhost:4321)
102
+ - admin: [http://localhost:4321/admin](http://localhost:4321/admin)
103
+ - MCP: [http://localhost:4321/mcp](http://localhost:4321/mcp)
64
104
 
65
- ### Install
105
+ Without a folder argument, the CLI first looks for `.living-doc.json` in the current folder, then one level below it. If it finds an existing Living Documentation project, it offers to launch it; otherwise it creates a complete documentation starter, in French or English, with built-in guides for Home, Markdown, Workspace, Agents, and Diagram.
66
106
 
67
- Requires **Node.js 20.19 or newer** (Vite 8 and Commander 14 no longer support Node.js 18).
107
+ When a folder argument is provided but that folder has no `.living-doc.json` yet, the CLI initializes that folder instead of serving it as an unconfigured project.
68
108
 
69
- ```bash
70
- npx living-ai-documentation@latest # zero-install
71
- npm install -g living-ai-documentation # global
72
- ```
109
+ > The folder passed to the CLI must be a relative path (`./docs`, `../documentation`). Absolute paths and `~` are rejected to keep `.living-doc.json` portable.
73
110
 
74
111
  ---
75
112
 
76
- ## Connect your AI agent
113
+ ## What the app contains
77
114
 
78
- ### Claude Code
115
+ | Surface | Usage |
116
+ | --- | --- |
117
+ | <kbd>Home</kbd> | Read, create, edit, search, and organize Markdown documents. |
118
+ | <kbd>Workspace</kbd> | Configure LLM providers, MCP, agents, and image providers. |
119
+ | <kbd>Agents</kbd> | Run agents from any page. |
120
+ | <kbd>Diagram</kbd> | Create and edit diagrams linked to documents. |
121
+ | <kbd>Files</kbd> | Browse attachments and documentation assets. |
122
+ | <kbd>AI Context</kbd> | Inspect AI context, rules, memory, and the MCP explorer. |
123
+ | <kbd>Admin</kbd> | Configure theme, language, Git, patterns, file security, agent debug. |
79
124
 
80
- ```bash
81
- claude mcp add --transport http living-ai-documentation http://localhost:4321/mcp
82
- ```
125
+ ---
83
126
 
84
- Or manually in `.claude/settings.json`:
127
+ ## Writing in Living Documentation
85
128
 
86
- ```json
87
- {
88
- "mcpServers": {
89
- "living-ai-documentation": {
90
- "type": "http",
91
- "url": "http://localhost:4321/mcp"
92
- }
93
- }
94
- }
95
- ```
129
+ The Home viewer is also a Markdown editor.
96
130
 
97
- ### Claude Desktop
131
+ Useful features:
98
132
 
99
- In `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS), then restart:
133
+ - inline editing with disk save
134
+ - Markdown snippets
135
+ - assisted tables
136
+ - ASCII trees
137
+ - collapsible blocks
138
+ - callouts
139
+ - images pasted from the clipboard
140
+ - attachments
141
+ - annotations
142
+ - automatic table of contents
143
+ - full-text search
100
144
 
101
- ```json
102
- {
103
- "mcpServers": {
104
- "living-ai-documentation": {
105
- "type": "http",
106
- "url": "http://localhost:4321/mcp"
107
- }
108
- }
109
- }
110
- ```
145
+ Files are organized by real folders and by categories extracted from the file name:
111
146
 
112
- ### Cursor, Continue, any MCP client
147
+ ```text
148
+ PROCESS/2026_06_30_10_00_[GUIDE]_prepare_a_meeting.md
149
+ ```
113
150
 
114
- Use the same HTTP endpoint: `http://localhost:4321/mcp` (Streamable HTTP transport, stateless).
151
+ Here:
115
152
 
116
- > The Living Documentation server must be running first (`npx living-ai-documentation@latest ./docs`) before the agent connects.
153
+ - `PROCESS` is the folder
154
+ - `GUIDE` is the category
155
+ - `prepare_a_meeting` is the title
117
156
 
118
157
  ---
119
158
 
120
- ## Core concepts
159
+ ## Git and versions
121
160
 
122
- - **Markdown on disk** , each document is a `.md` file. Configuration lives in `.living-doc.json` next to it. Both are git-friendly.
123
- - **Filename pattern** , default `YYYY_MM_DD_HH_mm_[Category]_title.md`. The pattern is configurable; date, category and title are parsed from it. Files that don't match still appear under **General**.
124
- - **Folders → categories → docs** in the sidebar. Folder names become the labels; numeric prefixes (`1_TUTORIAL`, `2_REFERENCE`) control order without showing in the UI.
125
- - **ADRs** are the canonical decision record. The MCP server enforces a normalized frontmatter (`**date:**`, `**status:**`, `**description:**`, `**tags:**`) and a `To be validated` initial status that only a human can promote.
126
- - **`sourceRoot`** points to the project's code. The MCP source tools (`list_source_files`, `read_source_file`, `search_source`) and the metadata binding rely on it. Defaults to the parent of the docs folder.
127
- - **Source-file metadata + reliability gauge** , bind a doc to the source files it describes. Each binding stores a SHA-256. The gauge in the doc header (`🔴 → 🟡 → 🟢`) reflects `unchanged / total`. As soon as one bound file is modified or deleted, drift is visible. **God files** (`package.json`, lock files, manifests, barrels) are excluded by convention.
128
- - **Diagrams are derived views** , they cite the documents they're built from (`evidence`). They cannot introduce concepts absent from the docs.
161
+ Git integration is optional, but strongly recommended.
129
162
 
130
- ---
163
+ It enables:
131
164
 
132
- ## MCP reference
133
-
134
- ### Tools (19)
135
-
136
- | Group | Tool | Description |
137
- | ---------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
138
- | Onboarding | `get_server_guide` | Returns the server guide: workflow, conventions, diagram rules. |
139
- | Documents | `list_documents` | Inventory: `id`, `title`, `category`, `folder`, `linkHref`. |
140
- | | `read_document` | Raw Markdown content of a document. |
141
- | | `create_document` | Create a new `.md` file (filename from configured pattern, optional `date` override for retrodoc). |
142
- | | `update_document` | Overwrite an existing doc (drift correction, supersede). |
143
- | Diagrams | `list_diagrams` | List saved diagrams. |
144
- | | `read_diagram` | Read nodes + edges of one diagram. |
145
- | | `create_diagram` | Create / overwrite a diagram (server-side guardrails enforce C4 progression and edge labels). |
146
- | Source code (fallback) | `list_source_files` | List files under `sourceRoot` (ignored: `node_modules`, `dist`, `.git`…). |
147
- | | `read_source_file` | Read a file under `sourceRoot`. |
148
- | | `search_source` | Grep-like text search under `sourceRoot`. |
149
- | Metadata | `list_metadata` | Source-file bindings of a doc. |
150
- | | `get_accuracy` | Per-entry status (`unchanged` / `modified` / `missing`) + weighted accuracy ∈ [0, 1]. |
151
- | | `add_metadata` | Bind a source file (path under `sourceRoot`), records SHA-256. **Skips god files.** |
152
- | | `remove_metadata` | Detach a binding (idempotent , for renames/deletes). |
153
- | | `refresh_metadata` | Re-hash every binding (re-baseline after an update). |
154
- | ADR audit | `list_adrs_below_accuracy` | Up to 10 ADRs whose accuracy < 80%, sorted most-degraded first. Excludes `SuperSeeded` and non-ADRs. |
155
- | | `review_adr_relevance` | Factual report on one ADR + drifted files to re-read. Returns a `state` to drive the LLM decision tree. |
156
- | Retrodocumentation | `retrodocument_adrs_from_git` | Up to 200 git commits (oldest first) classified `candidate` / `trivial` / `merge`, with god-file flags. Used to backfill missing ADRs. |
157
-
158
- ### Prompts (10)
159
-
160
- | Group | Prompt | When |
161
- | ------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------- |
162
- | ADR lifecycle | `create-adr` | A feature has just been implemented or modified. Records the decision, supersedes a prior ADR if any. |
163
- | | `audit-adrs-drift` | Batch audit: bring every drifting ADR back to a clear state (re-baseline or user-confirmed supersession). |
164
- | | `review-adr-relevance` | Single ADR review against its bound source files. |
165
- | | `retrodocument-adrs-from-git` | Backfill ADRs from git history when the project lacks them. |
166
- | Diagrams | `generate-context-diagram` | DEFAULT. C4 context diagram, gated server-side. |
167
- | | `generate-container-diagram` | Explicit-only. C4 container diagram of one system. |
168
- | | `generate-uml-diagram` | Explicit-only. UML class/sequence/state/activity/use-case. |
169
- | | `generate-screen-guide` | Explicit-only. Annotated screenshot with post-it callouts. |
170
- | | `update-diagram-from-docs` | Re-read source documents to update existing diagrams. |
171
- | | `flow`, `erd` | Linear flow / entity-relationship diagrams. |
172
-
173
- A `GET http://localhost:4321/mcp` returns the live tool + prompt schemas for inspection.
165
+ - automatic commits after saves
166
+ - push disabled or push every N commits
167
+ - warning when Git is not configured
168
+ - detection of changes outside the documentation folder
169
+ - <kbd>Versions</kbd> button on documents
170
+ - visual diff between HEAD and a selected commit
171
+ - block-level restore from an older version
174
172
 
175
- ---
173
+ Living Documentation only commits the configured documentation folder. Changes outside this folder are ignored and reported.
176
174
 
177
- ## Authoring features
175
+ ---
178
176
 
179
- - **Inline editor** , edit any doc in the browser, saves to disk instantly.
180
- - **Snippets panel** (`🧩 Snippets`) , pre-built Markdown constructs at the cursor: collapsible blocks, links (in-doc, cross-doc, anchor), lists, code blocks, blockquotes, separators, images. Plus a **table editor** (dynamic grid → aligned Markdown table) and a **tree editor** (indentation → ASCII tree with `├──` / `└──`). Selecting an existing snippet **detects its type** and pre-fills the form for editing.
181
- - **Image paste** , paste from clipboard while editing, auto-uploaded to `<docs>/images/`, inserted as Markdown.
182
- - **File attachments** , drag, drop, paste or pick any non-image file (PDF, archive, office doc). Uploaded under `<docs>/files/`, inserted as a paperclip pill. Blocked extensions and size limits configurable in Admin.
183
- - **Full-text search** , instant filename filter + server-side content search; for each file lists every occurrence, highlights and jumps to them.
184
- - **`metadata://<filename>` search prefix** , reverse-lookup: which documents reference this attachment?
185
- - **Annotations** , persistent highlight markers per document (yellow / pink / green / blue).
186
- - **Anchor navigation** , `[label](#heading-slug)` scrolls correctly after async render; IDs auto-generated.
187
- - **Dark mode** , follows system preference, manually toggleable. Syntax highlighting always dark.
177
+ ## Agents and MCP
188
178
 
189
- ![Sidebar grouped by folder category](/images/readme-sidebar.png)
179
+ Living Documentation exposes a local MCP server at:
190
180
 
191
- ![Full-text search](/images/readme-intelligent-search-demo.jpg)
181
+ ```text
182
+ http://localhost:4321/mcp
183
+ ```
192
184
 
193
- ---
185
+ MCP-compatible agents can use the internal tools to:
194
186
 
195
- ## Diagram editor
187
+ - list and read documents
188
+ - create or update a document
189
+ - manage metadata
190
+ - generate diagrams
191
+ - generate images through a configured image provider
192
+ - read the sourceRoot when necessary
193
+ - save an execution context
196
194
 
197
- Built-in canvas diagram editor (vis-network), accessible at `/diagram?id=...`.
195
+ The `GET /mcp` endpoint returns the live schemas of available tools and prompts. This README intentionally does not duplicate that list: it evolves with the product.
198
196
 
199
- - **C4 progression enforced** , context first (default), container/component only on explicit request. UML on explicit request.
200
- - **Architectural `kind` vs visual `renderAs`** , separate the concept (`software_system`, `database`, `queue`, `api`, `cloud_service`…) from the shape (`box`, `ellipse`, `database`, `actor`, `post-it`…). The MCP picks sensible defaults for each `kind`.
201
- - **Evidence provenance** , every architectural node/edge can cite the document and section that justifies it. The editor surfaces missing-evidence warnings.
202
- - **Custom shape libraries** at `/shape-editor` , define your own shapes (SVG icons, ports, default colors) and reuse them across diagrams.
203
- - **Ports** for anchored edges, **alignment guides**, **undo/redo**, **snap-to-grid**, **paste images**, **PNG export**, **deep-link** to a diagram by id.
197
+ ### Claude Code example
204
198
 
205
- ---
199
+ ```bash
200
+ claude mcp add --transport http living-ai-documentation http://localhost:4321/mcp
201
+ ```
206
202
 
207
- ## File organization
203
+ ### Claude Desktop example
208
204
 
205
+ ```json
206
+ {
207
+ "mcpServers": {
208
+ "living-ai-documentation": {
209
+ "type": "http",
210
+ "url": "http://localhost:4321/mcp"
211
+ }
212
+ }
213
+ }
209
214
  ```
210
- docs/
211
- ├── 2024_01_15_09_30_[DevOps]_deploy.md → category: DevOps
212
- ├── 1_tutorial/ → folder: Tutorial (prefix hidden in UI)
213
- │ └── 2024_03_01_10_00_[Onboarding]_setup.md → folder: Tutorial / category: Onboarding
214
- ├── adrs/
215
- │ └── 2024_04_01_10_15_[Architecture]_event_sourcing.md
216
- └── 2_reference/
217
- └── api.md → folder: Reference / category: General
218
- ```
219
-
220
- - The `[Category]` tag is parsed from the filename regardless of the folder.
221
- - Files without a `[Category]` fall under **General**. **General** is always rendered first.
222
- - Folders are sorted alphabetically , prefix with `1_`, `2_`… to force an order; the prefix is hidden in the UI but visible on hover.
223
- - Subdirectory nesting is supported recursively.
224
215
 
225
- ![Filename pattern](/images/readme-filename-pattern.png)
216
+ Use the same endpoint for Cursor, Continue, or any MCP client compatible with Streamable HTTP.
226
217
 
227
218
  ---
228
219
 
229
- ## Configuration (`.living-doc.json`)
220
+ ## Configuration
221
+
222
+ Configuration is stored in `.living-doc.json`, inside the documentation folder.
230
223
 
231
- Created automatically in your docs folder on first run. Edit in the Admin panel or by hand.
224
+ Example:
232
225
 
233
226
  ```json
234
227
  {
235
228
  "filenamePattern": "YYYY_MM_DD_HH_mm_[Category]_title",
236
229
  "title": "Living Documentation",
237
230
  "theme": "system",
231
+ "language": "en",
238
232
  "port": 4321,
239
- "extraFiles": ["../README.md", "../CLAUDE.md"],
240
- "sourceRoot": "../src",
241
- "blockedFileExtensions": [".exe", ".bin"]
233
+ "sourceRoot": "..",
234
+ "extraFiles": [],
235
+ "gitIntegration": {
236
+ "mode": "enabled",
237
+ "pushMode": "never",
238
+ "pushEveryCommits": 1,
239
+ "commitMessage": "docs: update living documentation"
240
+ }
242
241
  }
243
242
  ```
244
243
 
245
- | Field | Role |
246
- | ----------------------- | ----------------------------------------------------------------------------------------------------------- |
247
- | `filenamePattern` | Filename convention used to parse date / category / title. `[Category]` token mandatory, exactly once. |
248
- | `extraFiles` | Ordered Markdown files **outside** the docs folder (e.g. `README.md`, `CLAUDE.md`). Shown in General first. |
249
- | `sourceRoot` | Where your code lives (relative to docs folder). Defaults to `..`. Used by MCP source + metadata tools. |
250
- | `blockedFileExtensions` | File-attachment safety list, editable from Admin. |
251
-
252
- **All paths are relative POSIX** so `.living-doc.json` stays portable. Legacy absolute paths are silently migrated on first read.
253
-
254
- ![Extra files](/images/readme-extra-files.png)
244
+ Important points:
255
245
 
256
- ---
257
-
258
- ## Export
259
-
260
- | Format | Endpoint | Notes |
261
- | ---------------------- | --------------------------- | -------------------------------------------------- |
262
- | PDF (per doc) | `POST /api/export/html` | Browser print dialog from the rendered HTML. |
263
- | HTML , Notion mode | `POST /api/export/html` | Single HTML bundle suitable for Notion import. |
264
- | HTML , Confluence mode | `POST /api/export/html` | Zipped HTML bundle suitable for Confluence import. |
265
- | Markdown bundle | `POST /api/export/markdown` | Zip of every document with normalized links. |
246
+ - paths are stored relatively when possible
247
+ - `sourceRoot` is used by source tools and agents
248
+ - `[Category]` is used to classify documents
249
+ - Git can remain unconfigured, disabled, or explicitly enabled
250
+ - attachment extensions can be blocked in Admin
266
251
 
267
252
  ---
268
253
 
269
- ## UI surfaces
254
+ ## Exports
270
255
 
271
- | URL | Page |
272
- | --------------- | -------------------------------------------------------------------------------------------- |
273
- | `/` | Viewer , sidebar, document rendering, inline edit, snippets, search, attachments. |
274
- | `/admin` | Config , title, theme, filename pattern, extra files, source root, file safety list. |
275
- | `/diagram?id=` | Diagram editor (vis-network) with C4 conventions, ports, alignment guides, undo/redo. |
276
- | `/shape-editor` | Custom shape library editor , SVG icons, default colors, ports. |
277
- | `/context` | AI context page , instructions, rules, memory, **MCP explorer** (try tools live in-browser). |
256
+ Living Documentation can export:
278
257
 
279
- ---
280
-
281
- ## REST API
282
-
283
- <details>
284
- <summary>Full HTTP API (click to expand)</summary>
285
-
286
- | Method | Endpoint | Description |
287
- | -------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------ |
288
- | `GET` | `/api/documents` | List documents with metadata (includes extra files). |
289
- | `GET` | `/api/documents/:id` | Document content + rendered HTML. |
290
- | `POST` | `/api/documents` | Create from `{ title, category, folder?, content?, date? }`. |
291
- | `PUT` | `/api/documents/:id` | Save content to disk. |
292
- | `DELETE` | `/api/documents/:id` | Delete a document. |
293
- | `GET` | `/api/documents/search?q=` | Full-text search. |
294
- | `GET` | `/api/config` | Read config. |
295
- | `PUT` | `/api/config` | Update config (`title`, `theme`, `filenamePattern`, `extraFiles`, `sourceRoot`, `blockedFileExtensions`, …). |
296
- | `GET` | `/api/browse?path=` | List directories and `.md` files at a path. |
297
- | `POST` | `/api/browse/mkdir` | Create a folder under the docs root. |
298
- | `POST` | `/api/images/upload` | Upload a base64 image → `<docs>/images/`. |
299
- | `POST` | `/api/files/upload` | Upload a base64 attachment → `<docs>/files/`. |
300
- | `GET` | `/api/files` | List every attachment (chronological). |
301
- | `PUT` | `/api/files/:filename` | Replace an attachment. |
302
- | `DELETE` | `/api/files/:filename` | Delete an attachment. |
303
- | `GET` | `/api/metadata/:docId` | Reliability report for one doc. |
304
- | `POST` | `/api/metadata/:docId` | Add or replace a binding. |
305
- | `DELETE` | `/api/metadata/:docId` | Remove a binding. |
306
- | `POST` | `/api/metadata/:docId/refresh` | Re-baseline hashes. |
307
- | `GET` | `/api/browse-source?path=` | Navigate the source tree rooted at `sourceRoot`. |
308
- | `GET` | `/api/diagrams` | List saved diagrams. |
309
- | `GET` | `/api/diagrams/:id` | Read a single diagram (nodes + edges). |
310
- | `PUT` | `/api/diagrams/:id` | Create or update a diagram. |
311
- | `DELETE` | `/api/diagrams/:id` | Delete a diagram. |
312
- | `GET` | `/api/shape-libraries` | List custom shape libraries. |
313
- | `PUT` | `/api/shape-libraries/:id` | Save a shape library. |
314
- | `GET` | `/api/annotations[/:docId]` | List annotations (all docs / one doc). |
315
- | `POST` | `/api/annotations/:docId` | Add an annotation. |
316
- | `DELETE` | `/api/annotations/:docId/:id` | Delete one annotation. |
317
- | `POST` | `/api/export/html` | HTML export , Notion / Confluence modes. |
318
- | `POST` | `/api/export/markdown` | Markdown bundle export. |
319
- | `GET` | `/api/wordcloud?path=&ext=` | Recursively concatenate matching source files as raw text. |
320
- | `POST` | `/mcp` | Model Context Protocol endpoint (Streamable HTTP). |
321
- | `GET` | `/mcp` | Live tool + prompt schema summary. |
322
-
323
- </details>
258
+ - a document as printable HTML / browser PDF
259
+ - an HTML bundle for Notion or Confluence
260
+ - a complete Markdown bundle
261
+ - diagrams as images or `.drawio` depending on the case
324
262
 
325
263
  ---
326
264
 
327
- ## Build & test
265
+ ## Local development
328
266
 
329
267
  ```bash
330
268
  git clone https://github.com/craftskillz/living-documentation.git
331
269
  cd living-documentation
332
270
  npm install
333
- npm run setup-hooks # one-time: enable .githooks/ as core.hooksPath
334
- npm run dev -- ./documentation # Vite (UI on :5174, HMR) + Express backend (:4321)
335
- npm run build # tsc (server) + vite build (UI → dist/frontend-svelte)
336
- npm run test:e2e # Playwright end-to-end (~3 s, ~30 MCP specs)
337
- npm run test:coverage # c8 V8-native coverage
271
+ npm run dev -- ./documentation
338
272
  ```
339
273
 
340
- In **dev**, open the UI on **http://localhost:5174** (Vite serves the Svelte app with HMR and proxies `/api`, `/mcp`, `/images`, `/files` to the Express backend on `:4321`).
274
+ In development:
341
275
 
342
- End-to-end tests use **Playwright**. Each test spawns a real CLI child process against a fresh fixture on a random port , no leaking state, runs in parallel. Server-side coverage via **c8** (V8 native, ~72% baseline overall, 83% on `src/routes` and `src/lib`).
276
+ - Vite UI: [http://localhost:5174](http://localhost:5174)
277
+ - Express backend: [http://localhost:4321](http://localhost:4321)
278
+ - Vite proxy: `/api`, `/mcp`, `/images`, `/files`
343
279
 
344
- ### Test the published package locally
280
+ Useful commands:
345
281
 
346
- No need to publish a version. The CLI starts a **single Express server** that serves the pre-built Svelte UI **and** the API/MCP on one port , Vite (`:5174`) is dev-only and does not exist for end users.
282
+ ```bash
283
+ npm run build
284
+ npm run test:e2e
285
+ npm run test:coverage
286
+ npm run setup-hooks
287
+ ```
288
+
289
+ To test the package as it will be published:
347
290
 
348
291
  ```bash
349
- # Run the exact production artifact, then open http://localhost:4321
350
292
  npm run build
351
293
  node dist/bin/cli.js ./documentation
352
294
 
353
- # Most faithful: build the tarball npm would publish (respects "files"), then run it
354
- npm pack # → living-ai-documentation-<version>.tgz
295
+ npm pack
355
296
  npx ./living-ai-documentation-*.tgz ./documentation
356
-
357
- npm pack --dry-run # inspect exactly which files would be published
358
297
  ```
359
298
 
360
- > In production there is no `:5174`. The MCP endpoint clients connect to is **`http://localhost:4321/mcp`** (Express, default port).
299
+ > In production, there is no Vite server on `:5174`. The CLI serves the UI, API, and MCP from Express, on the configured port.
300
+
301
+ ---
361
302
 
362
- ### Contributing
303
+ ## Contributing
304
+
305
+ The repository enforces a bilingual README contract: if you modify `README.md`, you must also update `README.fr.md`, and vice versa.
306
+
307
+ Enable local hooks after cloning:
308
+
309
+ ```bash
310
+ npm run setup-hooks
311
+ ```
363
312
 
364
- This repository ships with a `pre-commit` hook (under `.githooks/`) that enforces the bilingual README contract: if you touch `README.md` you must also touch `README.fr.md`, and vice-versa. Run `npm run setup-hooks` once after cloning to activate it. The same check runs in CI on every PR (see `.github/workflows/readme-sync.yml`), so the rule is enforced even if a contributor forgets the local setup.
313
+ The same check runs in CI through `.github/workflows/readme-sync.yml`.
365
314
 
366
315
  ---
367
316
 
368
317
  ## License
369
318
 
370
- [AGPL-3.0](./LICENSE) , © Youssef MEDAGHRI-ALAOUI.
319
+ [AGPL-3.0](./LICENSE), © Youssef MEDAGHRI-ALAOUI.