Skip to content

Commit b8144fa

Browse files
committed
Update docs
1 parent a1bbeff commit b8144fa

9 files changed

Lines changed: 136 additions & 18 deletions

File tree

docmd-main/v08/de/guides/ai-optimisation/mcp-and-agent-skills.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ Fügen Sie in den MCP-Einstellungen Ihres Editors einen neuen Server mit dem `st
3737
Sobald die Verbindung steht, stehen dem Agenten die folgenden Tools zur Verfügung:
3838

3939
1. `search_docs(query)`: Führt eine Workspace-weite Volltextsuche durch.
40-
2. `read_doc(route)`: Ruft den rohen Markdown-Inhalt einer bestimmten Route ab.
41-
3. `validate_docs()`: Lintet die gesamte Dokumentation und gibt Validierungsfehler zurück (z. B. defekte Links).
42-
4. `get_llms_context()`: Ruft die konsolidierte `llms-full.txt`-Kontextdatei ab.
40+
2. `list_docs(subdir?)`: Listet alle Markdown-Dateien im Projekt auf, optional beschränkt auf ein Unterverzeichnis (eine Locale, eine Version, ein Guide-Abschnitt). Damit kann der Agent den Dokumentationsbaum navigieren, bevor er einzelne Dateien liest.
41+
3. `read_doc(route)`: Ruft den rohen Markdown-Inhalt einer bestimmten Route ab. Die Route muss innerhalb des Projekt-Wurzelverzeichnisses aufgelöst werden.
42+
4. `get_config()`: Liefert die aufgelöste `docmd.config` — Titel, Quell- und Ausgabeverzeichnisse, Locales, Versionen und aktivierte Plugins. Sensible Werte (API-Schlüssel, Analytics-IDs) werden aus der Antwort entfernt.
43+
5. `validate_docs()`: Lintet die gesamte Dokumentation und gibt Validierungsfehler zurück (z. B. defekte Links).
44+
6. `get_llms_context()`: Ruft die konsolidierte `llms-full.txt`-Kontextdatei ab.
4345

4446
## Agent Skills (`SKILL.md`) nutzen
4547

docmd-main/v08/de/reference/mcp-server.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ Fügen Sie dies zu den MCP-Einstellungen Ihres Editors hinzu:
4646

4747
## Verfügbare Tools
4848

49-
Der MCP-Server stellt vier Tools bereit, die Agenten aufrufen können:
49+
Der MCP-Server stellt sechs Tools bereit, die Agenten aufrufen können:
5050

5151
| Tool | Beschreibung |
5252
| :--- | :--- |
5353
| **`search_docs`** | Volltextsuche über alle Dokumentations-Dateien. Gibt passende Zeilen mit Dateipfaden und Zeilennummern zurück. |
54-
| **`read_doc`** | Liest den rohen Markdown-Inhalt einer beliebigen Dokumentations-Datei über ihren relativen Pfad. |
54+
| **`list_docs`** | Listet alle Markdown-Dateien im Projekt auf (optional beschränkt auf ein Unterverzeichnis wie eine Locale oder Version). Gibt relative Pfade zurück, damit der Agent den Dokumentationsbaum navigieren kann, bevor er einzelne Dateien liest. |
55+
| **`read_doc`** | Liest den rohen Markdown-Inhalt einer beliebigen Dokumentations-Datei über ihren relativen Pfad. Der Pfad ist auf das Projekt-Wurzelverzeichnis beschränkt. |
56+
| **`get_config`** | Ruft die aufgelöste `docmd.config` ab — Titel, Quell-/Ausgabeverzeichnisse, konfigurierte Locales, Versionen und aktivierte Plugins. Sensible Werte (API-Schlüssel, Analytics-IDs) werden aus der Antwort entfernt. |
5557
| **`validate_docs`** | Führt eine Link-Validierung über alle Markdown-Dateien aus. Gibt eine Liste defekter Links mit Datei, Zeile und Ziel zurück. |
5658
| **`get_llms_context`** | Ruft den vollständigen `llms-full.txt`-Kontext ab — die vereinte Inhaltsdarstellung der gesamten Dokumentations-Site, optimiert für die LLM-Ingestion. |
5759

@@ -72,6 +74,20 @@ Der MCP-Server stellt vier Tools bereit, die Agenten aufrufen können:
7274
}
7375
```
7476

