@aigne/doc-smith 0.8.10-beta → 0.8.10-beta.1

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 (45) hide show
  1. package/.aigne/doc-smith/config.yaml +3 -1
  2. package/.aigne/doc-smith/preferences.yml +4 -4
  3. package/.aigne/doc-smith/upload-cache.yaml +180 -0
  4. package/.release-please-manifest.json +1 -1
  5. package/CHANGELOG.md +13 -0
  6. package/README.md +2 -2
  7. package/RELEASE.md +3 -3
  8. package/agents/generate/check-need-generate-structure.mjs +40 -18
  9. package/agents/generate/index.yaml +1 -0
  10. package/agents/generate/user-review-document-structure.mjs +168 -0
  11. package/agents/update/generate-and-translate-document.yaml +3 -3
  12. package/agents/utils/check-feedback-refiner.mjs +2 -0
  13. package/agents/utils/save-docs.mjs +16 -22
  14. package/aigne.yaml +1 -0
  15. package/docs/advanced-how-it-works.md +26 -24
  16. package/docs/advanced-how-it-works.zh.md +32 -30
  17. package/docs/advanced-quality-assurance.md +6 -9
  18. package/docs/advanced-quality-assurance.zh.md +19 -22
  19. package/docs/cli-reference.md +35 -76
  20. package/docs/cli-reference.zh.md +48 -89
  21. package/docs/configuration-interactive-setup.md +18 -18
  22. package/docs/configuration-interactive-setup.zh.md +33 -33
  23. package/docs/configuration-language-support.md +12 -12
  24. package/docs/configuration-language-support.zh.md +20 -20
  25. package/docs/configuration-llm-setup.md +14 -13
  26. package/docs/configuration-llm-setup.zh.md +16 -15
  27. package/docs/configuration-preferences.md +22 -27
  28. package/docs/configuration-preferences.zh.md +35 -40
  29. package/docs/configuration.md +31 -45
  30. package/docs/configuration.zh.md +48 -62
  31. package/docs/features-generate-documentation.md +6 -7
  32. package/docs/features-generate-documentation.zh.md +21 -22
  33. package/docs/features-publish-your-docs.md +38 -30
  34. package/docs/features-publish-your-docs.zh.md +45 -37
  35. package/docs/features-translate-documentation.md +14 -74
  36. package/docs/features-translate-documentation.zh.md +19 -79
  37. package/docs/features-update-and-refine.md +19 -18
  38. package/docs/features-update-and-refine.zh.md +33 -32
  39. package/docs-mcp/get-docs-structure.mjs +1 -1
  40. package/package.json +2 -2
  41. package/prompts/detail/document-rules.md +1 -1
  42. package/prompts/structure/check-document-structure.md +11 -15
  43. package/tests/agents/generate/check-need-generate-structure.test.mjs +21 -24
  44. package/tests/agents/generate/user-review-document-structure.test.mjs +294 -0
  45. package/utils/auth-utils.mjs +2 -2
@@ -1,17 +1,18 @@
1
1
  # LLM Setup
2
2
 
3
- AIGNE DocSmith uses Large Language Models (LLMs) to generate documentation content. The tool provides two primary methods for configuring your AI model provider: using the integrated AIGNE Hub for a streamlined experience, or connecting your own custom API keys for direct provider access.
3
+ AIGNE DocSmith uses Large Language Models (LLMs) to generate documentation content. You can configure the AI model provider in two ways: using the integrated AIGNE Hub, or by connecting your own custom API keys.
4
4
 
5
5
  ## AIGNE Hub (Recommended)
6
6
 
7
- The simplest way to get started is with AIGNE Hub. It acts as a gateway to multiple LLM providers, offering two key advantages:
7
+ The most direct way to start is with AIGNE Hub. It functions as a gateway to multiple LLM providers, offering two main benefits:
8
8
 
9
- - **No API Key Required:** Generate documents without needing to manage your own API keys or service subscriptions.
10
- - **Easy Model Switching:** Change the AI model for any command using a simple flag.
9
+ - **No API Key Required:** You can generate documents without managing your own API keys or service subscriptions.
10
+ - **Easy Model Switching:** You can change the AI model for any command by using the `--model` flag.
11
11
 
12
12
  To use a specific model through AIGNE Hub, add the `--model` flag to your command. Here are a few examples:
13
13
 
14
- ```bash Use Google's Gemini 2.5 Flash model
14
+ ```bash Using Different Models via AIGNE Hub icon=mdi:code-braces
15
+ # Use Google's Gemini 2.5 Flash model
15
16
  aigne doc generate --model google:gemini-2.5-flash
16
17
 
17
18
  # Use Anthropic's Claude 3.5 Sonnet model
@@ -21,33 +22,33 @@ aigne doc generate --model claude:claude-3-5-sonnet
21
22
  aigne doc generate --model openai:gpt-4o
