autosnippet 3.3.0 → 3.3.3

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 (245) hide show
  1. package/dashboard/dist/assets/icons-BJ2mUBi8.js +1 -0
  2. package/dashboard/dist/assets/index-B659K9t5.js +128 -0
  3. package/dashboard/dist/assets/index-NCm40PMD.css +1 -0
  4. package/dashboard/dist/index.html +3 -3
  5. package/dist/bin/cli.d.ts +1 -0
  6. package/dist/bin/cli.js +284 -142
  7. package/dist/lib/agent/context/ExplorationTracker.d.ts +2 -0
  8. package/dist/lib/agent/context/ExplorationTracker.js +21 -3
  9. package/dist/lib/agent/core/ToolExecutionPipeline.d.ts +3 -1
  10. package/dist/lib/agent/core/ToolExecutionPipeline.js +8 -1
  11. package/dist/lib/agent/forge/DynamicComposer.d.ts +58 -0
  12. package/dist/lib/agent/forge/DynamicComposer.js +99 -0
  13. package/dist/lib/agent/forge/SandboxRunner.d.ts +60 -0
  14. package/dist/lib/agent/forge/SandboxRunner.js +251 -0
  15. package/dist/lib/agent/forge/TemporaryToolRegistry.d.ts +76 -0
  16. package/dist/lib/agent/forge/TemporaryToolRegistry.js +154 -0
  17. package/dist/lib/agent/forge/ToolForge.d.ts +92 -0
  18. package/dist/lib/agent/forge/ToolForge.js +239 -0
  19. package/dist/lib/agent/forge/ToolRequirementAnalyzer.d.ts +44 -0
  20. package/dist/lib/agent/forge/ToolRequirementAnalyzer.js +119 -0
  21. package/dist/lib/agent/tools/ToolRegistry.d.ts +2 -0
  22. package/dist/lib/agent/tools/ToolRegistry.js +4 -0
  23. package/dist/lib/agent/tools/composite.js +0 -1
  24. package/dist/lib/agent/tools/index.d.ts +2 -50
  25. package/dist/lib/agent/tools/index.js +2 -3
  26. package/dist/lib/agent/tools/lifecycle.d.ts +1 -58
  27. package/dist/lib/agent/tools/lifecycle.js +2 -75
  28. package/dist/lib/cli/KnowledgeSyncService.d.ts +26 -0
  29. package/dist/lib/cli/KnowledgeSyncService.js +33 -1
  30. package/dist/lib/cli/deploy/FileManifest.d.ts +0 -21
  31. package/dist/lib/cli/deploy/FileManifest.js +0 -11
  32. package/dist/lib/domain/knowledge/KnowledgeEntry.d.ts +10 -0
  33. package/dist/lib/domain/knowledge/KnowledgeEntry.js +2 -0
  34. package/dist/lib/domain/knowledge/Lifecycle.d.ts +19 -2
  35. package/dist/lib/domain/knowledge/Lifecycle.js +32 -6
  36. package/dist/lib/domain/knowledge/UnifiedValidator.d.ts +1 -5
  37. package/dist/lib/domain/knowledge/UnifiedValidator.js +7 -44
  38. package/dist/lib/domain/knowledge/values/Stats.d.ts +29 -0
  39. package/dist/lib/domain/knowledge/values/Stats.js +41 -0
  40. package/dist/lib/external/mcp/McpServer.d.ts +19 -38
  41. package/dist/lib/external/mcp/McpServer.js +145 -117
  42. package/dist/lib/external/mcp/autoApproveInjector.js +0 -2
  43. package/dist/lib/external/mcp/handlers/bootstrap/MissionBriefingBuilder.d.ts +26 -1
  44. package/dist/lib/external/mcp/handlers/bootstrap/MissionBriefingBuilder.js +41 -0
  45. package/dist/lib/external/mcp/handlers/bootstrap/pipeline/orchestrator.js +49 -0
  46. package/dist/lib/external/mcp/handlers/bootstrap/shared/bootstrap-phases.d.ts +3 -0
  47. package/dist/lib/external/mcp/handlers/bootstrap/shared/bootstrap-phases.js +27 -0
  48. package/dist/lib/external/mcp/handlers/bootstrap/skills.js +1 -1
  49. package/dist/lib/external/mcp/handlers/bootstrap-external.js +1 -0
  50. package/dist/lib/external/mcp/handlers/bootstrap-internal.js +2 -0
  51. package/dist/lib/external/mcp/handlers/browse.d.ts +1 -0
  52. package/dist/lib/external/mcp/handlers/browse.js +2 -1
  53. package/dist/lib/external/mcp/handlers/consolidated.d.ts +117 -6
  54. package/dist/lib/external/mcp/handlers/consolidated.js +251 -71
  55. package/dist/lib/external/mcp/handlers/guard.d.ts +150 -0
  56. package/dist/lib/external/mcp/handlers/guard.js +239 -5
  57. package/dist/lib/external/mcp/handlers/knowledge.d.ts +0 -29
  58. package/dist/lib/external/mcp/handlers/knowledge.js +1 -76
  59. package/dist/lib/external/mcp/handlers/panorama.d.ts +36 -0
  60. package/dist/lib/external/mcp/handlers/panorama.js +156 -0
  61. package/dist/lib/external/mcp/handlers/system.d.ts +2 -54
  62. package/dist/lib/external/mcp/handlers/system.js +3 -113
  63. package/dist/lib/external/mcp/handlers/task.d.ts +13 -24
  64. package/dist/lib/external/mcp/handlers/task.js +218 -557
  65. package/dist/lib/external/mcp/handlers/types.d.ts +91 -8
  66. package/dist/lib/external/mcp/handlers/types.js +18 -1
  67. package/dist/lib/external/mcp/handlers/wiki-external.d.ts +18 -1
  68. package/dist/lib/external/mcp/handlers/wiki-external.js +16 -1
  69. package/dist/lib/external/mcp/tools.d.ts +18 -24
  70. package/dist/lib/external/mcp/tools.js +132 -159
  71. package/dist/lib/http/HttpServer.js +52 -0
  72. package/dist/lib/http/middleware/validate.js +7 -3
  73. package/dist/lib/http/routes/audit.d.ts +8 -0
  74. package/dist/lib/http/routes/audit.js +51 -0
  75. package/dist/lib/http/routes/guardReport.d.ts +10 -0
  76. package/dist/lib/http/routes/guardReport.js +143 -0
  77. package/dist/lib/http/routes/knowledge.js +32 -1
  78. package/dist/lib/http/routes/panorama.d.ts +11 -0
  79. package/dist/lib/http/routes/panorama.js +322 -0
  80. package/dist/lib/http/routes/signals.d.ts +10 -0
  81. package/dist/lib/http/routes/signals.js +104 -0
  82. package/dist/lib/http/routes/task.d.ts +2 -3
  83. package/dist/lib/http/routes/task.js +17 -347
  84. package/dist/lib/http/routes/violations.js +1 -1
  85. package/dist/lib/infrastructure/audit/AuditLogger.d.ts +6 -1
  86. package/dist/lib/infrastructure/audit/AuditLogger.js +14 -1
  87. package/dist/lib/infrastructure/database/drizzle/schema.d.ts +202 -504
  88. package/dist/lib/infrastructure/database/drizzle/schema.js +38 -69
  89. package/dist/lib/infrastructure/database/migrations/004_evolution_proposals.d.ts +8 -0
  90. package/dist/lib/infrastructure/database/migrations/004_evolution_proposals.js +43 -0
  91. package/dist/lib/infrastructure/database/migrations/005_recipe_source_refs.d.ts +9 -0
  92. package/dist/lib/infrastructure/database/migrations/005_recipe_source_refs.js +24 -0
  93. package/dist/lib/infrastructure/logging/Logger.d.ts +2 -0
  94. package/dist/lib/infrastructure/logging/Logger.js +34 -7
  95. package/dist/lib/infrastructure/monitoring/ErrorTracker.js +3 -1
  96. package/dist/lib/infrastructure/monitoring/PerformanceMonitor.d.ts +2 -2
  97. package/dist/lib/infrastructure/monitoring/PerformanceMonitor.js +12 -10
  98. package/dist/lib/infrastructure/notification/LarkNotifier.d.ts +24 -0
  99. package/dist/lib/infrastructure/notification/LarkNotifier.js +97 -0
  100. package/dist/lib/infrastructure/report/ReportStore.d.ts +45 -0
  101. package/dist/lib/infrastructure/report/ReportStore.js +133 -0
  102. package/dist/lib/infrastructure/signal/SignalAggregator.d.ts +18 -0
  103. package/dist/lib/infrastructure/signal/SignalAggregator.js +84 -0
  104. package/dist/lib/infrastructure/signal/SignalBridge.d.ts +13 -0
  105. package/dist/lib/infrastructure/signal/SignalBridge.js +20 -0
  106. package/dist/lib/infrastructure/signal/SignalBus.d.ts +63 -0
  107. package/dist/lib/infrastructure/signal/SignalBus.js +106 -0
  108. package/dist/lib/infrastructure/signal/SignalTraceWriter.d.ts +36 -0
  109. package/dist/lib/infrastructure/signal/SignalTraceWriter.js +130 -0
  110. package/dist/lib/infrastructure/vector/HnswVectorAdapter.js +18 -2
  111. package/dist/lib/injection/ServiceContainer.js +8 -0
  112. package/dist/lib/injection/ServiceMap.d.ts +16 -10
  113. package/dist/lib/injection/modules/AgentModule.d.ts +1 -1
  114. package/dist/lib/injection/modules/AgentModule.js +7 -1
  115. package/dist/lib/injection/modules/AppModule.d.ts +1 -1
  116. package/dist/lib/injection/modules/AppModule.js +4 -13
  117. package/dist/lib/injection/modules/GuardModule.js +27 -2
  118. package/dist/lib/injection/modules/InfraModule.d.ts +0 -1
  119. package/dist/lib/injection/modules/InfraModule.js +9 -7
  120. package/dist/lib/injection/modules/KnowledgeModule.d.ts +5 -0
  121. package/dist/lib/injection/modules/KnowledgeModule.js +131 -0
  122. package/dist/lib/injection/modules/PanoramaModule.d.ts +18 -0
  123. package/dist/lib/injection/modules/PanoramaModule.js +76 -0
  124. package/dist/lib/injection/modules/SignalModule.d.ts +10 -0
  125. package/dist/lib/injection/modules/SignalModule.js +84 -0
  126. package/dist/lib/repository/knowledge/KnowledgeRepository.impl.d.ts +1 -0
  127. package/dist/lib/repository/knowledge/KnowledgeRepository.impl.js +6 -0
  128. package/dist/lib/service/bootstrap/BootstrapTaskManager.d.ts +3 -1
  129. package/dist/lib/service/bootstrap/BootstrapTaskManager.js +20 -1
  130. package/dist/lib/service/bootstrap/UiStartupTasks.d.ts +45 -0
  131. package/dist/lib/service/bootstrap/UiStartupTasks.js +101 -0
  132. package/dist/lib/service/delivery/AgentInstructionsGenerator.js +4 -5
  133. package/dist/lib/service/delivery/CursorDeliveryPipeline.d.ts +3 -1
  134. package/dist/lib/service/delivery/CursorDeliveryPipeline.js +13 -10
  135. package/dist/lib/service/delivery/RulesGenerator.js +3 -2
  136. package/dist/lib/service/evolution/ConsolidationAdvisor.d.ts +114 -0
  137. package/dist/lib/service/evolution/ConsolidationAdvisor.js +542 -0
  138. package/dist/lib/service/evolution/ContradictionDetector.d.ts +54 -0
  139. package/dist/lib/service/evolution/ContradictionDetector.js +253 -0
  140. package/dist/lib/service/evolution/DecayDetector.d.ts +71 -0
  141. package/dist/lib/service/evolution/DecayDetector.js +244 -0
  142. package/dist/lib/service/evolution/EnhancementSuggester.d.ts +38 -0
  143. package/dist/lib/service/evolution/EnhancementSuggester.js +220 -0
  144. package/dist/lib/service/evolution/KnowledgeMetabolism.d.ts +82 -0
  145. package/dist/lib/service/evolution/KnowledgeMetabolism.js +167 -0
  146. package/dist/lib/service/evolution/RedundancyAnalyzer.d.ts +53 -0
  147. package/dist/lib/service/evolution/RedundancyAnalyzer.js +210 -0
  148. package/dist/lib/service/evolution/StagingManager.d.ts +57 -0
  149. package/dist/lib/service/evolution/StagingManager.js +201 -0
  150. package/dist/lib/service/guard/ComplianceReporter.d.ts +42 -2
  151. package/dist/lib/service/guard/ComplianceReporter.js +43 -5
  152. package/dist/lib/service/guard/CoverageAnalyzer.d.ts +54 -0
  153. package/dist/lib/service/guard/CoverageAnalyzer.js +149 -0
  154. package/dist/lib/service/guard/GuardCheckEngine.d.ts +42 -0
  155. package/dist/lib/service/guard/GuardCheckEngine.js +465 -14
  156. package/dist/lib/service/guard/GuardFeedbackLoop.d.ts +3 -0
  157. package/dist/lib/service/guard/GuardFeedbackLoop.js +9 -0
  158. package/dist/lib/service/guard/ReverseGuard.d.ts +73 -0
  159. package/dist/lib/service/guard/ReverseGuard.js +256 -0
  160. package/dist/lib/service/guard/RuleLearner.d.ts +12 -0
  161. package/dist/lib/service/guard/RuleLearner.js +38 -0
  162. package/dist/lib/service/guard/UncertaintyCollector.d.ts +83 -0
  163. package/dist/lib/service/guard/UncertaintyCollector.js +149 -0
  164. package/dist/lib/service/guard/ViolationsStore.d.ts +1 -0
  165. package/dist/lib/service/guard/ViolationsStore.js +33 -3
  166. package/dist/lib/service/knowledge/ConfidenceRouter.d.ts +13 -0
  167. package/dist/lib/service/knowledge/ConfidenceRouter.js +14 -0
  168. package/dist/lib/service/knowledge/KnowledgeService.js +22 -4
  169. package/dist/lib/service/knowledge/SourceRefReconciler.d.ts +68 -0
  170. package/dist/lib/service/knowledge/SourceRefReconciler.js +309 -0
  171. package/dist/lib/service/panorama/CouplingAnalyzer.d.ts +27 -0
  172. package/dist/lib/service/panorama/CouplingAnalyzer.js +192 -0
  173. package/dist/lib/service/panorama/DimensionAnalyzer.d.ts +28 -0
  174. package/dist/lib/service/panorama/DimensionAnalyzer.js +320 -0
  175. package/dist/lib/service/panorama/LayerInferrer.d.ts +19 -0
  176. package/dist/lib/service/panorama/LayerInferrer.js +182 -0
  177. package/dist/lib/service/panorama/ModuleDiscoverer.d.ts +24 -0
  178. package/dist/lib/service/panorama/ModuleDiscoverer.js +185 -0
  179. package/dist/lib/service/panorama/PanoramaAggregator.d.ts +29 -0
  180. package/dist/lib/service/panorama/PanoramaAggregator.js +228 -0
  181. package/dist/lib/service/panorama/PanoramaScanner.d.ts +52 -0
  182. package/dist/lib/service/panorama/PanoramaScanner.js +188 -0
  183. package/dist/lib/service/panorama/PanoramaService.d.ts +125 -0
  184. package/dist/lib/service/panorama/PanoramaService.js +363 -0
  185. package/dist/lib/service/panorama/PanoramaTypes.d.ts +134 -0
  186. package/dist/lib/service/panorama/PanoramaTypes.js +6 -0
  187. package/dist/lib/service/panorama/RoleRefiner.d.ts +48 -0
  188. package/dist/lib/service/panorama/RoleRefiner.js +535 -0
  189. package/dist/lib/service/search/BM25Scorer.d.ts +2 -2
  190. package/dist/lib/service/search/CoarseRanker.d.ts +7 -6
  191. package/dist/lib/service/search/CoarseRanker.js +11 -10
  192. package/dist/lib/service/search/FieldWeightedScorer.d.ts +81 -0
  193. package/dist/lib/service/search/FieldWeightedScorer.js +318 -0
  194. package/dist/lib/service/search/MultiSignalRanker.d.ts +3 -2
  195. package/dist/lib/service/search/MultiSignalRanker.js +17 -1
  196. package/dist/lib/service/search/SearchEngine.d.ts +9 -7
  197. package/dist/lib/service/search/SearchEngine.js +67 -10
  198. package/dist/lib/service/search/SearchTypes.d.ts +25 -3
  199. package/dist/lib/service/search/SearchTypes.js +6 -1
  200. package/dist/lib/service/signal/HitRecorder.d.ts +68 -0
  201. package/dist/lib/service/signal/HitRecorder.js +173 -0
  202. package/dist/lib/service/skills/SignalCollector.d.ts +3 -1
  203. package/dist/lib/service/skills/SignalCollector.js +31 -1
  204. package/dist/lib/service/task/IntentExtractor.d.ts +66 -0
  205. package/dist/lib/service/task/IntentExtractor.js +256 -0
  206. package/dist/lib/service/task/PrimeSearchPipeline.d.ts +54 -0
  207. package/dist/lib/service/task/PrimeSearchPipeline.js +113 -0
  208. package/dist/lib/service/vector/VectorService.d.ts +3 -0
  209. package/dist/lib/service/vector/VectorService.js +38 -4
  210. package/dist/lib/shared/schemas/mcp-tools.d.ts +41 -96
  211. package/dist/lib/shared/schemas/mcp-tools.js +59 -119
  212. package/dist/scripts/analyze-signals.d.ts +20 -0
  213. package/dist/scripts/analyze-signals.js +155 -0
  214. package/dist/scripts/diagnose-mcp.js +1 -1
  215. package/package.json +1 -1
  216. package/skills/autosnippet-create/SKILL.md +98 -89
  217. package/skills/autosnippet-devdocs/SKILL.md +55 -57
  218. package/templates/claude-code/hooks/autosnippet-session.sh +10 -15
  219. package/templates/cursor-hooks/hooks/session-start.sh +1 -1
  220. package/templates/guard-ci.yml +2 -2
  221. package/templates/instructions/agent-static.md +2 -1
  222. package/templates/instructions/conventions.md +5 -6
  223. package/templates/recipes-setup/README.md +1 -2
  224. package/templates/recipes-setup/_template.md +39 -39
  225. package/dashboard/dist/assets/icons-BofcEZ3f.js +0 -1
  226. package/dashboard/dist/assets/index-D0whuycy.css +0 -1
  227. package/dashboard/dist/assets/index-SiN1GChm.js +0 -128
  228. package/dist/lib/domain/task/Task.d.ts +0 -140
  229. package/dist/lib/domain/task/Task.js +0 -254
  230. package/dist/lib/domain/task/TaskDependency.d.ts +0 -23
  231. package/dist/lib/domain/task/TaskDependency.js +0 -34
  232. package/dist/lib/domain/task/TaskIdGenerator.d.ts +0 -40
  233. package/dist/lib/domain/task/TaskIdGenerator.js +0 -75
  234. package/dist/lib/domain/task/index.d.ts +0 -4
  235. package/dist/lib/domain/task/index.js +0 -4
  236. package/dist/lib/infrastructure/database/migrations/002_add_tasks.d.ts +0 -11
  237. package/dist/lib/infrastructure/database/migrations/002_add_tasks.js +0 -86
  238. package/dist/lib/repository/task/TaskRepository.impl.d.ts +0 -171
  239. package/dist/lib/repository/task/TaskRepository.impl.js +0 -347
  240. package/dist/lib/service/task/TaskGraphService.d.ts +0 -222
  241. package/dist/lib/service/task/TaskGraphService.js +0 -597
  242. package/dist/lib/service/task/TaskKnowledgeBridge.d.ts +0 -95
  243. package/dist/lib/service/task/TaskKnowledgeBridge.js +0 -298
  244. package/dist/lib/service/task/TaskReadyEngine.d.ts +0 -84
  245. package/dist/lib/service/task/TaskReadyEngine.js +0 -115