77+
#### `list_docs`
78+
79+
```json
80+
{
81+
"name": "list_docs",
82+
"inputSchema": {
83+
"type": "object",
84+
"properties": {
85+
"subdir": { "type": "string", "description": "Optionales Unterverzeichnis zur Einschränkung der Auflistung (z. B. 'en', 'v1', 'guides'). Der Pfad ist auf das konfigurierte Quellverzeichnis beschränkt." }
86+
}
87+
}
88+
}
89+
```
90+
7591
#### `read_doc`
7692

7793
```json
@@ -80,13 +96,25 @@ Der MCP-Server stellt vier Tools bereit, die Agenten aufrufen können:
8096
"inputSchema": {
8197
"type": "object",
8298
"properties": {
83-
"route": { "type": "string", "description": "Relativer Pfad zur Markdown-Datei (z. B. docs/getting-started.md)." }
99+
"route": { "type": "string", "description": "Relativer Pfad zur Markdown-Datei (z. B. docs/getting-started.md). Muss innerhalb des Projekt-Wurzelverzeichnisses aufgelöst werden." }
84100
},
85101
"required": ["route"]
86102
}
87103
}
88104
```
89105

106+
#### `get_config`
107+
108+
```json
109+
{
110+
"name": "get_config",
111+
"inputSchema": {
112+
"type": "object",
113+
"properties": {}
114+
}
115+
}
116+
```
117+
90118
#### `validate_docs` / `get_llms_context`
91119

92120
Keine Eingabeparameter erforderlich.

docmd-main/v08/de/release-notes/0-8-10.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Die TUI-Zeile zeigt `Stopped ... PID gracefully` bei sauberem Exit oder `Killed
155155
- **llms.txt / llms.json-Titel werden bereinigt.** Frontmatter-Titel, die Markdown-Injection-Zeichen (`` ` ``, `[`, `]`, Zeilenumbrüche) enthalten, brechen die Linkform nicht mehr und werden nicht mehr als rohes HTML gerendert; Titel, die mit `=`, `+`, `-` oder `@` beginnen, erhalten ein vorangestelltes einfaches Anführungszeichen, damit das Öffnen in einer Tabellenkalkulation keine Formel ausführt. CSV-Formel-Neutralisierung (T-Z11) und Markdown-Injection-Verhinderung (T-Z10) in einem Helfer.
156156
- **`NO_COLOR` und `DOCMD_NO_BANNER` unterdrücken das Build-Banner.** Das Setzen von `NO_COLOR=1` (oder des docmd-spezifischen `DOCMD_NO_BANNER=1`) blendet jetzt das ASCII-Art und die Versionszeile am Anfang der Build-Ausgabe aus. `NO_COLOR` ist der De-facto-Standard für CLIs; `DOCMD_NO_BANNER` ist eine docmd-spezifische Hintertür für Anwender, die Farbe, aber kein Banner möchten (N-13 + N-16).
157157
- **Migrations-Feinschliff.** `moveFilesToBackup` behält nun Lockfiles und `package.json` an Ort und Stelle, sodass eine Wiederherstellung nicht jede Abhängigkeit neu auflösen muss (N-10). Die Docusaurus- und MkDocs-Migratoren erhalten das ursprüngliche `staticDir` / `site_dir` (N-22), und MkDocs-`nav:`-Blöcke werden in docmds `navigation`-Format übersetzt, wobei mehrstufige Abschnitte über `children` erhalten bleiben (N-9).
158+
- **MCP: `prompts/list` gibt eine leere Liste statt "Method not found" zurück.** Der Server deklariert die `prompts`-Capability in `initialize` zur Vorwärtskompatibilität, hatte aber keinen Handler. MCP-Clients, die die Capability-Bekanntmachung respektieren, erhalten nun `{ prompts: [] }` statt eines Unhandled-Method-Fehlers.
158159