22
23
  ```
23
24
 
24
- If you don't specify a model, DocSmith will use the default model defined in your project's configuration.
25
+ If you do not specify a model, DocSmith will use the default model defined in your project's configuration.
25
26
 
26
27
  ## Using Custom API Keys
27
28
 
28
- If you prefer to use your own accounts with providers like OpenAI or Anthropic, you can configure DocSmith with your personal API keys. This gives you direct control over API usage and billing.
29
+ If you prefer to use your own accounts with providers like OpenAI or Anthropic, you can configure DocSmith with your personal API keys. This method gives you direct control over API usage and billing.
29
30
 
30
- Configuration is handled through an interactive wizard. To launch it, run:
31
+ Configuration is handled through an interactive wizard. To launch it, run the following command:
31
32
 
32
33
  ```bash
33
34
  aigne doc init
34
35
  ```
35
36
 
36
- The wizard will prompt you to select your provider and enter your credentials. For a complete guide, please see the [Interactive Setup](./configuration-interactive-setup.md) documentation.
37
+ The wizard will prompt you to select your provider and enter your credentials. For a complete guide, refer to the [Interactive Setup](./configuration-interactive-setup.md) documentation.
37
38
 
38
39
  ## Setting a Default Model
39
40
 
40
- To ensure consistency across all documentation generation tasks, you can set a default LLM in your project's `aigne.yaml` configuration file. This model will be used automatically unless you override it with the `--model` flag.
41
+ To maintain consistency across all documentation generation tasks, you can set a default LLM in your project's `aigne.yaml` configuration file. This model will be used for any command that does not include the `--model` flag.
41
42
 
42
- ```yaml aigne.yaml icon=mdi:file-document
43
+ ```yaml aigne.yaml icon=mdi:file-code
43
44
  chat_model:
44
45
  provider: google
45
46
  name: gemini-2.5-pro
46
47
  temperature: 0.8
47
48
  ```
48
49
 
49
- In this configuration, DocSmith defaults to using Google's `gemini-2.5-pro` model with a `temperature` of `0.8` for all generation tasks.
50
+ In this example, DocSmith is configured to use Google's `gemini-2.5-pro` model with a `temperature` setting of `0.8` by default.
50
51
 
51
52
  ---
52
53
 
53
- Now that your LLM provider is configured, you can explore how to manage translations for your documentation. Proceed to the [Language Support](./configuration-language-support.md) guide to see the full list of supported languages and learn how to enable them.
54
+ With your LLM provider configured, you are ready to manage language settings for your documentation. Proceed to the [Language Support](./configuration-language-support.md) guide to see the full list of supported languages and learn how to enable them.
@@ -1,17 +1,18 @@
1
1
  # LLM 设置
2
2
 
3
- AIGNE DocSmith 使用大型语言模型 (LLMs) 生成文档内容。该工具提供两种配置 AI 模型提供商的主要方法:使用集成的 AIGNE Hub 以获得简化的体验,或连接你自己的自定义 API 密钥以直接访问提供商。
3
+ AIGNE DocSmith 使用大语言模型 (LLM) 生成文档内容。你可以通过两种方式配置 AI 模型提供商:使用集成的 AIGNE Hub,或连接你自己的自定义 API 密钥。
4
4
 
5
- ## AIGNE Hub (推荐)
5
+ ## AIGNE Hub(推荐)
6
6
 
7
- 最简单的入门方法是使用 AIGNE Hub。它充当多个 LLM 提供商的网关,提供两大关键优势:
7
+ 最直接的入门方式是使用 AIGNE Hub。它作为一个通往多个 LLM 提供商的网关,提供两大主要优势:
8
8
 
9
- - **无需 API 密钥:** 无需管理自己的 API 密钥或服务订阅即可生成文档。
10
- - **轻松切换模型:** 使用一个简单的标志即可为任何命令更改 AI 模型。
9
+ - **无需 API 密钥:** 你无需管理自己的 API 密钥或服务订阅即可生成文档。
10
+ - **轻松切换模型:** 你可以通过使用 `--model` 标志为任何命令更改 AI 模型。
11
11
 
12
- 要通过 AIGNE Hub 使用特定模型,请在命令中添加 `--model` 标志。以下是一些示例:
12
+ 要通过 AIGNE Hub 使用特定模型,请在命令中添加 `--model` 标志。以下是几个示例:
13
13
 
14
- ```bash 使用 Google Gemini 2.5 Flash 模型
14
+ ```bash 通过 AIGNE Hub 使用不同模型 icon=mdi:code-braces
15
+ # 使用 Google 的 Gemini 2.5 Flash 模型
15
16
  aigne doc generate --model google:gemini-2.5-flash
16
17
 
17
18
  # 使用 Anthropic 的 Claude 3.5 Sonnet 模型
@@ -21,33 +22,33 @@ aigne doc generate --model claude:claude-3-5-sonnet
21
22
  aigne doc generate --model openai:gpt-4o
