@pigcloud/skills 1.0.0

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 (161) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/LICENSE +201 -0
  3. package/README.en.md +84 -0
  4. package/README.md +79 -0
  5. package/bin/cli.js +663 -0
  6. package/bin/postinstall.js +60 -0
  7. package/bin/rules-loader.js +484 -0
  8. package/bin/runtime-bootstrap.js +121 -0
  9. package/index.js +7 -0
  10. package/install.cmd +5 -0
  11. package/install.ps1 +74 -0
  12. package/install.sh +168 -0
  13. package/package.json +70 -0
  14. package/pig-cloud-skills-commands/.codex-plugin/plugin.json +35 -0
  15. package/pig-cloud-skills-commands/README.md +24 -0
  16. package/pig-cloud-skills-commands/commands/analyze.md +21 -0
  17. package/pig-cloud-skills-commands/commands/build.md +21 -0
  18. package/pig-cloud-skills-commands/commands/design.md +21 -0
  19. package/pig-cloud-skills-commands/commands/distill.md +21 -0
  20. package/pig-cloud-skills-commands/commands/doc.md +21 -0
  21. package/pig-cloud-skills-commands/commands/infra.md +21 -0
  22. package/pig-cloud-skills-commands/commands/init.md +20 -0
  23. package/pig-cloud-skills-commands/commands/kb.md +20 -0
  24. package/pig-cloud-skills-commands/commands/perf.md +20 -0
  25. package/pig-cloud-skills-commands/commands/prd.md +21 -0
  26. package/pig-cloud-skills-commands/commands/review.md +21 -0
  27. package/pig-cloud-skills-commands/commands/security.md +21 -0
  28. package/pig-cloud-skills-commands/commands/test.md +21 -0
  29. package/pig-cloud-skills-commands/commands/workflow.md +20 -0
  30. package/rules/bundles.json +358 -0
  31. package/rules/coding/analysis.md +27 -0
  32. package/rules/coding/backend/cache-invalidation.md +30 -0
  33. package/rules/coding/backend/cache-keying.md +30 -0
  34. package/rules/coding/backend/cache.md +37 -0
  35. package/rules/coding/backend/database.md +32 -0
  36. package/rules/coding/backend/feign.md +30 -0
  37. package/rules/coding/backend/index.md +42 -0
  38. package/rules/coding/backend/query.md +32 -0
  39. package/rules/coding/backend/remote.md +33 -0
  40. package/rules/coding/backend/transaction-boundary.md +30 -0
  41. package/rules/coding/backend/transaction-rollback.md +30 -0
  42. package/rules/coding/backend/transaction.md +38 -0
  43. package/rules/coding/boundary.md +25 -0
  44. package/rules/coding/implementation.md +30 -0
  45. package/rules/coding/index.md +38 -0
  46. package/rules/coding/scaffold.md +28 -0
  47. package/rules/coding/testing.md +29 -0
  48. package/rules/coding/validation.md +29 -0
  49. package/rules/core/code-quality.md +30 -0
  50. package/rules/core/evidence.md +26 -0
  51. package/rules/core/index.md +41 -0
  52. package/rules/core/interface.md +26 -0
  53. package/rules/core/iteration.md +26 -0
  54. package/rules/core/layer-boundary.md +25 -0
  55. package/rules/core/logging.md +26 -0
  56. package/rules/core/security.md +26 -0
  57. package/rules/core/task-boundary.md +27 -0
  58. package/rules/docs/api.md +34 -0
  59. package/rules/docs/capture-summary.md +29 -0
  60. package/rules/docs/capture.md +34 -0
  61. package/rules/docs/contract.md +30 -0
  62. package/rules/docs/decision-log.md +32 -0
  63. package/rules/docs/examples.md +28 -0
  64. package/rules/docs/index.md +49 -0
  65. package/rules/docs/reference.md +32 -0
  66. package/rules/index.md +46 -0
  67. package/rules/overlays/index.md +28 -0
  68. package/rules/overlays/pig-cloud/controller.md +33 -0
  69. package/rules/overlays/pig-cloud/dto-vo.md +33 -0
  70. package/rules/overlays/pig-cloud/entity.md +32 -0
  71. package/rules/overlays/pig-cloud/exception.md +32 -0
  72. package/rules/overlays/pig-cloud/layering.md +31 -0
  73. package/rules/overlays/pig-cloud/mapper.md +32 -0
  74. package/rules/overlays/pig-cloud/query-style.md +32 -0
  75. package/rules/overlays/pig-cloud/rest-response.md +33 -0
  76. package/rules/overlays/pig-cloud/service.md +33 -0
  77. package/rules/overlays/pig-cloud/transactions.md +32 -0
  78. package/rules/overlays/pig-cloud/validation.md +33 -0
  79. package/rules/overlays/pig-cloud.md +45 -0
  80. package/rules/product/acceptance.md +25 -0
  81. package/rules/product/briefing.md +27 -0
  82. package/rules/product/index.md +36 -0
  83. package/rules/product/intake.md +27 -0
  84. package/rules/product/modeling.md +25 -0
  85. package/rules/product/project-context.md +29 -0
  86. package/rules/review/code.md +35 -0
  87. package/rules/review/evidence.md +31 -0
  88. package/rules/review/index.md +50 -0
  89. package/rules/review/java.md +42 -0
  90. package/rules/review/performance.md +38 -0
  91. package/rules/review/rubric.md +28 -0
  92. package/rules/review/security.md +38 -0
  93. package/rules/review/ts.md +33 -0
  94. package/rules/review/vue.md +33 -0
  95. package/rules/skill-profile-map.json +58 -0
  96. package/rules/skill-profile-map.md +28 -0
  97. package/rules/workflow/handoff.md +25 -0
  98. package/rules/workflow/index.md +37 -0
  99. package/rules/workflow/refinement.md +29 -0
  100. package/rules/workflow/router.md +25 -0
  101. package/rules/workflow/selection.md +25 -0
  102. package/rules/workflow/stop.md +25 -0
  103. package/scripts/ci-validator.sh +114 -0
  104. package/scripts/run-golden-replays.js +312 -0
  105. package/scripts/validate-rules.js +125 -0
  106. package/scripts/validate-skill-replay-signals.js +75 -0
  107. package/scripts/validate-skill-shapes.js +141 -0
  108. package/scripts/validate-skill-stop-rules.js +139 -0
  109. package/scripts/validate-skills.cmd +3 -0
  110. package/scripts/validate-skills.ps1 +42 -0
  111. package/scripts/validate-skills.sh +36 -0
  112. package/skills/api-docs/SKILL.md +76 -0
  113. package/skills/code-review/SKILL.md +135 -0
  114. package/skills/code-review/references/findings-template.md +51 -0
  115. package/skills/code-review/references/performance-checklist.md +213 -0
  116. package/skills/code-review/references/rubric.md +232 -0
  117. package/skills/code-review/references/rules.md +32 -0
  118. package/skills/code-review/references/security-checklist.md +178 -0
  119. package/skills/code-review/references/stack-notes.md +25 -0
  120. package/skills/code-review/references/template-review.md +214 -0
  121. package/skills/code-review/scripts/lint-code-review.mjs +431 -0
  122. package/skills/domain-modeling/SKILL.md +80 -0
  123. package/skills/domain-modeling/references/README.md +134 -0
  124. package/skills/domain-modeling/references/distillation-checklist.md +152 -0
  125. package/skills/domain-modeling/references/test-cases-template.md +128 -0
  126. package/skills/environment-deploy/SKILL.md +81 -0
  127. package/skills/feature-build/SKILL.md +122 -0
  128. package/skills/feature-build/references/coding-checklist.md +97 -0
  129. package/skills/feature-build/references/comment-specification.md +102 -0
  130. package/skills/knowledge-capture/SKILL.md +84 -0
  131. package/skills/performance-check/SKILL.md +117 -0
  132. package/skills/product-intake/SKILL.md +98 -0
  133. package/skills/project-bootstrap/SKILL.md +80 -0
  134. package/skills/references/agent-personas.md +34 -0
  135. package/skills/references/anti-rationalization.md +144 -0
  136. package/skills/references/engineering-delivery-method.md +63 -0
  137. package/skills/references/engineering-delivery-template.md +80 -0
  138. package/skills/references/flow-test-cases.md +62 -0
  139. package/skills/references/full-chain-replay-scenarios.md +79 -0
  140. package/skills/references/golden-prompt-suite.js +385 -0
  141. package/skills/references/golden-prompt-suite.md +33 -0
  142. package/skills/references/hooks.md +67 -0
  143. package/skills/references/negative-replay-scenarios.md +49 -0
  144. package/skills/references/project-requirement-alignment.md +41 -0
  145. package/skills/references/prompt-replay-checklist.md +128 -0
  146. package/skills/references/requirements-separation-map.md +71 -0
  147. package/skills/references/rule-loading-map.md +108 -0
  148. package/skills/references/skill-authoring-standard.md +73 -0
  149. package/skills/references/skill-boundary-template.md +38 -0
  150. package/skills/references/skill-enhanced-template.md +53 -0
  151. package/skills/references/skill-reference-matrix.md +53 -0
  152. package/skills/references/slash-commands.md +34 -0
  153. package/skills/security-review/SKILL.md +117 -0
  154. package/skills/spec-refinement/SKILL.md +143 -0
  155. package/skills/spec-refinement/references/ears-syntax.md +127 -0
  156. package/skills/spec-refinement/references/requirement-checklist.md +139 -0
  157. package/skills/spec-refinement/references/spec-workbook.md +75 -0
  158. package/skills/technical-design/SKILL.md +105 -0
  159. package/skills/technical-design/references/solid-checklist.md +199 -0
  160. package/skills/test-design/SKILL.md +91 -0
  161. package/skills/workflow-router/SKILL.md +86 -0
