@orchestrator-claude/cli 1.7.2 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/templates/base/.orchestrator/patterns/legacy/README.md +360 -0
  4. package/dist/templates/base/.orchestrator/patterns/legacy/php/laravel.patterns.json +396 -0
  5. package/dist/templates/base/.orchestrator/templates/legacy/README.md +296 -0
  6. package/dist/templates/base/.orchestrator/templates/legacy/analysis-report.md.hbs +342 -0
  7. package/dist/templates/base/.orchestrator/templates/legacy/api-spec.yaml.hbs +263 -0
  8. package/dist/templates/base/.orchestrator/templates/legacy/business-rules.md.hbs +449 -0
  9. package/dist/templates/base/.orchestrator/templates/legacy/database-schema.md.hbs +356 -0
  10. package/dist/templates/base/.orchestrator/templates/legacy/dead-code-report.md.hbs +330 -0
  11. package/dist/templates/base/.orchestrator/templates/legacy/discovery-report.md.hbs +267 -0
  12. package/dist/templates/base/.orchestrator/templates/legacy/final-report.md.hbs +451 -0
  13. package/dist/templates/base/.orchestrator/templates/legacy/inventory.json.schema +346 -0
  14. package/dist/templates/base/.orchestrator/templates/legacy/migration-roadmap.md.hbs +571 -0
  15. package/dist/templates/base/.orchestrator/templates/legacy/tech-debt.md.hbs +412 -0
  16. package/dist/templates/base/claude/agents/api-extractor.md +665 -0
  17. package/dist/templates/base/claude/agents/business-rule-miner.md +734 -0
  18. package/dist/templates/base/claude/agents/code-archaeologist.md +715 -0
  19. package/dist/templates/base/claude/agents/legacy-discoverer.md +578 -0
  20. package/dist/templates/base/claude/agents/legacy-synthesizer.md +1097 -0
  21. package/dist/templates/base/claude/agents/schema-extractor.md +767 -0
  22. package/dist/templates/workflows/README.md +137 -0
  23. package/dist/templates/workflows/bug-fix.json +73 -0
  24. package/dist/templates/workflows/feature-development.json +87 -0
  25. package/dist/templates/workflows/legacy-analysis.json +288 -0
  26. package/dist/templates/workflows/refactoring.json +73 -0
  27. package/package.json +1 -1
  28. package/templates/base/.orchestrator/patterns/legacy/README.md +360 -0
  29. package/templates/base/.orchestrator/patterns/legacy/php/laravel.patterns.json +396 -0
  30. package/templates/base/.orchestrator/templates/legacy/README.md +296 -0
  31. package/templates/base/.orchestrator/templates/legacy/analysis-report.md.hbs +342 -0
  32. package/templates/base/.orchestrator/templates/legacy/api-spec.yaml.hbs +263 -0
  33. package/templates/base/.orchestrator/templates/legacy/business-rules.md.hbs +449 -0
  34. package/templates/base/.orchestrator/templates/legacy/database-schema.md.hbs +356 -0
  35. package/templates/base/.orchestrator/templates/legacy/dead-code-report.md.hbs +330 -0
  36. package/templates/base/.orchestrator/templates/legacy/discovery-report.md.hbs +267 -0
  37. package/templates/base/.orchestrator/templates/legacy/final-report.md.hbs +451 -0
  38. package/templates/base/.orchestrator/templates/legacy/inventory.json.schema +346 -0
  39. package/templates/base/.orchestrator/templates/legacy/migration-roadmap.md.hbs +571 -0
  40. package/templates/base/.orchestrator/templates/legacy/tech-debt.md.hbs +412 -0
  41. package/templates/base/claude/agents/api-extractor.md +665 -0
  42. package/templates/base/claude/agents/business-rule-miner.md +734 -0
  43. package/templates/base/claude/agents/code-archaeologist.md +715 -0
  44. package/templates/base/claude/agents/legacy-discoverer.md +578 -0
  45. package/templates/base/claude/agents/legacy-synthesizer.md +1097 -0
  46. package/templates/base/claude/agents/schema-extractor.md +767 -0
  47. package/templates/workflows/README.md +137 -0
  48. package/templates/workflows/bug-fix.json +73 -0
  49. package/templates/workflows/feature-development.json +87 -0
  50. package/templates/workflows/legacy-analysis.json +288 -0
  51. package/templates/workflows/refactoring.json +73 -0