22
23
  ```
23
24
 
24
- 如果不指定模型,DocSmith 将使用项目配置中定义的默认模型。
25
+ 如果你未指定模型,DocSmith 将使用项目配置中定义的默认模型。
25
26
 
26
27
  ## 使用自定义 API 密钥
27
28
 
28
- 如果你更喜欢使用自己在 OpenAI 或 Anthropic 等提供商处的账户,可以用个人 API 密钥来配置 DocSmith。这样你就可以直接控制 API 的使用和计费。
29
+ 如果你更喜欢使用自己在 OpenAI 或 Anthropic 等提供商处的账户,可以用你的个人 API 密钥来配置 DocSmith。这种方法让你能够直接控制 API 的使用和计费。
29
30
 
30
- 配置通过交互式向导完成。运行以下命令以启动它:
31
+ 配置通过一个交互式向导进行处理。要启动它,请运行以下命令:
31
32
 
32
33
  ```bash
33
34
  aigne doc init
34
35
  ```
35
36
 
36
- 该向导将提示你选择提供商并输入凭据。有关完整指南,请参阅 [交互式设置](./configuration-interactive-setup.md) 文档。
37
+ 向导将提示你选择提供商并输入凭据。有关完整指南,请参阅 [交互式设置](./configuration-interactive-setup.md) 文档。
37
38
 
38
39
  ## 设置默认模型
39
40
 
40
- 为确保所有文档生成任务的一致性,你可以在项目的 `aigne.yaml` 配置文件中设置默认的 LLM。除非使用 `--model` 标志覆盖,否则将自动使用此模型。
41
+ 为了在所有文档生成任务中保持一致性,你可以在项目的 `aigne.yaml` 配置文件中设置一个默认的 LLM。任何不包含 `--model` 标志的命令都将使用此模型。
41
42
 
42
- ```yaml aigne.yaml icon=mdi:file-document
43
+ ```yaml aigne.yaml icon=mdi:file-code
43
44
  chat_model:
44
45
  provider: google
45
46
  name: gemini-2.5-pro
46
47
  temperature: 0.8
47
48
  ```
48
49
 
49
- 在此配置中,DocSmith 默认对所有生成任务使用 Google 的 `gemini-2.5-pro` 模型,并将 `temperature` 设置为 `0.8`。
50
+ 在此示例中,DocSmith 被配置为默认使用 Google 的 `gemini-2.5-pro` 模型,并将 `temperature` 设置为 `0.8`。
50
51
 
51
52
  ---
52
53
 
53
- 既然你的 LLM 提供商已配置完毕,你可以探索如何管理文档的翻译。请继续阅读 [语言支持](./configuration-language-support.md) 指南,查看支持的语言完整列表并了解如何启用它们。
54
+ 配置好 LLM 提供商后,你就可以管理文档的语言设置了。请继续阅读 [语言支持](./configuration-language-support.md) 指南,查看支持的语言完整列表并了解如何启用它们。
@@ -4,7 +4,7 @@ AIGNE DocSmith is designed to learn from your feedback. When you refine or corre
4
4
 
5
5
  ## The Preference Lifecycle
6
6
 
7
- The following diagram illustrates how your feedback becomes a reusable rule that can be applied to future tasks and managed via the command line.
7
+ The following diagram illustrates how your feedback becomes a reusable rule that can be applied to future tasks and managed from the command line.
8
8
 
9
9
  ```d2 The Preference Lifecycle
10
10
  direction: down
@@ -48,23 +48,23 @@ cli <-> pref_file: "Manages"
48
48
 
49
49
  ```
50
50
 
51
- ### How DocSmith Learns from Feedback
51
+ ### How Preferences are Created
52
52
 
53
- When you provide feedback during the `refine` or `translate` stages, an internal agent called the 'Feedback Refiner' analyzes your input. Its goal is to distinguish between a one-time fix (e.g., correcting a typo) and a reusable policy (e.g., "always write code comments in English"). If it determines the feedback represents a lasting instruction, it creates a new preference rule.
53
+ When you provide feedback during the `refine` or `translate` stages, an internal agent analyzes your input. It determines if the feedback is a one-time fix (e.g., correcting a typo) or a reusable policy (e.g., "always write code comments in English"). If it represents a lasting instruction, it creates a new preference rule.
54
54
 
55
- Each rule has several key properties that define its behavior:
55
+ ### Rule Properties
56
56
 
57
- | Property | Description |
58
- |---|---|
59
- | **id** | A unique identifier for the rule (e.g., `pref_a1b2c3d4`). |
60
- | **active** | A boolean (`true`/`false`) indicating if the rule is currently enabled. |
61
- | **scope** | Defines when the rule should be applied: `global`, `structure`, `document`, or `translation`. |
62
- | **rule** | The instruction that will be passed to the AI in future tasks. |
63
- | **feedback** | The original natural language feedback you provided. |
64
- | **createdAt** | The ISO 8601 timestamp of when the rule was created. |
65
- | **paths** | An optional list of file paths. If present, the rule only applies to content generated for those specific paths. |
57
+ Each rule saved in `preferences.yml` has the following structure:
66
58
 
