@uluops/setup 0.2.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 (107) hide show
  1. package/README.md +178 -0
  2. package/assets/agents/api-contract-validator-agent.md +960 -0
  3. package/assets/agents/aristotle-analyst-agent.md +705 -0
  4. package/assets/agents/aristotle-explorer-agent.md +152 -0
  5. package/assets/agents/aristotle-forecaster-agent.md +666 -0
  6. package/assets/agents/aristotle-validator-agent.md +667 -0
  7. package/assets/agents/assumption-excavator-agent.md +1354 -0
  8. package/assets/agents/code-auditor-agent.md +1061 -0
  9. package/assets/agents/code-optimizer-agent.md +876 -0
  10. package/assets/agents/code-validator-agent.md +846 -0
  11. package/assets/agents/docs-validator-agent.md +490 -0
  12. package/assets/agents/frontend-validator-agent.md +844 -0
  13. package/assets/agents/mcp-validator-agent.md +827 -0
  14. package/assets/agents/pre-implementation-architect-agent.md +1036 -0
  15. package/assets/agents/prompt-engineer-agent.md +1158 -0
  16. package/assets/agents/prompt-pattern-analyzer-agent.md +907 -0
  17. package/assets/agents/prompt-quality-validator-agent.md +1018 -0
  18. package/assets/agents/public-interface-validator-agent.md +951 -0
  19. package/assets/agents/release-readiness-agent.md +482 -0
  20. package/assets/agents/security-analyst-agent.md +1093 -0
  21. package/assets/agents/test-architect-agent.md +861 -0
  22. package/assets/agents/type-safety-validator-agent.md +932 -0
  23. package/assets/agents/workflow-synthesis-agent.md +836 -0
  24. package/assets/commands/agents/api-contract.md +135 -0
  25. package/assets/commands/agents/architect.md +135 -0
  26. package/assets/commands/agents/aristotle-analyst.md +115 -0
  27. package/assets/commands/agents/aristotle-explorer.md +92 -0
  28. package/assets/commands/agents/aristotle-forecaster.md +114 -0
  29. package/assets/commands/agents/aristotle-validator.md +114 -0
  30. package/assets/commands/agents/assumption-excavator.md +114 -0
  31. package/assets/commands/agents/audit.md +136 -0
  32. package/assets/commands/agents/docs-validate.md +133 -0
  33. package/assets/commands/agents/frontend.md +135 -0
  34. package/assets/commands/agents/mcp-validate.md +136 -0
  35. package/assets/commands/agents/optimize.md +133 -0
  36. package/assets/commands/agents/pattern-analyzer.md +126 -0
  37. package/assets/commands/agents/prompt-quality.md +134 -0
  38. package/assets/commands/agents/prompt-validate.md +135 -0
  39. package/assets/commands/agents/public-interface.md +134 -0
  40. package/assets/commands/agents/release.md +135 -0
  41. package/assets/commands/agents/security.md +137 -0
  42. package/assets/commands/agents/test-review.md +136 -0
  43. package/assets/commands/agents/type-safety.md +135 -0
  44. package/assets/commands/agents/validate.md +134 -0
  45. package/assets/commands/agents/workflow-synthesis.md +101 -0
  46. package/assets/commands/workflows/aristotle.md +543 -0
  47. package/assets/commands/workflows/post-implementation.md +577 -0
  48. package/assets/commands/workflows/pre-implementation.md +670 -0
  49. package/assets/commands/workflows/prompt-audit.md +754 -0
  50. package/assets/commands/workflows/ship.md +721 -0
  51. package/dist/cli.d.ts +2 -0
  52. package/dist/cli.js +436 -0
  53. package/dist/lib/config-merger.d.ts +26 -0
  54. package/dist/lib/config-merger.js +63 -0
  55. package/dist/lib/file-ops.d.ts +23 -0
  56. package/dist/lib/file-ops.js +86 -0
  57. package/dist/lib/hash.d.ts +1 -0
  58. package/dist/lib/hash.js +4 -0
  59. package/dist/lib/manifest.d.ts +16 -0
  60. package/dist/lib/manifest.js +34 -0
  61. package/dist/lib/paths.d.ts +14 -0
  62. package/dist/lib/paths.js +49 -0
  63. package/dist/lib/settings-merger.d.ts +43 -0
  64. package/dist/lib/settings-merger.js +91 -0
  65. package/dist/steps/agents.d.ts +8 -0
  66. package/dist/steps/agents.js +14 -0
  67. package/dist/steps/auth.d.ts +12 -0
  68. package/dist/steps/auth.js +80 -0
  69. package/dist/steps/commands.d.ts +9 -0
  70. package/dist/steps/commands.js +69 -0
  71. package/dist/steps/detect.d.ts +9 -0
  72. package/dist/steps/detect.js +30 -0
  73. package/dist/steps/mcp.d.ts +6 -0
  74. package/dist/steps/mcp.js +40 -0
  75. package/dist/steps/metrics.d.ts +22 -0
  76. package/dist/steps/metrics.js +176 -0
  77. package/dist/steps/shell.d.ts +2 -0
  78. package/dist/steps/shell.js +48 -0
  79. package/dist/steps/signup.d.ts +13 -0
  80. package/dist/steps/signup.js +92 -0
  81. package/dist/steps/verify.d.ts +10 -0
  82. package/dist/steps/verify.js +184 -0
  83. package/dist/test/auth.test.d.ts +1 -0
  84. package/dist/test/auth.test.js +43 -0
  85. package/dist/test/config-io.test.d.ts +1 -0
  86. package/dist/test/config-io.test.js +56 -0
  87. package/dist/test/config-merger.test.d.ts +1 -0
  88. package/dist/test/config-merger.test.js +94 -0
  89. package/dist/test/detect.test.d.ts +1 -0
  90. package/dist/test/detect.test.js +25 -0
  91. package/dist/test/file-ops.test.d.ts +1 -0
  92. package/dist/test/file-ops.test.js +100 -0
  93. package/dist/test/hash.test.d.ts +1 -0
  94. package/dist/test/hash.test.js +14 -0
  95. package/dist/test/manifest.test.d.ts +1 -0
  96. package/dist/test/manifest.test.js +78 -0
  97. package/dist/test/paths.test.d.ts +1 -0
  98. package/dist/test/paths.test.js +30 -0
  99. package/dist/test/settings-merger.test.d.ts +1 -0
  100. package/dist/test/settings-merger.test.js +167 -0
  101. package/dist/test/shell-profile.test.d.ts +1 -0
  102. package/dist/test/shell-profile.test.js +40 -0
  103. package/dist/test/shell.test.d.ts +1 -0
  104. package/dist/test/shell.test.js +71 -0
  105. package/dist/test/signup.test.d.ts +1 -0
  106. package/dist/test/signup.test.js +83 -0
  107. package/package.json +36 -0