@@ -0,0 +1,449 @@
1
+ # Business Rules: {{projectName}}
2
+
3
+ **Generated:** {{generatedAt}}
4
+ **Agent:** business-rule-miner
5
+ **Workflow Phase:** DOCUMENT
6
+ **Total Rules:** {{totalRules}}
7
+
8
+ ---
9
+
10
+ ## Executive Summary
11
+
12
+ {{summary}}
13
+
14
+ This document catalogs business rules extracted from the codebase. Rules are organized by domain and include source locations for traceability.
15
+
16
+ ---
17
+
18
+ ## Rules by Domain
19
+
20
+ {{#each domains}}
21
+ ## Domain: {{name}}
22
+
23
+ **Description:** {{description}}
24
+ **Total Rules:** {{ruleCount}}
25
+
26
+ {{#each rules}}
27
+ ### {{id}}: {{title}}
28
+
29
+ **Priority:** {{priority}}
30
+ **Type:** {{type}}
31
+ **Source:** `{{source.file}}:{{source.line}}`
32
+
33
+ **Rule:**
34
+ {{rule}}
35
+
36
+ **Context:**
37
+ {{context}}
38
+
39
+ {{#if constraints}}
40
+ **Constraints:**
41
+ {{#each constraints}}
42
+ - {{this}}
43
+ {{/each}}
44
+ {{/if}}
45
+
46
+ {{#if validations}}
47
+ **Validations:**
48
+ {{#each validations}}
49
+ - {{field}}: {{validation}} {{#if message}}({{message}}){{/if}}
50
+ {{/each}}
51
+ {{/if}}
52
+
53
+ {{#if examples}}
54
+ **Examples:**
55
+
56
+ Valid:
57
+ ```{{language}}
58
+ {{examples.valid}}
59
+ ```
60
+
61
+ Invalid:
62
+ ```{{language}}
63
+ {{examples.invalid}}
64
+ ```
65
+ {{/if}}
66
+
67
+ {{#if exceptions}}
68
+ **Exceptions:**
69
+ {{#each exceptions}}
70
+ - {{this}}
71
+ {{/each}}
72
+ {{/if}}
73
+
74
+ ---
75
+
76
+ {{/each}}
77
+
78
+ {{/each}}
79
+
80
+ ---
81
+
82
+ ## Rules by Type
83
+
84
+ ### Validation Rules
85
+
86
+ {{#if rulesByType.validation}}
87
+ {{#each rulesByType.validation}}
88
+ - **{{title}}** ({{domain}}) - `{{source.file}}:{{source.line}}`
89
+ - {{rule}}
90
+ {{/each}}
91
+ {{else}}
92
+ No validation rules extracted.
93
+ {{/if}}
94
+
95
+ ### Business Logic Rules
96
+
97
+ {{#if rulesByType.businessLogic}}
98
+ {{#each rulesByType.businessLogic}}
99
+ - **{{title}}** ({{domain}}) - `{{source.file}}:{{source.line}}`
100
+ - {{rule}}
101
+ {{/each}}
102
+ {{else}}
103
+ No business logic rules extracted.
104
+ {{/if}}
105
+
106
+ ### Authorization Rules
107
+
108
+ {{#if rulesByType.authorization}}
109
+ {{#each rulesByType.authorization}}
110
+ - **{{title}}** ({{domain}}) - `{{source.file}}:{{source.line}}`
111
+ - {{rule}}
112
+ {{/each}}
113
+ {{else}}
114
+ No authorization rules extracted.
115
+ {{/if}}
116
+
117
+ ### Calculation Rules
118
+
119
+ {{#if rulesByType.calculation}}
120
+ {{#each rulesByType.calculation}}
121
+ - **{{title}}** ({{domain}}) - `{{source.file}}:{{source.line}}`
122
+ - {{rule}}
123
+ {{/each}}
124
+ {{else}}
125
+ No calculation rules extracted.
126
+ {{/if}}
127
+
128
+ ### State Transition Rules
129
+
130
+ {{#if rulesByType.stateTransition}}
131
+ {{#each rulesByType.stateTransition}}
132
+ - **{{title}}** ({{domain}}) - `{{source.file}}:{{source.line}}`
133
+ - {{rule}}
134
+ {{/each}}
135
+ {{else}}
136
+ No state transition rules extracted.
137
+ {{/if}}
138
+
139
+ ---
140
+
141
+ ## Form Validations
142
+
143
+ {{#if formValidations}}
144
+ {{#each formValidations}}
145
+ ### {{formName}}
146
+
147
+ **File:** `{{file}}`
148
+ **Controller:** {{controller}}
149
+ **Action:** {{action}}
150
+
151
+ | Field | Rules | Custom Message |
152
+ |-------|-------|----------------|
153
+ {{#each fields}}
154
+ | {{name}} | {{rules}} | {{message}} |
155
+ {{/each}}
156
+
157
+ {{#if customValidations}}
158
+ **Custom Validations:**
159
+ {{#each customValidations}}
160
+ - {{name}}: {{logic}}
161
+ {{/each}}
162
+ {{/if}}
163
+
164
+ ---
165
+
166
+ {{/each}}
167
+ {{else}}
168
+ No form validation classes found.
169
+ {{/if}}
170
+
171
+ ---
172
+
173
+ ## Conditional Logic
174
+
175
+ {{#if conditionalLogic}}
176
+ Complex business logic extracted from conditional statements:
177
+
178
+ {{#each conditionalLogic}}
179
+ ### {{title}}
180
+
181
+ **Location:** `{{source.file}}:{{source.line}}`
182
+ **Complexity:** {{complexity}} ({{#if highComplexity}}⚠️ High{{else}}Normal{{/if}})
183
+
184
+ **Logic:**
185
+ ```{{language}}
186
+ {{logic}}
187
+ ```
188
+
189
+ **Interpretation:**
190
+ {{interpretation}}
191
+
192
+ {{#if simplification}}
193
+ **Suggested Simplification:**
194
+ ```{{language}}
195
+ {{simplification}}
196
+ ```
197
+ {{/if}}
198
+
199
+ ---
200
+
201
+ {{/each}}
202
+ {{else}}
203
+ No complex conditional logic extracted.
204
+ {{/if}}
205
+
206
+ ---
207
+
208
+ ## Constants & Enums
209
+
210
+ {{#if constants}}
211
+ Business constants and enumerations:
212
+
213
+ {{#each constants}}
214
+ ### {{name}}
215
+
216
+ **Type:** {{type}}
217
+ **File:** `{{file}}`
218
+
219
+ {{#if values}}
220
+ **Values:**
221
+ {{#each values}}
222
+ - `{{key}}` = {{value}} {{#if description}}// {{description}}{{/if}}
223
+ {{/each}}
224
+ {{/if}}
225
+
226
+ {{#if usage}}
227
+ **Usage:**
228
+ {{usage}}
229
+ {{/if}}
230
+
231
+ ---
232
+
233
+ {{/each}}
234
+ {{else}}
235
+ No business constants extracted.
236
+ {{/if}}
237
+
238
+ ---
239
+
240
+ ## Error Messages
241
+
242
+ {{#if errorMessages}}
243
+ Error messages that indicate business rules:
244
+
245
+ {{#each errorMessages}}
246
+ - **{{code}}**: "{{message}}" (`{{file}}:{{line}}`)
247
+ - Implied Rule: {{impliedRule}}
248
+ {{/each}}
249
+ {{else}}
250
+ No error messages extracted.
251
+ {{/if}}
252
+
253
+ ---
254
+
255
+ ## Permissions & Policies
256
+
257
+ {{#if permissions}}
258
+ {{#each permissions}}
259
+ ### {{resource}}
260
+
261
+ **Policy Class:** `{{policyClass}}`
262
+ **File:** `{{file}}`
263
+
264
+ | Action | Rule | Rationale |
265
+ |--------|------|-----------|
266
+ {{#each actions}}
267
+ | {{name}} | {{rule}} | {{rationale}} |
268
+ {{/each}}
269
+
270
+ ---
271
+
272
+ {{/each}}
273
+ {{else}}
274
+ No permission policies found.
275
+ {{/if}}
276
+
277
+ ---
278
+
279
+ ## Workflows & State Machines
280
+
281
+ {{#if workflows}}
282
+ {{#each workflows}}
283
+ ### {{name}}
284
+
285
+ **Entity:** {{entity}}
286
+ **File:** `{{file}}`
287
+
288
+ **States:**
289
+ {{#each states}}
290
+ - {{name}} ({{description}})
291
+ {{/each}}
292
+
293
+ **Transitions:**
294
+ ```mermaid
295
+ stateDiagram-v2
296
+ {{#each transitions}}
297
+ {{from}} --> {{to}}: {{event}}
298
+ {{/each}}
299
+ ```
300
+
301
+ **Transition Rules:**
302
+ {{#each transitions}}
303
+ - **{{event}}**: {{from}} → {{to}}
304
+ - Condition: {{condition}}
305
+ - Action: {{action}}
306
+ {{/each}}
307
+
308
+ ---
309
+
310
+ {{/each}}
311
+ {{else}}
312
+ No workflows or state machines detected.
313
+ {{/if}}
314
+
315
+ ---
316
+
317
+ ## Rules Requiring Clarification
318
+
319
+ {{#if ambiguousRules}}
320
+ These rules need business stakeholder clarification:
321
+
322
+ {{#each ambiguousRules}}
323
+ ### {{title}}
324
+
325
+ **Location:** `{{source.file}}:{{source.line}}`
326
+ **Issue:** {{issue}}
327
+
328
+ **Current Implementation:**
329
+ ```{{language}}
330
+ {{implementation}}
331
+ ```
332
+
333
+ **Questions:**
334
+ {{#each questions}}
335
+ {{@index}}. {{this}}
336
+ {{/each}}
337
+
338
+ ---
339
+
340
+ {{/each}}
341
+ {{else}}
342
+ ✅ All rules appear clear.
343
+ {{/if}}
344
+
345
+ ---
346
+
347
+ ## Contradictory Rules
348
+
349
+ {{#if contradictions}}
350
+ ⚠️ **Warning:** Potential rule contradictions detected:
351
+
352
+ {{#each contradictions}}
353
+ ### {{title}}
354
+
355
+ **Rule 1:** {{rule1}} (`{{location1}}`)
356
+ **Rule 2:** {{rule2}} (`{{location2}}`)
357
+
358
+ **Conflict:**
359
+ {{conflict}}
360
+
361
+ **Impact:**
362
+ {{impact}}
363
+
364
+ **Recommendation:**
365
+ {{recommendation}}
366
+
367
+ ---
368
+
369
+ {{/each}}
370
+ {{else}}
371
+ ✅ No rule contradictions detected.
372
+ {{/if}}
373
+
374
+ ---
375
+
376
+ ## Missing Rules
377
+
378
+ {{#if missingRules}}
379
+ Areas where business rules appear to be missing:
380
+
381
+ {{#each missingRules}}
382
+ - **{{area}}**: {{description}}
383
+ - Location: {{location}}
384
+ - Risk: {{risk}}
385
+ - Recommendation: {{recommendation}}
386
+ {{/each}}
387
+ {{else}}
388
+ No obvious gaps in business rules.
389
+ {{/if}}
390
+
391
+ ---
392
+
393
+ ## Domain Glossary
394
+
395
+ See full glossary in `glossary.md`.
396
+
397
+ **Quick Reference:**
398
+
399
+ {{#each glossary}}
400
+ - **{{term}}**: {{definition}}
401
+ {{/each}}
402
+
403
+ ---
404
+
405
+ ## Rule Coverage Matrix
406
+
407
+ | Domain | Total Rules | Documented | Tested | Status |
408
+ |--------|-------------|------------|--------|--------|
409
+ {{#each coverageMatrix}}
410
+ | {{domain}} | {{totalRules}} | {{documented}} ({{documentedPercent}}%) | {{tested}} ({{testedPercent}}%) | {{#if complete}}✅{{else}}⚠️{{/if}} |
411
+ {{/each}}
412
+
413
+ ---
414
+
415
+ ## Next Steps
416
+
417
+ 1. Review ambiguous rules with business stakeholders
418
+ 2. Resolve rule contradictions
419
+ 3. Document missing rules
420
+ 4. Ensure all rules have test coverage
421
+ 5. Proceed to RECOMMEND phase for migration strategy
422
+
423
+ ---
424
+
425
+ ## Extraction Methodology
426
+
427
+ **Techniques Used:**
428
+ - Static analysis of validation rules
429
+ - Pattern matching for conditional logic
430
+ - Error message analysis
431
+ - Policy class extraction
432
+ - Enum and constant analysis
433
+
434
+ **Coverage:**
435
+ - Form validations: {{coverage.formValidations}}%
436
+ - Business logic: {{coverage.businessLogic}}%
437
+ - Authorization: {{coverage.authorization}}%
438
+ - State machines: {{coverage.stateMachines}}%
439
+
440
+ **Limitations:**
441
+ - Cannot extract rules from dynamic/runtime conditions
442
+ - May miss rules in front-end code
443
+ - Complex business logic may require interpretation
444
+
445
+ ---
446
+
447
+ **Generated by:** business-rule-miner agent
448
+ **Standards:** AGENT-PROMPT-STANDARDS v1.1
449
+ **RFC:** RFC-004-LEGACY-ANALYSIS-WORKFLOW