@aigne/doc-smith 0.2.3 → 0.2.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/CHANGELOG.md +7 -0
- package/agents/save-docs.mjs +22 -22
- package/package.json +1 -1
- package/prompts/document/structure-planning.md +1 -0
- package/utils/utils.mjs +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.4](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.2.3...v0.2.4) (2025-08-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* polish agent output log ([40a2451](https://github.com/AIGNE-io/aigne-doc-smith/commit/40a245122ce4d8747e5b5dbe88be6986047c38ae))
|
|
9
|
+
|
|
3
10
|
## [0.2.3](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.2.2...v0.2.3) (2025-08-07)
|
|
4
11
|
|
|
5
12
|
|
package/agents/save-docs.mjs
CHANGED
|
@@ -45,41 +45,41 @@ export default async function saveDocs({
|
|
|
45
45
|
console.error("Failed to cleanup invalid .md files:", err.message);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const message = `## ✅ Documentation Generated Successfully!
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Successfully generated **${structurePlan.length}** documents and saved to: \`${docsDir}\`
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
### 🚀 Next Steps
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
1. Publish Documentation
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
\`\`\`bash
|
|
57
|
+
aigne doc publish
|
|
58
|
+
\`\`\`
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Get an online preview link to share with your team
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
### 🔧 Optional Improvements
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
1. Update Specific Documents
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
\`\`\`bash
|
|
67
|
+
aigne doc update
|
|
68
|
+
\`\`\`
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Regenerate content for specific documents
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
2. Provide Structure Feedback
|
|
73
|
+
\`\`\`bash
|
|
74
|
+
aigne doc generate --feedback "Your feedback on document structure"
|
|
75
|
+
\`\`\`
|
|
76
|
+
Improve the overall documentation structure
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
---
|
|
79
|
+
`;
|
|
80
80
|
|
|
81
81
|
return {
|
|
82
|
-
|
|
82
|
+
message,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
- 结构规划要精炼,避免同一个功能被拆为了多个部分,当内容足够复杂,放在一起展示过长影响用户阅读时,考虑拆出子层级
|
|
8
8
|
- **第一层 <= 7 项**,层级 <= 3 级;同一层使用统一语义(动词时态、名词单复数)
|
|
9
9
|
- 如果当前部分是存在子文档,当前文档只展示简要的内容,引导用户到子文档中查看详细的内容
|
|
10
|
+
- 如果存在测试相关的代码,可以作为生成文档的参考,**不要为测试代码生成文档**
|
|
10
11
|
- 总是在一开始包含下列内容:
|
|
11
12
|
- Overview:简要说明产品能解决什么,产品能提供什么,产品的结构信息,让用户能快速有一个全面的认识,给出下一步的入口,引导用户阅读
|
|
12
13
|
- Getting Started:内容包含安装、最小运行示例,让用户用通过一部分文档,在很短的时间就能跑通一个最简单的示例
|
package/utils/utils.mjs
CHANGED
|
@@ -595,7 +595,12 @@ function getDirectoryContents(dirPath, searchTerm = "") {
|
|
|
595
595
|
|
|
596
596
|
for (const entry of entries) {
|
|
597
597
|
const entryName = entry.name;
|
|
598
|
-
|
|
598
|
+
|
|
599
|
+
// Preserve ./ prefix when dirPath is "./"
|
|
600
|
+
let relativePath = path.join(dirPath, entryName);
|
|
601
|
+
if (dirPath?.startsWith("./")) {
|
|
602
|
+
relativePath = `./${relativePath}`;
|
|
603
|
+
}
|
|
599
604
|
|
|
600
605
|
// Filter by search term if provided
|
|
601
606
|
if (
|