@@ -1,97 +1,94 @@
1
1
  ---
2
2
  name: autosnippet-create
3
- description: Submit knowledge to AutoSnippet. Covers single/batch MCP submission, V3 field requirements, quality validation, and lifecycle. Use when user says "提交知识/加入知识库/create recipe" or agent needs to persist code patterns, rules, or facts.
3
+ description: Submit knowledge to AutoSnippet. Covers single/batch MCP submission, V3 field requirements, quality validation, and lifecycle. Use when user says "submit knowledge / add to KB / create recipe" or agent needs to persist code patterns, rules, or facts.
4
4
  ---
5
5
 
6
- # AutoSnippet Create — 知识提交
6
+ # AutoSnippet Create — Knowledge Submission
7
7
 
8
- > 前置:MCP 工具返回统一 JSON Envelope `{ success, errorCode?, message?, data?, meta }`。操作前调用 `autosnippet_health` 确认服务可用。
8
+ > Prerequisite: MCP tools return a unified JSON Envelope `{ success, errorCode?, message?, data?, meta }`. Call `autosnippet_health` before operations to confirm service availability.
9
9
 
10
- Skill 指导 Agent 将代码模式、规则、事实提交到 AutoSnippet 知识库。提交后的条目进入 **Candidates**(pending 状态),用户在 Dashboard 审核后发布。
10
+ This Skill guides the Agent to submit code patterns, rules, and facts to the AutoSnippet knowledge base. Submitted entries enter **Candidates** (pending status); users review and publish them via the Dashboard.
11
11
 