159160
### Changelog
160161

@@ -168,6 +169,7 @@ Die TUI-Zeile zeigt `Stopped ... PID gracefully` bei sauberem Exit oder `Killed
168169
7. **Migrate**: der `--upgrade`-Pfad in `packages/core/src/commands/migrate.ts` behandelt jetzt acht zusätzliche Legacy-Schlüssel: `source`, `outDir`, `nav`, top-level `search`, top-level `sidebar`, `theme.defaultMode`, `theme.enableModeToggle` und `theme.positionMode` (N-4).
169170
8. **Tests**: `tests/cli-contracts/validate-workspace.test.js` fügt 5 neue M-2-Assertions hinzu, die den Exit-Code und die vier Meldungsinhalt-Invarianten abdecken.
170171
9. **Tests**: `tests/cli-contracts/plugin-add-remove.test.js` fügt 3 neue M-14-Assertions hinzu, die die Meldung "already installed", das Fehlen der falschen Erfolgsmeldung und den Regressionsschutz für Neuinstallationen abdecken.
172+
10. **MCP-Server**: `runMcpServer` in `packages/core/src/commands/mcp.ts` ergänzt die Tools `list_docs` (Dateilisting, abgesicherter `subdir`) und `get_config` (sichere Konfigurations-Zusammenfassung) sowie einen `prompts/list`-Handler, der `{ prompts: [] }` zurückgibt. `tools/list` bewirbt nun sechs Tools.
171173
10. **Tests**: neue `tests/cli-contracts/deploy.test.js` (5 Assertions, registriert in `tests/runner.js` als `deploy`) decken die Pfade N-2 Überspringen / Überschreiben / Neu ab.
172174
11. **Tests**: neue `tests/cli-contracts/stop.test.js` (3 Assertions, registriert als `stop`) decken den M-11-Helfer `waitForExit` gegen laufende Kindprozesse ab.
173175
12. **Tests**: neue `tests/cli-contracts/migrate.test.js` (33 Assertions, registriert als `migrate`) decken N-3 Dry-Run sowohl für Quell-Migrationen als auch für Upgrade ab, sowie N-4-Abdeckung aller 13 Legacy-Upgrade-Pfade.

docmd-main/v08/en/guides/ai-optimisation/mcp-and-agent-skills.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ In your editor's MCP settings panel, add a new server using the `stdio` transpor
3737
Once connected, the following tools become available to the agent:
3838

3939
1. `search_docs(query)`: Performs a workspace-wide full-text search.
40-
2. `read_doc(route)`: Retrieves the raw Markdown contents of a specific route.
41-
3. `validate_docs()`: Lints the entire documentation and returns validation errors (e.g., broken links).
42-
4. `get_llms_context()`: Fetches the consolidated `llms-full.txt` context file.
40+
2. `list_docs(subdir?)`: Lists every markdown file in the project, optionally scoped to a subdirectory (a locale, a version, a guide section). Use this to navigate the docs tree before reading individual files.
41+
3. `read_doc(route)`: Retrieves the raw Markdown contents of a specific route. The route must resolve inside the project root.
42+
4. `get_config()`: Returns the resolved `docmd.config` — title, source and output directories, locales, versions, and enabled plugins. Sensitive values (API keys, analytics IDs) are stripped from the response.
43+
5. `validate_docs()`: Lints the entire documentation and returns validation errors (e.g., broken links).
44+
6. `get_llms_context()`: Fetches the consolidated `llms-full.txt` context file.
4345

4446
## Leveraging Agent Skills (`SKILL.md`)
4547

docmd-main/v08/en/reference/mcp-server.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ Add to your editor's MCP settings:
4646

4747
## Available Tools
4848

49-
The MCP server exposes four tools that agents can call:
49+
The MCP server exposes six tools that agents can call:
5050

5151
| Tool | Description |
5252
| :--- | :--- |
5353
| **`search_docs`** | Full-text search across all documentation files. Returns matching lines with file paths and line numbers. |
54-
| **`read_doc`** | Read the raw markdown content of any documentation file by its relative path. |
54+
| **`list_docs`** | List every markdown file in the project (optionally scoped to a subdirectory such as a locale or version). Returns relative paths so the agent can navigate the docs tree before reading individual files. |
55+
| **`read_doc`** | Read the raw markdown content of any documentation file by its relative path. Path is sandboxed to the project root. |
56+
| **`get_config`** | Retrieve the resolved `docmd.config` — title, source/output directories, configured locales, versions, and enabled plugins. Sensitive values (API keys, analytics IDs) are stripped from the response. |
5557
| **`validate_docs`** | Run link validation across all markdown files. Returns a list of broken links with file, line, and target. |
5658
| **`get_llms_context`** | Retrieve the complete `llms-full.txt` context — the unified content of the entire documentation site, optimised for LLM ingestion. |
5759

@@ -72,6 +74,20 @@ The MCP server exposes four tools that agents can call:
7274
}
7375
```
7476

