@pigcloud/skills 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -4
- package/README.en.md +74 -83
- package/README.md +74 -85
- package/bin/cli.js +114 -89
- package/bin/postinstall.js +1 -1
- package/package.json +1 -1
- package/rules/skill-profile-map.json +5 -5
- package/rules/skill-profile-map.md +2 -2
- package/scripts/validate-skill-shapes.js +2 -1
- package/scripts/validate-skills.ps1 +6 -6
- package/scripts/validate-skills.sh +5 -5
- package/skills/api-docs/SKILL.md +2 -2
- package/skills/domain-modeling/SKILL.md +4 -4
- package/skills/extract-business-facts/SKILL.md +336 -0
- package/skills/extract-business-facts/scripts/write-knowledge-base.js +227 -0
- package/skills/knowledge-capture/SKILL.md +16 -7
- package/skills/project-bootstrap/SKILL.md +2 -2
- package/skills/references/business-fact-extraction.md +414 -0
- package/skills/references/golden-prompt-suite.js +64 -14
- package/skills/references/rule-loading-map.md +18 -18
- package/skills/references/skill-authoring-standard.md +2 -2
- package/skills/references/skill-boundary-template.md +56 -23
- package/skills/references/skill-enhanced-template.md +80 -30
- package/skills/references/skill-reference-matrix.md +21 -20
- package/skills/{spec-refinement → spec}/SKILL.md +19 -14
- package/skills/technical-design/SKILL.md +4 -4
- package/pig-cloud-skills-commands/.codex-plugin/plugin.json +0 -35
- package/pig-cloud-skills-commands/README.md +0 -24
- package/pig-cloud-skills-commands/commands/analyze.md +0 -21
- package/pig-cloud-skills-commands/commands/build.md +0 -21
- package/pig-cloud-skills-commands/commands/design.md +0 -21
- package/pig-cloud-skills-commands/commands/distill.md +0 -21
- package/pig-cloud-skills-commands/commands/doc.md +0 -21
- package/pig-cloud-skills-commands/commands/infra.md +0 -21
- package/pig-cloud-skills-commands/commands/init.md +0 -20
- package/pig-cloud-skills-commands/commands/kb.md +0 -20
- package/pig-cloud-skills-commands/commands/perf.md +0 -20
- package/pig-cloud-skills-commands/commands/prd.md +0 -21
- package/pig-cloud-skills-commands/commands/review.md +0 -21
- package/pig-cloud-skills-commands/commands/security.md +0 -21
- package/pig-cloud-skills-commands/commands/test.md +0 -21
- package/pig-cloud-skills-commands/commands/workflow.md +0 -20
- package/skills/product-intake/SKILL.md +0 -98
- package/skills/references/agent-personas.md +0 -34
- package/skills/references/flow-test-cases.md +0 -62
- package/skills/references/full-chain-replay-scenarios.md +0 -79
- package/skills/references/hooks.md +0 -67
- package/skills/references/negative-replay-scenarios.md +0 -49
- package/skills/references/prompt-replay-checklist.md +0 -128
- package/skills/references/requirements-separation-map.md +0 -71
- package/skills/references/slash-commands.md +0 -34
- package/skills/spec-refinement/references/ears-syntax.md +0 -127
- package/skills/spec-refinement/references/requirement-checklist.md +0 -139
- package/skills/spec-refinement/references/spec-workbook.md +0 -75
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
# Business Fact Extraction
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Turn code-backed evidence into a three-stage artifact:
|
|
6
|
+
|
|
7
|
+
1. code facts
|
|
8
|
+
2. business facts
|
|
9
|
+
3. CodeWiki updates
|
|
10
|
+
|
|
11
|
+
## Evidence Order
|
|
12
|
+
|
|
13
|
+
Use the strongest source available first:
|
|
14
|
+
|
|
15
|
+
1. runtime behavior
|
|
16
|
+
2. automated tests
|
|
17
|
+
3. code paths
|
|
18
|
+
4. schema and contracts
|
|
19
|
+
5. docs and runbooks
|
|
20
|
+
6. comments and naming
|
|
21
|
+
|
|
22
|
+
## Fact Types
|
|
23
|
+
|
|
24
|
+
- evidence-backed fact: directly supported by code or tests
|
|
25
|
+
- inferred business fact: a reasonable business meaning derived from evidence
|
|
26
|
+
- unknown: the code does not prove it yet
|
|
27
|
+
- contradiction: two sources disagree
|
|
28
|
+
|
|
29
|
+
## Output Shape
|
|
30
|
+
|
|
31
|
+
### 1. Code Facts
|
|
32
|
+
|
|
33
|
+
#### `knowledge-base/realtime-code/modules.md`
|
|
34
|
+
|
|
35
|
+
- module:
|
|
36
|
+
- current responsibility:
|
|
37
|
+
- key entry points:
|
|
38
|
+
- important constraints:
|
|
39
|
+
- last verified:
|
|
40
|
+
|
|
41
|
+
#### `knowledge-base/realtime-code/flows.md`
|
|
42
|
+
|
|
43
|
+
- flow name:
|
|
44
|
+
- trigger:
|
|
45
|
+
- path:
|
|
46
|
+
- output:
|
|
47
|
+
- failure points:
|
|
48
|
+
- notes:
|
|
49
|
+
|
|
50
|
+
#### `knowledge-base/realtime-code/runtime-notes.md`
|
|
51
|
+
|
|
52
|
+
- fact:
|
|
53
|
+
- evidence:
|
|
54
|
+
- affected area:
|
|
55
|
+
- date:
|
|
56
|
+
- notes:
|
|
57
|
+
|
|
58
|
+
### 2. Business Facts
|
|
59
|
+
|
|
60
|
+
#### `knowledge-base/requirements/decisions.md`
|
|
61
|
+
|
|
62
|
+
- decision:
|
|
63
|
+
- reason:
|
|
64
|
+
- date or context:
|
|
65
|
+
- affected artifact:
|
|
66
|
+
- notes:
|
|
67
|
+
|
|
68
|
+
#### `knowledge-base/requirements/acceptance.md`
|
|
69
|
+
|
|
70
|
+
- requirement:
|
|
71
|
+
- acceptance criteria:
|
|
72
|
+
- out of scope:
|
|
73
|
+
- open questions:
|
|
74
|
+
- confirmed by:
|
|
75
|
+
|
|
76
|
+
#### `knowledge-base/requirements/conflicts.md`
|
|
77
|
+
|
|
78
|
+
- conflict:
|
|
79
|
+
- source:
|
|
80
|
+
- impact:
|
|
81
|
+
- resolution:
|
|
82
|
+
- status:
|
|
83
|
+
|
|
84
|
+
### 3. CodeWiki Update
|
|
85
|
+
|
|
86
|
+
#### `knowledge-base/codewiki/overview.md`
|
|
87
|
+
|
|
88
|
+
- one-line summary:
|
|
89
|
+
- what the system does:
|
|
90
|
+
- what changed:
|
|
91
|
+
- why it matters:
|
|
92
|
+
|
|
93
|
+
#### `knowledge-base/codewiki/architecture.md`
|
|
94
|
+
|
|
95
|
+
- layers:
|
|
96
|
+
- boundaries:
|
|
97
|
+
- dependencies:
|
|
98
|
+
- major integration points:
|
|
99
|
+
|
|
100
|
+
#### `knowledge-base/codewiki/modules.md`
|
|
101
|
+
|
|
102
|
+
- module name:
|
|
103
|
+
- responsibility:
|
|
104
|
+
- main interfaces:
|
|
105
|
+
- related runtime facts:
|
|
106
|
+
|
|
107
|
+
#### `knowledge-base/codewiki/flows.md`
|
|
108
|
+
|
|
109
|
+
- request flow:
|
|
110
|
+
- data flow:
|
|
111
|
+
- error flow:
|
|
112
|
+
- handoff flow:
|
|
113
|
+
|
|
114
|
+
#### `knowledge-base/codewiki/api.md`
|
|
115
|
+
|
|
116
|
+
- endpoint or contract:
|
|
117
|
+
- request shape:
|
|
118
|
+
- response shape:
|
|
119
|
+
- constraints:
|
|
120
|
+
|
|
121
|
+
#### `knowledge-base/codewiki/runbook.md`
|
|
122
|
+
|
|
123
|
+
- startup:
|
|
124
|
+
- verify:
|
|
125
|
+
- troubleshoot:
|
|
126
|
+
- recover:
|
|
127
|
+
|
|
128
|
+
#### `knowledge-base/codewiki/conventions.md`
|
|
129
|
+
|
|
130
|
+
- naming:
|
|
131
|
+
- layering:
|
|
132
|
+
- error handling:
|
|
133
|
+
- logging:
|
|
134
|
+
- data handling:
|
|
135
|
+
|
|
136
|
+
### 4. Enterprise Note
|
|
137
|
+
|
|
138
|
+
#### `knowledge-base/enterprise/decisions.md`
|
|
139
|
+
|
|
140
|
+
- decision:
|
|
141
|
+
- reason:
|
|
142
|
+
- scope:
|
|
143
|
+
- date:
|
|
144
|
+
- reusable lesson:
|
|
145
|
+
|
|
146
|
+
#### `knowledge-base/enterprise/pitfalls.md`
|
|
147
|
+
|
|
148
|
+
- pitfall:
|
|
149
|
+
- context:
|
|
150
|
+
- why it failed:
|
|
151
|
+
- how to avoid it:
|
|
152
|
+
|
|
153
|
+
#### `knowledge-base/enterprise/examples.md`
|
|
154
|
+
|
|
155
|
+
- example:
|
|
156
|
+
- context:
|
|
157
|
+
- lesson:
|
|
158
|
+
- reusable pattern:
|
|
159
|
+
|
|
160
|
+
#### `knowledge-base/enterprise/ai-coding-rules.md`
|
|
161
|
+
|
|
162
|
+
- rule:
|
|
163
|
+
- when it applies:
|
|
164
|
+
- why it matters:
|
|
165
|
+
- examples:
|
|
166
|
+
|
|
167
|
+
## Writing Rules
|
|
168
|
+
|
|
169
|
+
- Keep one fact per line.
|
|
170
|
+
- Point each fact back to evidence.
|
|
171
|
+
- Separate observed behavior from interpretation.
|
|
172
|
+
- Mark uncertainty explicitly.
|
|
173
|
+
- Do not mix solution ideas into the fact list.
|
|
174
|
+
- Write the three stages in order and keep them visually separate.
|
|
175
|
+
- Update the smallest matching file in each target layer.
|
|
176
|
+
- Keep file targets and file content in the same order.
|
|
177
|
+
|
|
178
|
+
## Auto-Write Pack
|
|
179
|
+
|
|
180
|
+
Use `skills/extract-business-facts/scripts/write-knowledge-base.js` when the staged readout should be written into the knowledge base.
|
|
181
|
+
|
|
182
|
+
### Input Shape
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"files": {
|
|
187
|
+
"knowledge-base/realtime-code/modules.md": [
|
|
188
|
+
{
|
|
189
|
+
"module": "order-service",
|
|
190
|
+
"current responsibility": "creates orders and reserves inventory",
|
|
191
|
+
"key entry points": "createOrder(), reserveInventory()",
|
|
192
|
+
"important constraints": "stock must be checked before commit",
|
|
193
|
+
"last verified": "2026-06-22"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Command
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
node skills/extract-business-facts/scripts/write-knowledge-base.js --input fact-pack.json
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Behavior
|
|
207
|
+
|
|
208
|
+
- Writes only under `knowledge-base/`
|
|
209
|
+
- Keeps the file-specific field order
|
|
210
|
+
- Replaces the generated block between markers when it already exists
|
|
211
|
+
- Preserves the surrounding manual notes
|
|
212
|
+
- Supports `--dry-run` for preview and `--sample` for a sample pack
|
|
213
|
+
|
|
214
|
+
## Handoff Targets
|
|
215
|
+
|
|
216
|
+
- `domain-modeling` when the facts need boundary or concept normalization
|
|
217
|
+
- `spec` when the facts need to become a user-confirmable spec
|
|
218
|
+
- `knowledge-capture` when the facts are stable and ready to persist
|
|
219
|
+
|
|
220
|
+
## Sample Readout
|
|
221
|
+
|
|
222
|
+
- code facts: module behavior, entry points, constraints, runtime evidence
|
|
223
|
+
- business facts: decisions, acceptance criteria, conflicts, open questions
|
|
224
|
+
- CodeWiki update: flow, architecture, module, API, runbook, convention deltas
|
|
225
|
+
- enterprise note: pitfalls, examples, reusable rules
|
|
226
|
+
|
|
227
|
+
## Full Example
|
|
228
|
+
|
|
229
|
+
### Code Facts
|
|
230
|
+
|
|
231
|
+
#### `knowledge-base/realtime-code/modules.md`
|
|
232
|
+
|
|
233
|
+
- module: `order-service`
|
|
234
|
+
- current responsibility: creates orders and reserves inventory
|
|
235
|
+
- key entry points: `createOrder()`, `reserveInventory()`
|
|
236
|
+
- important constraints: stock must be checked before commit
|
|
237
|
+
- last verified: 2026-06-22
|
|
238
|
+
|
|
239
|
+
#### `knowledge-base/realtime-code/flows.md`
|
|
240
|
+
|
|
241
|
+
- flow name: checkout order placement
|
|
242
|
+
- trigger: user confirms checkout
|
|
243
|
+
- path: validate stock -> reserve inventory -> create order
|
|
244
|
+
- output: confirmed order or shortage error
|
|
245
|
+
- failure points: stock shortage, reservation failure
|
|
246
|
+
- notes: reservation must happen before the order commit
|
|
247
|
+
|
|
248
|
+
### Business Facts
|
|
249
|
+
|
|
250
|
+
#### `knowledge-base/requirements/decisions.md`
|
|
251
|
+
|
|
252
|
+
- decision: inventory must be reserved before order confirmation
|
|
253
|
+
- reason: avoid overselling
|
|
254
|
+
- date or context: 2026-06-22, order flow review
|
|
255
|
+
- affected artifact: checkout spec
|
|
256
|
+
- notes: failure should return a clear stock shortage message
|
|
257
|
+
|
|
258
|
+
#### `knowledge-base/requirements/acceptance.md`
|
|
259
|
+
|
|
260
|
+
- requirement: checkout must not confirm an order when stock is unavailable
|
|
261
|
+
- acceptance criteria: shortage blocks confirmation and returns a clear message
|
|
262
|
+
- out of scope: backorder design
|
|
263
|
+
- open questions: whether to retry reservation automatically
|
|
264
|
+
- confirmed by: order flow review
|
|
265
|
+
|
|
266
|
+
### CodeWiki Update
|
|
267
|
+
|
|
268
|
+
#### `knowledge-base/codewiki/flows.md`
|
|
269
|
+
|
|
270
|
+
- request flow: checkout -> validate stock -> reserve inventory -> create order
|
|
271
|
+
- data flow: cart snapshot -> reservation record -> order record
|
|
272
|
+
- error flow: stock shortage -> stop checkout -> return shortage reason
|
|
273
|
+
- handoff flow: checkout service hands off to inventory service and order repository
|
|
274
|
+
|
|
275
|
+
#### `knowledge-base/codewiki/modules.md`
|
|
276
|
+
|
|
277
|
+
- module name: `order-service`
|
|
278
|
+
- responsibility: coordinates checkout and order creation
|
|
279
|
+
- main interfaces: `createOrder()`, `reserveInventory()`
|
|
280
|
+
- related runtime facts: inventory must be reserved before commit
|
|
281
|
+
|
|
282
|
+
### Enterprise Note
|
|
283
|
+
|
|
284
|
+
#### `knowledge-base/enterprise/pitfalls.md`
|
|
285
|
+
|
|
286
|
+
- pitfall: reservation happens after order creation
|
|
287
|
+
- context: checkout path
|
|
288
|
+
- why it failed: allowed overselling under concurrent requests
|
|
289
|
+
- how to avoid it: reserve before committing the order
|
|
290
|
+
|
|
291
|
+
## End-to-End Example
|
|
292
|
+
|
|
293
|
+
### 1. Source Input
|
|
294
|
+
|
|
295
|
+
- PRD / spec note: checkout must not confirm when stock is insufficient
|
|
296
|
+
- code evidence: `order-service` reserves inventory before creating the order
|
|
297
|
+
- runtime evidence: shortage returns a stock error before commit
|
|
298
|
+
|
|
299
|
+
### 2. Extracted Output
|
|
300
|
+
|
|
301
|
+
- code facts:
|
|
302
|
+
- `knowledge-base/realtime-code/modules.md`: `order-service` coordinates checkout and inventory reservation
|
|
303
|
+
- `knowledge-base/realtime-code/flows.md`: checkout -> validate stock -> reserve inventory -> create order
|
|
304
|
+
- business facts:
|
|
305
|
+
- `knowledge-base/requirements/decisions.md`: reserve inventory before order confirmation
|
|
306
|
+
- `knowledge-base/requirements/acceptance.md`: shortage blocks confirmation and returns a clear message
|
|
307
|
+
- CodeWiki update:
|
|
308
|
+
- `knowledge-base/codewiki/flows.md`: document request / data / error / handoff flow
|
|
309
|
+
- `knowledge-base/codewiki/modules.md`: document `order-service` responsibilities and interfaces
|
|
310
|
+
- enterprise note:
|
|
311
|
+
- `knowledge-base/enterprise/pitfalls.md`: reservation after order creation causes overselling
|
|
312
|
+
- `knowledge-base/enterprise/ai-coding-rules.md`: reserve before commit under concurrency
|
|
313
|
+
|
|
314
|
+
### 3. Fact Pack
|
|
315
|
+
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"files": {
|
|
319
|
+
"knowledge-base/realtime-code/modules.md": [
|
|
320
|
+
{
|
|
321
|
+
"module": "order-service",
|
|
322
|
+
"current responsibility": "coordinates checkout and inventory reservation",
|
|
323
|
+
"key entry points": "createOrder(), reserveInventory()",
|
|
324
|
+
"important constraints": "stock must be checked before commit",
|
|
325
|
+
"last verified": "2026-06-22"
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
"knowledge-base/requirements/decisions.md": [
|
|
329
|
+
{
|
|
330
|
+
"decision": "inventory must be reserved before order confirmation",
|
|
331
|
+
"reason": "avoid overselling",
|
|
332
|
+
"date or context": "2026-06-22, checkout review",
|
|
333
|
+
"affected artifact": "checkout spec",
|
|
334
|
+
"notes": "shortage returns a clear error"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"knowledge-base/codewiki/flows.md": [
|
|
338
|
+
{
|
|
339
|
+
"request flow": "checkout -> validate stock -> reserve inventory -> create order",
|
|
340
|
+
"data flow": "cart snapshot -> reservation record -> order record",
|
|
341
|
+
"error flow": "stock shortage -> stop checkout -> return shortage reason",
|
|
342
|
+
"handoff flow": "checkout service hands off to inventory service and order repository"
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"knowledge-base/enterprise/pitfalls.md": [
|
|
346
|
+
{
|
|
347
|
+
"pitfall": "reservation happens after order creation",
|
|
348
|
+
"context": "checkout path",
|
|
349
|
+
"why it failed": "allowed overselling under concurrent requests",
|
|
350
|
+
"how to avoid it": "reserve before committing the order"
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### 4. Persist
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
node skills/extract-business-facts/scripts/write-knowledge-base.js --input fact-pack.json
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### 5. `knowledge-capture`
|
|
364
|
+
|
|
365
|
+
- Normalize the extracted note.
|
|
366
|
+
- Link it back to the originating skill.
|
|
367
|
+
- Persist the fact pack only when the note is ready.
|
|
368
|
+
|
|
369
|
+
#### `knowledge-base/enterprise/ai-coding-rules.md`
|
|
370
|
+
|
|
371
|
+
- rule: reserve inventory before committing the order
|
|
372
|
+
- when it applies: any checkout flow that can oversell
|
|
373
|
+
- why it matters: keeps business state consistent under concurrency
|
|
374
|
+
- examples: validate stock, reserve, then create the order
|
|
375
|
+
|
|
376
|
+
## Sample Output
|
|
377
|
+
|
|
378
|
+
### Code Facts
|
|
379
|
+
|
|
380
|
+
#### `knowledge-base/realtime-code/modules.md`
|
|
381
|
+
|
|
382
|
+
- module: `order-service`
|
|
383
|
+
- current responsibility: creates orders and reserves inventory
|
|
384
|
+
- key entry points: `createOrder()`, `reserveInventory()`
|
|
385
|
+
- important constraints: stock must be checked before commit
|
|
386
|
+
- last verified: 2026-06-22
|
|
387
|
+
|
|
388
|
+
### Business Facts
|
|
389
|
+
|
|
390
|
+
#### `knowledge-base/requirements/decisions.md`
|
|
391
|
+
|
|
392
|
+
- decision: inventory must be reserved before order confirmation
|
|
393
|
+
- reason: avoid overselling
|
|
394
|
+
- date or context: 2026-06-22, order flow review
|
|
395
|
+
- affected artifact: checkout spec
|
|
396
|
+
- notes: failure should return a clear stock shortage message
|
|
397
|
+
|
|
398
|
+
### CodeWiki Update
|
|
399
|
+
|
|
400
|
+
#### `knowledge-base/codewiki/flows.md`
|
|
401
|
+
|
|
402
|
+
- request flow: checkout -> validate stock -> reserve inventory -> create order
|
|
403
|
+
- data flow: cart snapshot -> reservation record -> order record
|
|
404
|
+
- error flow: stock shortage -> stop checkout -> return shortage reason
|
|
405
|
+
- handoff flow: checkout service hands off to inventory service and order repository
|
|
406
|
+
|
|
407
|
+
### Enterprise Note
|
|
408
|
+
|
|
409
|
+
#### `knowledge-base/enterprise/pitfalls.md`
|
|
410
|
+
|
|
411
|
+
- pitfall: reservation happens after order creation
|
|
412
|
+
- context: checkout path
|
|
413
|
+
- why it failed: allowed overselling under concurrent requests
|
|
414
|
+
- how to avoid it: reserve before committing the order
|
|
@@ -16,7 +16,7 @@ const cases = [
|
|
|
16
16
|
'We have a new request but I am not sure which stage should handle it.',
|
|
17
17
|
['next skill', 'stage decision', 'handoff note'],
|
|
18
18
|
'Do not perform the target skill\'s work.',
|
|
19
|
-
'
|
|
19
|
+
'spec',
|
|
20
20
|
),
|
|
21
21
|
makeCase(
|
|
22
22
|
'workflow-router',
|
|
@@ -24,7 +24,7 @@ const cases = [
|
|
|
24
24
|
'The brief is ready. Which stage should receive it next?',
|
|
25
25
|
['next skill', 'stage decision', 'handoff note'],
|
|
26
26
|
'Do not perform the target skill\'s work.',
|
|
27
|
-
'spec
|
|
27
|
+
'spec',
|
|
28
28
|
),
|
|
29
29
|
makeCase(
|
|
30
30
|
'workflow-router',
|
|
@@ -36,32 +36,57 @@ const cases = [
|
|
|
36
36
|
),
|
|
37
37
|
|
|
38
38
|
makeCase(
|
|
39
|
-
'
|
|
39
|
+
'spec',
|
|
40
40
|
'product-reminder-feature',
|
|
41
41
|
'We need a reminder feature for inactive users.',
|
|
42
42
|
['product brief', 'scope', 'acceptance outline', 'open questions'],
|
|
43
43
|
'Do not jump into design or code.',
|
|
44
|
-
'spec
|
|
44
|
+
'spec',
|
|
45
45
|
),
|
|
46
46
|
makeCase(
|
|
47
|
-
'
|
|
47
|
+
'spec',
|
|
48
48
|
'product-retention-gap',
|
|
49
49
|
'Users keep missing renewal emails; help me define the product scope.',
|
|
50
50
|
['product objective', 'scope', 'acceptance outline', 'open questions'],
|
|
51
51
|
'Do not decide implementation details.',
|
|
52
|
-
'spec
|
|
52
|
+
'spec',
|
|
53
53
|
),
|
|
54
54
|
makeCase(
|
|
55
|
-
'
|
|
55
|
+
'spec',
|
|
56
56
|
'product-unclear-opportunity',
|
|
57
57
|
'We think there is a retention problem, but the exact feature is unclear.',
|
|
58
58
|
['product objective', 'scope', 'acceptance outline', 'open questions'],
|
|
59
59
|
'Do not write technical design.',
|
|
60
|
-
'spec
|
|
60
|
+
'spec',
|
|
61
61
|
),
|
|
62
62
|
|
|
63
63
|
makeCase(
|
|
64
|
-
'spec
|
|
64
|
+
'spec',
|
|
65
|
+
'spec-approved-brief',
|
|
66
|
+
'The brief is approved; turn it into an executable spec and task breakdown.',
|
|
67
|
+
['executable spec', 'task breakdown plan', 'acceptance criteria', 'confirmation package'],
|
|
68
|
+
'Do not generate code or reopen discovery.',
|
|
69
|
+
'feature-build',
|
|
70
|
+
),
|
|
71
|
+
makeCase(
|
|
72
|
+
'spec',
|
|
73
|
+
'spec-code-alignment',
|
|
74
|
+
'Compare the PRD with current project facts and implementation evidence, then produce the engineering spec.',
|
|
75
|
+
['execution direction plan', 'impact scope', 'implementation inputs', 'conflict map'],
|
|
76
|
+
'Do not jump into implementation.',
|
|
77
|
+
'technical-design',
|
|
78
|
+
),
|
|
79
|
+
makeCase(
|
|
80
|
+
'spec',
|
|
81
|
+
'spec-confirmation-pack',
|
|
82
|
+
'I need a confirmation package with the spec, tasks, and acceptance criteria before coding.',
|
|
83
|
+
['executable spec', 'task breakdown plan', 'confirmation package'],
|
|
84
|
+
'Do not write code.',
|
|
85
|
+
'feature-build',
|
|
86
|
+
),
|
|
87
|
+
|
|
88
|
+
makeCase(
|
|
89
|
+
'spec',
|
|
65
90
|
'spec-approved-brief',
|
|
66
91
|
'The brief is approved; turn it into an executable spec.',
|
|
67
92
|
['executable spec', 'acceptance criteria', 'impact scope', 'implementation inputs'],
|
|
@@ -69,7 +94,7 @@ const cases = [
|
|
|
69
94
|
'feature-build',
|
|
70
95
|
),
|
|
71
96
|
makeCase(
|
|
72
|
-
'spec
|
|
97
|
+
'spec',
|
|
73
98
|
'spec-code-gap',
|
|
74
99
|
'Compare the PRD with the current code and identify gaps.',
|
|
75
100
|
['executable spec', 'impact scope', 'implementation inputs'],
|
|
@@ -77,7 +102,7 @@ const cases = [
|
|
|
77
102
|
'feature-build',
|
|
78
103
|
),
|
|
79
104
|
makeCase(
|
|
80
|
-
'spec
|
|
105
|
+
'spec',
|
|
81
106
|
'spec-align-with-code',
|
|
82
107
|
'The requirement is messy; align it with existing behavior and make it engineer-ready.',
|
|
83
108
|
['executable spec', 'acceptance criteria', 'implementation input summary'],
|
|
@@ -257,7 +282,32 @@ const cases = [
|
|
|
257
282
|
'Extract ubiquitous language from the current product notes.',
|
|
258
283
|
['domain map', 'core concepts', 'boundary notes'],
|
|
259
284
|
'Do not write implementation code.',
|
|
260
|
-
'spec
|
|
285
|
+
'spec',
|
|
286
|
+
),
|
|
287
|
+
|
|
288
|
+
makeCase(
|
|
289
|
+
'extract-business-facts',
|
|
290
|
+
'extract-business-facts-from-code',
|
|
291
|
+
'Extract the business facts expressed by this order-processing code and explain the current behavior.',
|
|
292
|
+
['code fact map', 'business fact map', 'codewiki delta'],
|
|
293
|
+
'Do not design a new solution.',
|
|
294
|
+
'knowledge-capture',
|
|
295
|
+
),
|
|
296
|
+
makeCase(
|
|
297
|
+
'extract-business-facts',
|
|
298
|
+
'extract-business-invariants',
|
|
299
|
+
'From these service methods and tests, identify the business invariants and open questions.',
|
|
300
|
+
['code fact map', 'business fact map', 'codewiki delta'],
|
|
301
|
+
'Do not rewrite the PRD.',
|
|
302
|
+
'domain-modeling',
|
|
303
|
+
),
|
|
304
|
+
makeCase(
|
|
305
|
+
'extract-business-facts',
|
|
306
|
+
'extract-code-backed-terms',
|
|
307
|
+
'Turn this controller, service, and database flow into a terminology map with evidence.',
|
|
308
|
+
['code fact map', 'business fact map', 'codewiki delta'],
|
|
309
|
+
'Do not generate code.',
|
|
310
|
+
'spec',
|
|
261
311
|
),
|
|
262
312
|
|
|
263
313
|
makeCase(
|
|
@@ -332,7 +382,7 @@ const cases = [
|
|
|
332
382
|
'Bootstrap a fresh repository scaffold and hand it off.',
|
|
333
383
|
['starter structure', 'installed bundle', 'setup notes'],
|
|
334
384
|
'Do not start feature implementation.',
|
|
335
|
-
'
|
|
385
|
+
'spec',
|
|
336
386
|
),
|
|
337
387
|
|
|
338
388
|
makeCase(
|
|
@@ -361,7 +411,7 @@ const cases = [
|
|
|
361
411
|
),
|
|
362
412
|
|
|
363
413
|
makeCase(
|
|
364
|
-
'spec
|
|
414
|
+
'spec',
|
|
365
415
|
'negative-direct-code',
|
|
366
416
|
'Just code it, the PRD is small.',
|
|
367
417
|
['executable spec'],
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# Rule Loading Map
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
Keep rule loading separate from skill routing. Load the smallest rule set that matches the current task, then add the stack-specific overlay only when needed. When changed files are available, prefer them over workspace-wide heuristics.
|
|
6
|
-
|
|
7
|
-
## Governance Context
|
|
8
|
-
|
|
9
|
-
- `workflow-router` decides the next stage.
|
|
10
|
-
- `skills/` decides the reusable execution pattern.
|
|
11
|
-
- `rules/` decides the project constraints and must/never checks.
|
|
12
|
-
- `CI / Test / Evidence` decides whether the result can be accepted.
|
|
13
|
-
- For the higher-level explanation, see [docs/agent-governance-overview.md](../../docs/agent-governance-overview.md).
|
|
14
|
-
|
|
15
|
-
## Load Order
|
|
1
|
+
# Rule Loading Map
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Keep rule loading separate from skill routing. Load the smallest rule set that matches the current task, then add the stack-specific overlay only when needed. When changed files are available, prefer them over workspace-wide heuristics.
|
|
6
|
+
|
|
7
|
+
## Governance Context
|
|
8
|
+
|
|
9
|
+
- `workflow-router` decides the next stage.
|
|
10
|
+
- `skills/` decides the reusable execution pattern.
|
|
11
|
+
- `rules/` decides the project constraints and must/never checks.
|
|
12
|
+
- `CI / Test / Evidence` decides whether the result can be accepted.
|
|
13
|
+
- For the higher-level explanation, see [docs/agent-governance-overview.md](../../docs/agent-governance-overview.md).
|
|
14
|
+
|
|
15
|
+
## Load Order
|
|
16
16
|
|
|
17
17
|
### 1. Core Layer
|
|
18
18
|
|
|
@@ -33,7 +33,7 @@ Use the workflow layer when the task involves routing, handoff, boundary changes
|
|
|
33
33
|
- `rules/workflow/selection.md`
|
|
34
34
|
- `rules/workflow/stop.md`
|
|
35
35
|
- `PIG_SKILLS_RULE_PROFILE=router|refinement`
|
|
36
|
-
- `PIG_SKILLS_RULE_SKILL=workflow-router|spec
|
|
36
|
+
- `PIG_SKILLS_RULE_SKILL=workflow-router|spec`
|
|
37
37
|
|
|
38
38
|
### 3. Coding Layer
|
|
39
39
|
|
|
@@ -80,7 +80,7 @@ Use the review layer when the task involves code review, security review, perfor
|
|
|
80
80
|
|
|
81
81
|
### 5. Product / Docs Layer
|
|
82
82
|
|
|
83
|
-
Use the product/docs layer when the task involves requirement intake, domain modeling, API docs, knowledge capture, or contract writing.
|
|
83
|
+
Use the product/docs layer when the task involves requirement intake, reverse-engineered business facts, domain modeling, API docs, knowledge capture, or contract writing.
|
|
84
84
|
|
|
85
85
|
- `rules/product/index.md`
|
|
86
86
|
- `rules/product/intake.md`
|
|
@@ -96,7 +96,7 @@ Use the product/docs layer when the task involves requirement intake, domain mod
|
|
|
96
96
|
- `rules/docs/examples.md`
|
|
97
97
|
- `rules/docs/capture-summary.md`
|
|
98
98
|
- `PIG_SKILLS_RULE_PROFILE=intake|modeling|api|capture`
|
|
99
|
-
- `PIG_SKILLS_RULE_SKILL=
|
|
99
|
+
- `PIG_SKILLS_RULE_SKILL=spec|domain-modeling|extract-business-facts|api-docs|knowledge-capture`
|
|
100
100
|
|
|
101
101
|
### 6. Discovery Rules
|
|
102
102
|
|
|
@@ -63,8 +63,8 @@ Make every skill easy for AI to detect, cheap to read, and hard to misuse.
|
|
|
63
63
|
- Negative replay scenarios
|
|
64
64
|
|
|
65
65
|
## Template Selection
|
|
66
|
-
- Short template: `workflow-router`, `
|
|
67
|
-
- Enhanced template: `spec
|
|
66
|
+
- Short template: `workflow-router`, `knowledge-capture`, `api-docs`, `test-design`, `domain-modeling`, `project-bootstrap`, `environment-deploy`
|
|
67
|
+
- Enhanced template: `spec`, `technical-design`, `feature-build`, `code-review`, `security-review`, `performance-check`, `extract-business-facts`
|
|
68
68
|
|
|
69
69
|
## Quality Bar
|
|
70
70
|
- A model should know whether to use the skill in under 10 seconds.
|