67
- ## Managing Preferences via the CLI
59
+ <x-field data-name="id" data-type="string" data-desc="A unique, randomly generated identifier for the rule (e.g., pref_a1b2c3d4e5f6g7h8)."></x-field>
60
+ <x-field data-name="active" data-type="boolean" data-desc="Indicates if the rule is currently enabled. Inactive rules are ignored during generation tasks."></x-field>
61
+ <x-field data-name="scope" data-type="string" data-desc="Defines when the rule should be applied. Valid scopes are 'global', 'structure', 'document', or 'translation'."></x-field>
62
+ <x-field data-name="rule" data-type="string" data-desc="The specific, distilled instruction that will be passed to the AI in future tasks."></x-field>
63
+ <x-field data-name="feedback" data-type="string" data-desc="The original, natural language feedback provided by the user, preserved for reference."></x-field>
64
+ <x-field data-name="createdAt" data-type="string" data-desc="The ISO 8601 timestamp indicating when the rule was created."></x-field>
65
+ <x-field data-name="paths" data-type="string[]" data-required="false" data-desc="An optional list of file paths. If present, the rule only applies to content generated for these specific source files."></x-field>
66
+
67
+ ## Managing Preferences with the CLI
68
68
 
69
69
  You can view and manage all your saved preferences using the `aigne doc prefs` command. This allows you to list, activate, deactivate, or permanently remove rules.
70
70
 
@@ -76,9 +76,7 @@ To see all saved preferences, both active and inactive, use the `--list` flag.
76
76
  aigne doc prefs --list
77
77
  ```
78
78
 
79
- The command displays a formatted list explaining the status, scope, ID, and any path limitations for each rule.
80
-
81
- **Example Output:**
79
+ The command displays a formatted list showing the status, scope, ID, and any path limitations for each rule.
82
80
 
83
81
  ```text Example Output icon=lucide:clipboard-list
84
82
  # User Preferences
@@ -94,20 +92,17 @@ The command displays a formatted list explaining the status, scope, ID, and any
94
92
 
95
93
  ⚪ [document] pref_i9j0k1l2m3n4o5p6
96
94
  Code comments must be written in English.
97
-
98
95
  ```
99
96
 
100
- ### Toggling Preference Status
101
-
102
- If you want to temporarily disable a rule without deleting it, you can toggle its active status. Use the `--toggle` flag.
97
+ ### Deactivating and Reactivating Preferences
103
98
 
104
- Running the command without an ID will launch an interactive mode, allowing you to select one or more preferences to toggle:
99
+ If you want to temporarily disable a rule without deleting it, you can toggle its active status using the `--toggle` flag. Running the command without an ID will launch an interactive mode, allowing you to select one or more preferences to toggle.
105
100
 
106
101
  ```bash Toggle preferences interactively icon=lucide:terminal
107
102
  aigne doc prefs --toggle
108
103
  ```
109
104
 
110
- To toggle specific rules directly, provide their IDs using the `--id` flag:
105
+ To toggle a specific rule directly, provide its ID using the `--id` flag. This corresponds to the `deactivateRule` function, which sets the rule's `active` property to `false`.
111
106
 
112
107
  ```bash Toggle a specific preference icon=lucide:terminal
113
108
  aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
@@ -115,15 +110,15 @@ aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
115
110
 
116
111
  ### Removing Preferences
117
112
 
118
- To permanently delete one or more preferences, use the `--remove` flag. This action cannot be undone.
113
+ To permanently delete one or more preferences, use the `--remove` flag. This action, which corresponds to the `removeRule` function, cannot be undone.
119
114
 
120
- For an interactive selection prompt, run the command without an ID:
115
+ For an interactive selection prompt, run the command without an ID.
121
116
 
122
117
  ```bash Remove preferences interactively icon=lucide:terminal
123
118
  aigne doc prefs --remove
124
119
  ```
125
120
 
126
- To remove specific rules directly by their ID, use the `--id` flag:
121
+ To remove a specific rule directly by its ID, use the `--id` flag.
127
122
 