@@ -0,0 +1,385 @@
1
+ function makeCase(skill, id, prompt, expectedOutput, expectedStop, expectedHandoff) {
2
+ return {
3
+ id,
4
+ prompt,
5
+ expectedFirstSkill: skill,
6
+ expectedOutput,
7
+ expectedStop,
8
+ expectedHandoff,
9
+ };
10
+ }
11
+
12
+ const cases = [
13
+ makeCase(
14
+ 'workflow-router',
15
+ 'router-unclear-stage',
16
+ 'We have a new request but I am not sure which stage should handle it.',
17
+ ['next skill', 'stage decision', 'handoff note'],
18
+ 'Do not perform the target skill\'s work.',
19
+ 'product-intake',
20
+ ),
21
+ makeCase(
22
+ 'workflow-router',
23
+ 'router-approved-brief',
24
+ 'The brief is ready. Which stage should receive it next?',
25
+ ['next skill', 'stage decision', 'handoff note'],
26
+ 'Do not perform the target skill\'s work.',
27
+ 'spec-refinement',
28
+ ),
29
+ makeCase(
30
+ 'workflow-router',
31
+ 'router-before-coding',
32
+ 'This needs architecture help before coding. Route it.',
33
+ ['next skill', 'stage decision', 'handoff note'],
34
+ 'Do not perform the target skill\'s work.',
35
+ 'technical-design',
36
+ ),
37
+
38
+ makeCase(
39
+ 'product-intake',
40
+ 'product-reminder-feature',
41
+ 'We need a reminder feature for inactive users.',
42
+ ['product brief', 'scope', 'acceptance outline', 'open questions'],
43
+ 'Do not jump into design or code.',
44
+ 'spec-refinement',
45
+ ),
46
+ makeCase(
47
+ 'product-intake',
48
+ 'product-retention-gap',
49
+ 'Users keep missing renewal emails; help me define the product scope.',
50
+ ['product objective', 'scope', 'acceptance outline', 'open questions'],
51
+ 'Do not decide implementation details.',
52
+ 'spec-refinement',
53
+ ),
54
+ makeCase(
55
+ 'product-intake',
56
+ 'product-unclear-opportunity',
57
+ 'We think there is a retention problem, but the exact feature is unclear.',
58
+ ['product objective', 'scope', 'acceptance outline', 'open questions'],
59
+ 'Do not write technical design.',
60
+ 'spec-refinement',
61
+ ),
62
+
63
+ makeCase(
64
+ 'spec-refinement',
65
+ 'spec-approved-brief',
66
+ 'The brief is approved; turn it into an executable spec.',
67
+ ['executable spec', 'acceptance criteria', 'impact scope', 'implementation inputs'],
68
+ 'Do not rewrite the PRD or code the change.',
69
+ 'feature-build',
70
+ ),
71
+ makeCase(
72
+ 'spec-refinement',
73
+ 'spec-code-gap',
74
+ 'Compare the PRD with the current code and identify gaps.',
75
+ ['executable spec', 'impact scope', 'implementation inputs'],
76
+ 'Do not jump into implementation.',
77
+ 'feature-build',
78
+ ),
79
+ makeCase(
80
+ 'spec-refinement',
81
+ 'spec-align-with-code',
82
+ 'The requirement is messy; align it with existing behavior and make it engineer-ready.',
83
+ ['executable spec', 'acceptance criteria', 'implementation input summary'],
84
+ 'Do not rewrite the PRD.',
85
+ 'technical-design',
86
+ ),
87
+
88
+ makeCase(
89
+ 'technical-design',
90
+ 'design-cross-module',
91
+ 'This change touches multiple modules, cache behavior, and compatibility; help me plan it.',
92
+ ['design decisions', 'dependency map', 'interface contract', 'implementation constraints'],
93
+ 'Do not start implementation.',
94
+ 'feature-build',
95
+ ),
96
+ makeCase(
97
+ 'technical-design',
98
+ 'design-boundaries',
99
+ 'Design the module boundaries, dependencies, and rollback path.',
100
+ ['design decisions', 'dependency map', 'interface contract', 'implementation constraints'],
101
+ 'Do not reopen product discovery.',
102
+ 'feature-build',
103
+ ),
104
+ makeCase(
105
+ 'technical-design',
106
+ 'design-interface-contract',
107
+ 'I need an interface contract before anyone starts coding.',
108
+ ['interface contract', 'implementation constraints'],
109
+ 'Do not produce full code.',
110
+ 'feature-build',
111
+ ),
112
+
113
+ makeCase(
114
+ 'feature-build',
115
+ 'build-approved-spec',
116
+ 'Implement the approved spec in the controller and service.',
117
+ ['code changes', 'implementation notes', 'validation evidence'],
118
+ 'Do not expand scope or rewrite requirements.',
119
+ 'test-design',
120
+ ),
121
+ makeCase(
122
+ 'feature-build',
123
+ 'build-scope-stable',
124
+ 'Make the local code changes but keep the scope stable.',
125
+ ['code changes', 'implementation notes', 'validation evidence'],
126
+ 'Do not change the agreed boundaries.',
127
+ 'test-design',
128
+ ),
129
+ makeCase(
130
+ 'feature-build',
131
+ 'build-simple-refactor',
132
+ 'This controller needs a simple refactor that does not change behavior.',
133
+ ['code changes', 'implementation notes', 'validation evidence'],
134
+ 'Do not rewrite the spec.',
135
+ 'test-design',
136
+ ),
137
+
138
+ makeCase(
139
+ 'test-design',
140
+ 'test-coverage',
141
+ 'Design test coverage and validate the change.',
142
+ ['test strategy', 'test cases', 'regression matrix', 'validation result'],
143
+ 'Do not modify production code.',
144
+ 'code-review',
145
+ ),
146
+ makeCase(
147
+ 'test-design',
148
+ 'test-regression-matrix',
149
+ 'The feature is implemented; give me a regression matrix.',
150
+ ['test strategy', 'regression matrix', 'validation result'],
151
+ 'Do not rewrite the PRD.',
152
+ 'code-review',
153
+ ),
154
+ makeCase(
155
+ 'test-design',
156
+ 'test-edge-cases',
157
+ 'I need edge cases and validation paths for this change.',
158
+ ['test cases', 'validation result'],
159
+ 'Do not replace code review.',
160
+ 'code-review',
161
+ ),
162
+
163
+ makeCase(
164
+ 'code-review',
165
+ 'review-correctness',
166
+ 'Review this diff for correctness and safety.',
167
+ ['findings with severity', 'fix recommendations'],
168
+ 'Do not refactor the code inside the review step.',
169
+ 'knowledge-capture',
170
+ ),
171
+ makeCase(
172
+ 'code-review',
173
+ 'review-maintainability',
174
+ 'Find maintainability issues in this PR.',
175
+ ['findings', 'severity', 'fix recommendations'],
176
+ 'Do not perform implementation refactors.',
177
+ 'knowledge-capture',
178
+ ),
179
+ makeCase(
180
+ 'code-review',
181
+ 'review-regression',
182
+ 'Check whether this change introduces regressions.',
183
+ ['findings', 'severity', 'fix recommendations'],
184
+ 'Do not turn review into a design task.',
185
+ 'knowledge-capture',
186
+ ),
187
+
188
+ makeCase(
189
+ 'knowledge-capture',
190
+ 'capture-decisions',
191
+ 'Capture the reusable decisions and pitfalls from this task.',
192
+ ['reusable note', 'handoff summary'],
193
+ 'Do not redo upstream analysis.',
194
+ null,
195
+ ),
196
+ makeCase(
197
+ 'knowledge-capture',
198
+ 'capture-summary',
199
+ 'Summarize the decisions, pitfalls, and reusable notes from this task.',
200
+ ['reusable note', 'knowledge page', 'handoff summary'],
201
+ 'Do not generate new requirements or code.',
202
+ null,
203
+ ),
204
+ makeCase(
205
+ 'knowledge-capture',
206
+ 'capture-decision-log',
207
+ 'Turn these findings into a reusable note for future work.',
208
+ ['reusable note', 'handoff summary'],
209
+ 'Do not reopen the design or implementation debate.',
210
+ null,
211
+ ),
212
+
213
+ makeCase(
214
+ 'api-docs',
215
+ 'api-profile-docs',
216
+ 'Document the user profile endpoints with request and response shapes.',
217
+ ['API document', 'contract notes', 'examples'],
218
+ 'Do not change implementation.',
219
+ 'knowledge-capture',
220
+ ),
221
+ makeCase(
222
+ 'api-docs',
223
+ 'api-payment-contract',
224
+ 'Write the contract for this payment endpoint with examples.',
225
+ ['API document', 'contract notes', 'examples'],
226
+ 'Do not rewrite product scope.',
227
+ 'knowledge-capture',
228
+ ),
229
+ makeCase(
230
+ 'api-docs',
231
+ 'api-openapi-notes',
232
+ 'Capture the OpenAPI notes for a new endpoint.',
233
+ ['API document', 'contract notes', 'examples'],
234
+ 'Do not change implementation or product scope.',
235
+ 'knowledge-capture',
236
+ ),
237
+
238
+ makeCase(
239
+ 'domain-modeling',
240
+ 'domain-reverse-engineer',
241
+ 'Reverse engineer the customer order domain from this codebase and docs.',
242
+ ['domain map', 'core concepts', 'boundary notes'],
243
+ 'Do not implement code.',
244
+ 'technical-design',
245
+ ),
246
+ makeCase(
247
+ 'domain-modeling',
248
+ 'domain-boundary-split',
249
+ 'Split the billing and account concepts into boundaries.',
250
+ ['domain map', 'core concepts', 'boundary notes'],
251
+ 'Do not write PRD text.',
252
+ 'technical-design',
253
+ ),
254
+ makeCase(
255
+ 'domain-modeling',
256
+ 'domain-language-extraction',
257
+ 'Extract ubiquitous language from the current product notes.',
258
+ ['domain map', 'core concepts', 'boundary notes'],
259
+ 'Do not write implementation code.',
260
+ 'spec-refinement',
261
+ ),
262
+
263
+ makeCase(
264
+ 'security-review',
265
+ 'security-injection-auth',
266
+ 'Check this change for injection, auth, and secret handling issues.',
267
+ ['security findings', 'risk level', 'mitigation advice'],
268
+ 'Do not rewrite code.',
269
+ 'knowledge-capture',
270
+ ),
271
+ makeCase(
272
+ 'security-review',
273
+ 'security-permissions',
274
+ 'Review permission boundaries and data exposure risks.',
275
+ ['security findings', 'risk level', 'mitigation advice'],
276
+ 'Do not turn into a general review.',
277
+ 'knowledge-capture',
278
+ ),
279
+ makeCase(
280
+ 'security-review',
281
+ 'security-bypass-check',
282
+ 'Find any auth bypass or sensitive-data leaks in this diff.',
283
+ ['security findings', 'risk level', 'mitigation advice'],
284
+ 'Do not rewrite code or broaden the scope.',
285
+ 'knowledge-capture',
286
+ ),
287
+
288
+ makeCase(
289
+ 'performance-check',
290
+ 'perf-slow-endpoint',
291
+ 'This endpoint is slow; inspect query cost, cache, and concurrency.',
292
+ ['performance findings', 'bottleneck map', 'optimization advice'],
293
+ 'Do not rewrite code.',
294
+ 'knowledge-capture',
295
+ ),
296
+ makeCase(
297
+ 'performance-check',
298
+ 'perf-hot-path',
299
+ 'Find bottlenecks in the hot path and suggest improvements.',
300
+ ['performance findings', 'bottleneck map', 'optimization advice'],
301
+ 'Do not turn into a general review.',
302
+ 'knowledge-capture',
303
+ ),
304
+ makeCase(
305
+ 'performance-check',
306
+ 'perf-memory-latency',
307
+ 'Review memory pressure and response latency risks.',
308
+ ['performance findings', 'bottleneck map', 'optimization advice'],
309
+ 'Do not rewrite code or broaden the scope.',
310
+ 'knowledge-capture',
311
+ ),
312
+
313
+ makeCase(
314
+ 'project-bootstrap',
315
+ 'bootstrap-new-workspace',
316
+ 'Set up a new workspace for Codex with the right skills and rules.',
317
+ ['starter structure', 'installed bundle', 'setup notes'],
318
+ 'Do not design product scope.',
319
+ 'workflow-router',
320
+ ),
321
+ makeCase(
322
+ 'project-bootstrap',
323
+ 'bootstrap-skill-bundle',
324
+ 'Install the initial skill bundle for a new project.',
325
+ ['starter structure', 'installed bundle', 'setup notes'],
326
+ 'Do not generate application code.',
327
+ 'workflow-router',
328
+ ),
329
+ makeCase(
330
+ 'project-bootstrap',
331
+ 'bootstrap-scaffold',
332
+ 'Bootstrap a fresh repository scaffold and hand it off.',
333
+ ['starter structure', 'installed bundle', 'setup notes'],
334
+ 'Do not start feature implementation.',
335
+ 'product-intake',
336
+ ),
337
+
338
+ makeCase(
339
+ 'environment-deploy',
340
+ 'deploy-runtime-prereqs',
341
+ 'Prepare the runtime and deployment prerequisites for this workspace.',
342
+ ['environment plan', 'deployment notes', 'bootstrap instructions'],
343
+ 'Do not change product scope.',
344
+ 'feature-build',
345
+ ),
346
+ makeCase(
347
+ 'environment-deploy',
348
+ 'deploy-target-setup',
349
+ 'Set up the deployment target and document the bootstrap steps.',
350
+ ['environment plan', 'deployment notes', 'bootstrap instructions'],
351
+ 'Do not generate business logic.',
352
+ 'project-bootstrap',
353
+ ),
354
+ makeCase(
355
+ 'environment-deploy',
356
+ 'deploy-environment-check',
357
+ 'Verify the environment before feature work starts.',
358
+ ['environment plan', 'deployment notes', 'bootstrap instructions'],
359
+ 'Do not change product scope or generate business logic.',
360
+ 'feature-build',
361
+ ),
362
+
363
+ makeCase(
364
+ 'spec-refinement',
365
+ 'negative-direct-code',
366
+ 'Just code it, the PRD is small.',
367
+ ['executable spec'],
368
+ 'Do not jump directly into implementation.',
369
+ 'feature-build',
370
+ ),
371
+ makeCase(
372
+ 'code-review',
373
+ 'negative-review-refactor',
374
+ 'Review this change by refactoring it.',
375
+ ['findings', 'severity'],
376
+ 'Do not perform implementation refactors.',
377
+ 'knowledge-capture',
378
+ ),
379
+ ];
380
+
381
+ module.exports = {
382
+ name: 'golden-prompt-suite',
383
+ purpose: 'Golden prompt set for replay testing the full skill chain.',
384
+ cases,
385
+ };
@@ -0,0 +1,33 @@
1
+ # 金标提示词套件
2
+
3
+ ## 目的
4
+
5
+ 这套提示词用于真实回放测试。每个 case 都定义了预期首个 skill、返回工件、停止边界和交接目标。
6
+
7
+ 源码是真正的权威:[`golden-prompt-suite.js`](golden-prompt-suite.js)。运行器会直接加载这个文件。
8
+
9
+ ## 使用方式
10
+
11
+ 1. 把提示词发给 skill router 或者直接发给目标 skill。
12
+ 2. 对照预期首个 skill 检查结果。
13
+ 3. 检查输出工件是否符合预期形状。
14
+ 4. 确认 skill 是否停在指定边界。
15
+ 5. 验证下一跳是否是预期的交接目标。
16
+
17
+ ## 覆盖范围
18
+
19
+ - 每个 canonical skill 3 个 case
20
+ - 2 个用于边界回归的负向 case
21
+ - 共 44 个 case
22
+
23
+ ## 运行
24
+
25
+ - `npm run replay:golden`:真实模型回放
26
+ - `npm run replay:golden:mock`:本地 harness 检查
27
+
28
+ ## 输出字段
29
+
30
+ - 首个 skill
31
+ - 工件
32
+ - stop rule
33
+ - 交接
@@ -0,0 +1,67 @@
1
+ # Hooks
2
+
3
+ Hooks 负责协调 skill 执行和产物交接。
4
+
5
+ ## Hook 类型
6
+
7
+ | Hook 类型 | 触发时机 | 用途 |
8
+ |---|---|---|
9
+ | `pre_invoke` | skill 运行前 | 检查前置条件 |
10
+ | `post_invoke` | skill 运行后 | 更新状态和产物 |
11
+ | `on_success` | skill 成功时 | 通知并触发下一步 |
12
+ | `on_failure` | skill 失败时 | 记录问题并安全停止 |
13
+ | `on_confirm` | 用户确认时 | 推进工作流状态 |
14
+ | `on_reject` | 用户拒绝时 | 保持在当前阶段 |
15
+
16
+ ## canonical hook groups
17
+
18
+ ### product-intake
19
+
20
+ - 确认产品输入存在
21
+ - 收集目标、范围和待确认项
22
+ - 写出产品产物
23
+ - 在确认后触发 `spec-refinement`
24
+
25
+ ### spec-refinement
26
+
27
+ - 确认产品产物已通过确认
28
+ - 细化范围、边界和验收标准
29
+ - 写出研发规格
30
+ - 按需要触发 `technical-design` 或 `feature-build`
31
+
32
+ ### technical-design
33
+
34
+ - 确认规格已经稳定到足够支持设计
35
+ - 记录边界、依赖和接口决策
36
+
37
+ ### feature-build
38
+
39
+ - 确认规格和当前选定的 rules bundle 都已准备好
40
+ - 生成或更新代码
41
+ - 实现完成后触发 `test-design`
42
+
43
+ ### test-design
44
+
45
+ - 确认实现可用
46
+ - 写出测试用例、验证步骤和缺陷笔记
47
+ - 验证完成后触发 `code-review`
48
+
49
+ ### code-review
50
+
51
+ - 确认变更集已经可以审查
52
+ - 记录 findings、严重级别和后续事项
53
+ - 变更通过后触发 `knowledge-capture`
54
+
55
+ ## 工作流状态
56
+
57
+ - 跟踪当前阶段
58
+ - 跟踪已确认阶段
59
+ - 跟踪已产出工件
60
+ - 把错误和重试状态与工作流链路分开
61
+
62
+ ## Hook 原则
63
+
64
+ - 缺少前置条件就停止
65
+ - 推进阶段前优先做显式确认
66
+ - 输出要短小、机器可读
67
+ - 不要把框架规则混进 hook 逻辑里
@@ -0,0 +1,49 @@
1
+ # 负向回放场景
2
+
3
+ ## 目的
4
+
5
+ 专门验证 workflow 不会跳过阶段,也不会把 stop rule 写成“建议”。
6
+
7
+ ## 场景一:不能跳过规格细化
8
+
9
+ - 提示词:“PRD 很小,直接帮我把代码写了。”
10
+ - 期望首个 skill:`spec-refinement`
11
+ - 期望停点:不能直接进 `feature-build`
12
+ - 失败信号:`spec-refinement` 之后没有先形成可执行规格
13
+
14
+ ## 场景二:不能跳过技术设计
15
+
16
+ - 提示词:“这个需求会改多个模块,先别设计,直接写。”
17
+ - 期望首个 skill:`spec-refinement`
18
+ - 期望下一跳:`technical-design`
19
+ - 期望停点:不能直接进 `feature-build`
20
+ - 失败信号:复杂场景直接进入编码
21
+
22
+ ## 场景三:复杂需求必须先设计
23
+
24
+ - 提示词:“这个需求影响多个模块、缓存和兼容性,先帮我收口再直接实现。”
25
+ - 期望首个 skill:`spec-refinement`
26
+ - 期望下一跳:`technical-design`
27
+ - 期望停点:不能从规格细化直接跳到 `feature-build`
28
+ - 失败信号:`spec-refinement` 结束后没有进入 `technical-design`
29
+
30
+ ## 场景四:不能把测试当实现修补
31
+
32
+ - 提示词:“我需要测试覆盖,顺手把生产代码也改了。”
33
+ - 期望首个 skill:`test-design`
34
+ - 期望停点:不能修改生产代码
35
+ - 失败信号:测试阶段开始改实现
36
+
37
+ ## 场景五:不能把审查变成实现
38
+
39
+ - 提示词:“先帮我审查这个 diff,再顺手把问题修掉。”
40
+ - 期望首个 skill:`code-review`
41
+ - 期望停点:不能在审查阶段改代码
42
+ - 失败信号:`code-review` 输出里包含实现动作
43
+
44
+ ## 场景六:不能把沉淀变成重做分析
45
+
46
+ - 提示词:“把这次工作总结一下,但先重新分析一遍问题。”
47
+ - 期望首个 skill:`knowledge-capture`
48
+ - 期望停点:不能重新做上游分析
49
+ - 失败信号:`knowledge-capture` 开始重新定义需求或设计
@@ -0,0 +1,41 @@
1
+ # Project Requirement Alignment
2
+
3
+ ## Goal
4
+
5
+ Use this guide when a task needs both product intent and current project facts.
6
+
7
+ ## Read First
8
+
9
+ - Product brief or draft PRD
10
+ - Current project facts from repo docs, release notes, or existing behavior
11
+ - Known constraints from the current codebase or operating environment
12
+
13
+ ## Alignment Steps
14
+
15
+ 1. Summarize the product intent in one short paragraph.
16
+ 2. Summarize what the current project already does or guarantees.
17
+ 3. Mark what is unchanged, what must change, and what is still unknown.
18
+ 4. Record conflicts between product demand and current project facts.
19
+ 5. Turn the result into either a product brief or an executable spec, depending on the stage.
20
+
21
+ ## Output Shape
22
+
23
+ - product intent summary
24
+ - current project facts summary
25
+ - alignment notes
26
+ - open questions
27
+ - execution direction notes
28
+ - acceptance deltas
29
+ - task breakdown plan
30
+
31
+ ## Rules
32
+
33
+ - Do not merge product intent and project facts into one vague statement.
34
+ - Do not rewrite implementation details as requirements.
35
+ - Do not skip conflicts just because the requirement sounds simple.
36
+ - Do not move into code generation from this guide.
37
+
38
+ ## References
39
+
40
+ - `skills/references/requirements-separation-map.md`
41
+ - `docs/engineering-workflow.md`
@@ -0,0 +1,128 @@
1
+ # 提示词回放清单
2
+
3
+ ## 目的
4
+
5
+ 用这份清单手工回放提示词,判断 workflow skill 是否能正确路由、正确停住、正确交接。
6
+
7
+ ## 评分方式
8
+
9
+ 对每个提示词检查:
10
+
11
+ - 首个 skill 选择是否正确
12
+ - 输出产物是否正确
13
+ - stop rule 是否被遵守
14
+ - 下一跳交接是否正确
15
+ - 是否有额外工作泄漏到错误阶段
16
+
17
+ ### 评分标准
18
+
19
+ - 2:完全正确
20
+ - 1:部分正确,但还能恢复
21
+ - 0:错误,或者泄漏到错误阶段
22
+
23
+ ### 通过门槛
24
+
25
+ - 五项检查都要拿到 2,才算通过
26
+ - 任何一项为 0,直接判失败
27
+
28
+ ## 产品类提示词
29
+
30
+ - 提示词:“我们要给沉默用户做一个提醒功能,先帮我收口范围、优先级和验收。”
31
+ - 期望首个 skill:`product-intake`
32
+ - 期望产物:产品 brief
33
+ - 应该停在实现细节之前
34
+
35
+ - 提示词:“PRD 还不清楚,帮我先收集范围和验收。”
36
+ - 期望首个 skill:`product-intake`
37
+ - 期望产物:范围、验收轮廓、待确认项
38
+ - 应该停在规格或代码之前
39
+
40
+ ## 规格类提示词
41
+
42
+ - 提示词:“PRD 已确认,帮我把它转成可执行的研发规格。”
43
+ - 期望首个 skill:`spec-refinement`
44
+ - 期望产物:可执行规格
45
+ - 应该停在代码生成之前
46
+
47
+ - 提示词:“对比 PRD 和当前代码,找出需要改什么。”
48
+ - 期望首个 skill:`spec-refinement`
49
+ - 期望产物:影响范围和实现输入
50
+ - 应该停在实现之前
51
+
52
+ ## 设计类提示词
53
+
54
+ - 提示词:“这个改动影响多个模块和缓存层,先帮我设计边界。”
55
+ - 期望首个 skill:`technical-design`
56
+ - 期望产物:设计决策和依赖图
57
+ - 应该停在直接实现之前
58
+
59
+ - 提示词:“编码前我需要一个回退和兼容方案。”
60
+ - 期望首个 skill:`technical-design`
61
+ - 期望产物:可执行的方案笔记
62
+ - 应该停在代码之前
63
+
64
+ - 提示词:“这个需求会改多个模块和兼容性,先别写代码,直接推进实现。”
65
+ - 期望首个 skill:`spec-refinement`
66
+ - 期望产物:可执行规格和实现输入
67
+ - 应该先进入 `technical-design`,不能跳到实现
68
+
69
+ ## 实现类提示词
70
+
71
+ - 提示词:“规格已经确认,帮我实现 controller 和 service 的改动。”
72
+ - 期望首个 skill:`feature-build`
73
+ - 期望产物:代码改动
74
+ - 应该停在重写规格之前
75
+
76
+ - 提示词:“把本地代码改好,同时保持范围稳定。”
77
+ - 期望首个 skill:`feature-build`
78
+ - 期望产物:实现说明和验证证据
79
+ - 应该停在需求变更之前
80
+
81
+ ## 验证类提示词
82
+
83
+ - 提示词:“为实现后的改动设计测试并验证覆盖。”
84
+ - 期望首个 skill:`test-design`
85
+ - 期望产物:测试策略和回归矩阵
86
+ - 应该停在生产代码修改之前
87
+
88
+ - 提示词:“检查边界情况,告诉我这个能不能安全发布。”
89
+ - 期望首个 skill:`test-design`
90
+ - 期望产物:验证结果
91
+ - 应该停在实现之前
92
+
93
+ ## 审查类提示词
94
+
95
+ - 提示词:“帮我审查这个 diff 的正确性、安全性和可维护性。”
96
+ - 期望首个 skill:`code-review`
97
+ - 期望产物:带严重级别的 findings
98
+ - 应该停在重构代码之前
99
+
100
+ - 提示词:“找出这个改动里的安全问题或性能问题。”
101
+ - 期望首个 skill:`code-review`,必要时再进专项审查
102
+ - 期望产物:有优先级的 findings
103
+ - 应该停在审查结论
104
+
105
+ ## 沉淀类提示词
106
+
107
+ - 提示词:“把这次任务的决策、坑点和可复用要点总结一下。”
108
+ - 期望首个 skill:`knowledge-capture`
109
+ - 期望产物:可复用笔记和交接摘要
110
+ - 应该停在重新分析之前
111
+
112
+ ## 评估标准
113
+
114
+ - 首个 skill 正确
115
+ - 产物正确
116
+ - stop rule 正确
117
+ - 交接正确
118
+ - 没有跨阶段泄漏
119
+
120
+ ## 快速记分表
121
+
122
+ | 检查项 | 2 | 1 | 0 |
123
+ |---|---|---|---|
124
+ | 首个 skill | 精确匹配 | 接近但可恢复 | 阶段错误 |
125
+ | 产物 | 符合预期 | 基本正确 | 缺失或错误 |
126
+ | stop rule | 停得正确 | 停得稍晚 | 继续推进 |
127
+ | 交接 | 正确下一跳 | 方向对但弱 | 交接错误 |
128
+ | 泄漏 | 没有 | 轻微 | 明显 |