77+
#### `list_docs`
78+
79+
```json
80+
{
81+
"name": "list_docs",
82+
"inputSchema": {
83+
"type": "object",
84+
"properties": {
85+
"subdir": { "type": "string", "description": "Optional subdirectory to scope the listing (e.g. 'en', 'v1', 'guides'). Path is sandboxed to the configured source directory." }
86+
}
87+
}
88+
}
89+
```
90+
7591
#### `read_doc`
7692

7793
```json
@@ -80,13 +96,25 @@ The MCP server exposes four tools that agents can call:
8096
"inputSchema": {
8197
"type": "object",
8298
"properties": {
83-
"route": { "type": "string", "description": "Relative path to the markdown file (e.g. docs/getting-started.md)." }
99+
"route": { "type": "string", "description": "Relative path to the markdown file (e.g. docs/getting-started.md). Must resolve inside the project root." }
84100
},
85101
"required": ["route"]
86102
}
87103
}
88104
```
89105

106+
#### `get_config`
107+
108+
```json
109+
{
110+
"name": "get_config",
111+
"inputSchema": {
112+
"type": "object",
113+
"properties": {}
114+
}
115+
}
116+
```
117+
90118
#### `validate_docs` / `get_llms_context`
91119

92120
No input parameters required.

docmd-main/v08/en/release-notes/0-8-10.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ This release is a developer-experience pass on the CLI after the 0.8.8 hardening
1010

1111
No public API changes. No breaking config changes. Purely a developer-experience release.
1212

13+
### 🔌 MCP server gets two new tools
14+
15+
The `docmd mcp` server now exposes six tools (was four) and ships a working `prompts/list` handler so MCP clients that respect the declared `prompts` capability get a clean empty list instead of a "method not found" error.
16+
17+
Two new tools:
18+
19+
- **`list_docs(subdir?)`** — Lists every markdown file in the project, optionally scoped to a subdirectory (a locale, a version, a guide section). Returns relative paths so the agent can navigate the docs tree before reading individual files. The `subdir` argument is sandboxed through the same `safePath` boundary that protects `read_doc`.
20+
- **`get_config()`** — Returns the resolved `docmd.config` as a JSON object: title, source and output directories, configured locales, versions, and the list of enabled plugins. Sensitive values (API keys, analytics IDs) are reconstructed into a safe summary — raw secrets are never returned.
21+
22+
Together with the existing `search_docs`, `read_doc`, `validate_docs`, and `get_llms_context`, an agent can now explore the project structure (`get_config``list_docs``read_doc`) without first guessing paths or doing blind `search_docs` calls.
23+
1324
### 🧪 `migrate --dry-run` for every migration path
1425