128
123
  ```bash Remove a specific preference icon=lucide:terminal
129
124
  aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
@@ -131,4 +126,4 @@ aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
131
126
 
132
127
  ## Next Steps
133
128
 
134
- Managing preferences is a key part of tailoring DocSmith to your project's specific needs. For more customization options, explore the main [Configuration Guide](./configuration.md).
129
+ Managing preferences is a key part of tailoring DocSmith to your project's specific needs. For more customization options, explore the main [Configuration Guide](./configuration.md).
@@ -1,21 +1,21 @@
1
1
  # 管理偏好
2
2
 
3
- AIGNE DocSmith 旨在从您的反馈中学习。当您优化或更正生成的内容时,DocSmith 可以将这些反馈转化为持久性规则,即偏好。这些规则确保您特定的风格、结构要求和内容策略在未来的文档任务中得到一致应用。所有偏好都存储在项目根目录下 `.aigne/doc-smith/preferences.yml` 文件中,该文件为人类可读的 YAML 格式。
3
+ AIGNE DocSmith 旨在通过你的反馈进行学习。当你优化或更正生成的内容时,DocSmith 可以将该反馈转换为持久性规则,称为偏好。这些规则确保你特定的风格、结构要求和内容策略在未来的文档任务中得到一致应用。所有偏好都存储在项目根目录下一个名为 `.aigne/doc-smith/preferences.yml` 的人类可读 YAML 文件中。
4
4
 
5
5
  ## 偏好生命周期
6
6
 
7
- 下图说明了您的反馈如何成为一个可重用的规则,该规则可应用于未来的任务,并通过命令行进行管理。
7
+ 下图说明了你的反馈如何成为一个可重用的规则,该规则可应用于未来的任务,并可通过命令行进行管理。
8
8
 
9
9
  ```d2 偏好生命周期
10
10
  direction: down
11
11
 
12
12
  feedback: {
13
- label: "1. 用户在 'refine' 或 'translate' 期间\n提供反馈"
13
+ label: "1. 用户在“优化”或“翻译”期间提供反馈"
14
14
  shape: rectangle
15
15
  }
16
16
 
17
17
  refiner: {
18
- label: "2. Feedback Refiner Agent\n分析反馈"
18
+ label: "2. 反馈优化 Agent\n分析反馈"
19
19
  shape: rectangle
20
20
  }
21
21
 
@@ -30,7 +30,7 @@ pref_file: {
30
30
  }
31
31
 
32
32
  future_tasks: {
33
- label: "4. 未来的任务\n应用已保存的规则"
33
+ label: "4. 未来任务\n应用已保存的规则"
34
34
  shape: rectangle
35
35
  }
36
36
 
@@ -48,87 +48,82 @@ cli <-> pref_file: "管理"
48
48
 
49
49
  ```
50
50
 
51
- ### DocSmith 如何从反馈中学习
51
+ ### 如何创建偏好
52
52
 
53
- 当您在 `refine` 或 `translate` 阶段提供反馈时,一个名为 'Feedback Refiner' 的内部 Agent 会分析您的输入。其目标是区分一次性修复(例如,更正拼写错误)和可重用策略(例如,“始终用英语编写代码注释”)。如果它确定反馈代表一个持久性指令,就会创建一个新的偏好规则。
53
+ 当你在 `refine` 或 `translate` 阶段提供反馈时,一个内部 Agent 会分析你的输入。它会判断该反馈是一次性修复(例如,更正一个拼写错误)还是一个可重用的策略(例如,“始终用英语编写代码注释”)。如果它代表一个持久性指令,它就会创建一个新的偏好规则。
54
54
 
55
- 每个规则都有几个关键属性来定义其行为:
55
+ ### 规则属性
56
56
 
57
- | 属性 | 描述 |
58
- |---|---|
59
- | **id** | 规则的唯一标识符(例如,`pref_a1b2c3d4`)。 |
60
- | **active** | 一个布尔值(`true`/`false`),指示规则当前是否已启用。 |
61
- | **scope** | 定义规则的应用时机:`global`、`structure`、`document` 或 `translation`。 |
62
- | **rule** | 将在未来任务中传递给 AI 的指令。 |
63
- | **feedback** | 您提供的原始自然语言反馈。 |
64
- | **createdAt** | 规则创建时的 ISO 8601 时间戳。 |
65
- | **paths** | 一个可选的文件路径列表。如果存在,该规则仅适用于为这些特定路径生成的内容。 |
57
+ 保存在 `preferences.yml` 中的每个规则都具有以下结构:
66
58
 
67
- ## 通过 CLI 管理偏好
59
+ <x-field data-name="id" data-type="string" data-desc="规则的唯一、随机生成的标识符(例如,pref_a1b2c3d4e5f6g7h8)。"></x-field>
60
+ <x-field data-name="active" data-type="boolean" data-desc="指示规则当前是否已启用。未启用的规则在生成任务期间将被忽略。"></x-field>
61
+ <x-field data-name="scope" data-type="string" data-desc="定义规则何时应用。有效范围为 'global'、'structure'、'document' 或 'translation'。"></x-field>
62
+ <x-field data-name="rule" data-type="string" data-desc="将在未来任务中传递给 AI 的具体、提炼后的指令。"></x-field>
63
+ <x-field data-name="feedback" data-type="string" data-desc="用户提供的原始自然语言反馈,保留以供参考。"></x-field>
64
+ <x-field data-name="createdAt" data-type="string" data-desc="表示规则创建时间的 ISO 8601 时间戳。"></x-field>
65
+ <x-field data-name="paths" data-type="string[]" data-required="false" data-desc="一个可选的文件路径列表。如果存在,该规则仅适用于为这些特定源文件生成的内容。"></x-field>
68
66
 
69
- 您可以使用 `aigne doc prefs` 命令查看和管理所有已保存的偏好。这允许您列出、激活、停用或永久删除规则。
67
+ ## 使用 CLI 管理偏好
68
+
69
+ 你可以使用 `aigne doc prefs` 命令查看和管理所有已保存的偏好。这允许你列出、激活、停用或永久删除规则。
70
70
 
71
71
  ### 列出所有偏好
72
72
 
73
- 要查看所有已保存的偏好(包括活动和非活动的),请使用 `--list` 标志。
73
+ 要查看所有已保存的偏好,包括已激活和未激活的,请使用 `--list` 标志。
74
74
 
75
75
  ```bash 列出所有偏好 icon=lucide:terminal
