@aigne/doc-smith 0.9.8-alpha.4 → 0.9.8-alpha.6

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.yaml CHANGED
@@ -3,3 +3,9 @@
3
3
  model: anthropic/claude-sonnet-4-5
4
4
  agents:
5
5
  - doc-smith.yaml
6
+
7
+ cli:
8
+ agents:
9
+ - name: generate
10
+ alias: ["create", "gen", "g"]
11
+ url: doc-smith.yaml
@@ -6,8 +6,6 @@ Changeset 只包含两类修改:
6
6
  1. **全局语义修改** - 跨文档的规则、术语、风格
7
7
  2. **结构重写** - 补充、重写、重组特定章节
8
8
 
9
- **注意:** PATCH 类修改通过文档内 `:::PATCH` 标记实现,不会出现在 changeset 中。
10
-
11
9
  ## 读取和理解
12
10
 
13
11
  Changeset 是自然语言文本,格式自由。你需要:
@@ -42,51 +40,17 @@ Changeset 是自然语言文本,格式自由。你需要:
42
40
  "API 文档补充错误码说明" → 结构重写
43
41
  ```
44
42
 
45
- ## 常见模式参考
46
-
47
- ### 模式 1:简单列表
48
- ```markdown
49
- 1. 统一术语:"API" → "API 接口"
50
- 2. 补充 overview.md 的项目背景
51
- 3. 删除所有形容词
52
- ```
53
-
54
- 理解:1, 3 是全局修改;2 是结构重写
55
-
56
- ### 模式 2:分类组织
57
- ```markdown
58
- ## 全局修改
59
- - 代码示例添加语言标识符
60
- - 禁止使用第一人称
61
-
62
- ## 补充内容
63
- - getting-started.md 添加环境要求
64
- - api/errors.md 补充错误原因
65
- ```
66
-
67
- 理解:按章节分类,直接识别
68
-
69
- ### 模式 3:自由描述
70
- ```markdown
71
- 发现文档问题:
72
- - "API" 和 "接口" 混用,统一为 "API 接口"
73
- - 快速开始缺环境要求说明
74
- ```
75
-
76
- 理解:第一条是全局修改,第二条是结构重写
77
-
78
43
  ## 执行流程
79
44
 
80
45
  ### 1. 读取文件
81
- ```bash
82
- cat <changeset-file-path>
83
- ```
46
+
47
+ 读取 changeset 文件,只读取用户指令中指定的文件,忽略其他 changeset 文件。
84
48
 
85
49
  ### 2. 分类汇总
86
50
 
87
51
  **全局修改:**
88
- - 规则 1: ...
89
- - 规则 2: ...
52
+ - 1: ...
53
+ - 2: ...
90
54
 
91
55
  **结构重写:**
92
56
  - 文档 A, 章节 X: ...
@@ -97,9 +61,6 @@ cat <changeset-file-path>
97
61
  **优先级:** 全局修改 → 结构重写
98
62
 
99
63
  **全局修改:**
100
- ```bash
101
- find .aigne/doc-smith/docs/ -name "*.md"
102
- ```
103
64
  遍历所有文档,应用规则
104
65
 
105
66
  **结构重写:**
@@ -43,18 +43,21 @@
43
43
  **处理方式:**
44
44
  1. 扫描所有文档查找 `:::PATCH` 标记
45
45
  2. 读取 PATCH 内的修改指令
46
- 3. 执行精确替换
46
+ 3. 在指定位置完成 PATCH要求的修改,可能包含:替换原始内容、删除内容、新增内容
47
47
  4. 删除整个 PATCH 标记
48
48
 
49
49
  **PATCH 标记格式:**
50
50
  ```markdown
51
51
  ::: PATCH
52
- 修改说明或新内容
52
+ # Original
53
+ DocSmith 直接修改用户文档并写回到原项目。
54
+
55
+ # Revised
56
+ DocSmith 永远不直接 touch 用户原始 repo,而是
57
+ 在独立 workspace 中生成版本化产物,再通过 patch 合并。
53
58
  :::
