@aigne/doc-smith 0.9.8-alpha.2 → 0.9.8-alpha.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/CLAUDE.md +43 -0
- package/README.md +94 -250
- package/aigne.yaml +2 -149
- package/doc-smith/SKILL.md +117 -0
- package/doc-smith/references/changeset_schema.md +118 -0
- package/doc-smith/references/document_structure_schema.md +139 -0
- package/doc-smith/references/document_update_guide.md +193 -0
- package/doc-smith/references/structure_confirmation_guide.md +133 -0
- package/doc-smith/references/structure_planning_guide.md +146 -0
- package/doc-smith/references/user_intent_guide.md +172 -0
- package/doc-smith.yaml +114 -0
- package/main-system-prompt.md +56 -0
- package/package.json +3 -69
- package/scripts/README.md +90 -0
- package/scripts/install.sh +86 -0
- package/scripts/uninstall.sh +52 -0
- package/CHANGELOG.md +0 -994
- package/LICENSE +0 -93
- package/agentic-agents/common/base-info.md +0 -53
- package/agentic-agents/common/planner.md +0 -168
- package/agentic-agents/common/worker.md +0 -93
- package/agentic-agents/create/index.yaml +0 -118
- package/agentic-agents/create/objective.md +0 -44
- package/agentic-agents/create/set-custom-prompt.mjs +0 -27
- package/agentic-agents/detail/index.yaml +0 -95
- package/agentic-agents/detail/objective.md +0 -9
- package/agentic-agents/detail/set-custom-prompt.mjs +0 -88
- package/agentic-agents/predict-resources/index.yaml +0 -44
- package/agentic-agents/predict-resources/instructions.md +0 -61
- package/agentic-agents/structure/design-rules.md +0 -39
- package/agentic-agents/structure/index.yaml +0 -86
- package/agentic-agents/structure/objective.md +0 -14
- package/agentic-agents/structure/review-criteria.md +0 -55
- package/agentic-agents/structure/set-custom-prompt.mjs +0 -78
- package/agentic-agents/utils/init-workspace-cache.mjs +0 -171
- package/agentic-agents/utils/load-base-sources.mjs +0 -20
- package/agentic-agents/workspace-cache-sharing-design.md +0 -671
- package/agents/chat/chat-system.md +0 -38
- package/agents/chat/index.mjs +0 -59
- package/agents/chat/skills/generate-document.yaml +0 -15
- package/agents/chat/skills/list-documents.mjs +0 -15
- package/agents/chat/skills/update-document.yaml +0 -24
- package/agents/clear/choose-contents.mjs +0 -192
- package/agents/clear/clear-auth-tokens.mjs +0 -88
- package/agents/clear/clear-deployment-config.mjs +0 -49
- package/agents/clear/clear-document-config.mjs +0 -36
- package/agents/clear/clear-document-structure.mjs +0 -102
- package/agents/clear/clear-generated-docs.mjs +0 -142
- package/agents/clear/clear-media-description.mjs +0 -129
- package/agents/clear/index.yaml +0 -26
- package/agents/create/analyze-diagram-type-llm.yaml +0 -160
- package/agents/create/analyze-diagram-type.mjs +0 -297
- package/agents/create/check-document-structure.yaml +0 -30
- package/agents/create/check-need-generate-structure.mjs +0 -105
- package/agents/create/document-structure-tools/add-document.mjs +0 -85
- package/agents/create/document-structure-tools/delete-document.mjs +0 -116
- package/agents/create/document-structure-tools/move-document.mjs +0 -109
- package/agents/create/document-structure-tools/update-document.mjs +0 -84
- package/agents/create/generate-diagram-image.yaml +0 -60
- package/agents/create/generate-structure.yaml +0 -117
- package/agents/create/index.yaml +0 -49
- package/agents/create/refine-document-structure.yaml +0 -12
- package/agents/create/replace-d2-with-image.mjs +0 -625
- package/agents/create/update-document-structure.yaml +0 -54
- package/agents/create/user-add-document/add-documents-to-structure.mjs +0 -90
- package/agents/create/user-add-document/find-documents-to-add-links.yaml +0 -47
- package/agents/create/user-add-document/index.yaml +0 -46
- package/agents/create/user-add-document/prepare-documents-to-translate.mjs +0 -22
- package/agents/create/user-add-document/print-add-document-summary.mjs +0 -63
- package/agents/create/user-add-document/review-documents-with-new-links.mjs +0 -110
- package/agents/create/user-remove-document/find-documents-with-invalid-links.mjs +0 -78
- package/agents/create/user-remove-document/index.yaml +0 -40
- package/agents/create/user-remove-document/prepare-documents-to-translate.mjs +0 -22
- package/agents/create/user-remove-document/print-remove-document-summary.mjs +0 -53
- package/agents/create/user-remove-document/remove-documents-from-structure.mjs +0 -99
- package/agents/create/user-remove-document/review-documents-with-invalid-links.mjs +0 -115
- package/agents/create/user-review-document-structure.mjs +0 -140
- package/agents/create/utils/init-current-content.mjs +0 -34
- package/agents/create/utils/merge-document-structures.mjs +0 -30
- package/agents/evaluate/code-snippet.mjs +0 -97
- package/agents/evaluate/document-structure.yaml +0 -67
- package/agents/evaluate/document.yaml +0 -82
- package/agents/evaluate/generate-report.mjs +0 -85
- package/agents/evaluate/index.yaml +0 -46
- package/agents/history/index.yaml +0 -6
- package/agents/history/view.mjs +0 -78
- package/agents/init/check.mjs +0 -16
- package/agents/init/index.mjs +0 -275
- package/agents/init/validate.mjs +0 -16
- package/agents/localize/choose-language.mjs +0 -107
- package/agents/localize/index.yaml +0 -58
- package/agents/localize/record-translation-history.mjs +0 -23
- package/agents/localize/translate-document.yaml +0 -24
- package/agents/localize/translate-multilingual.yaml +0 -51
- package/agents/media/batch-generate-media-description.yaml +0 -46
- package/agents/media/generate-media-description.yaml +0 -50
- package/agents/media/load-media-description.mjs +0 -256
- package/agents/prefs/index.mjs +0 -203
- package/agents/publish/index.yaml +0 -26
- package/agents/publish/publish-docs.mjs +0 -356
- package/agents/publish/translate-meta.mjs +0 -103
- package/agents/schema/document-structure-item.yaml +0 -26
- package/agents/schema/document-structure-refine-item.yaml +0 -23
- package/agents/schema/document-structure.yaml +0 -29
- package/agents/update/batch-generate-document.yaml +0 -27
- package/agents/update/batch-update-document.yaml +0 -7
- package/agents/update/check-diagram-flag.mjs +0 -116
- package/agents/update/check-document.mjs +0 -162
- package/agents/update/check-generate-diagram.mjs +0 -106
- package/agents/update/check-sync-image-flag.mjs +0 -55
- package/agents/update/check-update-is-single.mjs +0 -53
- package/agents/update/document-tools/update-document-content.mjs +0 -303
- package/agents/update/generate-diagram.yaml +0 -63
- package/agents/update/generate-document.yaml +0 -70
- package/agents/update/handle-document-update.yaml +0 -103
- package/agents/update/index.yaml +0 -79
- package/agents/update/pre-check-generate-diagram.yaml +0 -44
- package/agents/update/save-and-translate-document.mjs +0 -76
- package/agents/update/sync-images-and-exit.mjs +0 -148
- package/agents/update/update-document-detail.yaml +0 -71
- package/agents/update/update-single/update-single-document-detail.mjs +0 -280
- package/agents/update/update-single-document.yaml +0 -7
- package/agents/update/user-review-document.mjs +0 -272
- package/agents/utils/action-success.mjs +0 -16
- package/agents/utils/analyze-document-feedback-intent.yaml +0 -32
- package/agents/utils/analyze-feedback-intent.mjs +0 -136
- package/agents/utils/analyze-structure-feedback-intent.yaml +0 -29
- package/agents/utils/check-detail-result.mjs +0 -38
- package/agents/utils/check-feedback-refiner.mjs +0 -81
- package/agents/utils/choose-docs.mjs +0 -293
- package/agents/utils/document-icon-generate.yaml +0 -52
- package/agents/utils/document-title-streamline.yaml +0 -48
- package/agents/utils/ensure-document-icons.mjs +0 -129
- package/agents/utils/exit.mjs +0 -6
- package/agents/utils/feedback-refiner.yaml +0 -50
- package/agents/utils/find-item-by-path.mjs +0 -114
- package/agents/utils/find-user-preferences-by-path.mjs +0 -37
- package/agents/utils/format-document-structure.mjs +0 -35
- package/agents/utils/generate-document-or-skip.mjs +0 -41
- package/agents/utils/handle-diagram-operations.mjs +0 -263
- package/agents/utils/load-all-document-content.mjs +0 -30
- package/agents/utils/load-document-all-content.mjs +0 -84
- package/agents/utils/load-sources.mjs +0 -405
- package/agents/utils/map-reasoning-effort-level.mjs +0 -15
- package/agents/utils/post-generate.mjs +0 -144
- package/agents/utils/read-current-document-content.mjs +0 -46
- package/agents/utils/save-doc-translation.mjs +0 -61
- package/agents/utils/save-doc.mjs +0 -88
- package/agents/utils/save-output.mjs +0 -26
- package/agents/utils/save-sidebar.mjs +0 -51
- package/agents/utils/skip-if-content-exists.mjs +0 -27
- package/agents/utils/streamline-document-titles-if-needed.mjs +0 -88
- package/agents/utils/transform-detail-data-sources.mjs +0 -45
- package/agents/utils/update-branding.mjs +0 -84
- package/assets/report-template/report.html +0 -198
- package/docs-mcp/analyze-content-relevance.yaml +0 -50
- package/docs-mcp/analyze-docs-relevance.yaml +0 -59
- package/docs-mcp/docs-search.yaml +0 -42
- package/docs-mcp/get-docs-detail.mjs +0 -41
- package/docs-mcp/get-docs-structure.mjs +0 -16
- package/docs-mcp/read-doc-content.mjs +0 -119
- package/prompts/common/document/content-rules-core.md +0 -20
- package/prompts/common/document/markdown-syntax-rules.md +0 -65
- package/prompts/common/document/media-file-list-usage-rules.md +0 -18
- package/prompts/common/document/openapi-usage-rules.md +0 -189
- package/prompts/common/document/role-and-personality.md +0 -16
- package/prompts/common/document/user-preferences.md +0 -9
- package/prompts/common/document-structure/conflict-resolution-guidance.md +0 -16
- package/prompts/common/document-structure/document-icon-generate.md +0 -116
- package/prompts/common/document-structure/document-structure-rules.md +0 -43
- package/prompts/common/document-structure/document-title-streamline.md +0 -86
- package/prompts/common/document-structure/glossary.md +0 -7
- package/prompts/common/document-structure/intj-traits.md +0 -5
- package/prompts/common/document-structure/openapi-usage-rules.md +0 -28
- package/prompts/common/document-structure/output-constraints.md +0 -18
- package/prompts/common/document-structure/user-locale-rules.md +0 -10
- package/prompts/common/document-structure/user-preferences.md +0 -9
- package/prompts/detail/custom/admonition-usage-rules.md +0 -94
- package/prompts/detail/custom/code-block-usage-rules.md +0 -163
- package/prompts/detail/custom/custom-components/x-card-usage-rules.md +0 -63
- package/prompts/detail/custom/custom-components/x-cards-usage-rules.md +0 -83
- package/prompts/detail/custom/custom-components/x-field-desc-usage-rules.md +0 -120
- package/prompts/detail/custom/custom-components/x-field-group-usage-rules.md +0 -80
- package/prompts/detail/custom/custom-components/x-field-usage-rules.md +0 -189
- package/prompts/detail/custom/custom-components-usage-rules.md +0 -18
- package/prompts/detail/diagram/generate-image-system.md +0 -135
- package/prompts/detail/diagram/generate-image-user.md +0 -32
- package/prompts/detail/diagram/guide.md +0 -29
- package/prompts/detail/diagram/official-examples.md +0 -712
- package/prompts/detail/diagram/pre-check.md +0 -23
- package/prompts/detail/diagram/role-and-personality.md +0 -2
- package/prompts/detail/diagram/rules.md +0 -46
- package/prompts/detail/diagram/system-prompt.md +0 -1139
- package/prompts/detail/diagram/user-prompt.md +0 -43
- package/prompts/detail/generate/detail-example.md +0 -457
- package/prompts/detail/generate/document-rules.md +0 -45
- package/prompts/detail/generate/system-prompt.md +0 -61
- package/prompts/detail/generate/user-prompt.md +0 -99
- package/prompts/detail/jsx/rules.md +0 -6
- package/prompts/detail/update/system-prompt.md +0 -121
- package/prompts/detail/update/user-prompt.md +0 -41
- package/prompts/evaluate/document-structure.md +0 -93
- package/prompts/evaluate/document.md +0 -149
- package/prompts/media/media-description/system-prompt.md +0 -43
- package/prompts/media/media-description/user-prompt.md +0 -17
- package/prompts/structure/check-document-structure.md +0 -93
- package/prompts/structure/document-rules.md +0 -21
- package/prompts/structure/find-documents-to-add-links.md +0 -52
- package/prompts/structure/generate/system-prompt.md +0 -13
- package/prompts/structure/generate/user-prompt.md +0 -137
- package/prompts/structure/review/structure-review-system.md +0 -81
- package/prompts/structure/structure-example.md +0 -89
- package/prompts/structure/structure-getting-started.md +0 -10
- package/prompts/structure/update/system-prompt.md +0 -93
- package/prompts/structure/update/user-prompt.md +0 -43
- package/prompts/translate/admonition.md +0 -20
- package/prompts/translate/code-block.md +0 -33
- package/prompts/translate/glossary.md +0 -6
- package/prompts/translate/translate-document.md +0 -305
- package/prompts/utils/analyze-document-feedback-intent.md +0 -54
- package/prompts/utils/analyze-structure-feedback-intent.md +0 -43
- package/prompts/utils/feedback-refiner.md +0 -105
- package/types/document-schema.mjs +0 -55
- package/types/document-structure-schema.mjs +0 -261
- package/utils/auth-utils.mjs +0 -275
- package/utils/blocklet.mjs +0 -104
- package/utils/check-document-has-diagram.mjs +0 -95
- package/utils/conflict-detector.mjs +0 -149
- package/utils/constants/index.mjs +0 -620
- package/utils/constants/linter.mjs +0 -102
- package/utils/d2-utils.mjs +0 -198
- package/utils/debug.mjs +0 -3
- package/utils/delete-diagram-images.mjs +0 -99
- package/utils/deploy.mjs +0 -86
- package/utils/docs-finder-utils.mjs +0 -623
- package/utils/evaluate/report-utils.mjs +0 -132
- package/utils/extract-api.mjs +0 -32
- package/utils/file-utils.mjs +0 -960
- package/utils/history-utils.mjs +0 -203
- package/utils/icon-map.mjs +0 -26
- package/utils/image-compress.mjs +0 -75
- package/utils/kroki-utils.mjs +0 -173
- package/utils/linter/index.mjs +0 -50
- package/utils/load-config.mjs +0 -107
- package/utils/markdown/index.mjs +0 -26
- package/utils/markdown-checker.mjs +0 -694
- package/utils/mermaid-validator.mjs +0 -140
- package/utils/mermaid-worker-pool.mjs +0 -250
- package/utils/mermaid-worker.mjs +0 -233
- package/utils/openapi/index.mjs +0 -28
- package/utils/preferences-utils.mjs +0 -175
- package/utils/request.mjs +0 -10
- package/utils/store/index.mjs +0 -45
- package/utils/sync-diagram-to-translations.mjs +0 -262
- package/utils/upload-files.mjs +0 -231
- package/utils/utils.mjs +0 -1354
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# 文档结构规划指南
|
|
2
|
+
|
|
3
|
+
本文档提供如何规划文档结构和决定是否拆分的详细指南。
|
|
4
|
+
|
|
5
|
+
## 核心原则
|
|
6
|
+
|
|
7
|
+
**规划必须依据用户意图**
|
|
8
|
+
|
|
9
|
+
在规划文档结构时,持续参考 `user_intent.md` 中的内容:
|
|
10
|
+
- **目标用户决定文档类型**:技术开发者需要 API 参考,最终用户需要使用指南
|
|
11
|
+
- **使用场景决定文档范围**:快速上手只需核心功能,深入学习才需要完整架构
|
|
12
|
+
- **侧重点决定详细程度**:使用指南型文档重实践轻原理,参考手册型文档要全面覆盖
|
|
13
|
+
|
|
14
|
+
## 常见问题及避免方法
|
|
15
|
+
|
|
16
|
+
### ❌ 不看用户意图,直接按代码结构规划
|
|
17
|
+
|
|
18
|
+
导致文档大而全,不聚焦用户需求。应该先参考 user_intent.md,只为用户需要的模块创建文档。
|
|
19
|
+
|
|
20
|
+
### ❌ 规划了用户不需要的文档
|
|
21
|
+
|
|
22
|
+
浪费资源生成无用文档。应该严格按照 user_intent.md 中的"文档侧重点"规划。
|
|
23
|
+
|
|
24
|
+
### ❌ 文档粒度与用户需求不匹配
|
|
25
|
+
|
|
26
|
+
顺序任务应合并成单一文档,独立模块才考虑拆分。
|
|
27
|
+
|
|
28
|
+
## 规划策略
|
|
29
|
+
|
|
30
|
+
### 1. 最小必要原则
|
|
31
|
+
|
|
32
|
+
只规划用户意图中明确需要的文档。
|
|
33
|
+
|
|
34
|
+
**检查清单**:
|
|
35
|
+
- [ ] 这个文档是否在 user_intent.md 的使用场景中?
|
|
36
|
+
- [ ] 这个文档是否符合文档侧重点?
|
|
37
|
+
- [ ] 如果去掉这个文档,用户会缺失重要信息吗?
|
|
38
|
+
|
|
39
|
+
### 2. 聚焦核心场景
|
|
40
|
+
|
|
41
|
+
优先覆盖用户的主要使用场景。
|
|
42
|
+
|
|
43
|
+
**优先级排序**:
|
|
44
|
+
1. user_intent.md 中明确提到的场景
|
|
45
|
+
2. 对目标用户最重要的功能
|
|
46
|
+
3. 可选的高级特性
|
|
47
|
+
|
|
48
|
+
### 3. 适度深度
|
|
49
|
+
|
|
50
|
+
根据用户需求决定嵌套层级。
|
|
51
|
+
|
|
52
|
+
**深度指南**:
|
|
53
|
+
- 最终用户:扁平结构(1 层)
|
|
54
|
+
- 开发者:适度嵌套(1-2 层)
|
|
55
|
+
- 复杂系统:合理嵌套(2-3 层)
|
|
56
|
+
|
|
57
|
+
## 拆分判断标准
|
|
58
|
+
|
|
59
|
+
### 应该拆分为子文档
|
|
60
|
+
|
|
61
|
+
**必须满足以下 3-4 个条件**:
|
|
62
|
+
|
|
63
|
+
1. **内容量大**
|
|
64
|
+
- 父主题包含 4 个以上主要章节
|
|
65
|
+
- 单页阅读体验差(预计超过 500 行)
|
|
66
|
+
|
|
67
|
+
2. **独立性强**
|
|
68
|
+
- 每个子主题都有丰富的独立内容
|
|
69
|
+
- 至少 3 个段落或 3+ 小节
|
|
70
|
+
- 可以独立理解,不强依赖其他子主题
|
|
71
|
+
|
|
72
|
+
3. **无重复**
|
|
73
|
+
- 子文档之间没有明显内容重复
|
|
74
|
+
- 子文档与父文档之间没有明显内容重复
|
|
75
|
+
|
|
76
|
+
4. **独立查阅**
|
|
77
|
+
- 用户经常需要单独查阅某个子主题
|
|
78
|
+
- 而非顺序通读全部内容
|
|
79
|
+
|
|
80
|
+
**示例:应该拆分**
|
|
81
|
+
|
|
82
|
+
API 参考拆分为用户、订单、支付三个子文档,因为每个类别内容丰富、相对独立、开发者会单独查阅。
|
|
83
|
+
|
|
84
|
+
### 不应该拆分
|
|
85
|
+
|
|
86
|
+
**有以下任一情况**:
|
|
87
|
+
|
|
88
|
+
1. **子文档内容单薄**
|
|
89
|
+
- 预计少于 3 段内容
|
|
90
|
+
- 没有足够的源文件支持
|
|
91
|
+
|
|
92
|
+
2. **存在内容重复或相互依赖**
|
|
93
|
+
- 子文档之间有明显的内容重复
|
|
94
|
+
- 必须同时阅读多个子文档才能理解
|
|
95
|
+
|
|
96
|
+
3. **顺序完成的步骤**
|
|
97
|
+
- 用户需要按顺序完成所有步骤
|
|
98
|
+
- 如:安装 → 配置 → 首次运行
|
|
99
|
+
|
|
100
|
+
4. **拆分后父文档变空壳**
|
|
101
|
+
- 父文档只剩导航链接
|
|
102
|
+
- 没有实质内容
|
|
103
|
+
|
|
104
|
+
**示例:不应该拆分**
|
|
105
|
+
|
|
106
|
+
快速开始不应拆分为安装、配置、首次运行三个子文档,因为这是顺序步骤,用户需要连续完成,拆分反而增加导航负担。应该合并为单一文档。
|
|
107
|
+
|
|
108
|
+
## 结构评估清单
|
|
109
|
+
|
|
110
|
+
在创建 document_structure.yaml 之前,对每个可能的嵌套结构使用此清单:
|
|
111
|
+
|
|
112
|
+
### 支持拆分的信号
|
|
113
|
+
|
|
114
|
+
满足 3+ 个时考虑拆分:
|
|
115
|
+
|
|
116
|
+
- [ ] 父主题源文件内容丰富,预计生成 4+ 个主要章节
|
|
117
|
+
- [ ] 每个子主题都有足够的源文件和独立内容(预计 3 段或 3+ 小节)
|
|
118
|
+
- [ ] 子主题之间相对独立,用户可能单独查阅(如不同的 API 类别)
|
|
119
|
+
- [ ] 工作区中已有按模块组织的源文件结构
|
|
120
|
+
|
|
121
|
+
### 反对拆分的信号
|
|
122
|
+
|
|
123
|
+
有 2+ 个时保持扁平:
|
|
124
|
+
|
|
125
|
+
- [ ] 子主题源文件内容单薄,预计每个少于 3 段
|
|
126
|
+
- [ ] 子主题之间有明显的顺序依赖或内容重复
|
|
127
|
+
- [ ] 用户需要按顺序完成(如安装 → 配置 → 首次运行)
|
|
128
|
+
- [ ] 源文件没有明确的模块划分
|
|
129
|
+
|
|
130
|
+
### 决策
|
|
131
|
+
|
|
132
|
+
综合评估后选择最适合用户的结构。
|
|
133
|
+
|
|
134
|
+
## 平衡原则
|
|
135
|
+
|
|
136
|
+
**优先考虑用户体验,根据实际内容量和用户需求决定结构。**
|
|
137
|
+
|
|
138
|
+
当难以决定时,问自己:
|
|
139
|
+
1. 这个结构对用户友好吗?
|
|
140
|
+
2. 用户能快速找到需要的信息吗?
|
|
141
|
+
3. 是否有不必要的导航层级?
|
|
142
|
+
|
|
143
|
+
**经验法则**:
|
|
144
|
+
- 有疑虑时,选择更简单的结构
|
|
145
|
+
- 扁平优于嵌套
|
|
146
|
+
- 少即是多
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# 用户意图推断指南
|
|
2
|
+
|
|
3
|
+
本文档提供如何推断和生成用户意图的详细指南。
|
|
4
|
+
|
|
5
|
+
## 推断内容
|
|
6
|
+
|
|
7
|
+
基于工作区内容推断以下三个方面:
|
|
8
|
+
|
|
9
|
+
### 1. 目标用户
|
|
10
|
+
|
|
11
|
+
判断文档的主要受众(技术开发者、最终用户、运维人员、产品经理等)。
|
|
12
|
+
|
|
13
|
+
### 2. 主要使用场景
|
|
14
|
+
|
|
15
|
+
推断用户查阅文档的场景(首次接触、开发集成、问题排查、深入学习等)。
|
|
16
|
+
|
|
17
|
+
### 3. 文档侧重点
|
|
18
|
+
|
|
19
|
+
确定文档类型(使用指南型、参考手册型、快速上手型、架构说明型)。
|
|
20
|
+
|
|
21
|
+
## user_intent.md 模板
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
# 用户意图
|
|
25
|
+
|
|
26
|
+
## 目标用户
|
|
27
|
+
[描述主要受众是谁,需要什么类型的信息]
|
|
28
|
+
|
|
29
|
+
## 使用场景
|
|
30
|
+
- [场景 1:用户在什么情况下查阅文档]
|
|
31
|
+
- [场景 2:...]
|
|
32
|
+
- [场景 3:...]
|
|
33
|
+
|
|
34
|
+
## 文档侧重点
|
|
35
|
+
本文档采用**[文档类型]**的形式:
|
|
36
|
+
- [侧重点 1]
|
|
37
|
+
- [侧重点 2]
|
|
38
|
+
- [侧重点 3]
|
|
39
|
+
|
|
40
|
+
[可选:说明不需要的内容,帮助聚焦]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 示例
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
# 用户意图
|
|
47
|
+
|
|
48
|
+
## 目标用户
|
|
49
|
+
本文档主要面向希望集成本项目 API 的开发者。
|
|
50
|
+
|
|
51
|
+
## 使用场景
|
|
52
|
+
- 开发者首次接触项目时,需要快速了解核心功能和如何开始
|
|
53
|
+
- 开发过程中查阅具体 API 的使用方法和参数说明
|
|
54
|
+
|
|
55
|
+
## 文档侧重点
|
|
56
|
+
本文档采用**使用指南 + API 参考**的组合形式:
|
|
57
|
+
- 提供清晰的快速开始指南
|
|
58
|
+
- 提供完整的 API 参考文档
|
|
59
|
+
|
|
60
|
+
不需要过多的架构设计说明。
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 交互策略
|
|
64
|
+
|
|
65
|
+
### 默认流程
|
|
66
|
+
|
|
67
|
+
1. **自动生成**:基于工作区分析,自动推断用户意图并生成 user_intent.md
|
|
68
|
+
2. **展示意图**:向用户展示推断的完整意图
|
|
69
|
+
3. **使用 AskUserQuestion 工具确认**:
|
|
70
|
+
- 问题:"用户意图是否符合您的需求?"
|
|
71
|
+
- 选项:"✅ 确认,开始规划文档结构"
|
|
72
|
+
4. **接收反馈**:如果用户选择调整或通过 Other 提供具体需求,更新 user_intent.md
|
|
73
|
+
5. **重新展示**:展示更新后的完整意图
|
|
74
|
+
6. **循环确认**:重复步骤 3-5,直到用户确认
|
|
75
|
+
7. **进入下一步**:用户确认后,才开始规划文档结构
|
|
76
|
+
|
|
77
|
+
### 展示格式
|
|
78
|
+
|
|
79
|
+
向用户展示推断的意图时,应清晰展示三个部分:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
📝 用户意图推断
|
|
83
|
+
|
|
84
|
+
## 目标用户
|
|
85
|
+
[具体描述]
|
|
86
|
+
|
|
87
|
+
## 使用场景
|
|
88
|
+
- [场景 1]
|
|
89
|
+
- [场景 2]
|
|
90
|
+
- [场景 3]
|
|
91
|
+
|
|
92
|
+
## 文档侧重点
|
|
93
|
+
本文档采用**[文档类型]**的形式:
|
|
94
|
+
- [侧重点 1]
|
|
95
|
+
- [侧重点 2]
|
|
96
|
+
|
|
97
|
+
[可选:不需要的内容]
|
|
98
|
+
|
|
99
|
+
这个意图是否符合您的需求?您可以提出调整建议。
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 示例交互
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Agent: 📝 用户意图推断
|
|
106
|
+
|
|
107
|
+
## 目标用户
|
|
108
|
+
本文档主要面向希望集成本项目 API 的开发者。
|
|
109
|
+
|
|
110
|
+
## 使用场景
|
|
111
|
+
- 开发者首次接触项目时,需要快速了解核心功能
|
|
112
|
+
- 开发过程中查阅具体 API 的使用方法
|
|
113
|
+
|
|
114
|
+
## 文档侧重点
|
|
115
|
+
本文档采用**使用指南 + API 参考**的组合形式:
|
|
116
|
+
- 提供清晰的快速开始指南
|
|
117
|
+
- 提供完整的 API 参考文档
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
[Agent 使用 AskUserQuestion 工具]
|
|
122
|
+
问题:用户意图是否符合您的需求?
|
|
123
|
+
选项:✅ 确认,开始规划文档结构
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
User: [选择 ✏️ Other] 其实主要是给运维人员看的,重点是部署和配置说明
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
Agent: 已更新目标用户和文档侧重点。
|
|
132
|
+
|
|
133
|
+
📝 更新后的用户意图
|
|
134
|
+
|
|
135
|
+
## 目标用户
|
|
136
|
+
本文档主要面向需要部署和维护系统的运维人员。
|
|
137
|
+
|
|
138
|
+
## 使用场景
|
|
139
|
+
- 运维人员首次部署时,需要了解系统要求和部署步骤
|
|
140
|
+
- 日常维护中查阅配置选项和最佳实践
|
|
141
|
+
|
|
142
|
+
## 文档侧重点
|
|
143
|
+
本文档采用**运维指南**的形式:
|
|
144
|
+
- 提供详细的部署和配置说明
|
|
145
|
+
- 提供系统要求和环境配置指南
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
[Agent 使用 AskUserQuestion 工具]
|
|
150
|
+
问题:用户意图是否符合您的需求?
|
|
151
|
+
选项:✅ 确认,开始规划文档结构
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
User: ✅ 确认,开始规划文档结构
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
Agent: 收到确认,开始规划文档结构...
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 处理反馈
|
|
163
|
+
|
|
164
|
+
根据用户反馈更新 user_intent.md 的对应部分(目标用户、使用场景、文档侧重点),必要时完全重写。每次修改后必须重新展示完整意图并询问确认。
|
|
165
|
+
|
|
166
|
+
## 关键原则
|
|
167
|
+
|
|
168
|
+
1. **基于证据推断**:从工作区内容(代码结构、README、配置文件)中寻找线索
|
|
169
|
+
2. **保持简洁**:user_intent.md 应该简洁明了,避免冗长
|
|
170
|
+
3. **可修改性**:用自然语言编写,用户易于理解和调整
|
|
171
|
+
4. **多轮确认**:支持用户多轮调整,每次修改后重新展示完整意图并确认
|
|
172
|
+
5. **用户确认后才继续**:绝对不要在用户确认前开始规划文档结构
|
package/doc-smith.yaml
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
type: ai
|
|
2
|
+
name: docsmith
|
|
3
|
+
keep_text_in_tool_uses: true
|
|
4
|
+
task_render_mode: collapse
|
|
5
|
+
instructions:
|
|
6
|
+
- role: system
|
|
7
|
+
url: ./main-system-prompt.md
|
|
8
|
+
|
|
9
|
+
input_key: message
|
|
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
|
+
|
|
95
|
+
|
|
96
|
+
afs:
|
|
97
|
+
modules:
|
|
98
|
+
- module: local-fs
|
|
99
|
+
options:
|
|
100
|
+
name: workspace
|
|
101
|
+
localPath: ${CWD}
|
|
102
|
+
description: |
|
|
103
|
+
Current working directory for the agent
|
|
104
|
+
- Read-write access to project files
|
|
105
|
+
- Use absolute path for file operations
|
|
106
|
+
- module: local-fs
|
|
107
|
+
options:
|
|
108
|
+
agentSkills: true
|
|
109
|
+
name: doc-smith
|
|
110
|
+
localPath: ./doc-smith
|
|
111
|
+
description: |
|
|
112
|
+
Agent skill for document operations
|
|
113
|
+
- Read-only access to skill definition files
|
|
114
|
+
- Do NOT modify files in this directory
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
You are an interactive CLI tool that helps users according to your "Output Style" below, which describes how you should respond to user queries. Use the instructions below and the tools available to you to assist the user.
|
|
2
|
+
|
|
3
|
+
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
|
|
4
|
+
|
|
5
|
+
# Looking up your own documentation:
|
|
6
|
+
|
|
7
|
+
When the user directly asks about any of the following:
|
|
8
|
+
- how to use Claude Code (eg. "can Claude Code do...", "does Claude Code have...")
|
|
9
|
+
- what you're able to do as Claude Code in second person (eg. "are you able...", "can you do...")
|
|
10
|
+
- about how they might do something with Claude Code (eg. "how do I...", "how can I...")
|
|
11
|
+
- how to use a specific Claude Code feature (eg. implement a hook, write a slash command, or install an MCP server)
|
|
12
|
+
- how to use the Claude Agent SDK, or asks you to write code that uses the Claude Agent SDK
|
|
13
|
+
|
|
14
|
+
# Tone and style
|
|
15
|
+
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
|
|
16
|
+
- Your output will be displayed on a command line interface. Your responses should be short and concise. You can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
|
|
17
|
+
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
|
|
18
|
+
- NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. This includes markdown files.
|
|
19
|
+
- Do not use a colon before tool calls. Your tool calls may not be shown directly in the output, so text like "Let me read the file:" followed by a read tool call should just be "Let me read the file." with a period.
|
|
20
|
+
|
|
21
|
+
# AFS Context
|
|
22
|
+
|
|
23
|
+
{{ $afs.description }}
|
|
24
|
+
|
|
25
|
+
```yaml alt="AFS Modules"
|
|
26
|
+
{{ $afs.modules | yaml.stringify }}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# Asking questions as you work
|
|
30
|
+
|
|
31
|
+
You have access to the askUserQuestion tool to ask the user questions when you need clarification, want to validate assumptions, or need to make a decision you're unsure about. When presenting options or plans, never include time estimates - focus on what each option involves, not how long it takes.
|
|
32
|
+
|
|
33
|
+
# Skill usage
|
|
34
|
+
|
|
35
|
+
When the user requests you to perform tasks, check if any of the available skills can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
|
|
36
|
+
|
|
37
|
+
## Loading skill resources on demand
|
|
38
|
+
|
|
39
|
+
Skills may include reference documents (guides, schemas, examples) in a `references/` directory. To optimize performance and context usage:
|
|
40
|
+
|
|
41
|
+
1. **Start with the main skill file** (e.g., `SKILL.md`) - it contains the workflow overview and references to detailed guides
|
|
42
|
+
2. **Load reference documents only when needed** - read specific guides only when you reach the step that requires them
|
|
43
|
+
3. **Don't preload all resources** - avoid reading all reference files at the start of a task
|
|
44
|
+
|
|
45
|
+
# Doing tasks
|
|
46
|
+
The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
|
|
47
|
+
- NEVER propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.
|
|
48
|
+
- Use the askUserQuestion tool to ask questions, clarify and gather information as needed.
|
|
49
|
+
- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it.
|
|
50
|
+
- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.
|
|
51
|
+
- Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.
|
|
52
|
+
- Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.
|
|
53
|
+
- Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task—three similar lines of code is better than a premature abstraction.
|
|
54
|
+
- Avoid backwards-compatibility hacks like renaming unused \`_vars\`, re-exporting types, adding \`// removed\` comments for removed code, etc. If something is unused, delete it completely.
|
|
55
|
+
|
|
56
|
+
IMPORTANT: Complete tasks fully. Do not stop mid-task or leave work incomplete. Do not claim a task is too large, that you lack time, or that context limits prevent completion. You have unlimited context through summarization. Continue working until the task is done or the user stops you.
|
package/package.json
CHANGED
|
@@ -1,83 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/doc-smith",
|
|
3
|
-
"version": "0.9.8-alpha.
|
|
3
|
+
"version": "0.9.8-alpha.4",
|
|
4
4
|
"description": "AI-driven documentation generation tool built on the AIGNE Framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
9
|
-
"agents",
|
|
10
|
-
"agentic-agents",
|
|
11
|
-
"assets/report-template",
|
|
12
|
-
"docs-mcp",
|
|
13
|
-
"prompts",
|
|
14
|
-
"types",
|
|
15
|
-
"utils",
|
|
16
|
-
"aigne.yaml",
|
|
17
|
-
"LICENSE",
|
|
18
|
-
"README.md",
|
|
19
|
-
"CHANGELOG.md"
|
|
20
|
-
],
|
|
21
|
-
"main": "index.js",
|
|
8
|
+
"main": "aigne.yaml",
|
|
22
9
|
"type": "module",
|
|
23
10
|
"bin": "aigne.yaml",
|
|
24
11
|
"keywords": [],
|
|
25
12
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
26
13
|
"license": "Elastic-2.0",
|
|
27
14
|
"dependencies": {
|
|
28
|
-
"@aigne/cli": "^1.
|
|
29
|
-
"@aigne/core": "^1.70.1",
|
|
30
|
-
"@aigne/publish-docs": "^0.14.2",
|
|
31
|
-
"@aigne/secrets": "^0.1.4",
|
|
32
|
-
"@blocklet/payment-broker-client": "^1.22.30",
|
|
33
|
-
"chalk": "^5.5.0",
|
|
34
|
-
"debug": "^4.4.1",
|
|
35
|
-
"diff": "^8.0.2",
|
|
36
|
-
"dompurify": "^3.2.6",
|
|
37
|
-
"fast-deep-equal": "^3.1.3",
|
|
38
|
-
"fastq": "^1.19.1",
|
|
39
|
-
"file-type": "^21.0.0",
|
|
40
|
-
"fs-extra": "^11.3.1",
|
|
41
|
-
"glob": "^11.0.3",
|
|
42
|
-
"gpt-tokenizer": "^3.2.0",
|
|
43
|
-
"image-size": "^2.0.2",
|
|
44
|
-
"is-in-ci": "^2.0.0",
|
|
45
|
-
"isbinaryfile": "^5.0.6",
|
|
46
|
-
"jsdom": "^26.1.0",
|
|
47
|
-
"marked": "^15.0.12",
|
|
48
|
-
"marked-terminal": "^7.3.0",
|
|
49
|
-
"mermaid": "^11.9.0",
|
|
50
|
-
"minimatch": "^10.1.1",
|
|
51
|
-
"open": "^10.2.0",
|
|
52
|
-
"p-limit": "^7.1.1",
|
|
53
|
-
"p-map": "^7.0.3",
|
|
54
|
-
"p-retry": "^7.0.0",
|
|
55
|
-
"remark-gfm": "^4.0.1",
|
|
56
|
-
"remark-lint": "^10.0.1",
|
|
57
|
-
"remark-parse": "^11.0.0",
|
|
58
|
-
"sharp": "^0.33.0",
|
|
59
|
-
"typescript": "^5.9.3",
|
|
60
|
-
"ufo": "^1.6.1",
|
|
61
|
-
"unified": "^11.0.5",
|
|
62
|
-
"unist-util-visit": "^5.0.0",
|
|
63
|
-
"vfile": "^6.0.3",
|
|
64
|
-
"yaml": "^2.8.0",
|
|
65
|
-
"zod": "^3.25.76",
|
|
66
|
-
"zod-to-json-schema": "^3.24.6"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@biomejs/biome": "^2.2.4"
|
|
70
|
-
},
|
|
71
|
-
"scripts": {
|
|
72
|
-
"test": "bun test --preload ./tests/setup/mock-process-exit.mjs",
|
|
73
|
-
"test:coverage2": "bun test --preload ./tests/setup/mock-process-exit.mjs --coverage",
|
|
74
|
-
"test:coverage": "bun test --preload ./tests/setup/mock-process-exit.mjs --coverage --coverage-reporter=lcov --coverage-reporter=text",
|
|
75
|
-
"test:deploy": "bun test --preload ./tests/setup/mock-process-exit.mjs tests/utils/deploy.test.mjs --coverage --coverage-reporter=text",
|
|
76
|
-
"test:user-review": "bun test --preload ./tests/setup/mock-process-exit.mjs tests/agents/update/user-review-document.test.mjs --coverage --coverage-reporter=lcov --coverage-reporter=text",
|
|
77
|
-
"test:watch": "bun test --preload ./tests/setup/mock-process-exit.mjs --watch",
|
|
78
|
-
"lint": "biome lint && biome format",
|
|
79
|
-
"update:deps": "npx -y taze major -r -w -f -n '/@abtnode|@aigne|@arcblock|@blocklet|@did-connect|@did-pay|@did-space|@nft-store|@nft-studio|@ocap/' && pnpm install && pnpm run deduplicate",
|
|
80
|
-
"deduplicate": "pnpm dedupe",
|
|
81
|
-
"lint:fix": "biome lint --write && biome format --write"
|
|
15
|
+
"@aigne/cli": "^1.59.0-beta.4"
|
|
82
16
|
}
|
|
83
17
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# DocSmith Skill 安装脚本
|
|
2
|
+
|
|
3
|
+
这个目录包含用于安装和卸载 doc-smith skill 的脚本。
|
|
4
|
+
|
|
5
|
+
## 脚本说明
|
|
6
|
+
|
|
7
|
+
### install.sh
|
|
8
|
+
将 doc-smith skill 安装到 Claude 的全局 skills 目录(`~/.claude/skills`),使其可以在任何项目中使用。
|
|
9
|
+
|
|
10
|
+
**功能:**
|
|
11
|
+
- 自动创建 `~/.claude/skills` 目录(如果不存在)
|
|
12
|
+
- 复制 doc-smith 文件夹到全局 skills 目录
|
|
13
|
+
- 检测并提示是否覆盖已存在的安装
|
|
14
|
+
- 验证安装是否成功
|
|
15
|
+
|
|
16
|
+
### uninstall.sh
|
|
17
|
+
从 Claude 的全局 skills 目录移除 doc-smith skill。
|
|
18
|
+
|
|
19
|
+
**功能:**
|
|
20
|
+
- 检查 skill 是否已安装
|
|
21
|
+
- 确认后删除 doc-smith skill
|
|
22
|
+
- 验证卸载是否成功
|
|
23
|
+
|
|
24
|
+
## 使用方法
|
|
25
|
+
|
|
26
|
+
### 安装
|
|
27
|
+
|
|
28
|
+
在项目根目录执行:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
./scripts/install.sh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
或者从 scripts 目录执行:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd scripts
|
|
38
|
+
./install.sh
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**自动确认安装(跳过提示):**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
./scripts/install.sh -y
|
|
45
|
+
# 或
|
|
46
|
+
./scripts/install.sh --yes
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
安装成功后,你可以在任何地方的 Claude Code 中使用:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
/doc-smith
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 卸载
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
./scripts/uninstall.sh
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 安装位置
|
|
62
|
+
|
|
63
|
+
- **源文件:** `doc-smith-skill/doc-smith/`
|
|
64
|
+
- **安装位置:** `~/.claude/skills/doc-smith/`
|
|
65
|
+
|
|
66
|
+
## 注意事项
|
|
67
|
+
|
|
68
|
+
1. 脚本会提示是否覆盖已存在的安装
|
|
69
|
+
2. 卸载前会要求确认
|
|
70
|
+
3. 所有操作都有彩色输出提示,便于识别状态
|
|
71
|
+
4. 脚本执行失败时会返回非零退出码
|
|
72
|
+
|
|
73
|
+
## 故障排查
|
|
74
|
+
|
|
75
|
+
**权限问题:**
|
|
76
|
+
```bash
|
|
77
|
+
chmod +x scripts/install.sh
|
|
78
|
+
chmod +x scripts/uninstall.sh
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**手动安装:**
|
|
82
|
+
```bash
|
|
83
|
+
mkdir -p ~/.claude/skills
|
|
84
|
+
cp -r doc-smith ~/.claude/skills/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**手动卸载:**
|
|
88
|
+
```bash
|
|
89
|
+
rm -rf ~/.claude/skills/doc-smith
|
|
90
|
+
```
|