76
76
  aigne doc prefs --list
77
77
  ```
78
78
 
79
- 该命令会显示一个格式化列表,解释每个规则的状态、范围、ID 以及任何路径限制。
80
-
81
- **示例输出:**
79
+ 该命令会显示一个格式化列表,展示每个规则的状态、范围、ID 以及任何路径限制。
82
80
 
83
- ```text 示例输出 icon=lucide:clipboard-list
81
+ ```text 输出示例 icon=lucide:clipboard-list
84
82
  # 用户偏好
85
83
 
86
84
  **格式说明:**
87
- - 🟢 = 活动偏好, ⚪ = 非活动偏好
85
+ - 🟢 = 已激活的偏好, ⚪ = 未激活的偏好
88
86
  - [scope] = 偏好范围 (global, structure, document, translation)
89
- - ID = 偏好唯一标识符
87
+ - ID = 唯一偏好标识符
90
88
  - Paths = 特定文件路径 (如果适用)
91
89
 
92
90
  🟢 [structure] pref_a1b2c3d4e5f6g7h8 | Paths: overview.md
93
- 在概览文档末尾添加一个 'Next Steps' 部分。
91
+ 在概览文档末尾添加“后续步骤”部分。
94
92
 
95
93
  ⚪ [document] pref_i9j0k1l2m3n4o5p6
96
94
  代码注释必须用英语编写。
97
-
98
95
  ```
99
96
 
100
- ### 切换偏好状态
101
-
102
- 如果您想临时禁用某个规则而不删除它,可以切换其活动状态。请使用 `--toggle` 标志。
97
+ ### 停用和重新激活偏好
103
98
 
104
- 不带 ID 运行该命令将启动交互模式,允许您选择一个或多个要切换的偏好:
99
+ 如果你想临时禁用一个规则而不删除它,可以使用 `--toggle` 标志来切换其激活状态。不带 ID 运行该命令将启动一个交互模式,允许你选择一个或多个偏好进行切换。
105
100
 
106
101
  ```bash 以交互方式切换偏好 icon=lucide:terminal
107
102
  aigne doc prefs --toggle
108
103
  ```
109
104
 
110
- 要直接切换特定规则,请使用 `--id` 标志提供其 ID
105
+ 要直接切换特定规则,请使用 `--id` 标志提供其 ID。这对应于 `deactivateRule` 函数,该函数将规则的 `active` 属性设置为 `false`。
111
106
 
112
107
  ```bash 切换特定偏好 icon=lucide:terminal
113
108
  aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
114
109
  ```
115
110
 
116
- ### 移除偏好
111
+ ### 删除偏好
117
112
 
118
- 要永久删除一个或多个偏好,请使用 `--remove` 标志。此操作无法撤销。
113
+ 要永久删除一个或多个偏好,请使用 `--remove` 标志。此操作对应于 `removeRule` 函数,且无法撤销。
119
114
 
120
- 要进入交互式选择提示,请不带 ID 运行该命令:
115
+ 要进入交互式选择提示,请不带 ID 运行该命令。
121
116
 
122
- ```bash 以交互方式移除偏好 icon=lucide:terminal
117
+ ```bash 以交互方式删除偏好 icon=lucide:terminal
123
118
  aigne doc prefs --remove
124
119
  ```
125
120
 
126
- 要通过 ID 直接移除特定规则,请使用 `--id` 标志:
121
+ 要通过 ID 直接删除特定规则,请使用 `--id` 标志。
127
122
 
128
- ```bash 移除特定偏好 icon=lucide:terminal
123
+ ```bash 删除特定偏好 icon=lucide:terminal
129
124
  aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
130
125
  ```
131
126
 
132
127
  ## 后续步骤
133
128
 
134
- 管理偏好是根据项目特定需求定制 DocSmith 的关键部分。要了解更多自定义选项,请查阅主要的[配置指南](./configuration.md)。
129
+ 管理偏好是根据项目特定需求定制 DocSmith 的关键部分。有关更多自定义选项,请查阅主要的[配置指南](./configuration.md)。
@@ -1,6 +1,6 @@
1
1
  # Configuration Guide
2
2
 