12
- 关联 Skill:**autosnippet-recipes**(检索已有知识)。
12
+ Related Skill: **autosnippet-recipes** (search existing knowledge).
13
13
 
14
14
  ---
15
15
 
16
- ## 提交路径
16
+ ## Submission Paths
17
17
 
18
- | 路径 | 工具 | 适用场景 |
18
+ | Path | Tool | Use Case |
19
19
  |------|------|----------|
20
- | **单条提交** | `autosnippet_submit_knowledge` | Agent 精心构造一条完整知识 |
21
- | **批量提交** | `autosnippet_submit_knowledge_batch` | 冷启动维度分析、批量扫描 |
22
- | **Dashboard** | 浏览器 `http://localhost:3000` | 用户手动粘贴/扫描文件 |
20
+ | **Single** | `autosnippet_submit_knowledge` | Agent carefully constructs one complete entry |
21
+ | **Batch** | `autosnippet_submit_knowledge` (items array) | Cold-start dimension analysis, batch scans |
22
+ | **Dashboard** | Browser `http://localhost:3000` | User manual paste/file scan |
23
23
 
24
- **Agent 首选 MCP 提交**,无需浏览器。
24
+ **Agent prefers MCP submission** — no browser needed.
25
25
 
26
26
  ---
27
27
 
