@aigne/doc-smith 0.8.3 → 0.8.4
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/.aigne/doc-smith/config.yaml +3 -3
- package/.aigne/doc-smith/preferences.yml +58 -12
- package/.aigne/doc-smith/upload-cache.yaml +600 -207
- package/CHANGELOG.md +10 -0
- package/README.md +77 -5
- package/docs/advanced-how-it-works.md +55 -60
- package/docs/advanced-how-it-works.zh.md +60 -65
- package/docs/advanced-quality-assurance.md +73 -38
- package/docs/advanced-quality-assurance.zh.md +73 -38
- package/docs/advanced.md +2 -14
- package/docs/advanced.zh.md +5 -17
- package/docs/changelog.md +41 -4
- package/docs/changelog.zh.md +77 -40
- package/docs/cli-reference.md +79 -13
- package/docs/cli-reference.zh.md +92 -26
- package/docs/configuration-interactive-setup.md +102 -49
- package/docs/configuration-interactive-setup.zh.md +102 -49
- package/docs/configuration-language-support.md +69 -39
- package/docs/configuration-language-support.zh.md +68 -38
- package/docs/configuration-llm-setup.md +25 -62
- package/docs/configuration-llm-setup.zh.md +25 -62
- package/docs/configuration-preferences.md +79 -67
- package/docs/configuration-preferences.zh.md +78 -67
- package/docs/configuration.md +122 -109
- package/docs/configuration.zh.md +130 -117
- package/docs/features-generate-documentation.md +44 -24
- package/docs/features-generate-documentation.zh.md +52 -32
- package/docs/features-publish-your-docs.md +41 -40
- package/docs/features-publish-your-docs.zh.md +50 -49
- package/docs/features-translate-documentation.md +73 -17
- package/docs/features-translate-documentation.zh.md +76 -20
- package/docs/features-update-and-refine.md +72 -21
- package/docs/features-update-and-refine.zh.md +80 -29
- package/docs/features.md +24 -28
- package/docs/features.zh.md +25 -29
- package/docs/getting-started.md +87 -38
- package/docs/getting-started.zh.md +88 -39
- package/docs/overview.md +17 -35
- package/docs/overview.zh.md +18 -36
- package/package.json +9 -8
- package/prompts/content-detail-generator.md +1 -0
- package/prompts/document/custom-code-block.md +101 -0
- package/prompts/document/d2-chart/rules.md +941 -1031
- package/prompts/document/detail-generator.md +7 -53
- package/tests/kroki-utils.test.mjs +88 -17
- package/utils/constants.mjs +15 -1
- package/utils/kroki-utils.mjs +22 -14
- package/utils/markdown-checker.mjs +1 -1
- package/utils/utils.mjs +3 -2
- package/prompts/document/d2-chart/diy-examples.md +0 -44
- package/prompts/document/d2-chart/shape-rules.md +0 -182
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.4](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.3...v0.8.4) (2025-09-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* parse markdown code blocks into custom x-code element ([#89](https://github.com/AIGNE-io/aigne-doc-smith/issues/89)) ([96ea776](https://github.com/AIGNE-io/aigne-doc-smith/commit/96ea7761299b93ea406abe04193f531fc406ccfa))
|
|
9
|
+
* **utils:** update code block regex to support enhanced attributes ([#92](https://github.com/AIGNE-io/aigne-doc-smith/issues/92)) ([bf1fbab](https://github.com/AIGNE-io/aigne-doc-smith/commit/bf1fbabf193e90a83ed6e83e4ff4c5b3b2930477))
|
|
10
|
+
* **ux:** make background transparent for d2 diagrams ([13eed81](https://github.com/AIGNE-io/aigne-doc-smith/commit/13eed81cb6be13c64ad04c41505d9d76f34d54bb))
|
|
11
|
+
* **ux:** make background transparent for d2 diagrams ([#96](https://github.com/AIGNE-io/aigne-doc-smith/issues/96)) ([13eed81](https://github.com/AIGNE-io/aigne-doc-smith/commit/13eed81cb6be13c64ad04c41505d9d76f34d54bb))
|
|
12
|
+
|
|
3
13
|
## [0.8.3](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.2...v0.8.3) (2025-09-05)
|
|
4
14
|
|
|
5
15
|
|
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ As shown in the diagram, DocSmith integrates seamlessly with other [AIGNE](https
|
|
|
19
19
|
|
|
20
20
|
- **Automated Structure Planning:** Intelligently analyzes your codebase to generate a comprehensive and logical document structure.
|
|
21
21
|
- **AI-Powered Content Generation:** Populates the document structure with detailed, high-quality content.
|
|
22
|
-
- **Multi-Language Support:** Seamlessly translates your documentation into 12
|
|
23
|
-
- **AIGNE Hub Integration:** Use AIGNE Hub as your LLM provider without needing your own API keys, with easy switching between different large language models.
|
|
24
|
-
- **
|
|
22
|
+
- **Multi-Language Support:** Seamlessly translates your documentation into 12 languages including English, Chinese, Japanese, Korean, Spanish, French, German, Portuguese, Russian, Italian, and Arabic.
|
|
23
|
+
- **AIGNE Hub Integration:** Use [AIGNE Hub](https://www.aigne.io/en/hub) as your LLM provider without needing your own API keys, with easy switching between different large language models.
|
|
24
|
+
- **Document Publishing:** Preview your documentation on the official platform at [docsmith.aigne.io](https://docsmith.aigne.io/app/), or publish to your own [Discuss Kit](https://www.arcblock.io/docs/web3-kit/en/discuss-kit) instance for full control.
|
|
25
25
|
- **Document Update Mechanism:** Automatically detects source code changes and updates documentation accordingly.
|
|
26
26
|
- **Individual Document Optimization:** Regenerate and optimize specific documents with targeted feedback.
|
|
27
27
|
|
|
@@ -29,9 +29,81 @@ As shown in the diagram, DocSmith integrates seamlessly with other [AIGNE](https
|
|
|
29
29
|
|
|
30
30
|
### Prerequisites
|
|
31
31
|
|
|
32
|
-
- Node.js and
|
|
32
|
+
- Node.js and npm
|
|
33
33
|
- AIGNE CLI
|
|
34
34
|
|
|
35
|
+
### Node.js Installation
|
|
36
|
+
|
|
37
|
+
#### Windows
|
|
38
|
+
1. Download Node.js installer from [nodejs.org](https://nodejs.org/)
|
|
39
|
+
2. Run the installer (.msi file)
|
|
40
|
+
3. Follow installation wizard steps
|
|
41
|
+
4. Verify installation: `node --version`
|
|
42
|
+
|
|
43
|
+
#### macOS
|
|
44
|
+
**Option 1: Using Homebrew (Recommended)**
|
|
45
|
+
```bash
|
|
46
|
+
# Install Homebrew if not already installed
|
|
47
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
48
|
+
|
|
49
|
+
# Install Node.js
|
|
50
|
+
brew install node
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Option 2: Using the Official Installer**
|
|
54
|
+
1. Download the macOS installer from [nodejs.org](https://nodejs.org/)
|
|
55
|
+
2. Double-click the .pkg file to run the installer
|
|
56
|
+
3. Follow the installation wizard
|
|
57
|
+
4. Verify installation: `node --version`
|
|
58
|
+
|
|
59
|
+
#### Linux
|
|
60
|
+
|
|
61
|
+
**Ubuntu/Debian:**
|
|
62
|
+
```bash
|
|
63
|
+
# Update package index
|
|
64
|
+
sudo apt update
|
|
65
|
+
|
|
66
|
+
# Install Node.js
|
|
67
|
+
sudo apt install nodejs npm
|
|
68
|
+
|
|
69
|
+
# Or install latest LTS version using NodeSource repository
|
|
70
|
+
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
|
|
71
|
+
sudo apt-get install -y nodejs
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**CentOS/RHEL/Fedora:**
|
|
75
|
+
```bash
|
|
76
|
+
# For CentOS/RHEL
|
|
77
|
+
sudo yum install nodejs npm
|
|
78
|
+
|
|
79
|
+
# For Fedora
|
|
80
|
+
sudo dnf install nodejs npm
|
|
81
|
+
|
|
82
|
+
# Or using NodeSource repository
|
|
83
|
+
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
|
|
84
|
+
sudo yum install nodejs
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Using Node Version Manager (nvm) - All Linux Distributions:**
|
|
88
|
+
```bash
|
|
89
|
+
# Install nvm
|
|
90
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|
91
|
+
|
|
92
|
+
# Restart terminal or run:
|
|
93
|
+
source ~/.bashrc
|
|
94
|
+
|
|
95
|
+
# Install latest LTS Node.js
|
|
96
|
+
nvm install --lts
|
|
97
|
+
nvm use --lts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Verification
|
|
101
|
+
After installation on any platform, verify Node.js and npm are installed correctly:
|
|
102
|
+
```bash
|
|
103
|
+
node --version
|
|
104
|
+
npm --version
|
|
105
|
+
```
|
|
106
|
+
|
|
35
107
|
### Installation
|
|
36
108
|
|
|
37
109
|
Install the latest version of AIGNE CLI globally:
|
|
@@ -161,7 +233,7 @@ aigne doc publish
|
|
|
161
233
|
|
|
162
234
|
**Interactive Publishing:** When run `aigne doc publish` will present an interactive menu for you to choose between:
|
|
163
235
|
- **Official Platform:** [docsmith.aigne.io](https://docsmith.aigne.io/app/)
|
|
164
|
-
- **
|
|
236
|
+
- **Own Instance:** Your own deployed [Discuss Kit](https://store.blocklet.dev/blocklets/z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu) instance
|
|
165
237
|
|
|
166
238
|
|
|
167
239
|
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# How It Works
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
8
|
-
|
|
9
|
-
## Architectural Overview
|
|
10
|
-
|
|
11
|
-
DocSmith is an integral part of the AIGNE ecosystem, a comprehensive platform for AI application development. It seamlessly integrates with other AIGNE components, utilizing the platform's core AI capabilities and infrastructure.
|
|
12
|
-
|
|
13
|
-

|
|
3
|
+
AIGNE DocSmith automates documentation using a multi-agent system. Instead of a single AI model, DocSmith orchestrates a pipeline of specialized AI agents, where each agent is an expert in a specific task. This collaborative approach generates structured and detailed documentation directly from your source code.
|
|
14
4
|
|
|
15
5
|
At its core, DocSmith operates as a pipeline, processing your source code through several distinct stages, each managed by one or more dedicated AI agents.
|
|
16
6
|
|
|
@@ -21,72 +11,77 @@ The entire process, from analyzing your code to publishing the final documents,
|
|
|
21
11
|
```d2
|
|
22
12
|
direction: down
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
"Structure Planning": {
|
|
30
|
-
shape: step
|
|
31
|
-
label: "1. Structure Planning"
|
|
14
|
+
Input: {
|
|
15
|
+
label: "Source Code & Config"
|
|
16
|
+
shape: rectangle
|
|
32
17
|
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
Pipeline: {
|
|
20
|
+
label: "Documentation Generation Pipeline"
|
|
21
|
+
shape: rectangle
|
|
22
|
+
grid-columns: 1
|
|
23
|
+
grid-gap: 40
|
|
24
|
+
|
|
25
|
+
Structure-Planning: {
|
|
26
|
+
label: "1. Structure Planning\n(reflective-structure-planner)"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Content-Generation: {
|
|
31
|
+
label: "2. Content Generation\n(content-detail-generator)"
|
|
32
|
+
shape: rectangle
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Saving: {
|
|
36
|
+
label: "3. Save Documents\n(save-docs)"
|
|
37
|
+
shape: rectangle
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
User-Feedback: {
|
|
42
|
+
label: "User Feedback Loop\n(via --feedback flag)"
|
|
43
|
+
shape: rectangle
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
Optional-Steps: {
|
|
47
|
+
label: "Optional Steps"
|
|
48
|
+
shape: rectangle
|
|
49
|
+
grid-columns: 2
|
|
50
|
+
grid-gap: 40
|
|
51
|
+
|
|
52
|
+
Translation: {
|
|
53
|
+
label: "Translate\n(aigne doc translate)"
|
|
54
|
+
shape: rectangle
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Publishing: {
|
|
58
|
+
label: "Publish\n(aigne doc publish)"
|
|
59
|
+
shape: rectangle
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"Publishing": {
|
|
55
|
-
shape: step
|
|
56
|
-
label: "Publishing"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
"Feedback Loop": {
|
|
60
|
-
shape: callout
|
|
61
|
-
label: "User Feedback Loop"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
"Source Code & Config" -> "Structure Planning"
|
|
65
|
-
"Structure Planning" -> "Content Generation"
|
|
66
|
-
"Content Generation" -> "Saving & Output"
|
|
67
|
-
"Saving & Output" -> "Optional Processes"
|
|
68
|
-
|
|
69
|
-
"Optional Processes" -> "Translation": "Translate Docs"
|
|
70
|
-
"Optional Processes" -> "Publishing": "Publish Docs"
|
|
71
|
-
|
|
72
|
-
"Structure Planning" <- "Feedback Loop": "Refine Structure"
|
|
73
|
-
"Content Generation" <- "Feedback Loop": "Regenerate Content"
|
|
63
|
+
Input -> Pipeline.Structure-Planning
|
|
64
|
+
Pipeline.Structure-Planning -> Pipeline.Content-Generation
|
|
65
|
+
Pipeline.Content-Generation -> Pipeline.Saving
|
|
66
|
+
Pipeline.Saving -> Optional-Steps
|
|
74
67
|
|
|
68
|
+
User-Feedback -> Pipeline.Structure-Planning: "Refine Structure"
|
|
69
|
+
User-Feedback -> Pipeline.Content-Generation: "Regenerate Content"
|
|
75
70
|
```
|
|
76
71
|
|
|
77
72
|
1. **Input Analysis**: The process begins with agents like `load-sources` and `load-config`, which gather your source code, configuration files (`aigne.yaml`), and any user-defined rules.
|
|
78
73
|
|
|
79
|
-
2. **Structure Planning**: The `reflective-structure-planner` agent analyzes the codebase to propose a
|
|
74
|
+
2. **Structure Planning**: The `reflective-structure-planner` agent analyzes the codebase to propose a logical document structure. It considers your specified target audience, rules, and feedback to create an optimal outline.
|
|
80
75
|
|
|
81
|
-
3. **Content Generation**: Once the structure is
|
|
76
|
+
3. **Content Generation**: Once the structure is defined, the `content-detail-generator` and `batch-docs-detail-generator` agents take over. They populate each section of the document plan with detailed content, ensuring technical accuracy and adherence to the defined style.
|
|
82
77
|
|
|
83
|
-
4. **Refinement and Updates**: If you provide feedback using `aigne doc update` or `aigne doc generate --feedback`, the `detail-regenerator` and `feedback-refiner` agents are activated. They
|
|
78
|
+
4. **Refinement and Updates**: If you provide feedback using `aigne doc update` or `aigne doc generate --feedback`, the `detail-regenerator` and `feedback-refiner` agents are activated. They update specific documents or adjust the overall structure based on your input.
|
|
84
79
|
|
|
85
80
|
5. **Translation and Publishing**: Finally, optional agents like `translate` and `publish-docs` handle multi-language translation and publishing to Discuss Kit platforms, completing the end-to-end workflow.
|
|
86
81
|
|
|
87
82
|
## Key AI Agents
|
|
88
83
|
|
|
89
|
-
DocSmith's
|
|
84
|
+
DocSmith's functionality comes from its team of specialized agents. While many agents work behind the scenes, here are some of the key players in the documentation pipeline:
|
|
90
85
|
|
|
91
86
|
| Agent Role | Primary Function | Governing File(s) |
|
|
92
87
|
|---|---|---|
|
|
@@ -95,10 +90,10 @@ DocSmith's power comes from its team of specialized agents. While many agents wo
|
|
|
95
90
|
| **Translation Agent** | Translates generated documentation into multiple target languages. | `translate.yaml`, `batch-translate.yaml` |
|
|
96
91
|
| **Refinement Agent** | Regenerates or modifies content and structure based on user feedback. | `detail-regenerator.yaml`, `feedback-refiner.yaml` |
|
|
97
92
|
| **Publishing Agent** | Manages the process of publishing documents to Discuss Kit instances. | `publish-docs.mjs`, `team-publish-docs.yaml` |
|
|
98
|
-
| **Configuration Loader** | Reads and interprets the project's configuration
|
|
93
|
+
| **Configuration Loader** | Reads and interprets the project's configuration and source files. | `load-config.mjs`, `load-sources.mjs` |
|
|
99
94
|
|
|
100
|
-
This modular, agent-based architecture makes DocSmith
|
|
95
|
+
This modular, agent-based architecture makes DocSmith flexible and robust, allowing each step of the process to be optimized independently.
|
|
101
96
|
|
|
102
97
|
---
|
|
103
98
|
|
|
104
|
-
Now that you understand the mechanics behind DocSmith, learn about the measures in place to guarantee
|
|
99
|
+
Now that you understand the mechanics behind DocSmith, learn about the measures in place to guarantee output quality in the [Quality Assurance](./advanced-quality-assurance.md) section.
|
|
@@ -1,104 +1,99 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# 工作原理
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
8
|
-
|
|
9
|
-
## 架构概述
|
|
3
|
+
AIGNE DocSmith 使用一个多 Agent 系统来自动化文档生成。DocSmith 不使用单个 AI 模型,而是协调一个由专业化 AI Agent 组成的流水线,其中每个 Agent 都是特定任务的专家。这种协作方法可以直接从您的源代码生成结构化且详细的文档。
|
|
10
4
|
|
|
11
|
-
DocSmith
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
DocSmith 的核心是一个处理流水线,它将您的源代码经过几个不同阶段的处理,每个阶段都由一个或多个专用的 AI Agent 管理。
|
|
5
|
+
其核心是,DocSmith 作为一个流水线运行,通过几个不同的阶段处理您的源代码,每个阶段都由一个或多个专用的 AI Agent 管理。
|
|
16
6
|
|
|
17
7
|
## 文档生成流水线
|
|
18
8
|
|
|
19
|
-
|
|
9
|
+
从分析代码到发布最终文档的整个过程,都遵循一个结构化的流水线。这确保了一致性,并允许在任何阶段进行有针对性的优化。
|
|
20
10
|
|
|
21
11
|
```d2
|
|
22
12
|
direction: down
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
"Structure Planning": {
|
|
30
|
-
shape: step
|
|
31
|
-
label: "1. 结构规划"
|
|
14
|
+
Input: {
|
|
15
|
+
label: "Source Code & Config"
|
|
16
|
+
shape: rectangle
|
|
32
17
|
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
Pipeline: {
|
|
20
|
+
label: "Documentation Generation Pipeline"
|
|
21
|
+
shape: rectangle
|
|
22
|
+
grid-columns: 1
|
|
23
|
+
grid-gap: 40
|
|
24
|
+
|
|
25
|
+
Structure-Planning: {
|
|
26
|
+
label: "1. Structure Planning\n(reflective-structure-planner)"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Content-Generation: {
|
|
31
|
+
label: "2. Content Generation\n(content-detail-generator)"
|
|
32
|
+
shape: rectangle
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Saving: {
|
|
36
|
+
label: "3. Save Documents\n(save-docs)"
|
|
37
|
+
shape: rectangle
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
User-Feedback: {
|
|
42
|
+
label: "User Feedback Loop\n(via --feedback flag)"
|
|
43
|
+
shape: rectangle
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
Optional-Steps: {
|
|
47
|
+
label: "Optional Steps"
|
|
48
|
+
shape: rectangle
|
|
49
|
+
grid-columns: 2
|
|
50
|
+
grid-gap: 40
|
|
51
|
+
|
|
52
|
+
Translation: {
|
|
53
|
+
label: "Translate\n(aigne doc translate)"
|
|
54
|
+
shape: rectangle
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Publishing: {
|
|
58
|
+
label: "Publish\n(aigne doc publish)"
|
|
59
|
+
shape: rectangle
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"Publishing": {
|
|
55
|
-
shape: step
|
|
56
|
-
label: "发布"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
"Feedback Loop": {
|
|
60
|
-
shape: callout
|
|
61
|
-
label: "用户反馈循环"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
"Source Code & Config" -> "Structure Planning"
|
|
65
|
-
"Structure Planning" -> "Content Generation"
|
|
66
|
-
"Content Generation" -> "Saving & Output"
|
|
67
|
-
"Saving & Output" -> "Optional Processes"
|
|
68
|
-
|
|
69
|
-
"Optional Processes" -> "Translation": "翻译文档"
|
|
70
|
-
"Optional Processes" -> "Publishing": "发布文档"
|
|
71
|
-
|
|
72
|
-
"Structure Planning" <- "Feedback Loop": "优化结构"
|
|
73
|
-
"Content Generation" <- "Feedback Loop": "重新生成内容"
|
|
63
|
+
Input -> Pipeline.Structure-Planning
|
|
64
|
+
Pipeline.Structure-Planning -> Pipeline.Content-Generation
|
|
65
|
+
Pipeline.Content-Generation -> Pipeline.Saving
|
|
66
|
+
Pipeline.Saving -> Optional-Steps
|
|
74
67
|
|
|
68
|
+
User-Feedback -> Pipeline.Structure-Planning: "Refine Structure"
|
|
69
|
+
User-Feedback -> Pipeline.Content-Generation: "Regenerate Content"
|
|
75
70
|
```
|
|
76
71
|
|
|
77
|
-
1. **输入分析**:该过程始于 `load-sources` 和 `load-config` 等 Agent
|
|
72
|
+
1. **输入分析**:该过程始于 `load-sources` 和 `load-config` 等 Agent,它们会收集您的源代码、配置文件(`aigne.yaml`)以及任何用户定义的规则。
|
|
78
73
|
|
|
79
|
-
2. **结构规划**:`reflective-structure-planner` Agent
|
|
74
|
+
2. **结构规划**:`reflective-structure-planner` Agent 会分析代码库,以提出一个逻辑化的文档结构。它会考虑您指定的目标受众、规则和反馈,以创建一个最佳大纲。
|
|
80
75
|
|
|
81
|
-
3.
|
|
76
|
+
3. **内容生成**:一旦结构确定,`content-detail-generator` 和 `batch-docs-detail-generator` Agent 就会接管。它们会用详细内容填充文档计划的每个部分,确保技术准确性并遵循定义的风格。
|
|
82
77
|
|
|
83
|
-
4. **优化与更新**:如果您使用 `aigne doc update` 或 `aigne doc generate --feedback` 提供反馈,`detail-regenerator` 和 `feedback-refiner` Agent
|
|
78
|
+
4. **优化与更新**:如果您使用 `aigne doc update` 或 `aigne doc generate --feedback` 提供反馈,`detail-regenerator` 和 `feedback-refiner` Agent 将被激活。它们会根据您的输入更新特定文档或调整整体结构。
|
|
84
79
|
|
|
85
80
|
5. **翻译与发布**:最后,像 `translate` 和 `publish-docs` 这样的可选 Agent 会处理多语言翻译和发布到 Discuss Kit 平台的工作,从而完成端到端的工作流。
|
|
86
81
|
|
|
87
82
|
## 关键 AI Agent
|
|
88
83
|
|
|
89
|
-
DocSmith
|
|
84
|
+
DocSmith 的功能源于其专业化的 Agent 团队。虽然许多 Agent 在幕后工作,但以下是文档生成流水线中的一些关键角色:
|
|
90
85
|
|
|
91
86
|
| Agent 角色 | 主要功能 | 相关文件 |
|
|
92
87
|
|---|---|---|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
88
|
+
| **Structure Planner** | 分析源代码和规则,生成整体文档大纲。 | `structure-planning.yaml`, `reflective-structure-planner.yaml` |
|
|
89
|
+
| **Content Generator** | 根据计划为每个独立的文档部分撰写详细内容。 | `content-detail-generator.yaml`, `batch-docs-detail-generator.yaml` |
|
|
95
90
|
| **Translation Agent** | 将生成的文档翻译成多种目标语言。 | `translate.yaml`, `batch-translate.yaml` |
|
|
96
91
|
| **Refinement Agent** | 根据用户反馈重新生成或修改内容和结构。 | `detail-regenerator.yaml`, `feedback-refiner.yaml` |
|
|
97
92
|
| **Publishing Agent** | 管理将文档发布到 Discuss Kit 实例的过程。 | `publish-docs.mjs`, `team-publish-docs.yaml` |
|
|
98
|
-
|
|
|
93
|
+
| **Configuration Loader** | 读取并解析项目的配置文件和源文件。 | `load-config.mjs`, `load-sources.mjs` |
|
|
99
94
|
|
|
100
|
-
这种模块化的、基于 Agent
|
|
95
|
+
这种模块化的、基于 Agent 的架构使得 DocSmith 灵活而强大,允许流程中的每一步都能被独立优化。
|
|
101
96
|
|
|
102
97
|
---
|
|
103
98
|
|
|
104
|
-
现在您已经了解了 DocSmith
|
|
99
|
+
现在您已经了解了 DocSmith 背后的工作原理,请在 [质量保证](./advanced-quality-assurance.md) 部分了解为保证输出质量而采取的措施。
|
|
@@ -1,64 +1,99 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Quality Assurance
|
|
6
2
|
|
|
7
|
-
To ensure
|
|
3
|
+
To ensure all generated documentation is functional, clear, and professional, DocSmith incorporates an automated quality assurance process. This process executes a series of checks on the Markdown content to detect and report common issues, from broken links to malformed diagrams, before publication.
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
This automated pipeline validates content structure, links, media, and syntax to maintain a consistent standard of quality.
|
|
10
6
|
|
|
11
7
|
```d2
|
|
12
|
-
direction:
|
|
8
|
+
direction: down
|
|
9
|
+
|
|
10
|
+
Input-Markdown-Content: {
|
|
11
|
+
label: "Input: Markdown Content"
|
|
12
|
+
shape: rectangle
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
QA-Pipeline: {
|
|
16
|
+
label: "QA Pipeline"
|
|
17
|
+
shape: rectangle
|
|
18
|
+
grid-columns: 1
|
|
19
|
+
grid-gap: 50
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
Structural-Checks: {
|
|
22
|
+
label: "Structural Checks"
|
|
23
|
+
shape: rectangle
|
|
24
|
+
grid-columns: 2
|
|
25
|
+
Completeness: "Ensures content is not truncated"
|
|
26
|
+
Code-Blocks: "Validates block syntax & indentation"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Content-Validation: {
|
|
30
|
+
label: "Content Validation"
|
|
31
|
+
shape: rectangle
|
|
32
|
+
grid-columns: 2
|
|
33
|
+
Link-Integrity: "Verifies internal links"
|
|
34
|
+
Image-Paths: "Checks local image existence"
|
|
35
|
+
Table-Formatting: "Matches column counts"
|
|
36
|
+
}
|
|
15
37
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Checks: {
|
|
38
|
+
Syntax-Validation: {
|
|
39
|
+
label: "Syntax Validation"
|
|
40
|
+
shape: rectangle
|
|
20
41
|
grid-columns: 2
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"Markdown Linting": "Table formatting & standard rules"
|
|
42
|
+
D2-Diagrams: "Validates D2 syntax"
|
|
43
|
+
Mermaid-Diagrams: "Validates Mermaid syntax"
|
|
44
|
+
Markdown-Linting: "Enforces style rules"
|
|
25
45
|
}
|
|
26
46
|
}
|
|
27
47
|
|
|
28
|
-
Output:
|
|
48
|
+
Output-Validated-Content-or-Error-Report: {
|
|
49
|
+
label: "Output: Validated Content or Error Report"
|
|
50
|
+
shape: rectangle
|
|
51
|
+
}
|
|
29
52
|
|
|
30
|
-
Input ->
|
|
31
|
-
|
|
53
|
+
Input-Markdown-Content -> QA-Pipeline
|
|
54
|
+
QA-Pipeline -> Output-Validated-Content-or-Error-Report
|
|
32
55
|
```
|
|
33
56
|
|
|
34
|
-
###
|
|
57
|
+
### Core Validation Areas
|
|
58
|
+
|
|
59
|
+
DocSmith's quality assurance process covers several key areas to ensure document integrity.
|
|
60
|
+
|
|
61
|
+
#### Content Structure & Completeness
|
|
35
62
|
|
|
36
|
-
DocSmith
|
|
63
|
+
DocSmith performs several checks to ensure the structural integrity of the content:
|
|
37
64
|
|
|
38
|
-
- **Incomplete Code Blocks**:
|
|
39
|
-
- **
|
|
40
|
-
- **Content
|
|
65
|
+
- **Incomplete Code Blocks**: Detects code blocks that are opened with ```` ``` ```` but never closed.
|
|
66
|
+
- **Missing Line Breaks**: Identifies content that appears on a single line, which may indicate missing newlines.
|
|
67
|
+
- **Content Endings**: Verifies that the content ends with appropriate punctuation (e.g., `.`, `)`, `|`, `>`) to prevent truncated output.
|
|
41
68
|
|
|
42
|
-
|
|
69
|
+
#### Link and Media Integrity
|
|
43
70
|
|
|
44
|
-
|
|
71
|
+
- **Link Integrity**: All relative links within the documentation are validated against the project's `structurePlan` to prevent dead links. This ensures that all internal navigation works as expected. The checker ignores external links (starting with `http://` or `https://`) and `mailto:` links.
|
|
45
72
|
|
|
46
|
-
- **
|
|
47
|
-
- **Local Image Verification**: For local images (i.e., those not hosted on an external server), the system checks that the referenced image file exists at the specified relative or absolute path.
|
|
73
|
+
- **Image Validation**: To avoid broken images, the checker verifies that any local image file referenced in the documentation exists on the file system. It resolves both relative and absolute paths to confirm the file is present. External image URLs and data URLs are not checked.
|
|
48
74
|
|
|
49
|
-
|
|
75
|
+
#### Diagram Syntax Validation
|
|
50
76
|
|
|
51
|
-
|
|
77
|
+
- **D2 Diagrams**: DocSmith validates D2 diagram syntax by sending the code to a rendering service. This process confirms that the diagram can be successfully compiled into an SVG image, catching any syntax errors before they result in a broken graphic.
|
|
52
78
|
|
|
53
|
-
|
|
79
|
+
- **Mermaid Diagrams**: Mermaid diagrams undergo several checks: a primary syntax validation, and specific checks for patterns known to cause rendering issues, such as backticks or numbered lists within node labels, and unquoted special characters that require quotes.
|
|
54
80
|
|
|
55
|
-
|
|
81
|
+
#### Formatting and Style Enforcement
|
|
56
82
|
|
|
57
|
-
|
|
83
|
+
- **Table Formatting**: Tables are inspected for mismatched column counts between the header, the separator line, and the data rows. This check prevents common table rendering failures.
|
|
84
|
+
|
|
85
|
+
- **Code Block Indentation**: The checker analyzes code blocks for inconsistent indentation. If a line of code has less indentation than the opening ```` ``` ```` marker, it can cause rendering problems. This check helps maintain correct code presentation.
|
|
86
|
+
|
|
87
|
+
- **Markdown Linting**: A built-in linter enforces a consistent Markdown structure. Key rules include:
|
|
88
|
+
|
|
89
|
+
| Rule ID | Description |
|
|
58
90
|
|---|---|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
91
|
+
| `no-duplicate-headings` | Prevents multiple headings with the same content in the same section. |
|
|
92
|
+
| `no-undefined-references` | Ensures all link and image references are defined. |
|
|
93
|
+
| `no-heading-content-indent` | Disallows indentation before heading content. |
|
|
94
|
+
| `no-multiple-toplevel-headings` | Allows only one top-level heading (H1) per document. |
|
|
95
|
+
| `code-block-style` | Enforces a consistent style for code blocks (e.g., using backticks). |
|
|
96
|
+
|
|
97
|
+
By automating these checks, DocSmith maintains a consistent standard for documentation, ensuring the final output is accurate and navigable.
|
|
63
98
|
|
|
64
|
-
|
|
99
|
+
To learn more about the overall architecture, see the [How It Works](./advanced-how-it-works.md) section.
|