3
- AIGNE DocSmith's behavior is controlled by a central file, `config.yaml`, typically located at `.aigne/doc-smith/config.yaml`. This file dictates the style, target audience, languages, and structure of your documentation.
3
+ AIGNE DocSmith's behavior is controlled by a central file, `config.yaml`, located at `.aigne/doc-smith/config.yaml`. This file dictates the style, target audience, languages, and structure of your documentation.
4
4
 
5
5
  You can create and manage this file using the interactive setup wizard by running `aigne doc init`. For a step-by-step walkthrough, see the [Interactive Setup](./configuration-interactive-setup.md) guide.
6
6
 
@@ -10,7 +10,7 @@ Your documentation is shaped by several key areas of configuration. Explore thes
10
10
 
11
11
  <x-cards data-columns="2">
12
12
  <x-card data-title="Interactive Setup" data-icon="lucide:wand-2" data-href="/configuration/interactive-setup">
13
- Learn about the guided wizard that helps you configure your documentation project from scratch, including setting recommendations.
13
+ Learn about the guided wizard that helps you configure your documentation project, including setting recommendations and conflict detection.
14
14
  </x-card>
15
15
  <x-card data-title="LLM Setup" data-icon="lucide:brain-circuit" data-href="/configuration/llm-setup">
16
16
  Discover how to connect different AI models, including using the built-in AIGNE Hub which requires no API keys.
@@ -33,8 +33,8 @@ These settings provide basic context about your project, which is used when publ
33
33
 
34
34
  | Parameter | Description |
35
35
  |---|---|
36
- | `projectName` | The name of your project. Automatically detected from `package.json` if available. |
37
- | `projectDesc` | A short description of your project. Automatically detected from `package.json`. |
36
+ | `projectName` | The name of your project. Detected from `package.json` if available. |
37
+ | `projectDesc` | A short description of your project. Detected from `package.json`. |
38
38
  | `projectLogo` | A path or URL to your project's logo image. |
39
39
 
40
40
  ### Documentation Strategy
@@ -42,7 +42,7 @@ These settings provide basic context about your project, which is used when publ
42
42
  These parameters define the tone, style, and depth of the generated content.
43
43
 
44
44
  #### `documentPurpose`
45
- What is the main outcome you want readers to achieve? This setting influences the overall structure and focus of the documentation.
45
+ Defines the main outcome you want readers to achieve. This setting influences the overall structure and focus of the documentation.
46
46
 
47
47
  | Option | Name | Description |
48
48
  |---|---|---|
@@ -54,7 +54,7 @@ What is the main outcome you want readers to achieve? This setting influences th
54
54
  | `mixedPurpose` | Serve multiple purposes | Documentation covering multiple needs. |
55
55
 
56
56
  #### `targetAudienceTypes`
57
- Who will be reading this documentation most often? This choice affects the writing style and examples.
57
+ Defines who will be reading this documentation most often. This choice affects the writing style and examples.
58
58
 
59
59
  | Option | Name | Description |
60
60
  |---|---|---|
@@ -66,7 +66,7 @@ Who will be reading this documentation most often? This choice affects the writi
66
66
  | `mixedTechnical`| Mixed technical audience | Developers, DevOps, and other technical users. |
67
67
 
68
68
  #### `readerKnowledgeLevel`
69
- What do readers typically know when they arrive? This adjusts how much foundational knowledge is assumed.
69
+ Defines what readers typically know when they arrive. This adjusts how much foundational knowledge is assumed.
70
70
 
71
71
  | Option | Name | Description |
72
72
  |---|---|---|
@@ -77,7 +77,7 @@ What do readers typically know when they arrive? This adjusts how much foundatio
77
77
  | `exploringEvaluating` | Is evaluating this tool against others | Trying to understand if this fits their needs. |
78
78
 
79
79
  #### `documentationDepth`
80
- How comprehensive should the documentation be?
80
+ Defines how comprehensive the documentation should be.
81
81
 
82
82
  | Option | Name | Description |
83
83
  |---|---|---|
@@ -92,8 +92,8 @@ For more granular control, you can provide free-text instructions.
92
92
 
93
93
  | Parameter | Description |
94
94
  |---|---|
95
- | `rules` | A multi-line string where you can define specific documentation generation rules and requirements (e.g., "Always include performance benchmarks"). |
96
- | `targetAudience`| A multi-line string to describe your specific target audience and their characteristics in more detail than the presets allow. |
95
+ | `rules` | A multi-line string where you can define specific documentation generation rules (e.g., "Always include performance benchmarks"). |
96
+ | `targetAudience`| A multi-line string to describe your specific target audience in more detail than the presets allow. |
97
97
 
98
98
  ### Language and Path Configuration
99
99
 
@@ -109,56 +109,35 @@ These settings control localization and file locations.
109
109
 
110
110
  ## Example `config.yaml`
111
111
 