1526
`docmd migrate --dry-run` is now a real flag for every supported source (Docusaurus, MkDocs, VitePress, Starlight) and for the in-place `--upgrade` path. Dry-run prints what would change and exits 0 without writing anything:
@@ -155,6 +166,7 @@ The TUI line shows `Stopped ... PID gracefully` for a clean exit, or `Killed ...
155166
- **llms.txt / llms.json titles are sanitised.** Frontmatter titles containing markdown injection chars (`` ` ``, `[`, `]`, newlines) no longer break the link form or render as raw HTML, and titles starting with `=`, `+`, `-`, or `@` are prefixed with a single-quote so opening the file in a spreadsheet does not execute a formula. CSV formula neutralisation (T-Z11) and markdown injection prevention (T-Z10) in one helper.
156167
- **`NO_COLOR` and `DOCMD_NO_BANNER` suppress the build banner.** Setting `NO_COLOR=1` (or the docmd-specific `DOCMD_NO_BANNER=1`) now hides the ASCII art and version line at the top of the build output. `NO_COLOR` is the de-facto standard for CLIs; `DOCMD_NO_BANNER` is a docmd-specific escape hatch for users who want colour but no banner (N-13 + N-16).
157168
- **Migration polish.** `moveFilesToBackup` now keeps lockfiles and `package.json` in place so a recovery doesn't have to re-resolve every dependency (N-10). The Docusaurus and MkDocs migrators preserve the original `staticDir` / `site_dir` (N-22) and MkDocs `nav:` blocks are translated to docmd's `navigation` format with multi-level sections preserved via `children` (N-9).
169+
- **MCP: `prompts/list` returns an empty list instead of "method not found".** The server declares `prompts` capability in `initialize` for forward compatibility, but had no handler. MCP clients honouring the capability advertisement now get `{ prompts: [] }` instead of an unhandled-method error.
158170

159171
### Changelog
160172

