@chongyan/autospec 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +472 -0
  3. package/README.md +476 -0
  4. package/bin/autospec.js +3 -0
  5. package/knowledge/README.md +144 -0
  6. package/knowledge/checklists/code.md +182 -0
  7. package/knowledge/checklists/design.md +196 -0
  8. package/knowledge/checklists/release.md +70 -0
  9. package/knowledge/checklists/requirement.md +169 -0
  10. package/knowledge/checklists/test.md +46 -0
  11. package/knowledge/config/README.en.md +44 -0
  12. package/knowledge/config/README.md +44 -0
  13. package/knowledge/config/role-composition.yaml +98 -0
  14. package/knowledge/config/role-extensions.yaml +140 -0
  15. package/knowledge/config/skill-compositions.yaml +142 -0
  16. package/knowledge/config/team-stage.yaml +95 -0
  17. package/knowledge/config/team-tasks.yaml +139 -0
  18. package/knowledge/config/team-triggers.yaml +198 -0
  19. package/knowledge/config/validation-patterns.yaml +137 -0
  20. package/knowledge/domain/README.md +115 -0
  21. package/knowledge/domain/flows/README.md +194 -0
  22. package/knowledge/domain/glossary.md +143 -0
  23. package/knowledge/domain/rules.md +138 -0
  24. package/knowledge/environment/README.en.md +36 -0
  25. package/knowledge/environment/README.md +87 -0
  26. package/knowledge/environment/component-knowledge.md +316 -0
  27. package/knowledge/environment/detection-patterns.yaml +502 -0
  28. package/knowledge/environment/middleware-knowledge.md +237 -0
  29. package/knowledge/environment/template-registry.md +321 -0
  30. package/knowledge/guides/domain-driven-design.md +345 -0
  31. package/knowledge/guides/knowledge-management.md +369 -0
  32. package/knowledge/guides/requirement-engineering.md +329 -0
  33. package/knowledge/guides/stages/ai-effect-evaluator.md +93 -0
  34. package/knowledge/guides/stages/code-implementer.md +205 -0
  35. package/knowledge/guides/stages/code-reviewer.md +111 -0
  36. package/knowledge/guides/stages/consistency-checker.md +177 -0
  37. package/knowledge/guides/stages/design-planner.md +401 -0
  38. package/knowledge/guides/stages/design-reviewer.md +83 -0
  39. package/knowledge/guides/stages/integration-test-runner.md +105 -0
  40. package/knowledge/guides/stages/release-checker.md +205 -0
  41. package/knowledge/guides/stages/requirement-analyzer.md +195 -0
  42. package/knowledge/guides/stages/requirement-reviewer.md +83 -0
  43. package/knowledge/guides/stages/security-reviewer.md +89 -0
  44. package/knowledge/guides/stages/test-context-analyzer.md +250 -0
  45. package/knowledge/guides/stages/test-generator.md +241 -0
  46. package/knowledge/guides/stages/test-planner.md +183 -0
  47. package/knowledge/guides/stages/test-reviewer.md +76 -0
  48. package/knowledge/guides/stages/unit-test-runner.md +83 -0
  49. package/knowledge/guides/support/ai-agent-analyzer.md +362 -0
  50. package/knowledge/guides/support/ai-anomaly-analyzer.md +213 -0
  51. package/knowledge/guides/support/ai-artifact-evaluator.md +192 -0
  52. package/knowledge/guides/support/ai-capability-analyzer.md +193 -0
  53. package/knowledge/guides/support/ai-component-analyzer.md +169 -0
  54. package/knowledge/guides/support/ai-data-validator.md +276 -0
  55. package/knowledge/guides/support/ai-evaluation-planner.md +374 -0
  56. package/knowledge/guides/support/ai-path-evaluator.md +274 -0
  57. package/knowledge/guides/support/ai-pipeline-evaluator.md +219 -0
  58. package/knowledge/guides/support/ai-rag-analyzer.md +339 -0
  59. package/knowledge/guides/support/ai-task-assessor.md +418 -0
  60. package/knowledge/guides/support/ai-test-diagnostics.md +133 -0
  61. package/knowledge/guides/support/complexity-assessor.md +268 -0
  62. package/knowledge/guides/support/component-discovery.md +183 -0
  63. package/knowledge/guides/support/environment-scanner.md +207 -0
  64. package/knowledge/guides/support/environment-validator.md +207 -0
  65. package/knowledge/guides/support/knowledge-generator.md +234 -0
  66. package/knowledge/guides/support/methodology-extractor.md +55 -0
  67. package/knowledge/guides/support/pipeline-protocol.md +438 -0
  68. package/knowledge/guides/support/practice-logger.md +359 -0
  69. package/knowledge/guides/support/scope-inference.md +174 -0
  70. package/knowledge/guides/support/skill-distiller.md +91 -0
  71. package/knowledge/guides/support/skill-updater.md +45 -0
  72. package/knowledge/guides/support/skill-validator.md +72 -0
  73. package/knowledge/guides/support/team-orchestrator.md +323 -0
  74. package/knowledge/guides/support/tech-stack-analyzer.md +139 -0
  75. package/knowledge/guides/support/test-runner.md +254 -0
  76. package/knowledge/guides/system-design.md +352 -0
  77. package/knowledge/organization/ai-native-team.md +318 -0
  78. package/knowledge/organization/team-metrics.md +228 -0
  79. package/knowledge/principles/constitution.md +134 -0
  80. package/knowledge/principles/core-principles.md +368 -0
  81. package/knowledge/principles/design-philosophy.md +877 -0
  82. package/knowledge/principles/evolution.md +553 -0
  83. package/knowledge/process/01-requirement.md +113 -0
  84. package/knowledge/process/02-design.md +123 -0
  85. package/knowledge/process/03-implementation.md +90 -0
  86. package/knowledge/process/04-review.md +80 -0
  87. package/knowledge/process/05-testing.md +90 -0
  88. package/knowledge/process/06-delivery.md +88 -0
  89. package/knowledge/process/README.en.md +38 -0
  90. package/knowledge/process/README.md +48 -0
  91. package/knowledge/process/ai-sdlc.md +475 -0
  92. package/knowledge/process/overview.md +319 -0
  93. package/knowledge/standards/code-review.md +876 -0
  94. package/knowledge/standards/coding-style.md +940 -0
  95. package/knowledge/standards/data-consistency.md +1085 -0
  96. package/knowledge/standards/document-versioning.md +210 -0
  97. package/knowledge/standards/risk-detection.md +186 -0
  98. package/knowledge/templates/ai-evaluation.md +150 -0
  99. package/knowledge/templates/api-design.md +117 -0
  100. package/knowledge/templates/database-design.md +132 -0
  101. package/knowledge/templates/domain-driven-design.md +321 -0
  102. package/knowledge/templates/product-proposal.md +201 -0
  103. package/knowledge/templates/system-design.md +227 -0
  104. package/knowledge/templates/task-breakdown.md +107 -0
  105. package/knowledge/templates/test-case.md +170 -0
  106. package/package.json +53 -0
  107. package/plugins/.claude-plugin/plugin.json +134 -0
  108. package/plugins/agents/roles/ai-engineer.md +129 -0
  109. package/plugins/agents/roles/backend-engineer.md +165 -0
  110. package/plugins/agents/roles/ceo.md +94 -0
  111. package/plugins/agents/roles/data-engineer.md +135 -0
  112. package/plugins/agents/roles/devops-engineer.md +181 -0
  113. package/plugins/agents/roles/frontend-engineer.md +129 -0
  114. package/plugins/agents/roles/product-owner.md +98 -0
  115. package/plugins/agents/roles/quality-engineer.md +129 -0
  116. package/plugins/agents/roles/security-engineer.md +180 -0
  117. package/plugins/agents/roles/tech-lead.md +97 -0
  118. package/plugins/agents/support/blind-comparator.md +88 -0
  119. package/plugins/agents/support/consistency-checker.md +103 -0
  120. package/plugins/agents/support/failure-diagnostician.md +141 -0
  121. package/plugins/agents/support/independent-reviewer.md +80 -0
  122. package/plugins/agents/support/safety-auditor.md +121 -0
  123. package/plugins/agents/support/skill-benchmarker.md +86 -0
  124. package/plugins/agents/support/skill-forger.md +105 -0
  125. package/plugins/agents/support/stage-gate-evaluator.md +121 -0
  126. package/plugins/agents/support/test-coverage-reviewer.md +73 -0
  127. package/plugins/benchmarks/templates/README.md +44 -0
  128. package/plugins/benchmarks/templates/commands/explore-template.yaml +48 -0
  129. package/plugins/benchmarks/templates/pipeline/agile-template.yaml +84 -0
  130. package/plugins/benchmarks/templates/pipeline/waterfall-template.yaml +106 -0
  131. package/plugins/benchmarks/templates/skills/requirement-analyzer-template.yaml +48 -0
  132. package/plugins/commands/README.en.md +96 -0
  133. package/plugins/commands/README.md +96 -0
  134. package/plugins/commands/apply.md +191 -0
  135. package/plugins/commands/archive.md +76 -0
  136. package/plugins/commands/env-export.md +79 -0
  137. package/plugins/commands/env-sync.md +640 -0
  138. package/plugins/commands/env-template.md +223 -0
  139. package/plugins/commands/env-update.md +264 -0
  140. package/plugins/commands/env-validate.md +176 -0
  141. package/plugins/commands/env.md +79 -0
  142. package/plugins/commands/explore.md +76 -0
  143. package/plugins/commands/field-evolve.md +536 -0
  144. package/plugins/commands/memory.md +249 -0
  145. package/plugins/commands/project-evolve.md +821 -0
  146. package/plugins/commands/propose.md +93 -0
  147. package/plugins/commands/review.md +140 -0
  148. package/plugins/commands/run.md +224 -0
  149. package/plugins/commands/status.md +62 -0
  150. package/plugins/commands/validate.md +108 -0
  151. package/plugins/hooks/README.en.md +56 -0
  152. package/plugins/hooks/README.md +56 -0
  153. package/plugins/hooks/ai-project-guard.js +329 -0
  154. package/plugins/hooks/artifact-evaluation-hook.js +237 -0
  155. package/plugins/hooks/constitution-guard.js +211 -0
  156. package/plugins/hooks/environment-autocommit.js +264 -0
  157. package/plugins/hooks/environment-manager.js +778 -0
  158. package/plugins/hooks/execution-tracker.js +354 -0
  159. package/plugins/hooks/frozen-zone-guard.js +140 -0
  160. package/plugins/hooks/layer1-validator.js +423 -0
  161. package/plugins/hooks/lib/artifact-evaluator.js +414 -0
  162. package/plugins/hooks/lib/benchmarks/change-detector.js +390 -0
  163. package/plugins/hooks/lib/benchmarks/evaluator.js +605 -0
  164. package/plugins/hooks/lib/benchmarks/integration-example.js +169 -0
  165. package/plugins/hooks/lib/data-and-ai-detector.js +275 -0
  166. package/plugins/hooks/lib/detection-pattern-loader.js +865 -0
  167. package/plugins/hooks/lib/directory-discovery.js +395 -0
  168. package/plugins/hooks/lib/environment-config-loader.js +341 -0
  169. package/plugins/hooks/lib/environment-detector.js +553 -0
  170. package/plugins/hooks/lib/environment-evolver.js +564 -0
  171. package/plugins/hooks/lib/environment-registry.js +813 -0
  172. package/plugins/hooks/lib/execution-path.js +427 -0
  173. package/plugins/hooks/lib/hook-error-recorder.js +245 -0
  174. package/plugins/hooks/lib/hook-logger.js +538 -0
  175. package/plugins/hooks/lib/hook-runner.js +97 -0
  176. package/plugins/hooks/lib/hook-runner.sh +44 -0
  177. package/plugins/hooks/lib/hook-state-manager.js +480 -0
  178. package/plugins/hooks/lib/memory-extractor.js +377 -0
  179. package/plugins/hooks/lib/memory-manager.js +673 -0
  180. package/plugins/hooks/lib/metrics-analyzer.js +489 -0
  181. package/plugins/hooks/lib/project-evolution/auto-fixer.js +511 -0
  182. package/plugins/hooks/lib/project-evolution/memory-manager.js +346 -0
  183. package/plugins/hooks/lib/project-evolution/pattern-detector.js +476 -0
  184. package/plugins/hooks/lib/project-evolution/semantic-indexer.js +480 -0
  185. package/plugins/hooks/lib/project-structure-detector.js +326 -0
  186. package/plugins/hooks/lib/rollback-tracker.js +346 -0
  187. package/plugins/hooks/lib/source-code-scanner.js +596 -0
  188. package/plugins/hooks/lib/technology-stack-detector.js +374 -0
  189. package/plugins/hooks/lib/test-failure-analyzer.js +375 -0
  190. package/plugins/hooks/lib/test-failure-fixer.js +268 -0
  191. package/plugins/hooks/lib/trace-context.js +277 -0
  192. package/plugins/hooks/lib/validation-patterns.js +415 -0
  193. package/plugins/hooks/memory-sync.js +171 -0
  194. package/plugins/hooks/pipeline-observer.js +413 -0
  195. package/plugins/hooks/scope-sentinel.js +204 -0
  196. package/plugins/hooks/trace-initialization.js +169 -0
  197. package/plugins/memory/templates/code-quality.yaml +149 -0
  198. package/plugins/memory/templates/multi-system.yaml +155 -0
  199. package/plugins/memory/templates/team-habits.yaml +119 -0
  200. package/plugins/memory/templates/testing.yaml +121 -0
  201. package/plugins/skills/README.en.md +47 -0
  202. package/plugins/skills/README.md +104 -0
  203. package/plugins/skills/benchmark-executor/README.md +93 -0
  204. package/plugins/skills/benchmark-executor/SKILL.md +647 -0
  205. package/plugins/skills/benchmark-generator/SKILL.md +349 -0
  206. package/plugins/skills/delivery-stage/SKILL.md +203 -0
  207. package/plugins/skills/design-stage/SKILL.md +216 -0
  208. package/plugins/skills/evolution-process/SKILL.md +291 -0
  209. package/plugins/skills/exploration-phase/SKILL.md +133 -0
  210. package/plugins/skills/implementation-stage/SKILL.md +179 -0
  211. package/plugins/skills/layer1-validation/SKILL.md +79 -0
  212. package/plugins/skills/pending-dashboard/SKILL.md +109 -0
  213. package/plugins/skills/project-evolution/SKILL.md +847 -0
  214. package/plugins/skills/requirement-stage/SKILL.md +183 -0
  215. package/plugins/skills/skill-forge/SKILL.md +223 -0
  216. package/plugins/skills/skill-forge/references/description-guide.md +92 -0
  217. package/plugins/skills/skill-forge/references/quality-rubric.md +104 -0
  218. package/plugins/skills/skill-forge/references/skill-template.md +106 -0
  219. package/plugins/skills/startup-guard/SKILL.md +38 -0
  220. package/plugins/skills/testing-stage/SKILL.md +195 -0
  221. package/scripts/cli/global-init.js +288 -0
  222. package/scripts/cli/global.js +324 -0
  223. package/scripts/cli/index.js +55 -0
  224. package/scripts/cli/init.js +382 -0
  225. package/scripts/cli/list.js +69 -0
  226. package/scripts/cli/org.js +340 -0
  227. package/scripts/cli/update.js +44 -0
  228. package/scripts/config/commands.config.js +145 -0
  229. package/scripts/config/hooks.config.js +197 -0
  230. package/scripts/evolution/evolution-router.js +273 -0
  231. package/scripts/evolution/evolution-signal-collector.js +307 -0
  232. package/scripts/evolution/knowledge-loader.js +346 -0
  233. package/scripts/evolution/marketplace.js +317 -0
  234. package/scripts/evolution/version-manager.js +371 -0
  235. package/scripts/install/agents.js +106 -0
  236. package/scripts/install/commands.js +133 -0
  237. package/scripts/install/constants.js +424 -0
  238. package/scripts/install/hook-logger.js +536 -0
  239. package/scripts/install/hooks.js +110 -0
  240. package/scripts/install/index.js +39 -0
  241. package/scripts/install/skills.js +95 -0
  242. package/scripts/postinstall.js +25 -0
  243. package/scripts/state.js +376 -0