54
59
  ```
55
60
 
56
- **来源:** 仅通过文档内标记(不会出现在 Changeset 文件中)
57
-
58
61
  ## 三种输入方式处理
59
62
 
60
63
  ### 方式 1:自然语言修改请求
@@ -133,10 +136,6 @@ ls -la .aigne/doc-smith/docs/
133
136
  **执行优先级:** 全局修改 → 结构重写 → PATCH
134
137
 
135
138
  **全局修改:**
136
- ```bash
137
- # 获取所有文档
138
- find .aigne/doc-smith/docs/ -name "*.md"
139
- ```
140
139
  对每个文档:
141
140
  - 读取内容
142
141
  - 应用规则(替换、删除、添加)
package/doc-smith.yaml CHANGED
@@ -1,97 +1,14 @@
1
1
  type: ai
2
2
  name: docsmith
3
- keep_text_in_tool_uses: true
4
3
  task_render_mode: collapse
4
+
5
5
  instructions:
6
6
  - role: system
7
7
  url: ./main-system-prompt.md
8
8
 
9
9
  input_key: message
10
10
  skills:
11
- - type: function
12
- name: askUserQuestion
13
- description: |
14
- Use this tool when you need to ask the user questions during execution. This allows you to:
15
- 1. Gather user preferences or requirements
16
- 2. Clarify ambiguous instructions
17
- 3. Get decisions on implementation choices as you work
18
- 4. Offer choices to the user about what direction to take.
19
-
20
- Usage notes:
21
- - The system automatically adds an "✏️ Other" option to all questions, allowing users to provide custom text input. DO NOT add your own "Other", "需要调整", or similar options - they will cause duplication.
22
- - Only provide the specific action options (e.g., "✅ Confirm"). The "Other" option is handled by the system.
23
- - Use multiSelect: true to allow multiple answers to be selected for a question
24
- - If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label
25
- input_schema:
26
- type: object
27
- properties:
28
- questions:
29
- type: array
30
- items:
31
- type: object
32
- properties:
33
- question:
34
- type: string
35
- description: The complete question to ask
36
- header:
37
- type: string
38
- description: Short label(max 12 chars)
39
- options:
40
- type: array
41
- items:
42
- type: string
43
- description:
44
- Available choices (2 ~ 4 options)
45
- # multiSelect:
46
- # type: boolean
47
- # description: Allow multiple selections
48
- required:
49
- - question
50
- - header
51
- required:
52
- - questions
53
- process: |
54
- const {questions} = input
55
-
56
- const answers = []
57
- const OTHER_OPTION = '✏️ Other'
58
-
59
- for (const item of questions) {
60
- let answer
61
-
62
- if (item?.options?.length) {
63
- answer = await options.prompts.select({
64
- message: item.question,
65
- choices: [
66
- ...item.options.map(option => ({
67
- name: option,
68
- description: option,
69
- value: option
70
- })),
71
- {
72
- name: OTHER_OPTION,
73
- description: 'Enter your own response',
74
- value: OTHER_OPTION
75
- }
76
- ]
77
- })
78
-
79
- if (answer === OTHER_OPTION) {
80
- answer = await options.prompts.input({
81
- message: 'Please enter your response:'
82
- })
83
- }
84
- } else {
85
- answer = await options.prompts.input({
86
- message: item.question
87
- })
88
- }
89
-
90
- answers.push({question: item.question, answer})
91
- }
92
-
93
- return {answers}
94
-
11
+ - type: "@aigne/agent-library/ask-user-question"
95
12
 
96
13
  afs:
97
14
  modules:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/doc-smith",
3
- "version": "0.9.8-alpha.4",
3
+ "version": "0.9.8-alpha.6",
4
4
  "description": "AI-driven documentation generation tool built on the AIGNE Framework",
5
5
  "publishConfig": {
6
6
  "access": "public"