@@ -167,6 +179,7 @@ The TUI line shows `Stopped ... PID gracefully` for a clean exit, or `Killed ...
167179
6. **Migrate**: `migrateProject` in `packages/core/src/commands/migrate.ts` accepts a new `dryRun` option (N-3). For every source path (Docusaurus, MkDocs, VitePress, Starlight) the dry-run prints the file move list and the new `docmd.config.js` before any side effects; for `--upgrade` it prints the upgraded config. `packages/core/src/bin/docmd.ts` adds `--dry-run` to the migrate CLI.
168180
7. **Migrate**: the `--upgrade` path in `packages/core/src/commands/migrate.ts` now handles eight additional legacy keys: `source`, `outDir`, `nav`, top-level `search`, top-level `sidebar`, `theme.defaultMode`, `theme.enableModeToggle`, and `theme.positionMode` (N-4).
169181
8. **Tests**: `tests/cli-contracts/validate-workspace.test.js` adds 5 new M-2 assertions covering the exit code and the four message-content invariants.
182+
10. **MCP server**: `runMcpServer` in `packages/core/src/commands/mcp.ts` adds `list_docs` (file listing, sandboxed `subdir`) and `get_config` (safe config summary) tools, and a `prompts/list` handler returning `{ prompts: [] }`. `tools/list` now advertises six tools.
170183
9. **Tests**: `tests/cli-contracts/plugin-add-remove.test.js` adds 3 new M-14 assertions covering the already-installed message, the absence of the false success message, and the regression guard for fresh installs.
171184
10. **Tests**: new `tests/cli-contracts/deploy.test.js` (5 assertions, registered in `tests/runner.js` as `deploy`) covers the N-2 skip / overwrite / fresh paths.
172185
11. **Tests**: new `tests/cli-contracts/stop.test.js` (3 assertions, registered as `stop`) covers the M-11 `waitForExit` helper against live child processes.

docmd-main/v08/zh/guides/ai-optimisation/mcp-and-agent-skills.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ Model Context Protocol 将 LLM 环境直接连接到您本地工作区的工具
3737
连接成功后,以下工具将对 Agent 可用:
3838

3939
1. `search_docs(query)`:执行工作区范围的全文本搜索。
40-
2. `read_doc(route)`:获取指定路由的原始 Markdown 内容。
41-
3. `validate_docs()`:对整个文档进行 lint 检查,并返回校验错误(例如断链)。
42-
4. `get_llms_context()`:获取合并后的 `llms-full.txt` 上下文文件。
40+
2. `list_docs(subdir?)`:列出项目中的全部 Markdown 文件,可选择限定到某个子目录(如某个 locale、版本或指南小节)。让 Agent 在读取单文件前能够先浏览整个文档树。
41+
3. `read_doc(route)`:获取指定路由的原始 Markdown 内容。路径必须在项目根目录之内解析。
42+
4. `get_config()`:返回已解析的 `docmd.config` —— 标题、源/输出目录、locale、版本、已启用的插件。敏感字段(API 密钥、analytics ID)会在响应中被剔除。
43+
5. `validate_docs()`:对整个文档进行 lint 检查,并返回校验错误(例如断链)。
44+
6. `get_llms_context()`:获取合并后的 `llms-full.txt` 上下文文件。
4345

4446
## 利用 Agent Skills (`SKILL.md`)
4547

docmd-main/v08/zh/reference/mcp-server.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ docmd mcp
4646

4747
## 可用工具
4848

49-
MCP 服务器向 Agent 暴露四个工具
49+
MCP 服务器向 Agent 暴露六个工具
5050

5151
| 工具 | 说明 |
5252
| :--- | :--- |
5353
| **`search_docs`** | 在所有文档文件中进行全文搜索。返回匹配行及其文件路径和行号。 |
54-
| **`read_doc`** | 读取任意文档文件的原始 Markdown 内容(按相对路径)。 |
54+
| **`list_docs`** | 列出项目中的全部 Markdown 文件(可选择限定到某个子目录,如某个 locale 或版本)。返回相对路径,让 Agent 在读取单文件前能够先浏览整个文档树。 |
55+
| **`read_doc`** | 读取任意文档文件的原始 Markdown 内容(按相对路径)。路径被沙箱化到项目根目录之内。 |
56+
| **`get_config`** | 拉取已解析的 `docmd.config` —— 标题、源/输出目录、已配置的 locale、版本、已启用的插件。敏感字段(API 密钥、analytics ID)会在响应中被剔除。 |
5557
| **`validate_docs`** | 跨所有 Markdown 文件执行链接校验,返回失效链接的列表(含文件、行号、目标)。 |
5658
| **`get_llms_context`** | 拉取完整的 `llms-full.txt` 上下文 —— 整个文档站点内容的统一聚合,已为 LLM 摄取优化。 |
5759

@@ -72,6 +74,20 @@ MCP 服务器向 Agent 暴露四个工具:
7274
}
7375
```
7476

77+
#### `list_docs`
78+
79+
```json
80+
{
81+
"name": "list_docs",
82+
"inputSchema": {
83+
"type": "object",
84+
"properties": {
85+
"subdir": { "type": "string", "description": "可选的子目录,用于把列表限定到其中(如 'en'、'v1'、'guides')。路径被沙箱化到已配置的源目录之内。" }
86+
}
87+
}
88+
}
89+
```
90+
7591
#### `read_doc`
7692

7793
```json
@@ -80,13 +96,25 @@ MCP 服务器向 Agent 暴露四个工具:
8096
"inputSchema": {
8197
"type": "object",
8298
"properties": {
83-
"route": { "type": "string", "description": "Markdown 文件的相对路径(例如 docs/getting-started.md)。" }
99+
"route": { "type": "string", "description": "Markdown 文件的相对路径(例如 docs/getting-started.md)。必须在项目根目录之内解析。" }
84100
},
85101
"required": ["route"]
86102
}
87103
}
88104
```
89105

106+
#### `get_config`
107+
108+
```json
109+
{
110+
"name": "get_config",
111+
"inputSchema": {
112+
"type": "object",
113+
"properties": {}
114+
}
115+
}
116+
```
117+
90118
#### `validate_docs` / `get_llms_context`
91119

92120
无需任何入参。

0 commit comments

Comments
 (0)