28
- ## 单条提交 — autosnippet_submit_knowledge
28
+ ## Single Submission — autosnippet_submit_knowledge
29
29
 
30
- 一次提交一条完整的 V3 知识条目。即使部分字段校验未通过也会入库,返回中附带 `recipeReadyHints` 提示缺失字段。
30
+ Submit one complete V3 knowledge entry at a time. Even if some fields fail validation, the entry is still stored; the response includes `recipeReadyHints` indicating missing fields.
31
31
 
32
- ### V3 必填字段(16 个)
32
+ ### V3 Required Fields (16)
33
33
 
34
- | 字段 | 类型 | 说明 |
35
- |------|------|------|
36
- | `title` | string | 知识标题,简洁明确 |
37
- | `description` | string | 一句话描述用途 |
38
- | `trigger` | string | 触发关键词,如 `@NetworkMonitor` |
39
- | `language` | string | 编程语言,如 `typescript`、`swift` |
40
- | `kind` | enum | `rule`(规范)/ `pattern`(模式)/ `fact`(事实) |
34
+ | Field | Type | Description |
35
+ |-------|------|-------------|
36
+ | `title` | string | Knowledge title, concise and clear |
37
+ | `description` | string | One-line purpose description |
38
+ | `trigger` | string | Trigger keyword, e.g. `@NetworkMonitor` |
39
+ | `language` | string | Programming language, e.g. `typescript`, `swift` |
40
+ | `kind` | enum | `rule` (constraint) / `pattern` (reusable) / `fact` (project fact) |
41
41
  | `category` | string | `View`/`Service`/`Tool`/`Model`/`Network`/`Storage`/`UI`/`Utility` |
42
- | `knowledgeType` | string | 知识类型标识 |
43
- | `doClause` | string | ✅ 应该做什么(Channel A+B 硬依赖) |
44
- | `dontClause` | string | ❌ 不应该做什么 |
45
- | `whenClause` | string | 何时适用(Channel B 硬依赖) |
46
- | `coreCode` | string | 核心代码片段 |
47
- | `headers` | string[] | 完整 import 语句列表 |
48
- | `usageGuide` | string | 使用指南(Markdown,见下方格式要求) |
49
- | `content` | object | `{ markdown: string, rationale: string }` 至少提供 markdown |
42
+ | `knowledgeType` | string | Knowledge type identifier |
43
+ | `doClause` | string | ✅ What to do (Channel A+B hard dependency) |
44
+ | `dontClause` | string | ❌ What not to do |
45
+ | `whenClause` | string | When to apply (Channel B hard dependency) |
46
+ | `coreCode` | string | Core code snippet |
47
+ | `headers` | string[] | Complete import statement list |
48
+ | `usageGuide` | string | Usage guide (Markdown, see format below) |
49
+ | `content` | object | `{ markdown: string, rationale: string }` at minimum provide markdown |
50
50
  | `reasoning` | object | `{ whyStandard: string, sources: string[], confidence: number }` |
51
51
 
52
- ### 可选字段
52
+ ### Optional Fields
53
53
 