@@ -0,0 +1,96 @@
1
+ # Command Templates
2
+
3
+ This directory contains slash command templates for AutoSpec. Each template is a Markdown file that defines a command's behavior.
4
+
5
+ ## Template Structure
6
+
7
+ Each command template follows this structure:
8
+
9
+ ```markdown
10
+ ---
11
+ description: Command description shown in CLI
12
+ ---
13
+
14
+ # Command Title
15
+
16
+ ## User Input
17
+
18
+ \`\`\`
19
+ $ARGUMENTS
20
+ \`\`\`
21
+
22
+ ## Execution Steps
23
+
24
+ Step-by-step instructions for Claude to execute.
25
+ ```
26
+
27
+ ## Variable Replacement
28
+
29
+ Templates use `{{variable}}` syntax for variables that are replaced at generation time:
30
+
31
+ | Variable | Replacement | Example |
32
+ |----------|-------------|---------|
33
+ | `{{knowledge}}` | `.autospec/knowledge` | Framework directory path |
34
+
35
+ ## Available Commands
36
+
37
+ ### Main Entry Commands
38
+
39
+ | Command | Template | Description |
40
+ |---------|----------|-------------|
41
+ | `/autospec:run` | `run.md` | Start/resume AutoSpec autonomous development workflow |
42
+ | `/autospec:explore` | `explore.md` | Requirement exploration stage |
43
+ | `/autospec:propose` | `propose.md` | Solution design stage |
44
+ | `/autospec:apply` | `apply.md` | Implementation stage (coding + review + QA) |
45
+ | `/autospec:archive` | `archive.md` | Delivery and archive stage |
46
+
47
+ ### Evolution Commands
48
+
49
+ | Command | Template | Description |
50
+ |---------|----------|-------------|
51
+ | `/evolve` | `evolve.md` | Trigger self-evolution cycle |
52
+
53
+ ### Status Commands
54
+
55
+ | Command | Template | Description |
56
+ |---------|----------|-------------|
57
+ | `/autospec:status` | `status.md` | View current AutoSpec process status |
58
+ | `/autospec:validate` | `validate.md` | Run Layer1 deterministic validation |
59
+ | `/autospec:review` | `review.md` | Review deliverables at each stage |
60
+
61
+ ### Environment Commands
62
+
63
+ | Command | Template | Description |
64
+ |---------|----------|-------------|
65
+ | `/autospec:env` | `env.md` | View current environment configuration |
66
+ | `/autospec:env-validate` | `env-validate.md` | Validate environment knowledge configuration |
67
+ | `/autospec:env-sync` | `env-sync.md` | Initialize environment directory, sync knowledge from code, import org knowledge base |
68
+ | `/autospec:env-export` | `env-export.md` | Export current project's knowledge base |
69
+ | `/autospec:env-template` | `env-template.md` | View and manage environment knowledge templates |
70
+ | `/autospec:env-update` | `env-update.md` | Submit local knowledge changes to knowledge source |
71
+
72
+ ## Adding New Commands
73
+
74
+ 1. Create a new `.md` file in this directory
75
+ 2. Add the `description` frontmatter
76
+ 3. Define the command behavior using the template structure
77
+ 4. Register the command in `src/core/config/commands.config.js`:
78
+
79
+ ```javascript
80
+ export const COMMAND_DEFINITIONS = {
81
+ 'my-command': {
82
+ name: 'my-command',
83
+ templateFile: 'my-command.md',
84
+ description: 'My new command'
85
+ }
86
+ };
87
+ ```
88
+
89
+ ## Internal Commands
90
+
91
+ Some commands are marked as `internal: true` in the configuration. These are only for AutoSpec's own use and are not generated for user projects.
92
+
93
+ ## Related Files
94
+
95
+ - `src/core/config/commands.config.js` - Command definitions and configuration
96
+ - `src/core/generators/commands.js` - Template processing and command generation
@@ -0,0 +1,96 @@
1
+ # 命令模板目录
2
+
3
+ 本目录包含 AutoSpec 的斜杠命令模板。每个模板是一个 Markdown 文件,定义了命令的行为。
4
+
5
+ ## 模板结构
6
+
7
+ 每个命令模板遵循以下结构:
8
+
9
+ ```markdown
10
+ ---
11
+ description: 命令描述(显示在 CLI 中)
12
+ ---
13
+
14
+ # 命令标题
15
+
16
+ ## 用户输入
17
+
18
+ \`\`\`
19
+ $ARGUMENTS
20
+ \`\`\`
21
+
22
+ ## 执行步骤
23
+
24
+ Claude 执行的逐步指令。
25
+ ```
26
+
27
+ ## 变量替换
28
+
29
+ 模板使用 `{{variable}}` 语法进行生成时变量替换:
30
+
31
+ | 变量 | 替换值 | 说明 |
32
+ |------|--------|------|
33
+ | `{{knowledge}}` | `.autospec/knowledge` | 框架目录路径 |
34
+
35
+ ## 可用命令
36
+
37
+ ### 主入口命令
38
+
39
+ | 命令 | 模板 | 说明 |
40
+ |------|------|------|
41
+ | `/autospec:run` | `run.md` | 启动/恢复 AutoSpec 自主研发工作流 |
42
+ | `/autospec:explore` | `explore.md` | 需求探索阶段 |
43
+ | `/autospec:propose` | `propose.md` | 方案设计阶段 |
44
+ | `/autospec:apply` | `apply.md` | 实施阶段(编码 + 审查 + QA) |
45
+ | `/autospec:archive` | `archive.md` | 交付归档阶段 |
46
+
47
+ ### 进化命令
48
+
49
+ | 命令 | 模板 | 说明 |
50
+ |------|------|------|
51
+ | `/evolve` | `evolve.md` | 触发自进化循环 |
52
+
53
+ ### 状态命令
54
+
55
+ | 命令 | 模板 | 说明 |
56
+ |------|------|------|
57
+ | `/autospec:status` | `status.md` | 查看当前 AutoSpec 流程状态 |
58
+ | `/autospec:validate` | `validate.md` | 运行 Layer1 确定性验证 |
59
+ | `/autospec:review` | `review.md` | 审查各阶段交付物 |
60
+
61
+ ### 环境命令
62
+
63
+ | 命令 | 模板 | 说明 |
64
+ |------|------|------|
65
+ | `/autospec:env` | `env.md` | 查看当前环境配置 |
66
+ | `/autospec:env-validate` | `env-validate.md` | 校验环境知识配置 |
67
+ | `/autospec:env-sync` | `env-sync.md` | 初始化环境目录、同步环境知识、导入组织知识库 |
68
+ | `/autospec:env-export` | `env-export.md` | 导出当前项目的知识库 |
69
+ | `/autospec:env-template` | `env-template.md` | 查看和管理环境知识模板 |
70
+ | `/autospec:env-update` | `env-update.md` | 将本地知识变更提交到知识源 |
71
+
72
+ ## 添加新命令
73
+
74
+ 1. 在本目录创建新的 `.md` 文件
75
+ 2. 添加 `description` frontmatter
76
+ 3. 使用模板结构定义命令行为
77
+ 4. 在 `src/core/config/commands.config.js` 中注册命令:
78
+
79
+ ```javascript
80
+ export const COMMAND_DEFINITIONS = {
81
+ 'my-command': {
82
+ name: 'my-command',
83
+ templateFile: 'my-command.md',
84
+ description: '我的新命令'
85
+ }
86
+ };
87
+ ```
88
+
89
+ ## 内部命令
90
+
91
+ 部分命令在配置中标记为 `internal: true`。这些命令仅供 AutoSpec 自身使用,不会为用户项目生成。
92
+
93
+ ## 相关文件
94
+
95
+ - `src/core/config/commands.config.js` - 命令定义和配置
96
+ - `src/core/generators/commands.js` - 模板处理和命令生成
@@ -0,0 +1,191 @@
1
+ ---
2
+ description: "开工,按单子做" — 实施阶段。包含编码实现 + 代码审查 + QA测试。
3
+ ---
4
+
5
+ # AutoSpec Apply — 编码实施
6
+
7
+ ## 用户输入
8
+
9
+ ```
10
+ $ARGUMENTS
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 前置处理
16
+
17
+ 【前置】读取流程协议:
18
+ > **【重要】执行本command前必须先读取流程协议**
19
+ > 1. 读取 `knowledge/guides/support/pipeline-protocol.md` 中的「流程能力」章节
20
+ > 2. 执行以下步骤:
21
+ > - 解析命令与参数
22
+ > - 加载必要文件
23
+ > - 检查前置条件(确认方案设计已完成)
24
+ > 3. 完成后继续执行本命令的具体逻辑
25
+ >
26
+ > **【注意】日志追踪已启用**
27
+ > - 执行日志会自动记录到 `.autospec/logs/execution-{date}.json`
28
+ > - 关键步骤(skill加载、agent调用、产物生成、阶段完成)都会被追踪
29
+
30
+ ---
31
+
32
+ ## 执行指令
33
+
34
+ ### Step 1: 编码实现
35
+
36
+ - 检查上游依赖(确认方案设计已完成)
37
+ - **【强制】读取并按照 code-implementer 执行**
38
+ - 使用 Read 工具读取 `knowledge/guides/stages/code-implementer.md`
39
+ - 搜索现有代码库识别可复用组件
40
+ - 按方案模块划分编码
41
+ - **【强制】执行 Layer1 验证**
42
+ - 编译检查
43
+ - 单元测试
44
+ - Lint 检查
45
+ - 类型检查(如适用)
46
+ - **【强制】Layer1通过才能进入下一步**
47
+
48
+ ### Step 2: 代码审查
49
+
50
+ **【强制】必须调用 Layer2 审查**
51
+ - 使用 Agent 工具,subagent_type=independent-reviewer
52
+ - 传入审查标准:`knowledge/guides/stages/code-reviewer.md`
53
+ - 传入被审查代码:变更文件列表
54
+ - 等待审查完成后再继续
55
+
56
+ **审查结果处理**:
57
+ - 审查通过 → 进入 Step 2.5(安全审查)
58
+ - 审查不通过 → 执行修复循环(最多3次):
59
+ 1. 提取 reviewer 的"必须修复(blocking)"清单
60
+ 2. 读取 code-implementer.md 并执行修复
61
+ 3. 重新执行 Layer1 验证
62
+ 4. 重新调用 Layer2 审查
63
+ 5. 达到3次上限仍不通过 → 记录问题,标记需要人工介入
64
+
65
+ ### Step 2.5: 安全审查【强制执行】
66
+
67
+ **【强制】当代码包含Skill/Agent相关实现时必须执行**:
68
+ - 使用 Agent 工具,subagent_type=independent-reviewer
69
+ - 传入审查标准:`knowledge/guides/stages/security-reviewer.md`
70
+ - 传入被审查代码:变更文件列表
71
+ - 等待审查完成后再继续
72
+
73
+ **审查结果处理**:
74
+ - 审查通过 → 进入 Step 3
75
+ - 审查不通过 → 执行修复循环(最多3次)
76
+
77
+ ### Step 3: 测试生成【强制执行】
78
+
79
+ **【强制】必须按顺序执行:**
80
+
81
+ 1. **【强制】读取 test-context-analyzer.md**
82
+ - 使用 Read 工具读取 `knowledge/guides/stages/test-context-analyzer.md`
83
+ - 学习现有测试风格
84
+
85
+ 2. **【强制】读取并按照 test-generator 执行**
86
+ - 使用 Read 工具读取 `knowledge/guides/stages/test-generator.md`
87
+ - 生成测试用例和代码
88
+
89
+ 3. **【强制】调用 Layer2 测试审查**
90
+ - 使用 Agent 工具,subagent_type=test-coverage-reviewer
91
+ - 传入审查标准:`knowledge/guides/stages/test-reviewer.md`
92
+
93
+ 4. **【强制】审查结果处理**
94
+ - 审查通过 → 进入步骤4
95
+ - 审查不通过 → 执行修复循环(最多3次):
96
+ 1. 提取 reviewer 的"必须修复(blocking)"清单
97
+ 2. 读取 test-generator.md 并执行修复
98
+ 3. 重新执行 Layer1 验证
99
+ 4. 重新调用 Layer2 审查
100
+ 5. 达到3次上限仍不通过 → 记录问题,标记需要人工介入
101
+
102
+ 5. **【强制】执行 Layer1 验证**
103
+ - 运行测试,确认通过
104
+ - **【强制】覆盖率 < 70% → 补充测试**
105
+
106
+ ### Step 3.5: Agent 测试执行【强制执行】
107
+
108
+ **【强制】使用 Agent 团队执行完整测试流程**:
109
+
110
+ #### 3.5.1 并行执行单元测试
111
+ - 使用 Agent 工具,subagent_type=general-purpose
112
+ ```
113
+ prompt: |
114
+ 你是一个测试执行专家。请执行以下任务:
115
+
116
+ 1. 读取 unit-test-runner skill 了解测试执行规范
117
+ 2. 检测项目测试框架(pytest/Jest/JUnit等)
118
+ 3. 执行单元测试并分析结果
119
+ 4. 识别失败的测试并分析原因
120
+
121
+ 项目目录:{project_path}
122
+ ```
123
+ - 加载 unit-test-runner skill:`knowledge/guides/stages/unit-test-runner.md`
124
+ - 并行执行多个测试文件(提升效率)
125
+ - 等待所有单元测试完成
126
+
127
+ #### 3.5.2 串行执行集成测试(单元测试通过后)
128
+ - 使用 Agent 工具,subagent_type=general-purpose
129
+ ```
130
+ prompt: |
131
+ 你是一个集成测试专家。请执行以下任务:
132
+
133
+ 1. 读取 integration-test-runner skill 了解集成测试规范
134
+ 2. 智能检测项目中的集成测试(不限于特定目录)
135
+ 3. 分析测试文件,区分单元测试和集成测试
136
+ 4. 执行集成测试并分析失败原因
137
+
138
+ 项目目录:{project_path}
139
+ ```
140
+ - 加载 integration-test-runner skill:`knowledge/guides/stages/integration-test-runner.md`
141
+ - 智能检测项目中的集成测试(不限于特定目录)
142
+ - 执行集成测试
143
+ - 测试失败 → 修复循环(最多3次)
144
+
145
+ #### 3.5.3 效果评测(如有AI/模型组件)
146
+ - 使用 Agent 工具,subagent_type=general-purpose
147
+ ```
148
+ prompt: |
149
+ 你是一个AI效果评测专家。请执行以下任务:
150
+
151
+ 1. 读取 ai-effect-evaluator skill 了解评测规范
152
+ 2. 加载评测数据集
153
+ 3. 执行效果评测,计算指标
154
+ 4. 生成评测报告,识别badcase
155
+
156
+ 项目目录:{project_path}
157
+ ```
158
+ - 加载 ai-effect-evaluator skill:`knowledge/guides/stages/ai-effect-evaluator.md`
159
+ - 执行效果评测
160
+ - 评测结果作为质量门禁
161
+
162
+ **测试执行策略**:
163
+ | 阶段 | 执行方式 | 理由 |
164
+ |------|---------|------|
165
+ | 单元测试 | 并行 | 独立无依赖,提升效率 |
166
+ | 集成测试 | 串行 | 依赖单元测试通过,确保质量 |
167
+ | 效果评测 | 串行 | 依赖完整环境,确保准确 |
168
+
169
+ ### Step 4: 效果评测【强制执行】(如有AI/模型组件)
170
+
171
+ **【强制】必须执行:**
172
+ - 读取 `knowledge/guides/support/ai-evaluation-planner.md`
173
+ - 构建评测数据集
174
+ - 开发评测脚本
175
+ - 执行评测并生成报告
176
+
177
+ ### Step 5: 精准回退(如有失败)
178
+
179
+ - Level 1: 内联重试
180
+ - Level 2: 修正循环(最多3次)
181
+ - Level 3: 升级人工
182
+
183
+ ### 更新 state.json
184
+
185
+ **【强制】更新状态**
186
+ - 记录阶段完成状态
187
+ - 记录关键决策和验证结果
188
+
189
+ ---
190
+
191
+ **继续执行**: `/autospec:archive`
@@ -0,0 +1,76 @@
1
+ ---
2
+ description: "做完了,收工归档" — 交付归档阶段。包含交付部署 + 自进化归档。
3
+ ---
4
+
5
+ # AutoSpec Archive — 交付归档
6
+
7
+ ## 用户输入
8
+
9
+ ```
10
+ $ARGUMENTS
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 前置处理
16
+
17
+ 【前置】读取流程协议:
18
+ > **【重要】执行本command前必须先读取流程协议**
19
+ > 1. 读取 `knowledge/guides/support/pipeline-protocol.md` 中的「流程能力」章节
20
+ > 2. 执行以下步骤:
21
+ > - 解析命令与参数
22
+ > - 加载必要文件
23
+ > - 检查前置条件(确认QA测试已完成)
24
+ > 3. 完成后继续执行本命令的具体逻辑
25
+ >
26
+ > **【注意】日志追踪已启用**
27
+ > - 执行日志会自动记录到 `.autospec/logs/execution-{date}.json`
28
+ > - 关键步骤(skill加载、agent调用、产物生成、阶段完成)都会被追踪
29
+
30
+ ---
31
+
32
+ ## 执行指令
33
+
34
+ ### Step 1: 检查上游依赖
35
+
36
+ - 确认QA测试已完成(检查 state.json)
37
+ - 未完成 → 阻断并提示先执行 apply
38
+
39
+ ### Step 2: 交付部署
40
+
41
+ **【强制】必须执行:**
42
+
43
+ 1. **【强制】执行跨产物一致性检查**
44
+ - 使用 Agent 工具,subagent_type=consistency-checker
45
+ - 检查需求→设计→代码→测试的一致性
46
+
47
+ 2. **【强制】执行安全审计**(如有不可逆动作)
48
+ - 使用 Agent 工具,subagent_type=safety-auditor
49
+ - 不可逆动作需人工确认后才能执行
50
+
51
+ ### Step 3: 自进化归档
52
+
53
+ **【强制】必须执行:**
54
+
55
+ 1. **【强制】记录 practice-log**
56
+ - 读取 `.autospec/runtime/state.json`
57
+ - 收集执行度量(Layer1/2通过率、回退次数、人工介入次数)
58
+ - 写入 `.autospec/evolution/practice-log/{NNN}-{feature}.md`
59
+
60
+ 2. **【强制】触发 skill-distiller**
61
+ - 读取 `knowledge/guides/support/skill-distiller.md`
62
+ - 检查是否有可沉淀的新技能
63
+
64
+ 3. **【强制】触发 methodology-extractor**
65
+ - 读取 `knowledge/guides/support/methodology-extractor.md`
66
+ - 检查是否有可提取的新方法论
67
+
68
+ ### Step 4: 标记流程完成
69
+
70
+ **【强制】更新状态**
71
+ - 更新 `.autospec/runtime/state.json` 标记为完成
72
+ - 记录完成时间戳
73
+
74
+ ---
75
+
76
+ **流程结束** 🎉
@@ -0,0 +1,79 @@
1
+ ---
2
+ description: 导出当前项目的知识库
3
+ ---
4
+
5
+ # AutoSpec Env Export — 知识导出
6
+
7
+ ## 用户输入
8
+
9
+ ```
10
+ $ARGUMENTS
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 执行指令
16
+
17
+ ### Step 1: 收集知识文件
18
+
19
+ 收集 `.autospec/environment/` 下的所有文件
20
+
21
+ ### Step 2: 生成清单
22
+
23
+ 创建 `manifest.json`:
24
+
25
+ ```json
26
+ {
27
+ "name": "{知识库名称}",
28
+ "version": "{版本号}",
29
+ "description": "{描述}",
30
+ "generatedAt": "2024-01-15T10:30:00Z",
31
+ "includes": {
32
+ "middleware": [
33
+ { "name": "redis", "version": "1.0" },
34
+ { "name": "mysql", "version": "1.0" }
35
+ ],
36
+ "components": [
37
+ { "name": "axios", "version": "1.0" }
38
+ ],
39
+ "bestPractices": [],
40
+ "detectionPatterns": true
41
+ }
42
+ }
43
+ ```
44
+
45
+ ### Step 3: 打包输出
46
+
47
+ ```bash
48
+ # 创建目标目录
49
+ mkdir -p {target-dir}
50
+
51
+ # 复制文件
52
+ cp -r .autospec/environment/* {target-dir}/
53
+
54
+ # 写入清单
55
+ cp manifest.json {target-dir}/
56
+ ```
57
+
58
+ ### Step 4: 输出结果
59
+
60
+ ```
61
+ ✅ 导出完成
62
+
63
+ 知识库: {name} (v{version})
64
+ 路径: {target-dir}
65
+
66
+ 包含:
67
+ 中间件: redis, mysql
68
+ 组件: axios
69
+ 检测模式: ✅
70
+
71
+ 可以分享此目录或发布到 npm/Git 供其他项目使用。
72
+ ```
73
+
74
+ ---
75
+
76
+ ## 产出物
77
+
78
+ - 导出的知识库目录
79
+ - `manifest.json` 清单文件