@@ -0,0 +1,721 @@
1
+ ---
2
+ name: ship
3
+ description: Final gate before shipping. Runs 5 core phases (Validate → Type Safety → Test Architect → Code Auditor → Public Interface → Security) plus conditional API Contract/Release Readiness. Persists all recommendations to tracker.
4
+ tools: Read, Grep, Glob, Bash
5
+ model: sonnet
6
+ ---
7
+
8
+ # Ship Pipeline
9
+
10
+ Final gate before shipping. Runs 5 core phases (Validate → Type Safety → Test Architect → Code Auditor → Public Interface → Security) plus conditional API Contract/Release Readiness. Persists all recommendations to tracker.
11
+
12
+
13
+ **Philosophy**: The final gate before shipping—smart enough to know what checks your project needs.
14
+
15
+ ---
16
+
17
+ ## Workflow Overview
18
+
19
+ ```
20
+ ┌─────────────────────────────────────────────────────────────────────────────┐
21
+ │ CORE PHASES (Always Run) │
22
+ │ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌───────┐ ┌──────┐ │
23
+ │ │Validate│─▶│ Type │─▶│ Test │─▶│ Code │─▶│Public │─▶│Security│ │
24
+ │ │ Code │ │Safety*│ │Architect│ │Auditor│ │Interface│ │ Audit │ │
25
+ │ └──────┘ └──────┘ └──────┘ └──────┘ └───────┘ └──────┘ │
26
+ │ │ │ │ │ │ │ │
27
+ │ ▼ ▼ ▼ ▼ ▼ ▼ │
28
+ │ PASS/ SAFE/ APPROVED/ SOUND/ POLISHED/ SECURE/ │
29
+ │ FAIL UNSAFE* IMPROVE UNSOUND CLEANUP BLOCKED │
30
+ │ │
31
+ │ * Type Safety runs only if tsconfig.json exists │
32
+ │ │
33
+ ├─────────────────────────────────────────────────────────────────────────────┤
34
+ │ CONDITIONAL PHASES (Based on Project Type) │
35
+ │ │
36
+ │ IF API Routes Detected: IF Publishable Package: │
37
+ │ ┌───────────┐ ┌─────────────┐ │
38
+ │ │API Contract│ │Release Ready │ │
39
+ │ └───────────┘ └─────────────┘ │
40
+ │ │ │ │
41
+ │ ▼ ▼ │
42
+ │ CONSISTENT/ READY/ │
43
+ │ DRIFT NOT READY │
44
+ │ │
45
+ ├─────────────────────────────────────────────────────────────────────────────┤
46
+ │ OUTPUTS (Always Run - regardless of pass/fail) │
47
+ │ │
48
+ │ ┌──────────────────┐ ┌──────────────────┐ │
49
+ │ │ Features List │ │ Save to Tracker │ │
50
+ │ │ (markdown) │ │ (MCP tool) │ │
51
+ │ └────────┬─────────┘ └────────┬─────────┘ │
52
+ │ └──────────┬─────────────────┘ │
53
+ │ ▼ │
54
+ │ ┌──────────────────┐ │
55
+ │ │ Post-Save │ │
56
+ │ │ Verification │ │
57
+ │ └──────────────────┘ │
58
+ │ │
59
+ └─────────────────────────────────────────────────────────────────────────────┘
60
+
61
+ ```
62
+
63
+ [TS] = Runs if tsconfig.json detected (TypeScript project)
64
+ [API] = Runs if REST routes detected (Express/router patterns)
65
+ [PKG] = Runs if publishable package (not private)
66
+
67
+ Duration: 8-20 minutes (varies with project type)
68
+ **Important:** Even in parallel mode, if ANY agent in a group fails with a blocking result, stop the pipeline and report all results collected so far.
69
+
70
+ ---
71
+
72
+ ## Agent Handoff Formats
73
+
74
+ Each agent passes structured data to the next in the pipeline:
75
+
76
+ | From | To | Passes | Expects |
77
+ |------|-----|--------|---------|
78
+ | Code Validator | Type Safety | File list, error baseline, complexity metrics | Type-specific issues beyond basic linting |
79
+ | Code Validator | Test Architect | Test file locations, coverage baseline | Test quality assessment beyond coverage % |
80
+ | Code Validator | Public Interface | Export list, module structure | Documentation accuracy, unused code detection |
81
+ | Test Architect | Code Auditor | Test confidence level, covered paths | Runtime bugs in areas tests miss |
82
+ | Code Auditor | Security | Code quality baseline, async patterns | OWASP compliance, vulnerability scan |
83
+ | Security | API Contract | Security-cleared codebase | Contract drift on secure API |
84
+ | Security | Release Readiness | Security-cleared package | Version and publishing readiness |
85
+
86
+ **Handoff Contract:**
87
+ - Each agent accepts predecessor's score and blockers
88
+ - Agents don't re-check validated areas (trust predecessors)
89
+ - Critical failures propagate as pipeline blockers
90
+ - All findings feed into tracker persistence
91
+
92
+ ---
93
+
94
+ ## Pre-Flight: Target Detection and Configuration
95
+
96
+ Before running agents, determine the target path and which optional validators should run.
97
+
98
+ ### Context Detection
99
+
100
+ **Detection criteria**: A detector returns TRUE if its command exits with code 0.
101
+
102
+ | Detector ID | Description |
103
+ |-------------|-------------|
104
+ | `typescript_detected` | Check if file exists: {{ target }}/tsconfig.json |
105
+ | `package_json_detected` | Check if file exists: package.json |
106
+ | `private_package` | Search for pattern ""private":\s*true" in package.json |
107
+ | `api_routes_detected` | Search for pattern "router\.|app\.get|app\.post|app\.put|app\.delete" in *.ts, *.js |
108
+
109
+ **typescript_detected**:
110
+ ```bash
111
+ test -f "{{ target }}/tsconfig.json" && echo "DETECTED" || echo "NOT DETECTED"
112
+ ```
113
+
114
+ **package_json_detected**:
115
+ ```bash
116
+ test -f "package.json" && echo "DETECTED" || echo "NOT DETECTED"
117
+ ```
118
+
119
+ **private_package**:
120
+ ```bash
121
+ grep -rqE --include="package.json" ""private":\s*true" . 2>/dev/null && echo "DETECTED" || echo "NOT DETECTED"
122
+ ```
123
+
124
+ **api_routes_detected**:
125
+ ```bash
126
+ grep -rqE --include="*.ts" --include="*.js" "router\.|app\.get|app\.post|app\.put|app\.delete" . 2>/dev/null && echo "DETECTED" || echo "NOT DETECTED"
127
+ ```
128
+
129
+
130
+ ---
131
+
132
+ ## Arguments
133
+
134
+ ### Positional Arguments
135
+
136
+ | Argument | Required | Description |
137
+ |----------|----------|-------------|
138
+ | directory | Yes | Target directory to validate |
139
+
140
+
141
+ ### Usage Examples
142
+
143
+ | Command | Behavior |
144
+ |---------|----------|
145
+ | `/workflows:ship ./packages/bfl-api` | Validates package, detects API routes, runs full pipeline |
146
+ | `/workflows:ship ./services/auth-service` | Service validation with API contract checks |
147
+ | `/workflows:ship .` | Validates current directory |
148
+
149
+ ---
150
+
151
+ ## Execution Mode Selection
152
+
153
+ **After completing project detection, ask the user to choose execution mode using AskUserQuestion:**
154
+
155
+ | Mode | Description | Best For |
156
+ |------|-------------|----------|
157
+ | Sequential | Run agents one at a time, stop on first failure | Debugging, first runs, when you want early feedback |
158
+ | Parallel | Run independent agents concurrently | Speed, CI/CD, when project is stable |
159
+
160
+ **Parallel execution groups (when parallel mode selected):**
161
+
162
+ ```
163
+ Group 1 (gate): code-validator
164
+
165
+
166
+ Group 2 (parallel): type-safety + test-architect + public-interface
167
+
168
+
169
+ Group 3 (sequential): code-auditor
170
+
171
+
172
+ Group 4 (gate): security
173
+
174
+
175
+ Group 5 (parallel): api-contract + release-readiness
176
+
177
+
178
+ Group 6 (always): persist-to-tracker
179
+ ```
180
+
181
+ **Note:** Conditional validators only run in their groups if detected in pre-flight.
182
+
183
+ **Important:** Even in parallel mode, if ANY agent in a group fails with a blocking result, stop the pipeline and report all results collected so far.
184
+
185
+ ---
186
+
187
+ ## Execution
188
+
189
+ Run each agent in sequence (or parallel groups if selected). Stop and fix if any agent fails. **Collect all recommendations for tracker persistence.**
190
+
191
+ ### Phase 1: Code Validation
192
+ **Commands**: validate@1.0.0
193
+
194
+ **Invoke via Task tool:**
195
+ ```
196
+ Task(
197
+ subagent_type: "validate",
198
+ prompt: "[validator:validate] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
199
+ description: "Code Validator"
200
+ )
201
+ ```
202
+
203
+ **Gate**: threshold >= 70, on fail: stop
204
+
205
+ **Focus**:
206
+ - Code quality and standards compliance
207
+ - Complexity and maintainability
208
+ - Error handling patterns
209
+ - Linting and formatting
210
+
211
+ **Capture for tracker**: All findings, regardless of pass/fail status.
212
+
213
+ **If failing**: Fix code quality issues before proceeding. Do not ship broken code.
214
+
215
+ **Decision criteria**:
216
+ - PASS (✅): Score ≥70 AND no auto-fail conditions
217
+ - FAIL (❌): Score <70 OR auto-fail triggered
218
+
219
+ ---
220
+
221
+ ### Phase 2: Type Safety (Conditional)
222
+ **Runs when**: `context.typescript_detected`
223
+
224
+ **Commands**: type-safety@1.0.0
225
+
226
+ **Invoke via Task tool:**
227
+ ```
228
+ Task(
229
+ subagent_type: "type-safety",
230
+ prompt: "[validator:type-safety] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
231
+ description: "Type Safety Validator"
232
+ )
233
+ ```
234
+
235
+ **Gate**: threshold >= 80, warn if < 70, on fail: stop
236
+
237
+ **Why this threshold?** Type holes in shipped code propagate to consumers. Stricter than post-impl because this is the final gate.
238
+
239
+ **Focus**:
240
+ - Explicit any usage and type holes
241
+ - Type assertions without runtime guards
242
+ - Strict mode compliance
243
+ - Public API type quality
244
+
245
+ **Capture for tracker**: All type safety issues, any abuse, unsafe assertions.
246
+
247
+ **If failing**: Fix type holes before proceeding. Type safety issues compound—one any infects all downstream code.
248
+
249
+ **Skip conditions**:
250
+ - No tsconfig.json found
251
+ - Pure JavaScript project
252
+
253
+ **Decision criteria**:
254
+ - SAFE (✅): Score ≥80 AND no any in public API
255
+ - REVIEW (⚠️): Score 70-79 OR minor any usage with justification
256
+ - UNSAFE (❌): Score <70 OR any in public API OR critical type holes
257
+
258
+ **Auto-fail conditions**:
259
+ - any in exported function signatures
260
+ - Double assertions (as unknown as SomeType pattern)
261
+ - strict: false in tsconfig for library code
262
+
263
+ **Depends on**: code-validator
264
+
265
+ ---
266
+
267
+ ### Phase 3: Test Architecture Review
268
+ **Commands**: test-review@1.0.0
269
+
270
+ **Invoke via Task tool:**
271
+ ```
272
+ Task(
273
+ subagent_type: "test-review",
274
+ prompt: "[validator:test-review] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
275
+ description: "Test Architect"
276
+ )
277
+ ```
278
+
279
+ **Gate**: threshold >= 70, on fail: stop
280
+
281
+ **Focus**:
282
+ - Test quality, not just coverage
283
+ - False confidence patterns (mocks at wrong level)
284
+ - Critical path coverage
285
+ - Edge case handling
286
+
287
+ **Capture for tracker**: All recommendations for test improvements.
288
+
289
+ **If failing**: Improve tests before shipping. Ship pipeline requires higher test confidence.
290
+
291
+ **Decision criteria**:
292
+ - APPROVED (✅): Score ≥70 AND critical paths covered
293
+ - IMPROVE (❌): Score <70 → Run /fix:test-gaps
294
+
295
+ **Depends on**: code-validator
296
+
297
+ ---
298
+
299
+ ### Phase 4: Runtime Correctness Audit
300
+ **Commands**: audit@1.0.0
301
+
302
+ **Invoke via Task tool:**
303
+ ```
304
+ Task(
305
+ subagent_type: "audit",
306
+ prompt: "[validator:audit] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
307
+ description: "Code Auditor"
308
+ )
309
+ ```
310
+
311
+ **Gate**: threshold >= 80, warn if < 70, on fail: stop
312
+
313
+ **Why this threshold?** Code-auditor catches bugs that pass tests. Higher threshold because these are silent production failures.
314
+
315
+ **Focus**:
316
+ - Async hazards (unawaited promises in callbacks)
317
+ - Null dereferences (.find() without null check)
318
+ - Silent failures (empty catch blocks)
319
+ - Error propagation gaps
320
+
321
+ **Capture for tracker**: All runtime correctness issues with file:line references.
322
+
323
+ **If failing**: Fix runtime bugs before shipping. These cause production incidents.
324
+
325
+ **Decision criteria**:
326
+ - SOUND (🔒): Score ≥80 AND no auto-fail conditions
327
+ - REVIEW (🔍): Score 70-79
328
+ - UNSOUND (⛔): Score <70 OR auto-fail triggered
329
+
330
+ **Auto-fail conditions**:
331
+ - Unawaited promise in error callback
332
+ - .find() result used without null check
333
+ - Empty catch block swallowing errors
334
+ - JSON.parse without try/catch
335
+ - HTTP response used without status check
336
+ - Array access without bounds validation
337
+
338
+ **Depends on**: test-architect
339
+
340
+ ---
341
+
342
+ ### Phase 5: Public Interface Validation
343
+ **Commands**: public-interface@1.0.0
344
+
345
+ **Invoke via Task tool:**
346
+ ```
347
+ Task(
348
+ subagent_type: "public-interface",
349
+ prompt: "[validator:public-interface] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
350
+ description: "Public Interface Validator"
351
+ )
352
+ ```
353
+
354
+ **Gate**: threshold >= 75, on fail: stop
355
+
356
+ **Focus**:
357
+ - README accuracy and completeness
358
+ - Export hygiene (unused exports, missing exports)
359
+ - Documentation gaps
360
+ - Code cleanliness (unused imports, dead code)
361
+
362
+ **Capture for tracker**: All documentation gaps and hygiene issues.
363
+
364
+ **If failing**: Update README, remove dead code, add JSDoc. Consumer-facing polish required for ship.
365
+
366
+ **Decision criteria**:
367
+ - POLISHED (✨): Score ≥75 AND README matches exports
368
+ - NEEDS CLEANUP (🧹): Score <75
369
+
370
+ **Depends on**: code-validator
371
+
372
+ ---
373
+
374
+ ### Phase 6: Security Audit
375
+ **Commands**: security@1.0.0
376
+
377
+ **Invoke via Task tool:**
378
+ ```
379
+ Task(
380
+ subagent_type: "security",
381
+ prompt: "[validator:security] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
382
+ description: "Security Analyst"
383
+ )
384
+ ```
385
+
386
+ **Gate**: threshold >= 85, warn if < 70, on fail: stop
387
+
388
+ **Why this threshold?** Security is the final gate. Shipping vulnerable code is unacceptable.
389
+
390
+ **Focus**:
391
+ - OWASP Top 10 compliance
392
+ - Secrets and credentials exposure
393
+ - Dependency vulnerabilities (npm audit)
394
+ - Input validation and sanitization
395
+ - Authentication and authorization patterns
396
+
397
+ **Capture for tracker**: All security findings and recommendations.
398
+
399
+ **If failing**: Fix security issues before shipping. Security is non-negotiable for production.
400
+
401
+ **Decision criteria**:
402
+ - SECURE (✅): Score ≥85 AND no auto-fail conditions
403
+ - CONDITIONAL (⚠️): Score 70-84 → Review and document accepted risks
404
+ - BLOCKED (❌): Score <70 OR auto-fail triggered
405
+
406
+ **Auto-fail conditions**:
407
+ - Hardcoded secrets/API keys in source code
408
+ - SQL injection or command injection confirmed
409
+ - Authentication bypass possible
410
+ - Critical npm vulnerability (CVSS >= 9.0)
411
+ - Secrets in git history
412
+ - RCE vector identified
413
+
414
+ **Depends on**: code-auditor
415
+
416
+ ---
417
+
418
+ ### Phase 7: API Contract Validation (Conditional)
419
+ **Runs when**: `context.is_api_service`
420
+
421
+ **Commands**: api-contract@1.0.0
422
+
423
+ **Invoke via Task tool:**
424
+ ```
425
+ Task(
426
+ subagent_type: "api-contract",
427
+ prompt: "[validator:api-contract] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
428
+ description: "API Contract Validator"
429
+ )
430
+ ```
431
+
432
+ **Gate**: threshold >= 80, on fail: stop
433
+
434
+ **Focus**:
435
+ - Documentation/implementation alignment
436
+ - Type definitions match actual responses
437
+ - Breaking changes detection
438
+ - Endpoint completeness
439
+
440
+ **Capture for tracker**: Contract drift issues and sync recommendations.
441
+
442
+ **If failing**: Sync API contracts before shipping. Consumers depend on accurate documentation.
443
+
444
+ **Skip conditions**:
445
+ - No Express/router patterns detected
446
+ - CLI tool only (no HTTP endpoints)
447
+
448
+ **Decision criteria**:
449
+ - CONSISTENT (✅): Score ≥80 AND no drift detected
450
+ - DRIFT (⚠️): Score <80 → Sync contracts
451
+
452
+ **Depends on**: security
453
+
454
+ ---
455
+
456
+ ### Phase 8: Release Readiness (Conditional)
457
+ **Runs when**: `context.publishable_package`
458
+
459
+ **Commands**: release@1.0.0
460
+
461
+ **Invoke via Task tool:**
462
+ ```
463
+ Task(
464
+ subagent_type: "release",
465
+ prompt: "[validator:release] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
466
+ description: "Release Readiness"
467
+ )
468
+ ```
469
+
470
+ **Gate**: threshold >= 80, warn if < 70, on fail: stop
471
+
472
+ **Focus**:
473
+ - Version consistency (CLI --version matches package.json)
474
+ - CHANGELOG has current version entry
475
+ - Build is fresh and matches source
476
+ - Package.json completeness (main, types, exports)
477
+
478
+ **Capture for tracker**: Version issues, documentation gaps, release hygiene items.
479
+
480
+ **If failing**: Fix version and documentation issues before publishing.
481
+
482
+ **Skip conditions**:
483
+ - Private package (private: true)
484
+ - No package.json
485
+ - Internal tool only
486
+
487
+ **Decision criteria**:
488
+ - READY (✅): Score ≥80 AND versions match AND CHANGELOG current
489
+ - WARNINGS (⚠️): Score 70-79 → Review, then continue
490
+ - NOT READY (❌): Score <70
491
+
492
+ **Depends on**: security
493
+
494
+ ---
495
+
496
+
497
+ ---
498
+
499
+ ## Summary Report
500
+
501
+ After all phases complete, summarize:
502
+
503
+ ```
504
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
505
+ SUMMARY
506
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
507
+
508
+ Target: [path]
509
+ Run: [N]
510
+
511
+ ┌─────────────────────┬────────┬────────────┐
512
+ │ Agent │ Score │ Status │
513
+ ├─────────────────────┼────────┼────────────┤
514
+ │ ... │ [X]/100│ ✅/❌/⏭️ │
515
+ └─────────────────────┴────────┴────────────┘
516
+
517
+ ```
518
+
519
+
520
+ ### Scoring
521
+
522
+ **Method**: weighted_average
523
+
524
+ | Phase | Weight |
525
+ |-------|--------|
526
+ | code-validator | 15% |
527
+ | type-safety | 10% |
528
+ | test-architect | 15% |
529
+ | code-auditor | 20% |
530
+ | public-interface | 10% |
531
+ | security | 20% |
532
+ | api-contract | 5% |
533
+ | release-readiness | 5% |
534
+
535
+
536
+ ---
537
+
538
+ ## Final Phase: Outputs (MANDATORY)
539
+
540
+ **This phase runs regardless of pass/fail status.** All agent recommendations must be captured.
541
+
542
+ ### Artifacts
543
+
544
+ **features-list** (markdown):
545
+
546
+ Generate a timestamp for the filename:
547
+
548
+ ```bash
549
+ TIMESTAMP=$(date +%Y-%m-%dT%H-%M-%S)
550
+ echo "Timestamp: $TIMESTAMP"
551
+ ```
552
+
553
+ Write file to: `{{ target_path }}/{{ target_name }}-features-list-{{ timestamp }}.md`
554
+
555
+ #### Granularity Rules
556
+
557
+ **DO NOT consolidate multiple findings into single entries.** The tracker handles deduplication via fingerprinting. Save ALL raw findings:
558
+
559
+ | Agent Reports | You Save |
560
+ |---------------|----------|
561
+ | "N+1 pattern in 14 locations" | 14 separate recommendations, one per file:line |
562
+ | "Missing null checks on 8 .find() calls" | 8 separate recommendations |
563
+ | "6 endpoints missing from docs" | 6 separate recommendations |
564
+
565
+ **Rule:** If validator output has a file:line reference, it becomes a separate recommendation entry.
566
+
567
+ ### Save to Tracker (MANDATORY — Always Save First)
568
+
569
+ **CRITICAL: Always save to the tracker. Never skip this step.**
570
+
571
+ After writing the markdown file, save results via `mcp__uluops-tracker__save_features_list`:
572
+
573
+ ```
574
+ mcp__uluops-tracker__save_features_list({
575
+ project: {{ target_name }},
576
+ workflow_type: "ship",
577
+ timestamp: {ISO8601 timestamp},
578
+ validators: [
579
+ {
580
+ "name": "{Agent Name}",
581
+ "score": {numeric},
582
+ "status": "{PASS|FAIL|SKIP}",
583
+ "model": "{haiku|sonnet|opus}"
584
+ }
585
+ // ... one entry per agent
586
+ ],
587
+ recommendations: [
588
+ {
589
+ "validator": "{agent-name}",
590
+ "title": "{short title}",
591
+ "priority": "{critical|suggested|backlog}",
592
+ "severity": "{critical|high|medium|low|info}",
593
+ "description": "{details}",
594
+ "file_path": "{path}",
595
+ "line_number": {number}
596
+ }
597
+ // ... one entry per recommendation
598
+ ]
599
+ })
600
+ ```
601
+
602
+ **Priority mapping:**
603
+ - Blocking (fix before ship) → `"critical"`
604
+ - Warnings (review before ship) → `"suggested"`
605
+ - Post-ship/backlog items → `"backlog"`
606
+
607
+ ### Post-Save Verification
608
+
609
+ After saving, verify the data was persisted correctly. **These are warnings, not blockers.**
610
+
611
+ **Query uluops-tracker and compare to recommendations.length**
612
+
613
+ - On mismatch: **warn** (do NOT block or re-attempt)
614
+ - Saved count differs from payload count. This is normal when cross-phase deduplication occurs (multiple validators flag the same file:line). Log the discrepancy as a note—do NOT re-attempt or block.
615
+
616
+ **Verify file exists: {{ target_path }}/{{ target_name }}-features-list-{{ timestamp }}.md**
617
+
618
+ - On mismatch: **warn** (do NOT block or re-attempt)
619
+ - Features list markdown file not found at expected path. Verify the write succeeded.
620
+
621
+ **Verification procedure:**
622
+
623
+ 1. Query the tracker for the saved run
624
+ 2. Compare saved recommendation count against your payload count
625
+ 3. If counts differ, log the discrepancy as a note — cross-phase deduplication is expected when multiple validators flag the same issue
626
+ 4. **Proceed regardless** — the save already succeeded
627
+
628
+
629
+ ---
630
+
631
+
632
+
633
+
634
+
635
+
636
+ ---
637
+
638
+ ## Quick Reference
639
+
640
+ | Agent | Threshold | Group |
641
+ |-------|-----------|-------|
642
+ | Code Validation | threshold >= 70, on fail: stop | 1 |
643
+ | Type Safety | threshold >= 80, warn if < 70, on fail: stop | 2 |
644
+ | Test Architecture Review | threshold >= 70, on fail: stop | 2 |
645
+ | Runtime Correctness Audit | threshold >= 80, warn if < 70, on fail: stop | 3 |
646
+ | Public Interface Validation | threshold >= 75, on fail: stop | 2 |
647
+ | Security Audit | threshold >= 85, warn if < 70, on fail: stop | 4 |
648
+ | API Contract Validation | threshold >= 80, on fail: stop | 5 |
649
+ | Release Readiness | threshold >= 80, warn if < 70, on fail: stop | 5 |
650
+
651
+ **Conditional Validator Activation**:
652
+ - **Type Safety**: `context.typescript_detected`
653
+ - **API Contract Validation**: `context.is_api_service`
654
+ - **Release Readiness**: `context.publishable_package`
655
+
656
+ ---
657
+
658
+ ## Troubleshooting
659
+
660
+ ### Code Auditor keeps flagging async issues that seem fine
661
+
662
+ Code Auditor uses Opus for deeper reasoning about async patterns. If it flags something, investigate carefully:
663
+ - Unawaited promises in callbacks ARE a problem even if tests pass
664
+ - .then() without .catch() can silently swallow errors
665
+ - Fire-and-forget patterns need explicit documentation
666
+
667
+ If the pattern is intentional, add a SAFETY comment explaining why.
668
+
669
+
670
+ ### Type Safety fails but tsc compiles fine
671
+
672
+ The Type Safety validator checks beyond compilation:
673
+ - any abuse that tsc allows but causes runtime issues
674
+ - Type assertions that skip runtime validation
675
+ - Implicit any from missing types
676
+
677
+ tsc with strict mode catches some issues, but the validator looks for patterns that compile but cause consumer problems.
678
+
679
+
680
+ ### Security blocks on a dependency vulnerability I cannot upgrade
681
+
682
+ If a dependency has a known vulnerability but upgrading would break things:
683
+ 1. Document the risk in the validation report
684
+ 2. Add a note explaining mitigation (if any)
685
+ 3. Consider the CONDITIONAL path (score 70-84) for documented accepted risks
686
+ 4. Create a tracking issue for the upgrade
687
+
688
+ Never ignore security findings—document the decision.
689
+
690
+
691
+ ### Release Readiness says version mismatch but I use semantic-release
692
+
693
+ With semantic-release CI/CD, versioning is automated. The validator may flag:
694
+ - CLI --version showing different version (check if it reads from package.json dynamically)
695
+ - CHANGELOG being auto-generated
696
+
697
+ If you use semantic-release, these are expected. The validator will note "Release Strategy: Semantic Release CI/CD" and adjust expectations.
698
+
699
+
700
+ ### API Contract runs but I do not have OpenAPI docs
701
+
702
+ API Contract validation checks alignment between:
703
+ - JSDoc/TSDoc on route handlers
704
+ - TypeScript types for request/response
705
+ - Any README documentation about endpoints
706
+
707
+ You don't need formal OpenAPI—the validator checks whatever documentation exists matches implementation.
708
+
709
+
710
+ ### Pipeline takes too long in parallel mode
711
+
712
+ Even in parallel mode, groups run sequentially:
713
+ 1. Group 1 (gate) must complete first
714
+ 2. Group 2 (parallel) runs type-safety + test-architect + public-interface
715
+ 3. Group 3 runs code-auditor (needs test context)
716
+ 4. Group 4 runs security (final gate)
717
+ 5. Group 5 runs conditionals in parallel
718
+
719
+ The bottleneck is usually code-auditor (Opus) and security. These cannot be parallelized because they depend on prior phases.
720
+
721
+