54
- `topicHint`、`complexity`(beginner/intermediate/advanced)、`scope`(universal/project-specific/target-specific)、`tags`(string[])、`constraints`、`relations`、`skipDuplicateCheck`(默认 false
54
+ `topicHint`, `complexity` (beginner/intermediate/advanced), `scope` (universal/project-specific/target-specific), `tags` (string[]), `constraints`, `relations`, `skipDuplicateCheck` (default false)
55
55
 
56
- ### usageGuide 格式要求
56
+ ### usageGuide Format Requirements
57
57
 
58
- **必须**使用 Markdown 分节,禁止写成一行长文本。
58
+ **Must** use Markdown sections. Never write as a single long line.
59
59
 
60
60
  ```markdown
61
- ### 何时用
62
- - 场景 A
63
- - 场景 B
61
+ ### When to Use
62
+ - Scenario A
63
+ - Scenario B
64
64
 
65
- ### 何时不用
66
- - 排除场景
65
+ ### When Not to Use
66
+ - Exclusion scenario
67
67
 
68
- ### 使用步骤
69
- 1. 第一步
70
- 2. 第二步
68
+ ### Steps
69
+ 1. First step
70
+ 2. Second step
71
71
 
72
- ### 关键点
73
- - 注意事项 A
74
- - 注意事项 B
72
+ ### Key Points
73
+ - Note A
74
+ - Note B
75
75
  ```
76
76
 
77
- 可选章节:依赖与前置条件、错误处理、性能与资源、安全与合规、常见误用、替代方案、相关知识。
77
+ Optional sections: Dependencies & Prerequisites, Error Handling, Performance & Resources, Security & Compliance, Common Misuse, Alternatives, Related Knowledge.
78
78
 
79
79
  ---
80
80
 
81
- ## 批量提交autosnippet_submit_knowledge_batch
81
+ ## Batch Submission autosnippet_submit_knowledge (items array)
82
82
 
83
- 一次提交多条知识。每条单独校验,不通过的拒绝但不阻塞其他。
83
+ Submit multiple entries at once. Each is validated independently; failures are rejected without blocking others.
84
84
 
85
- ### 参数
85
+ ### Parameters
86
86
 
87
- | 字段 | 必填 | 类型 | 说明 |
88
- |------|------|------|------|
89
- | `target_name` | ✅ | string | 批量来源标识(如 `network-module-scan`) |
90
- | `items` | ✅ | object[] | 知识条目数组,每条结构同单条提交的字段 |
91
- | `source` | | string | 来源标记,默认 `cursor-scan` |
92
- | `deduplicate` | | boolean | 基于 title 去重,默认 `true` |
87
+ | Field | Required | Type | Description |
88
+ |-------|----------|------|-------------|
89
+ | `items` | ✅ | object[] | Array of knowledge entries, each following the same field structure as single submission |
93
90
 
94
- ### 返回值
91
+ ### Response
95
92
 
96
93
  ```json
97
94
  {
@@ -104,75 +101,87 @@ description: Submit knowledge to AutoSnippet. Covers single/batch MCP submission
104
101
  }
105
102
  ```
106
103
 
107
- **批量提交校验更严格**:单条提交校验不通过仍入库(附 hints),**批量提交校验不通过直接拒绝**。
104
+ **Batch validation is stricter**: single submission stores entries even with validation warnings (with hints), **batch submission rejects entries that fail validation**.
108
105
 
109
106
  ---
110
107
 
111
- ## 提交工作流
108
+ ## Submission Workflow
112
109
 
113
- ### 标准流程(Agent 通过 MCP
110
+ ### Standard Flow (Agent via MCP)
114
111
 
115
112
  ```
116
- 1. 分析代码构造 V3 字段
117
- 2. autosnippet_submit_knowledge / _batch 入库为 pending
118
- 3. 检查返回值:
119
- - 成功告知用户"已提交,请在 Dashboard Candidates 审核"
120
- - rejectedItems → 根据 rejectedSummary.commonMissingFields 补全后重试
121
- 4. [可选] autosnippet_enrich_candidates → 诊断候选字段完整性
113
+ 1. Analyze code construct V3 fields
114
+ 2. autosnippet_submit_knowledge stored as pending
115
+ 3. Check response:
116
+ - Successinform user "Submitted. Review in Dashboard Candidates."
117
+ - Has rejectedItems → fill in missing fields per rejectedSummary.commonMissingFields, retry
118
+ 4. [Optional] autosnippet_enrich_candidates → diagnose candidate field completeness
122
119
  ```
123
120
 
124
- ### 一条知识一个场景
121
+ ### One Entry Per Scenario
125
122
 
126
- 拆分原则:不同使用场景、不同 API 入口、不同配置方式→各自一条知识。禁止将多个模式合并为一条。
123
+ Splitting principle: different use cases, different API endpoints, different configurations → separate entries each. Never merge multiple patterns into one.
124
+
125
+ ### Batch Anti-Redundancy Rules (⚠️ MANDATORY)
126
+
127
+ **Items in the array must NOT be cross-redundant**:
128
+ - No highly overlapping doClause / coreCode / trigger entries within the same batch
129
+ - If two entries share 80%+ content, **merge into one** or split into **primary + extends supplementary** entries
130
+ - Primary entry contains complete core content; supplementary entry contains only the differences, referencing the primary trigger in `_relations.extends`
131
+ - The system only detects fusion between "candidates vs existing DB entries" — **it does NOT check intra-batch redundancy** — Agent must self-enforce
132
+
133
+ **Example**: Two routing knowledge entries (registration flow + dispatch supplement) should be structured as:
134
+ 1. Primary: Complete route registration pattern (register + open + doc sync)
135
+ 2. Supplementary: Only deepLink/Modal/Tab stack differences, `_relations.extends → primary trigger`
127
136
 
128
137
  ---
129
138
 
130
- ## 提交后管理
139
+ ## Post-Submission Management
131
140
 
132
- | 需求 | 工具 |
141
+ | Need | Tool |
133
142
  |------|------|
134
- | 查看候选状态 | `autosnippet_knowledge(operation=list)` |
135
- | 诊断缺失字段 | `autosnippet_enrich_candidates` |
136
- | 审核/发布 | `autosnippet_knowledge_lifecycle(operation=approve/publish/fast_track)` |
137
- | 搜索已有知识避免重复 | `autosnippet_search(mode=context, query=...)` |
143
+ | Check candidate status | `autosnippet_knowledge(operation=list)` |
144
+ | Diagnose missing fields | `autosnippet_enrich_candidates` |
145
+ | Review/publish | `autosnippet_knowledge_lifecycle(operation=approve/publish/fast_track)` |
146
+ | Search existing knowledge to avoid duplicates | `autosnippet_search(mode=context, query=...)` |
138
147
 
139
148
  ---
140
149
 
141
- ## kind 路由与管线影响
150
+ ## Kind Routing & Pipeline Impact
142
151
 
143
- | kind | 用途 | 管线产出 |
144
- |------|------|----------|
145
- | `rule` | 编码规范、约束 | → Channel A(.mdc 规则文件) |
146
- | `pattern` | 代码模式、用法 | → Channel B(.mdc 模式文件 + Snippet |
147
- | `fact` | 项目事实、架构决策 | → 搜索/Guard 上下文,不直接产出文件 |
152
+ | kind | Purpose | Pipeline Output |
153
+ |------|---------|-----------------|
154
+ | `rule` | Coding conventions, constraints | → Channel A (.mdc rule files) |
155
+ | `pattern` | Code patterns, usage | → Channel B (.mdc pattern files + Snippet) |
156
+ | `fact` | Project facts, architecture decisions | → Search/Guard context, no direct file output |
148
157
 
149
- `doClause` Channel A+B 的**硬依赖**——缺少此字段则完全无法生成 .mdc 文件。
158
+ `doClause` is a **hard dependency** for Channel A+B missing this field means .mdc files cannot be generated at all.
150
159
 
151
160
  ---
152
161
 
153
- ## 示例:提交一条知识
162
+ ## Example: Submit One Entry
154
163
 
155
164
  ```json
156
165
  {
157
- "title": "Network Monitor — 网络状态监听",
158
- "description": "使用 NWPathMonitor 监听网络连通性变化",
166
+ "title": "Network Monitor — Connectivity Listener",
167
+ "description": "Monitor network connectivity changes using NWPathMonitor",
159
168
  "trigger": "@NetworkMonitor",
160
169
  "language": "swift",
161
170
  "kind": "pattern",
162
171
  "category": "Network",
163
172
  "knowledgeType": "api-usage",
164
- "doClause": "使用 NWPathMonitor 监听网络状态变化,在主队列回调更新 UI",
165
- "dontClause": "不要用 Reachability 旧库,不要在后台线程直接更新 UI",
166
- "whenClause": "需要实时感知网络连通性变化时",
173
+ "doClause": "Use NWPathMonitor to observe network status changes; dispatch UI updates to the main queue",
174
+ "dontClause": "Do not use the deprecated Reachability library; do not update UI directly on background threads",
175
+ "whenClause": "When the app needs real-time network connectivity awareness",
167
176
  "coreCode": "let monitor = NWPathMonitor()\nmonitor.pathUpdateHandler = { path in\n DispatchQueue.main.async {\n self.isConnected = path.status == .satisfied\n }\n}\nmonitor.start(queue: DispatchQueue.global())",
168
177
  "headers": ["import Network"],
169
- "usageGuide": "### 何时用\n- App 需要实时网络状态\n- 启动时初始化一次\n\n### 关键点\n- 单例模式访问 sharedMonitor\n- start() 开始监听,cancel() 停止\n- 回调在 global queue,更新 UI 需切主线程",
178
+ "usageGuide": "### When to Use\n- App needs real-time network status\n- Initialize once at launch\n\n### Key Points\n- Access via singleton sharedMonitor\n- start() begins monitoring, cancel() stops\n- Callback runs on global queue; switch to main thread for UI updates",
170
179
  "content": {
171
- "markdown": "NWPathMonitor iOS 12+ 推荐的网络状态监听方案,替代废弃的 Reachability",
172
- "rationale": "Apple 官方推荐,线程安全,支持蜂窝/WiFi/有线判断。"
180
+ "markdown": "NWPathMonitor is the recommended network status monitoring API for iOS 12+, replacing deprecated Reachability.",
181
+ "rationale": "Apple-recommended, thread-safe, supports cellular/WiFi/wired detection."
173
182
  },
174
183
  "reasoning": {
175
- "whyStandard": "Apple Developer Documentation 推荐方案,替代 SCNetworkReachability",
184
+ "whyStandard": "Apple Developer Documentation recommended approach, replacing SCNetworkReachability",
176
185
  "sources": ["Apple Developer Documentation - NWPathMonitor"],
177
186
  "confidence": 0.95
178
187
  }
@@ -1,89 +1,87 @@
1
1
  ---
2
2
  name: autosnippet-devdocs
3
- description: Teaches the agent how to save development documents (architecture decisions, debug reports, design docs, research notes) to the AutoSnippet knowledge base using autosnippet_save_document. Use when the agent finishes analysis, debugging, design, or research and wants to persist the findings.
3
+ description: Generate and publish project Wiki documentation using autosnippet_wiki MCP tool (plan write finalize). Use when user says "generate wiki/docs", "write documentation", or agent needs to produce structured project documentation from the knowledge base.
4
4
  ---
5
5
 
6
- # AutoSnippet — Save Development Documents
6
+ # AutoSnippet — Wiki Documentation Generation
7
7
 
8
- This skill tells the agent how to **save development documents** (architecture decisions, debug reports, design docs, research notes) to the AutoSnippet knowledge base, so they can be retrieved by future sessions.
8
+ This skill guides the agent through generating structured **Wiki documentation** from the AutoSnippet knowledge base using the `autosnippet_wiki` MCP tool.
9
9
 
10
10
  ## When to use this skill
11
11
 
12
- - After finishing a **debug/troubleshooting session** save the root cause analysis
13
- - After making an **architecture or design decision** save the ADR (Architecture Decision Record)
14
- - After completing a **research or investigation** save findings and conclusions
15
- - After a **performance analysis** — save the benchmark results and optimization notes
16
- - When the user says "保存这个分析" / "记录一下" / "save this to KB"
12
+ - User asks to **generate project documentation** or **wiki**
13
+ - After a **cold-start bootstrap** completesproduce docs from newly captured knowledge
14
+ - When the user says "generate docs" / "write wiki" / "create documentation"
15
+ - After significant **knowledge base changes** — refresh documentation
17
16
 
18
- ## MCP Tool
17
+ ## MCP Tools
19
18
 
20
- | Tool | Description |
21
- |------|-------------|
22
- | `autosnippet_save_document` | Save a development document to KB. Only needs `title` + `markdown`. Auto-published, no review needed. |
23
- | `autosnippet_search` | Search saved documents by keyword or semantic query. |
19
+ | Tool | Operation | Description |
20
+ |------|-----------|-------------|
21
+ | `autosnippet_wiki` | `plan` | Plan topics + data packages (returns topic list + per-topic data for writing) |
22
+ | `autosnippet_wiki` | `finalize` | Complete generation (write meta.json, dedup check, validate completeness) |
23
+ | `autosnippet_search` | — | Search knowledge for additional context during writing |
24
+ | `autosnippet_knowledge` | `get` | Retrieve full Recipe content for reference |
24
25
 
25
- ## How to save a document
26
+ ## Workflow
26
27
 
27
- Call `autosnippet_save_document` with:
28
+ ### Step 1: Plan topics
28
29
 
29
30
  ```json
30
31
  {
31
- "title": "BiliDemo 冷启动性能分析",
32
- "markdown": "## 问题背景\n\n冷启动耗时 8s...\n\n## 根因分析\n\n...\n\n## 解决方案\n\n...",
33
- "description": "冷启动耗时 8s 的根因分析和优化方案",
34
- "tags": ["debug-report", "performance"],
35
- "scope": "project-specific"
32
+ "operation": "plan",
33
+ "language": "en"
36
34
  }
37
35
  ```
38
36
 
39
- ### Required fields
37
+ Returns:
38
+ - **topics[]** — Recommended documentation topics based on knowledge base content
39
+ - **dataPackages** — Per-topic data bundles (related Recipes, code patterns, architecture info)
40
+ - **sessionId** — Session identifier for the finalize step
40
41
 
41
- | Field | Description |
42
- |-------|-------------|
43
- | `title` | Document title (Chinese or English) |
44
- | `markdown` | Full Markdown content |
45
-
46
- ### Optional fields
47
-
48
- | Field | Default | Description |
49
- |-------|---------|-------------|
50
- | `description` | `""` | One-line summary |
51
- | `tags` | `[]` | Labels for filtering: `adr`, `debug-report`, `design-doc`, `research`, `performance`, `refactoring` |
52
- | `scope` | `project-specific` | `universal` or `project-specific` |
42
+ ### Step 2: Write articles
53
43
 
54
- ## Recommended tags
44
+ For each topic in the plan:
45
+ 1. Read the **dataPackage** for that topic
46
+ 2. Write a well-structured Markdown article to the wiki directory (`AutoSnippet/wiki/`)
47
+ 3. Use Recipe content as source of truth — cite Recipe titles
48
+ 4. Follow the structure: Overview → Details → Code Examples → Related Topics
55
49
 
56
- | Tag | Use case |
57
- |-----|----------|
58
- | `adr` | Architecture Decision Record |
59
- | `debug-report` | Bug investigation / root cause analysis |
60
- | `design-doc` | Module/feature design document |
61
- | `research` | Technology research or investigation |
62
- | `performance` | Benchmark results, profiling analysis |
63
- | `refactoring` | Refactoring plan or post-mortem |
64
- | `migration` | Migration guide or plan |
65
- | `meeting-notes` | Technical meeting summary |
50
+ ### Step 3: Finalize
66
51
 
67
- ## How documents are delivered to Cursor
68
-
69
- Documents are stored as `knowledgeType: 'dev-document'` in the knowledge DB. They follow a dedicated delivery path:
52
+ ```json
53
+ {
54
+ "operation": "finalize",
55
+ "sessionId": "<from plan>",
56
+ "articlesWritten": ["AutoSnippet/wiki/topic-1.md", "AutoSnippet/wiki/topic-2.md"]
57
+ }
58
+ ```
70
59
 
71
- 1. **NOT compressed** into Cursor Rules (Channel A/B skip dev-documents)
72
- 2. **Full text** written to `.cursor/skills/autosnippet-devdocs/references/*.md` (Channel D)
73
- 3. **Searchable** via `autosnippet_search("your query")` full-text search hits documents
60
+ This triggers:
61
+ - **meta.json** generation topic index with cross-references
62
+ - **Dedup check** — detect overlapping articles
63
+ - **Completeness validation** — ensure all planned topics are covered
74
64
 
75
- ## Document format tips
65
+ ## Writing guidelines
76
66
 
77
67
  - Use **clear headings** (`##`, `###`) — helps search and scanning
78
- - Include a **summary section** at the top
68
+ - Include a **summary section** at the top of each article
79
69
  - Reference **file paths** and **class names** concretely — improves search relevance
80
- - For ADRs, use the structure: Context Decision → Consequences
81
- - For debug reports: SymptomInvestigationRoot Cause Fix
70
+ - Cite **Recipe triggers** (e.g., `@bilidili-feature-url-routing`) as knowledge sources
71
+ - For architecture docs: ContextDesignImplementationTrade-offs
72
+ - For pattern docs: When to Use → How to Use → Code Example → Anti-patterns
73
+
74
+ ## Language parameter
75
+
76
+ | Value | Effect |
77
+ |-------|--------|
78
+ | `"en"` | English documentation (default) |
79
+ | `"zh"` | Chinese documentation |
82
80
 
83
81
  ## Related Skills
84
82
 
85
83
  | Skill | When to use |
86
84
  |-------|-------------|
87
- | `autosnippet-create` | Saving **code patterns/recipes** (needs trigger, doClause, etc.) |
88
- | `autosnippet-devdocs` (this) | Saving **prose documents** (only needs title + markdown) |
89
- | `autosnippet-recipes` | Looking up existing knowledge |
85
+ | `autosnippet-create` | Submitting **code patterns/recipes** to KB (not documents) |
86
+ | `autosnippet-devdocs` (this) | Generating **Wiki documentation** from KB |
87
+ | `autosnippet-recipes` | Looking up existing knowledge for reference |
@@ -8,11 +8,11 @@ if [[ "$1" == "--brief" ]]; then
8
8
  cat <<'EOF'
9
9
  📋 AutoSnippet Task Rules (MANDATORY):
10
10
  • Prime EVERY message: autosnippet_task({ operation: "prime" }) FIRST.
11
- • Create task for non-trivial work (≥2 files OR ≥10 lines). Claim → code → close.
12
- • Handle in-progress tasks before new work. Close/defer ALL on session end.
11
+ • Create task for non-trivial work (≥2 files OR ≥10 lines). Create → code → close.
12
+ • Handle in-progress tasks before new work. Close/fail ALL on session end.
13
13
  • You are the task operator — user speaks naturally, you run task operations.
14
14
  • User agrees/disagrees → record_decision immediately.
15
- • "fix bug"/"implement" → create→claim→code→close | "pause" → defer | "abandon" → fail | "next" → ready()
15
+ • "fix bug"/"implement" → create→code→close | "pause"/"abandon" → fail
16
16
  EOF
17
17
  else
18
18
  # Full mode — SessionStart
@@ -27,9 +27,8 @@ else
27
27
 
28
28
  📋 MUST:
29
29
  • Create task for non-trivial work (≥2 files OR ≥10 lines) BEFORE starting
30
- Claim before coding, close when done with meaningful reason
31
- Handle unfinished tasks first (ask user: Continue/Defer/Abandon)
32
- • Close or defer ALL in_progress tasks before session ends
30
+ Close when done with meaningful reason
31
+ Close or fail ALL in_progress tasks before session ends
33
32
 
34
33
  🚫 NEVER:
35
34
  • Skip prime
@@ -38,24 +37,20 @@ else
38
37
  • Leave tasks in in_progress when session ends
39
38
 
40
39
  📖 User Says → You Run:
41
- • "fix bug" / "implement" → create → claim → code → close
40
+ • "fix bug" / "implement" → create → code → close
42
41
  • "continue" → resume in-progress → code → close
43
- • "pause" → defer(id, reason)
44
- • "abandon" → fail(id, reason)
45
- • "break down" → decompose(id, subtasks)
46
- • "what's next" → ready() → present list
42
+ • "pause" / "abandon" fail(id, reason)
47
43
  • "agreed" → record_decision(...)
48
44
  • Quick question → No task. Just answer.
49
45
 
50
- 💡 When in doubt → create a task. When idle → autosnippet_task({ operation: "ready" })
46
+ 💡 When in doubt → create a task.
51
47
 
52
48
  📌 User agrees/disagrees with plan → autosnippet_task({ operation: "record_decision" }) immediately
53
49
 
54
50
  ✅ Session end checklist:
55
- [ ] Close every claimed task with reason
56
- [ ] Defer incomplete tasks with notes
51
+ [ ] Close every task with reason
52
+ [ ] Fail incomplete tasks with notes
57
53
  [ ] Verify zero in_progress
58
- [ ] Mention ready tasks for next session
59
54
 
60
55
  🔎 Search knowledge: autosnippet_search({ query: "..." })
61
56
  📚 Do NOT modify AutoSnippet/recipes/ or .autosnippet/ directly
@@ -5,6 +5,6 @@
5
5
 
6
6
  cat <<'EOF'
7
7
  {
8
- "additional_context": "[AutoSnippet Task Rules]\n\n⚡ FIRST: Call autosnippet_task({ \"operation\": \"prime\" }) on EVERY message. No exceptions.\n\n CRITICAL: YOU Operate autosnippet_task — The User Doesn't\n• WRONG: \"You can run autosnippet_task to create a task\"\n• RIGHT: (you run create yourself and tell the user \"Created task asd-42\")\n\n📋 MUST:\n• Create task for non-trivial work (≥2 files OR ≥10 lines) BEFORE starting\n• Claim before coding, close when done with meaningful reason\n• Handle unfinished tasks first (ask user: Continue/Defer/Abandon)\n• Close or defer ALL in_progress tasks before session ends\n\n🚫 NEVER:\n• Skip prime\n• Start new work with open in_progress tasks\n• Tell user to run task commands (YOU are the operator)\n• Leave tasks in in_progress when session ends\n\n📖 User Says → You Run:\n• \"fix bug\" / \"implement\" → create → claim → code → close\n• \"continue\" → resume in-progress → code → close\n• \"pause\" defer(id, reason)\n• \"abandon\" → fail(id, reason)\n• \"break down\" → decompose(id, subtasks)\n• \"what's next\" → ready()\n• \"agreed\" → record_decision(...)\n• Quick question → No task. Just answer.\n\n💡 When in doubt → create a task. When idle → autosnippet_task({ operation: \"ready\" })\n\n📌 User agrees/disagrees with plan → autosnippet_task({ operation: \"record_decision\" }) immediately\n\n✅ Session end checklist: close all tasks → defer incomplete → verify zero in_progress"
8
+ "additional_context": "[AutoSnippet Task Rules]\n\n⚡ FIRST: Call autosnippet_task({ \"operation\": \"prime\" }) on EVERY message. No exceptions.\n\n🔑 CRITICAL: YOU Operate autosnippet_task — The User Doesn't\n• WRONG: \"You can run autosnippet_task to create a task\"\n• RIGHT: (you run create yourself and tell the user \"Created task asd-42\")\n\n📋 MUST:\n• Create task for non-trivial work (≥2 files OR ≥10 lines) BEFORE starting\n• Close when done with meaningful reason\n• Close or fail ALL in_progress tasks before session ends\n\n🚫 NEVER:\n• Skip prime\n• Start new work with open in_progress tasks\n• Tell user to run task commands (YOU are the operator)\n• Leave tasks in in_progress when session ends\n\n📖 User Says → You Run:\n• \"fix bug\" / \"implement\" → create → code → close\n• \"continue\" → resume in-progress → code → close\n• \"pause\" / \"abandon\" → fail(id, reason)\n• \"agreed\" → record_decision(...)\n• Quick question → No task. Just answer.\n\n💡 When in doubt → create a task.\n\n📌 User agrees/disagrees with plan → autosnippet_task({ operation: \"record_decision\" }) immediately\n\n✅ Session end checklist: close all tasks → fail incomplete → verify zero in_progress"
9
9
  }
10
10
  EOF
@@ -1,8 +1,8 @@
1
1
  # AutoSnippet Guard CI/CD Check
2
2
  # Auto-generated by AutoSnippet. Do not edit manually.
3
- # push PR 时自动运行 Guard 合规检查
3
+ # Automatically runs Guard compliance checks on push and PR.
4
4
  #
5
- # 使用方法:将此文件复制到项目的 .github/workflows/ 目录
5
+ # Usage: Copy this file to your project's .github/workflows/ directory.
6
6
 
7
7
  name: AutoSnippet Guard Check
8
8
 
@@ -7,7 +7,7 @@ Access the knowledge base through MCP tools.
7
7
 
8
8
  ## MCP Tools
9
9
 
10
- - `autosnippet_task` — Task & decision management (prime/create/claim/close/record_decision)
10
+ - `autosnippet_task` — Task & decision management (prime/create/close/fail/record_decision)
11
11
  - `autosnippet_search` — Search knowledge (mode: auto/context/keyword/semantic)
12
12
  - `autosnippet_knowledge` — Knowledge CRUD (operation: list/get/insights)
13
13
  - `autosnippet_submit_knowledge` — Submit knowledge candidate
@@ -15,6 +15,7 @@ Access the knowledge base through MCP tools.
15
15
  - `autosnippet_skill` — Skill management (list/load)
16
16
  - `autosnippet_structure` — Project structure discovery
17
17
  - `autosnippet_bootstrap` — Project cold-start & scan
18
+ - `autosnippet_panorama` — Project panorama (operation: overview/module/gaps/health)
18
19
  - `autosnippet_health` — Service health & KB stats
19
20
 
20
21
  ## Constraints
@@ -5,19 +5,17 @@ Users speak naturally; you translate to task operations. Never tell users to cal
5
5
  ## Task Rules (MANDATORY)
6
6
 
7
7
  1. **Prime EVERY message** — `autosnippet_task({ operation: "prime" })` FIRST.
8
- 2. **Create task for non-trivial work** — ≥2 files OR ≥10 lines → `create` → `claim` → code → `close`.
8
+ 2. **Create task for non-trivial work** — ≥2 files OR ≥10 lines → `create` → code → `close`.
9
9
  3. **Decision persistence** — User agrees/disagrees → `record_decision` immediately.
10
- 4. **Session end** — Close or defer ALL tasks. Zero in_progress on exit.
10
+ 4. **Session end** — Close or fail ALL tasks. Zero in_progress on exit.
11
11
  5. **You are the operator** — Never tell users to call autosnippet_task.
12
12
  6. **Skip task for**: Quick questions, single-file trivial fixes (<10 lines), code explanation.
13
13
 
14
14
  | User Says | You Run |
15
15
  |---|---|
16
- | "fix bug" / "implement" | `create` → `claim` → code → `close` |
16
+ | "fix bug" / "implement" | `create` → code → `close` |
17
17
  | "continue" | resume in-progress → `close` |
18
- | "pause" / "abandon" | `defer` / `fail` |
19
- | "break down" | `decompose(id, subtasks)` |
20
- | "what's next" | `ready()` → present |
18
+ | "pause" / "abandon" | `fail(id, reason)` |
21
19
  | "agreed" | `record_decision(...)` |
22
20
 
23
21
  ## Knowledge Rules
@@ -34,6 +32,7 @@ Users speak naturally; you translate to task operations. Never tell users to cal
34
32
  - `autosnippet_submit_knowledge` — Submit knowledge candidate
35
33
  - `autosnippet_guard` — Code compliance check
36
34
  - `autosnippet_skill` — Load project skills (list/load)
35
+ - `autosnippet_panorama` — Project panorama (overview/module/gaps/health)
37
36
  - `autosnippet_health` — Service health & KB stats
38
37
 
39
38
  ## Context Pressure
@@ -158,8 +158,7 @@ V2 知识库中的 Recipe 按 `knowledgeType` 自动归入三类 kind,影响
158
158
  | 工具 | 说明 |
159
159
  |------|------|
160
160
  | `autosnippet_search` | 统合搜索(mode=auto: BM25 + 语义融合,mode=context: 智能上下文检索) |
161
- | `autosnippet_submit_knowledge` | 单条候选提交(严格前置校验,缺少必要字段直接拒绝不入库。必填: title, language, content(+rationale), kind, doClause, category, trigger, description, headers, usageGuide, knowledgeType) |
162
- | `autosnippet_submit_knowledge_batch` | 批量候选提交 |
161
+ | `autosnippet_submit_knowledge` | 统一知识提交(单条/批量/文档)。使用 `items` 数组格式传入 1~N 条。文档模式设 `knowledgeType: 'dev-document'` 仅需 title + markdown |
163
162
  | `autosnippet_knowledge(operation=confirm_usage)` | 确认 Recipe 被采纳/应用 |
164
163
  | `autosnippet_knowledge(operation=insights)` | 获取 Recipe 质量洞察(只读) |
165
164