112
- Here is an example of a complete configuration file with comments explaining each section. You can edit this file directly to change settings at any time.
112
+ Here is an example of a complete configuration file. You can edit this file directly to change settings at any time.
113
113
 
114
114
  ```yaml Example config.yaml icon=logos:yaml
115
115
  # Project information for documentation publishing
116
116
  projectName: AIGNE DocSmith
117
- projectDesc: A powerful, AI-driven documentation generation tool.
117
+ projectDesc: An AI-driven documentation generation tool.
118
118
  projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
119
119
 
120
120
  # =============================================================================
121
121
  # Documentation Configuration
122
122
  # =============================================================================
123
123
 
124
- # Purpose: What's the main outcome you want readers to achieve?
125
- # Available options (uncomment and modify as needed):
126
- # getStarted - Get started quickly: Help new users go from zero to working in <30 minutes
127
- # completeTasks - Complete specific tasks: Guide users through common workflows and use cases
128
- # findAnswers - Find answers fast: Provide searchable reference for all features and APIs
129
- # understandSystem - Understand the system: Explain how it works, why design decisions were made
130
- # solveProblems - Troubleshoot common issues: Help users troubleshoot and fix issues
131
- # mixedPurpose - Serve multiple purposes: Comprehensive documentation covering multiple needs
124
+ # Purpose: What is the main outcome you want readers to achieve?
125
+ # Options: getStarted, completeTasks, findAnswers, understandSystem, solveProblems, mixedPurpose
132
126
  documentPurpose:
133
127
  - completeTasks
134
128
  - findAnswers
135
129
 
136
130
  # Target Audience: Who will be reading this most often?
137
- # Available options (uncomment and modify as needed):
138
- # endUsers - End users (non-technical): People who use the product but don't code
139
- # developers - Developers integrating your product/API: Engineers adding this to their projects
140
- # devops - DevOps / SRE / Infrastructure teams: Teams deploying, monitoring, maintaining systems
141
- # decisionMakers - Technical decision makers: Architects, leads evaluating or planning implementation
142
- # supportTeams - Support teams: People helping others use the product
143
- # mixedTechnical - Mixed technical audience: Developers, DevOps, and technical users
131
+ # Options: endUsers, developers, devops, decisionMakers, supportTeams, mixedTechnical
144
132
  targetAudienceTypes:
145
133
  - developers
146
134
 
147
135
  # Reader Knowledge Level: What do readers typically know when they arrive?
148
- # Available options (uncomment and modify as needed):
149
- # completeBeginners - Is a total beginner, starting from scratch: New to this domain/technology entirely
150
- # domainFamiliar - Has used similar tools before: Know the problem space, new to this specific solution
151
- # experiencedUsers - Is an expert trying to do something specific: Regular users needing reference/advanced topics
152
- # emergencyTroubleshooting - Emergency/troubleshooting: Something's broken, need to fix it quickly
153
- # exploringEvaluating - Is evaluating this tool against others: Trying to understand if this fits their needs
136
+ # Options: completeBeginners, domainFamiliar, experiencedUsers, emergencyTroubleshooting, exploringEvaluating
154
137
  readerKnowledgeLevel: domainFamiliar
155
138
 
156
139
  # Documentation Depth: How comprehensive should the documentation be?
157
- # Available options (uncomment and modify as needed):
158
- # essentialOnly - Essential only: Cover the 80% use cases, keep it concise
159
- # balancedCoverage - Balanced coverage: Good depth with practical examples [RECOMMENDED]
160
- # comprehensive - Comprehensive: Cover all features, edge cases, and advanced scenarios
161
- # aiDecide - Let AI decide: Analyze code complexity and suggest appropriate depth
140
+ # Options: essentialOnly, balancedCoverage, comprehensive, aiDecide
162
141
  documentationDepth: balancedCoverage
163
142
 
164
143
  # Custom Rules: Define specific documentation generation rules and requirements
@@ -169,15 +148,22 @@ rules: |+
169
148
  targetAudience: |+
170
149
 
171
150
 
172
- # Glossary: Define project-specific terms and definitions
173
- # glossary: "@glossary.md" # Path to markdown file containing glossary definitions
151
+ # Glossary: Path to markdown file containing project-specific terms and definitions
152
+ # glossary: "@glossary.md"
174
153
 
154
+ # Primary language for the documentation
175
155
  locale: en
176
- # translateLanguages: # List of languages to translate the documentation to
177
- # - zh # Example: Chinese translation
178
- # - fr # Example: French translation
179
- docsDir: .aigne/doc-smith/docs # Directory to save generated documentation
180
- sourcesPath: # Source code paths to analyze
156
+
157
+ # List of languages to translate the documentation into
158
+ # translateLanguages:
159
+ # - zh
160
+ # - fr
161
+
162
+ # Directory to save generated documentation
163
+ docsDir: .aigne/doc-smith/docs
164
+
165
+ # Source code paths to analyze
166
+ sourcesPath:
181
167
  - ./
182
168
  ```
183
169