agentic-qe 3.4.1 → 3.4.2

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 (496) hide show
  1. package/.claude/skills/.validation/README.md +111 -0
  2. package/.claude/skills/.validation/examples/chaos-engineering-output.example.json +530 -0
  3. package/.claude/skills/.validation/examples/performance-testing-output.example.json +252 -0
  4. package/.claude/skills/.validation/examples/security-testing-output.example.json +413 -0
  5. package/.claude/skills/.validation/examples/testability-scoring-output.example.json +350 -0
  6. package/.claude/skills/.validation/schemas/skill-eval.schema.json +452 -0
  7. package/.claude/skills/.validation/schemas/skill-frontmatter.schema.json +341 -0
  8. package/.claude/skills/.validation/schemas/skill-output-meta.schema.json +199 -0
  9. package/.claude/skills/.validation/schemas/skill-output.template.json +610 -0
  10. package/.claude/skills/.validation/skill-validation-mcp-integration.md +250 -0
  11. package/.claude/skills/.validation/templates/eval.template.yaml +366 -0
  12. package/.claude/skills/.validation/templates/schemas/output.json +145 -0
  13. package/.claude/skills/.validation/templates/security-testing-eval.template.yaml +725 -0
  14. package/.claude/skills/.validation/templates/skill-frontmatter.example.yaml +225 -0
  15. package/.claude/skills/.validation/templates/validate.template.sh +1060 -0
  16. package/.claude/skills/.validation/templates/validator-lib.sh +1031 -0
  17. package/.claude/skills/.validation/test-data/invalid-output.json +5 -0
  18. package/.claude/skills/.validation/test-data/minimal-output.json +9 -0
  19. package/.claude/skills/.validation/test-data/sample-output.json +73 -0
  20. package/.claude/skills/TRUST-TIERS.md +158 -0
  21. package/.claude/skills/a11y-ally/SKILL.md +1664 -1658
  22. package/.claude/skills/a11y-ally/evals/a11y-ally.yaml +376 -0
  23. package/.claude/skills/a11y-ally/schemas/output.json +549 -0
  24. package/.claude/skills/a11y-ally/scripts/validate.sh +690 -0
  25. package/.claude/skills/accessibility-testing/SKILL.md +8 -1
  26. package/.claude/skills/accessibility-testing/evals/accessibility-testing.yaml +719 -0
  27. package/.claude/skills/accessibility-testing/schemas/output.json +776 -0
  28. package/.claude/skills/accessibility-testing/scripts/validate.sh +943 -0
  29. package/.claude/skills/accessibility-testing/test-data/sample-output.json +191 -0
  30. package/.claude/skills/agentic-quality-engineering/SKILL.md +4 -0
  31. package/.claude/skills/agentic-quality-engineering/schemas/output.json +577 -0
  32. package/.claude/skills/api-testing-patterns/SKILL.md +5 -0
  33. package/.claude/skills/api-testing-patterns/evals/api-testing-patterns.yaml +696 -0
  34. package/.claude/skills/api-testing-patterns/schemas/output.json +845 -0
  35. package/.claude/skills/api-testing-patterns/scripts/validate.sh +931 -0
  36. package/.claude/skills/aqe-v2-v3-migration/schemas/output.json +513 -0
  37. package/.claude/skills/aqe-v2-v3-migration/skill.md +4 -0
  38. package/.claude/skills/brutal-honesty-review/SKILL.md +5 -0
  39. package/.claude/skills/brutal-honesty-review/schemas/output.json +291 -0
  40. package/.claude/skills/brutal-honesty-review/scripts/validate.sh +130 -0
  41. package/.claude/skills/bug-reporting-excellence/SKILL.md +5 -0
  42. package/.claude/skills/bug-reporting-excellence/schemas/output.json +288 -0
  43. package/.claude/skills/bug-reporting-excellence/scripts/validate.sh +108 -0
  44. package/.claude/skills/chaos-engineering-resilience/SKILL.md +5 -0
  45. package/.claude/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -0
  46. package/.claude/skills/chaos-engineering-resilience/schemas/output.json +1205 -0
  47. package/.claude/skills/chaos-engineering-resilience/scripts/validate.sh +1107 -0
  48. package/.claude/skills/cicd-pipeline-qe-orchestrator/SKILL.md +6 -0
  49. package/.claude/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +157 -0
  50. package/.claude/skills/cicd-pipeline-qe-orchestrator/schemas/output.json +542 -0
  51. package/.claude/skills/cicd-pipeline-qe-orchestrator/scripts/validate.sh +310 -0
  52. package/.claude/skills/code-review-quality/SKILL.md +5 -0
  53. package/.claude/skills/code-review-quality/schemas/output.json +264 -0
  54. package/.claude/skills/code-review-quality/scripts/validate.sh +113 -0
  55. package/.claude/skills/compatibility-testing/evals/compatibility-testing.yaml +410 -0
  56. package/.claude/skills/compatibility-testing/schemas/output.json +551 -0
  57. package/.claude/skills/compatibility-testing/scripts/validate.sh +605 -0
  58. package/.claude/skills/compliance-testing/SKILL.md +7 -0
  59. package/.claude/skills/compliance-testing/evals/compliance-testing.yaml +1107 -0
  60. package/.claude/skills/compliance-testing/schemas/output.json +845 -0
  61. package/.claude/skills/compliance-testing/scripts/validate.sh +888 -0
  62. package/.claude/skills/consultancy-practices/SKILL.md +4 -0
  63. package/.claude/skills/consultancy-practices/schemas/output.json +282 -0
  64. package/.claude/skills/context-driven-testing/SKILL.md +3 -0
  65. package/.claude/skills/contract-testing/SKILL.md +5 -0
  66. package/.claude/skills/contract-testing/evals/contract-testing.yaml +748 -0
  67. package/.claude/skills/contract-testing/schemas/output.json +638 -0
  68. package/.claude/skills/contract-testing/scripts/validate.sh +1033 -0
  69. package/.claude/skills/database-testing/SKILL.md +5 -0
  70. package/.claude/skills/database-testing/evals/database-testing.yaml +968 -0
  71. package/.claude/skills/database-testing/schemas/output.json +1446 -0
  72. package/.claude/skills/database-testing/scripts/validate.sh +1099 -0
  73. package/.claude/skills/exploratory-testing-advanced/SKILL.md +3 -0
  74. package/.claude/skills/holistic-testing-pact/SKILL.md +3 -0
  75. package/.claude/skills/localization-testing/SKILL.md +6 -0
  76. package/.claude/skills/localization-testing/evals/localization-testing.yaml +544 -0
  77. package/.claude/skills/localization-testing/schemas/output.json +325 -0
  78. package/.claude/skills/localization-testing/scripts/validate.sh +131 -0
  79. package/.claude/skills/mobile-testing/SKILL.md +6 -0
  80. package/.claude/skills/mobile-testing/evals/mobile-testing.yaml +537 -0
  81. package/.claude/skills/mobile-testing/schemas/output.json +318 -0
  82. package/.claude/skills/mobile-testing/scripts/validate.sh +127 -0
  83. package/.claude/skills/mutation-testing/SKILL.md +8 -1
  84. package/.claude/skills/mutation-testing/evals/mutation-testing.yaml +652 -0
  85. package/.claude/skills/mutation-testing/schemas/output.json +707 -0
  86. package/.claude/skills/mutation-testing/scripts/validate.sh +992 -0
  87. package/.claude/skills/mutation-testing/test-data/sample-output.json +295 -0
  88. package/.claude/skills/n8n-expression-testing/SKILL.md +6 -0
  89. package/.claude/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +450 -0
  90. package/.claude/skills/n8n-expression-testing/schemas/output.json +369 -0
  91. package/.claude/skills/n8n-expression-testing/scripts/validate.sh +162 -0
  92. package/.claude/skills/n8n-integration-testing-patterns/SKILL.md +6 -0
  93. package/.claude/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +522 -0
  94. package/.claude/skills/n8n-integration-testing-patterns/schemas/output.json +291 -0
  95. package/.claude/skills/n8n-integration-testing-patterns/scripts/validate.sh +104 -0
  96. package/.claude/skills/n8n-security-testing/SKILL.md +6 -0
  97. package/.claude/skills/n8n-security-testing/evals/n8n-security-testing.yaml +493 -0
  98. package/.claude/skills/n8n-security-testing/schemas/output.json +293 -0
  99. package/.claude/skills/n8n-security-testing/scripts/validate.sh +120 -0
  100. package/.claude/skills/n8n-trigger-testing-strategies/SKILL.md +6 -0
  101. package/.claude/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +500 -0
  102. package/.claude/skills/n8n-trigger-testing-strategies/schemas/output.json +295 -0
  103. package/.claude/skills/n8n-trigger-testing-strategies/scripts/validate.sh +121 -0
  104. package/.claude/skills/n8n-workflow-testing-fundamentals/SKILL.md +6 -0
  105. package/.claude/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +497 -0
  106. package/.claude/skills/n8n-workflow-testing-fundamentals/schemas/output.json +254 -0
  107. package/.claude/skills/n8n-workflow-testing-fundamentals/scripts/validate.sh +126 -0
  108. package/.claude/skills/performance-analysis/SKILL.md +6 -0
  109. package/.claude/skills/performance-analysis/evals/performance-analysis.yaml +144 -0
  110. package/.claude/skills/performance-analysis/schemas/output.json +588 -0
  111. package/.claude/skills/performance-analysis/scripts/validate.sh +63 -0
  112. package/.claude/skills/performance-testing/SKILL.md +5 -0
  113. package/.claude/skills/performance-testing/evals/performance-testing.yaml +772 -0
  114. package/.claude/skills/performance-testing/schemas/output.json +1184 -0
  115. package/.claude/skills/performance-testing/scripts/validate.sh +1090 -0
  116. package/.claude/skills/qcsd-ideation-swarm/SKILL.md +1759 -1753
  117. package/.claude/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -0
  118. package/.claude/skills/qcsd-ideation-swarm/schemas/output.json +568 -0
  119. package/.claude/skills/qcsd-ideation-swarm/scripts/validate.sh +56 -0
  120. package/.claude/skills/qe-chaos-resilience/SKILL.md +6 -0
  121. package/.claude/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +443 -0
  122. package/.claude/skills/qe-chaos-resilience/schemas/output.json +314 -0
  123. package/.claude/skills/qe-chaos-resilience/scripts/validate.sh +401 -0
  124. package/.claude/skills/qe-code-intelligence/SKILL.md +6 -0
  125. package/.claude/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +459 -0
  126. package/.claude/skills/qe-code-intelligence/schemas/output.json +315 -0
  127. package/.claude/skills/qe-code-intelligence/scripts/validate.sh +408 -0
  128. package/.claude/skills/qe-contract-testing/SKILL.md +6 -0
  129. package/.claude/skills/qe-contract-testing/evals/qe-contract-testing.yaml +513 -0
  130. package/.claude/skills/qe-contract-testing/schemas/output.json +295 -0
  131. package/.claude/skills/qe-contract-testing/scripts/validate.sh +421 -0
  132. package/.claude/skills/qe-coverage-analysis/SKILL.md +6 -0
  133. package/.claude/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -0
  134. package/.claude/skills/qe-coverage-analysis/schemas/output.json +286 -0
  135. package/.claude/skills/qe-coverage-analysis/scripts/validate.sh +453 -0
  136. package/.claude/skills/qe-defect-intelligence/SKILL.md +6 -0
  137. package/.claude/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +511 -0
  138. package/.claude/skills/qe-defect-intelligence/schemas/output.json +283 -0
  139. package/.claude/skills/qe-defect-intelligence/scripts/validate.sh +466 -0
  140. package/.claude/skills/qe-iterative-loop/SKILL.md +445 -440
  141. package/.claude/skills/qe-iterative-loop/schemas/output.json +264 -0
  142. package/.claude/skills/qe-iterative-loop/scripts/validate.sh +474 -0
  143. package/.claude/skills/qe-learning-optimization/SKILL.md +6 -0
  144. package/.claude/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +144 -0
  145. package/.claude/skills/qe-learning-optimization/schemas/output.json +288 -0
  146. package/.claude/skills/qe-learning-optimization/scripts/validate.sh +56 -0
  147. package/.claude/skills/qe-quality-assessment/SKILL.md +6 -0
  148. package/.claude/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +506 -0
  149. package/.claude/skills/qe-quality-assessment/schemas/output.json +550 -0
  150. package/.claude/skills/qe-quality-assessment/scripts/validate.sh +352 -0
  151. package/.claude/skills/qe-requirements-validation/SKILL.md +6 -0
  152. package/.claude/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -0
  153. package/.claude/skills/qe-requirements-validation/schemas/output.json +587 -0
  154. package/.claude/skills/qe-requirements-validation/scripts/validate.sh +275 -0
  155. package/.claude/skills/qe-security-compliance/SKILL.md +6 -0
  156. package/.claude/skills/qe-security-compliance/evals/qe-security-compliance.yaml +595 -0
  157. package/.claude/skills/qe-security-compliance/schemas/output.json +498 -0
  158. package/.claude/skills/qe-security-compliance/scripts/validate.sh +305 -0
  159. package/.claude/skills/qe-test-execution/SKILL.md +6 -0
  160. package/.claude/skills/qe-test-execution/evals/qe-test-execution.yaml +607 -0
  161. package/.claude/skills/qe-test-execution/schemas/output.json +529 -0
  162. package/.claude/skills/qe-test-execution/scripts/validate.sh +323 -0
  163. package/.claude/skills/qe-test-generation/SKILL.md +6 -0
  164. package/.claude/skills/qe-test-generation/evals/qe-test-generation.yaml +148 -0
  165. package/.claude/skills/qe-test-generation/schemas/output.json +439 -0
  166. package/.claude/skills/qe-test-generation/scripts/validate.sh +56 -0
  167. package/.claude/skills/qe-visual-accessibility/SKILL.md +6 -0
  168. package/.claude/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +142 -0
  169. package/.claude/skills/qe-visual-accessibility/schemas/output.json +491 -0
  170. package/.claude/skills/qe-visual-accessibility/scripts/validate.sh +56 -0
  171. package/.claude/skills/quality-metrics/SKILL.md +6 -0
  172. package/.claude/skills/quality-metrics/evals/quality-metrics.yaml +494 -0
  173. package/.claude/skills/quality-metrics/schemas/output.json +403 -0
  174. package/.claude/skills/quality-metrics/scripts/validate.sh +434 -0
  175. package/.claude/skills/refactoring-patterns/SKILL.md +5 -0
  176. package/.claude/skills/refactoring-patterns/schemas/output.json +475 -0
  177. package/.claude/skills/refactoring-patterns/scripts/validate.sh +241 -0
  178. package/.claude/skills/regression-testing/SKILL.md +6 -0
  179. package/.claude/skills/regression-testing/evals/regression-testing.yaml +504 -0
  180. package/.claude/skills/regression-testing/schemas/output.json +311 -0
  181. package/.claude/skills/regression-testing/scripts/validate.sh +130 -0
  182. package/.claude/skills/risk-based-testing/SKILL.md +6 -0
  183. package/.claude/skills/risk-based-testing/evals/risk-based-testing.yaml +141 -0
  184. package/.claude/skills/risk-based-testing/schemas/output.json +480 -0
  185. package/.claude/skills/risk-based-testing/scripts/validate.sh +56 -0
  186. package/.claude/skills/security-testing/SKILL.md +5 -0
  187. package/.claude/skills/security-testing/evals/security-testing.yaml +789 -0
  188. package/.claude/skills/security-testing/schemas/output.json +879 -0
  189. package/.claude/skills/security-testing/scripts/validate.sh +967 -0
  190. package/.claude/skills/security-visual-testing/SKILL.md +223 -217
  191. package/.claude/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -0
  192. package/.claude/skills/security-visual-testing/schemas/output.json +486 -0
  193. package/.claude/skills/security-visual-testing/scripts/validate.sh +748 -0
  194. package/.claude/skills/sherlock-review/SKILL.md +5 -0
  195. package/.claude/skills/sherlock-review/schemas/output.json +297 -0
  196. package/.claude/skills/sherlock-review/scripts/validate.sh +115 -0
  197. package/.claude/skills/shift-left-testing/SKILL.md +6 -0
  198. package/.claude/skills/shift-left-testing/evals/shift-left-testing.yaml +145 -0
  199. package/.claude/skills/shift-left-testing/schemas/output.json +459 -0
  200. package/.claude/skills/shift-left-testing/scripts/validate.sh +56 -0
  201. package/.claude/skills/shift-right-testing/SKILL.md +6 -0
  202. package/.claude/skills/shift-right-testing/evals/shift-right-testing.yaml +147 -0
  203. package/.claude/skills/shift-right-testing/schemas/output.json +418 -0
  204. package/.claude/skills/shift-right-testing/scripts/validate.sh +56 -0
  205. package/.claude/skills/six-thinking-hats/SKILL.md +3 -0
  206. package/.claude/skills/tdd-london-chicago/SKILL.md +5 -0
  207. package/.claude/skills/tdd-london-chicago/schemas/output.json +444 -0
  208. package/.claude/skills/tdd-london-chicago/scripts/validate.sh +214 -0
  209. package/.claude/skills/technical-writing/SKILL.md +4 -0
  210. package/.claude/skills/technical-writing/schemas/output.json +268 -0
  211. package/.claude/skills/test-automation-strategy/SKILL.md +6 -0
  212. package/.claude/skills/test-automation-strategy/evals/test-automation-strategy.yaml +148 -0
  213. package/.claude/skills/test-automation-strategy/schemas/output.json +444 -0
  214. package/.claude/skills/test-automation-strategy/scripts/validate.sh +195 -0
  215. package/.claude/skills/test-data-management/SKILL.md +6 -0
  216. package/.claude/skills/test-data-management/evals/test-data-management.yaml +504 -0
  217. package/.claude/skills/test-data-management/schemas/output.json +284 -0
  218. package/.claude/skills/test-data-management/scripts/validate.sh +137 -0
  219. package/.claude/skills/test-design-techniques/SKILL.md +6 -0
  220. package/.claude/skills/test-design-techniques/evals/test-design-techniques.yaml +142 -0
  221. package/.claude/skills/test-design-techniques/schemas/output.json +295 -0
  222. package/.claude/skills/test-design-techniques/scripts/validate.sh +91 -0
  223. package/.claude/skills/test-environment-management/SKILL.md +4 -0
  224. package/.claude/skills/test-environment-management/schemas/output.json +310 -0
  225. package/.claude/skills/test-reporting-analytics/SKILL.md +6 -0
  226. package/.claude/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +155 -0
  227. package/.claude/skills/test-reporting-analytics/schemas/output.json +329 -0
  228. package/.claude/skills/test-reporting-analytics/scripts/validate.sh +77 -0
  229. package/.claude/skills/testability-scoring/SKILL.md +5 -0
  230. package/.claude/skills/testability-scoring/evals/testability-scoring.yaml +814 -0
  231. package/.claude/skills/testability-scoring/schemas/output.json +606 -0
  232. package/.claude/skills/testability-scoring/scripts/validate.sh +891 -0
  233. package/.claude/skills/trust-tier-manifest.json +2333 -0
  234. package/.claude/skills/verification-quality/SKILL.md +6 -0
  235. package/.claude/skills/verification-quality/evals/verification-quality.yaml +150 -0
  236. package/.claude/skills/verification-quality/schemas/output.json +432 -0
  237. package/.claude/skills/verification-quality/scripts/validate.sh +77 -0
  238. package/.claude/skills/visual-testing-advanced/SKILL.md +6 -0
  239. package/.claude/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +154 -0
  240. package/.claude/skills/visual-testing-advanced/schemas/output.json +294 -0
  241. package/.claude/skills/visual-testing-advanced/scripts/validate.sh +77 -0
  242. package/.claude/skills/xp-practices/SKILL.md +3 -0
  243. package/README.md +39 -2
  244. package/package.json +4 -1
  245. package/scripts/run-skill-eval.ts +1097 -0
  246. package/scripts/test-schema-validation.js +301 -0
  247. package/scripts/update-skill-manifest.ts +751 -0
  248. package/scripts/validate-skill-frontmatter.js +141 -0
  249. package/v3/CHANGELOG.md +21 -0
  250. package/v3/README.md +43 -3
  251. package/v3/assets/agents/v3/qe-test-idea-rewriter.md +375 -375
  252. package/v3/assets/skills/.validation/README.md +111 -0
  253. package/v3/assets/skills/.validation/examples/chaos-engineering-output.example.json +530 -0
  254. package/v3/assets/skills/.validation/examples/performance-testing-output.example.json +252 -0
  255. package/v3/assets/skills/.validation/examples/security-testing-output.example.json +413 -0
  256. package/v3/assets/skills/.validation/examples/testability-scoring-output.example.json +350 -0
  257. package/v3/assets/skills/.validation/schemas/skill-eval.schema.json +452 -0
  258. package/v3/assets/skills/.validation/schemas/skill-frontmatter.schema.json +341 -0
  259. package/v3/assets/skills/.validation/schemas/skill-output-meta.schema.json +199 -0
  260. package/v3/assets/skills/.validation/schemas/skill-output.template.json +610 -0
  261. package/v3/assets/skills/.validation/skill-validation-mcp-integration.md +250 -0
  262. package/v3/assets/skills/.validation/templates/eval.template.yaml +366 -0
  263. package/v3/assets/skills/.validation/templates/schemas/output.json +145 -0
  264. package/v3/assets/skills/.validation/templates/security-testing-eval.template.yaml +725 -0
  265. package/v3/assets/skills/.validation/templates/skill-frontmatter.example.yaml +225 -0
  266. package/v3/assets/skills/.validation/templates/validate.template.sh +1060 -0
  267. package/v3/assets/skills/.validation/templates/validator-lib.sh +1031 -0
  268. package/v3/assets/skills/.validation/test-data/invalid-output.json +5 -0
  269. package/v3/assets/skills/.validation/test-data/minimal-output.json +9 -0
  270. package/v3/assets/skills/.validation/test-data/sample-output.json +73 -0
  271. package/v3/assets/skills/accessibility-testing/SKILL.md +8 -1
  272. package/v3/assets/skills/accessibility-testing/evals/accessibility-testing.yaml +719 -0
  273. package/v3/assets/skills/accessibility-testing/schemas/output.json +776 -0
  274. package/v3/assets/skills/accessibility-testing/scripts/validate.sh +943 -0
  275. package/v3/assets/skills/accessibility-testing/test-data/sample-output.json +191 -0
  276. package/v3/assets/skills/agentic-quality-engineering/SKILL.md +4 -0
  277. package/v3/assets/skills/agentic-quality-engineering/schemas/output.json +577 -0
  278. package/v3/assets/skills/api-testing-patterns/SKILL.md +5 -0
  279. package/v3/assets/skills/api-testing-patterns/evals/api-testing-patterns.yaml +696 -0
  280. package/v3/assets/skills/api-testing-patterns/schemas/output.json +845 -0
  281. package/v3/assets/skills/api-testing-patterns/scripts/validate.sh +931 -0
  282. package/v3/assets/skills/aqe-v2-v3-migration/schemas/output.json +513 -0
  283. package/v3/assets/skills/aqe-v2-v3-migration/skill.md +20 -16
  284. package/v3/assets/skills/bug-reporting-excellence/SKILL.md +5 -0
  285. package/v3/assets/skills/bug-reporting-excellence/schemas/output.json +288 -0
  286. package/v3/assets/skills/bug-reporting-excellence/scripts/validate.sh +108 -0
  287. package/v3/assets/skills/chaos-engineering-resilience/SKILL.md +5 -0
  288. package/v3/assets/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -0
  289. package/v3/assets/skills/chaos-engineering-resilience/schemas/output.json +1205 -0
  290. package/v3/assets/skills/chaos-engineering-resilience/scripts/validate.sh +1107 -0
  291. package/v3/assets/skills/code-review-quality/SKILL.md +5 -0
  292. package/v3/assets/skills/code-review-quality/schemas/output.json +264 -0
  293. package/v3/assets/skills/code-review-quality/scripts/validate.sh +113 -0
  294. package/v3/assets/skills/compatibility-testing/evals/compatibility-testing.yaml +410 -0
  295. package/v3/assets/skills/compatibility-testing/schemas/output.json +551 -0
  296. package/v3/assets/skills/compatibility-testing/scripts/validate.sh +605 -0
  297. package/v3/assets/skills/compliance-testing/SKILL.md +7 -0
  298. package/v3/assets/skills/compliance-testing/evals/compliance-testing.yaml +1107 -0
  299. package/v3/assets/skills/compliance-testing/schemas/output.json +845 -0
  300. package/v3/assets/skills/compliance-testing/scripts/validate.sh +888 -0
  301. package/v3/assets/skills/consultancy-practices/SKILL.md +4 -0
  302. package/v3/assets/skills/consultancy-practices/schemas/output.json +282 -0
  303. package/v3/assets/skills/context-driven-testing/SKILL.md +3 -0
  304. package/v3/assets/skills/contract-testing/SKILL.md +5 -0
  305. package/v3/assets/skills/contract-testing/evals/contract-testing.yaml +748 -0
  306. package/v3/assets/skills/contract-testing/schemas/output.json +638 -0
  307. package/v3/assets/skills/contract-testing/scripts/validate.sh +1033 -0
  308. package/v3/assets/skills/database-testing/SKILL.md +5 -0
  309. package/v3/assets/skills/database-testing/evals/database-testing.yaml +968 -0
  310. package/v3/assets/skills/database-testing/schemas/output.json +1446 -0
  311. package/v3/assets/skills/database-testing/scripts/validate.sh +1099 -0
  312. package/v3/assets/skills/exploratory-testing-advanced/SKILL.md +3 -0
  313. package/v3/assets/skills/holistic-testing-pact/SKILL.md +3 -0
  314. package/v3/assets/skills/localization-testing/SKILL.md +6 -0
  315. package/v3/assets/skills/localization-testing/evals/localization-testing.yaml +544 -0
  316. package/v3/assets/skills/localization-testing/schemas/output.json +325 -0
  317. package/v3/assets/skills/localization-testing/scripts/validate.sh +131 -0
  318. package/v3/assets/skills/mobile-testing/SKILL.md +6 -0
  319. package/v3/assets/skills/mobile-testing/evals/mobile-testing.yaml +537 -0
  320. package/v3/assets/skills/mobile-testing/schemas/output.json +318 -0
  321. package/v3/assets/skills/mobile-testing/scripts/validate.sh +127 -0
  322. package/v3/assets/skills/mutation-testing/SKILL.md +8 -1
  323. package/v3/assets/skills/mutation-testing/evals/mutation-testing.yaml +652 -0
  324. package/v3/assets/skills/mutation-testing/schemas/output.json +707 -0
  325. package/v3/assets/skills/mutation-testing/scripts/validate.sh +992 -0
  326. package/v3/assets/skills/mutation-testing/test-data/sample-output.json +295 -0
  327. package/v3/assets/skills/n8n-expression-testing/scripts/validate.sh +162 -0
  328. package/v3/assets/skills/n8n-integration-testing-patterns/scripts/validate.sh +104 -0
  329. package/v3/assets/skills/n8n-security-testing/scripts/validate.sh +120 -0
  330. package/v3/assets/skills/n8n-trigger-testing-strategies/scripts/validate.sh +121 -0
  331. package/v3/assets/skills/n8n-workflow-testing-fundamentals/scripts/validate.sh +126 -0
  332. package/v3/assets/skills/performance-testing/SKILL.md +5 -0
  333. package/v3/assets/skills/performance-testing/evals/performance-testing.yaml +772 -0
  334. package/v3/assets/skills/performance-testing/schemas/output.json +1184 -0
  335. package/v3/assets/skills/performance-testing/scripts/validate.sh +1090 -0
  336. package/v3/assets/skills/qe-chaos-resilience/SKILL.md +6 -0
  337. package/v3/assets/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +443 -0
  338. package/v3/assets/skills/qe-chaos-resilience/schemas/output.json +314 -0
  339. package/v3/assets/skills/qe-chaos-resilience/scripts/validate.sh +401 -0
  340. package/v3/assets/skills/qe-code-intelligence/SKILL.md +6 -0
  341. package/v3/assets/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +459 -0
  342. package/v3/assets/skills/qe-code-intelligence/schemas/output.json +315 -0
  343. package/v3/assets/skills/qe-code-intelligence/scripts/validate.sh +408 -0
  344. package/v3/assets/skills/qe-contract-testing/SKILL.md +6 -0
  345. package/v3/assets/skills/qe-contract-testing/evals/qe-contract-testing.yaml +513 -0
  346. package/v3/assets/skills/qe-contract-testing/schemas/output.json +295 -0
  347. package/v3/assets/skills/qe-contract-testing/scripts/validate.sh +421 -0
  348. package/v3/assets/skills/qe-coverage-analysis/SKILL.md +6 -0
  349. package/v3/assets/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -0
  350. package/v3/assets/skills/qe-coverage-analysis/schemas/output.json +286 -0
  351. package/v3/assets/skills/qe-coverage-analysis/scripts/validate.sh +453 -0
  352. package/v3/assets/skills/qe-defect-intelligence/SKILL.md +6 -0
  353. package/v3/assets/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +511 -0
  354. package/v3/assets/skills/qe-defect-intelligence/schemas/output.json +283 -0
  355. package/v3/assets/skills/qe-defect-intelligence/scripts/validate.sh +466 -0
  356. package/v3/assets/skills/qe-iterative-loop/SKILL.md +445 -443
  357. package/v3/assets/skills/qe-iterative-loop/schemas/output.json +264 -0
  358. package/v3/assets/skills/qe-iterative-loop/scripts/validate.sh +474 -0
  359. package/v3/assets/skills/qe-learning-optimization/SKILL.md +6 -0
  360. package/v3/assets/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +144 -0
  361. package/v3/assets/skills/qe-learning-optimization/schemas/output.json +288 -0
  362. package/v3/assets/skills/qe-learning-optimization/scripts/validate.sh +56 -0
  363. package/v3/assets/skills/qe-quality-assessment/SKILL.md +6 -0
  364. package/v3/assets/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +506 -0
  365. package/v3/assets/skills/qe-quality-assessment/schemas/output.json +550 -0
  366. package/v3/assets/skills/qe-quality-assessment/scripts/validate.sh +352 -0
  367. package/v3/assets/skills/qe-requirements-validation/SKILL.md +6 -0
  368. package/v3/assets/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -0
  369. package/v3/assets/skills/qe-requirements-validation/schemas/output.json +587 -0
  370. package/v3/assets/skills/qe-requirements-validation/scripts/validate.sh +275 -0
  371. package/v3/assets/skills/qe-security-compliance/SKILL.md +6 -0
  372. package/v3/assets/skills/qe-security-compliance/evals/qe-security-compliance.yaml +595 -0
  373. package/v3/assets/skills/qe-security-compliance/schemas/output.json +498 -0
  374. package/v3/assets/skills/qe-security-compliance/scripts/validate.sh +305 -0
  375. package/v3/assets/skills/qe-test-execution/SKILL.md +6 -0
  376. package/v3/assets/skills/qe-test-execution/evals/qe-test-execution.yaml +607 -0
  377. package/v3/assets/skills/qe-test-execution/schemas/output.json +529 -0
  378. package/v3/assets/skills/qe-test-execution/scripts/validate.sh +323 -0
  379. package/v3/assets/skills/qe-test-generation/SKILL.md +6 -0
  380. package/v3/assets/skills/qe-test-generation/evals/qe-test-generation.yaml +148 -0
  381. package/v3/assets/skills/qe-test-generation/schemas/output.json +439 -0
  382. package/v3/assets/skills/qe-test-generation/scripts/validate.sh +56 -0
  383. package/v3/assets/skills/qe-visual-accessibility/SKILL.md +6 -0
  384. package/v3/assets/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +142 -0
  385. package/v3/assets/skills/qe-visual-accessibility/schemas/output.json +491 -0
  386. package/v3/assets/skills/qe-visual-accessibility/scripts/validate.sh +56 -0
  387. package/v3/assets/skills/quality-metrics/SKILL.md +6 -0
  388. package/v3/assets/skills/quality-metrics/evals/quality-metrics.yaml +494 -0
  389. package/v3/assets/skills/quality-metrics/schemas/output.json +403 -0
  390. package/v3/assets/skills/quality-metrics/scripts/validate.sh +434 -0
  391. package/v3/assets/skills/refactoring-patterns/SKILL.md +5 -0
  392. package/v3/assets/skills/refactoring-patterns/schemas/output.json +475 -0
  393. package/v3/assets/skills/refactoring-patterns/scripts/validate.sh +241 -0
  394. package/v3/assets/skills/regression-testing/SKILL.md +6 -0
  395. package/v3/assets/skills/regression-testing/evals/regression-testing.yaml +504 -0
  396. package/v3/assets/skills/regression-testing/schemas/output.json +311 -0
  397. package/v3/assets/skills/regression-testing/scripts/validate.sh +130 -0
  398. package/v3/assets/skills/risk-based-testing/SKILL.md +6 -0
  399. package/v3/assets/skills/risk-based-testing/evals/risk-based-testing.yaml +141 -0
  400. package/v3/assets/skills/risk-based-testing/schemas/output.json +480 -0
  401. package/v3/assets/skills/risk-based-testing/scripts/validate.sh +56 -0
  402. package/v3/assets/skills/security-testing/SKILL.md +5 -0
  403. package/v3/assets/skills/security-testing/evals/security-testing.yaml +789 -0
  404. package/v3/assets/skills/security-testing/schemas/output.json +879 -0
  405. package/v3/assets/skills/security-testing/scripts/validate.sh +967 -0
  406. package/v3/assets/skills/shift-left-testing/SKILL.md +6 -0
  407. package/v3/assets/skills/shift-left-testing/evals/shift-left-testing.yaml +145 -0
  408. package/v3/assets/skills/shift-left-testing/schemas/output.json +459 -0
  409. package/v3/assets/skills/shift-left-testing/scripts/validate.sh +56 -0
  410. package/v3/assets/skills/shift-right-testing/SKILL.md +6 -0
  411. package/v3/assets/skills/shift-right-testing/evals/shift-right-testing.yaml +147 -0
  412. package/v3/assets/skills/shift-right-testing/schemas/output.json +418 -0
  413. package/v3/assets/skills/shift-right-testing/scripts/validate.sh +56 -0
  414. package/v3/assets/skills/six-thinking-hats/SKILL.md +3 -0
  415. package/v3/assets/skills/tdd-london-chicago/SKILL.md +5 -0
  416. package/v3/assets/skills/tdd-london-chicago/schemas/output.json +444 -0
  417. package/v3/assets/skills/tdd-london-chicago/scripts/validate.sh +214 -0
  418. package/v3/assets/skills/technical-writing/SKILL.md +4 -0
  419. package/v3/assets/skills/technical-writing/schemas/output.json +268 -0
  420. package/v3/assets/skills/test-automation-strategy/SKILL.md +6 -0
  421. package/v3/assets/skills/test-automation-strategy/evals/test-automation-strategy.yaml +148 -0
  422. package/v3/assets/skills/test-automation-strategy/schemas/output.json +444 -0
  423. package/v3/assets/skills/test-automation-strategy/scripts/validate.sh +195 -0
  424. package/v3/assets/skills/test-data-management/SKILL.md +6 -0
  425. package/v3/assets/skills/test-data-management/evals/test-data-management.yaml +504 -0
  426. package/v3/assets/skills/test-data-management/schemas/output.json +284 -0
  427. package/v3/assets/skills/test-data-management/scripts/validate.sh +137 -0
  428. package/v3/assets/skills/test-design-techniques/SKILL.md +6 -0
  429. package/v3/assets/skills/test-design-techniques/evals/test-design-techniques.yaml +142 -0
  430. package/v3/assets/skills/test-design-techniques/schemas/output.json +295 -0
  431. package/v3/assets/skills/test-design-techniques/scripts/validate.sh +91 -0
  432. package/v3/assets/skills/test-environment-management/SKILL.md +4 -0
  433. package/v3/assets/skills/test-environment-management/schemas/output.json +310 -0
  434. package/v3/assets/skills/test-reporting-analytics/SKILL.md +6 -0
  435. package/v3/assets/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +155 -0
  436. package/v3/assets/skills/test-reporting-analytics/schemas/output.json +329 -0
  437. package/v3/assets/skills/test-reporting-analytics/scripts/validate.sh +77 -0
  438. package/v3/assets/skills/verification-quality/SKILL.md +6 -0
  439. package/v3/assets/skills/verification-quality/evals/verification-quality.yaml +150 -0
  440. package/v3/assets/skills/verification-quality/schemas/output.json +432 -0
  441. package/v3/assets/skills/verification-quality/scripts/validate.sh +77 -0
  442. package/v3/assets/skills/visual-testing-advanced/SKILL.md +6 -0
  443. package/v3/assets/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +154 -0
  444. package/v3/assets/skills/visual-testing-advanced/schemas/output.json +294 -0
  445. package/v3/assets/skills/visual-testing-advanced/scripts/validate.sh +77 -0
  446. package/v3/assets/skills/xp-practices/SKILL.md +3 -0
  447. package/v3/assets/templates/validation-report.md.hbs +139 -0
  448. package/v3/assets/templates/validation-summary.json +56 -0
  449. package/v3/dist/cli/bundle.js +7368 -3418
  450. package/v3/dist/cli/commands/eval.d.ts +18 -0
  451. package/v3/dist/cli/commands/eval.d.ts.map +1 -0
  452. package/v3/dist/cli/commands/eval.js +505 -0
  453. package/v3/dist/cli/commands/eval.js.map +1 -0
  454. package/v3/dist/cli/commands/validate-swarm.d.ts +16 -0
  455. package/v3/dist/cli/commands/validate-swarm.d.ts.map +1 -0
  456. package/v3/dist/cli/commands/validate-swarm.js +251 -0
  457. package/v3/dist/cli/commands/validate-swarm.js.map +1 -0
  458. package/v3/dist/cli/commands/validate.d.ts +14 -0
  459. package/v3/dist/cli/commands/validate.d.ts.map +1 -0
  460. package/v3/dist/cli/commands/validate.js +408 -0
  461. package/v3/dist/cli/commands/validate.js.map +1 -0
  462. package/v3/dist/cli/index.js +6 -0
  463. package/v3/dist/cli/index.js.map +1 -1
  464. package/v3/dist/index.d.ts +2 -0
  465. package/v3/dist/index.d.ts.map +1 -1
  466. package/v3/dist/index.js +10 -0
  467. package/v3/dist/index.js.map +1 -1
  468. package/v3/dist/init/skills-installer.d.ts +6 -0
  469. package/v3/dist/init/skills-installer.d.ts.map +1 -1
  470. package/v3/dist/init/skills-installer.js +48 -0
  471. package/v3/dist/init/skills-installer.js.map +1 -1
  472. package/v3/dist/learning/index.d.ts +2 -0
  473. package/v3/dist/learning/index.d.ts.map +1 -1
  474. package/v3/dist/learning/index.js +4 -0
  475. package/v3/dist/learning/index.js.map +1 -1
  476. package/v3/dist/learning/skill-validation-learner.d.ts +264 -0
  477. package/v3/dist/learning/skill-validation-learner.d.ts.map +1 -0
  478. package/v3/dist/learning/skill-validation-learner.js +515 -0
  479. package/v3/dist/learning/skill-validation-learner.js.map +1 -0
  480. package/v3/dist/validation/index.d.ts +19 -0
  481. package/v3/dist/validation/index.d.ts.map +1 -0
  482. package/v3/dist/validation/index.js +31 -0
  483. package/v3/dist/validation/index.js.map +1 -0
  484. package/v3/dist/validation/parallel-eval-runner.d.ts +307 -0
  485. package/v3/dist/validation/parallel-eval-runner.d.ts.map +1 -0
  486. package/v3/dist/validation/parallel-eval-runner.js +566 -0
  487. package/v3/dist/validation/parallel-eval-runner.js.map +1 -0
  488. package/v3/dist/validation/swarm-skill-validator.d.ts +282 -0
  489. package/v3/dist/validation/swarm-skill-validator.d.ts.map +1 -0
  490. package/v3/dist/validation/swarm-skill-validator.js +460 -0
  491. package/v3/dist/validation/swarm-skill-validator.js.map +1 -0
  492. package/v3/dist/validation/validation-result-aggregator.d.ts +232 -0
  493. package/v3/dist/validation/validation-result-aggregator.d.ts.map +1 -0
  494. package/v3/dist/validation/validation-result-aggregator.js +630 -0
  495. package/v3/dist/validation/validation-result-aggregator.js.map +1 -0
  496. package/v3/package.json +1 -1
@@ -0,0 +1,1090 @@
1
+ #!/bin/bash
2
+ # =============================================================================
3
+ # AQE Skill Validator: performance-testing v1.0.0
4
+ # Validates performance testing skill output per ADR-056
5
+ # =============================================================================
6
+ #
7
+ # This validator checks:
8
+ # 1. JSON schema compliance (response time percentiles, throughput, error rates)
9
+ # 2. Required performance testing tools availability (k6, artillery, jmeter)
10
+ # 3. Performance metrics structure and validity
11
+ # 4. SLA compliance validation
12
+ # 5. Bottleneck identification structure
13
+ # 6. Percentile values are properly ordered (p50 <= p95 <= p99)
14
+ #
15
+ # Usage: ./validate.sh <output-file> [options]
16
+ #
17
+ # Options:
18
+ # --self-test Run validator self-test mode
19
+ # --verbose Enable verbose output
20
+ # --json Output results as JSON only
21
+ # --list-tools Show available validation tools
22
+ # --help Show this help message
23
+ #
24
+ # Exit Codes:
25
+ # 0 - Validation passed
26
+ # 1 - Validation failed
27
+ # 2 - Validation skipped (missing required tools)
28
+ #
29
+ # =============================================================================
30
+
31
+ set -euo pipefail
32
+
33
+ # Get script directory
34
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
35
+
36
+ # Navigate to skill directory and project root
37
+ # scripts/ -> performance-testing/ -> skills/ -> .claude/ -> project root
38
+ SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
39
+ PROJECT_ROOT="$(cd "$SKILL_DIR/../../.." && pwd)"
40
+
41
+ # Source validator library - check multiple locations
42
+ VALIDATOR_LIB=""
43
+ for lib_path in \
44
+ "$PROJECT_ROOT/.claude/skills/.validation/templates/validator-lib.sh" \
45
+ "$SKILL_DIR/scripts/validator-lib.sh" \
46
+ "$SCRIPT_DIR/validator-lib.sh"; do
47
+ if [[ -f "$lib_path" ]]; then
48
+ VALIDATOR_LIB="$lib_path"
49
+ break
50
+ fi
51
+ done
52
+
53
+ if [[ -n "$VALIDATOR_LIB" ]]; then
54
+ # shellcheck source=/dev/null
55
+ source "$VALIDATOR_LIB"
56
+ else
57
+ echo "ERROR: Validator library not found"
58
+ echo "Searched:"
59
+ echo " - $PROJECT_ROOT/.claude/skills/.validation/templates/validator-lib.sh"
60
+ echo " - $SKILL_DIR/scripts/validator-lib.sh"
61
+ echo " - $SCRIPT_DIR/validator-lib.sh"
62
+ exit 1
63
+ fi
64
+
65
+ # =============================================================================
66
+ # SKILL-SPECIFIC CONFIGURATION
67
+ # =============================================================================
68
+
69
+ # Skill name and version
70
+ SKILL_NAME="performance-testing"
71
+ SKILL_VERSION="1.0.0"
72
+
73
+ # Required tools (validation FAILS with exit 2 if missing)
74
+ # jq is essential for JSON parsing
75
+ REQUIRED_TOOLS=("jq")
76
+
77
+ # Optional tools (validation continues with warnings if missing)
78
+ # These enhance performance testing capabilities
79
+ OPTIONAL_TOOLS=("k6" "artillery" "jmeter" "node" "ajv" "jsonschema" "python3")
80
+
81
+ # Path to output JSON schema
82
+ SCHEMA_PATH="$SKILL_DIR/schemas/output.json"
83
+
84
+ # Path to sample test data for self-test
85
+ SAMPLE_OUTPUT_PATH="$PROJECT_ROOT/.claude/skills/.validation/examples/performance-testing-output.example.json"
86
+
87
+ # =============================================================================
88
+ # CONTENT VALIDATION CONFIGURATION
89
+ # =============================================================================
90
+
91
+ # Required fields in output
92
+ REQUIRED_FIELDS=("skillName" "status" "output" "output.summary" "output.testType" "output.metrics")
93
+
94
+ # Fields that must have non-null, non-empty values
95
+ REQUIRED_NON_EMPTY_FIELDS=("output.summary")
96
+
97
+ # Performance-specific terms that MUST appear in output
98
+ MUST_CONTAIN_TERMS=("response" "throughput")
99
+
100
+ # Terms that must NOT appear in output (indicates failure/hallucination)
101
+ MUST_NOT_CONTAIN_TERMS=("TODO" "placeholder" "FIXME")
102
+
103
+ # Enum validations
104
+ ENUM_VALIDATIONS=(
105
+ ".status:success,partial,failed,skipped"
106
+ ".output.testType:load,stress,endurance,spike,volume,scalability,smoke,soak"
107
+ )
108
+
109
+ # Minimum array lengths
110
+ MIN_ARRAY_LENGTHS=()
111
+
112
+ # =============================================================================
113
+ # Argument Parsing
114
+ # =============================================================================
115
+
116
+ OUTPUT_FILE=""
117
+ SELF_TEST=false
118
+ VERBOSE=false
119
+ JSON_ONLY=false
120
+ LIST_TOOLS=false
121
+
122
+ while [[ $# -gt 0 ]]; do
123
+ case "$1" in
124
+ --self-test)
125
+ SELF_TEST=true
126
+ shift
127
+ ;;
128
+ --verbose|-v)
129
+ VERBOSE=true
130
+ export AQE_DEBUG=1
131
+ shift
132
+ ;;
133
+ --json)
134
+ JSON_ONLY=true
135
+ shift
136
+ ;;
137
+ --list-tools)
138
+ LIST_TOOLS=true
139
+ shift
140
+ ;;
141
+ -h|--help)
142
+ cat << 'HELP_EOF'
143
+ AQE Performance Testing Skill Validator v1.0.0
144
+
145
+ Usage: ./validate.sh <output-file> [options]
146
+ ./validate.sh --self-test [--verbose]
147
+ ./validate.sh --list-tools
148
+
149
+ Arguments:
150
+ <output-file> Path to skill output JSON file to validate
151
+
152
+ Options:
153
+ --self-test Run validator self-test mode
154
+ --verbose, -v Enable verbose/debug output
155
+ --json Output results as JSON only (for CI integration)
156
+ --list-tools Show available validation tools and exit
157
+ --help, -h Show this help message
158
+
159
+ Exit Codes:
160
+ 0 - Validation passed
161
+ 1 - Validation failed
162
+ 2 - Validation skipped (missing required tools)
163
+
164
+ Performance Tool Requirements:
165
+ Required: jq (JSON parsing)
166
+ Optional: k6, artillery, jmeter (load testing tools)
167
+
168
+ Examples:
169
+ ./validate.sh perf-output.json # Validate output file
170
+ ./validate.sh perf-output.json --json # JSON output for CI
171
+ ./validate.sh --self-test --verbose # Self-test with debug
172
+ ./validate.sh --list-tools # Show available tools
173
+
174
+ HELP_EOF
175
+ exit 0
176
+ ;;
177
+ -*)
178
+ error "Unknown option: $1"
179
+ echo "Use --help for usage information"
180
+ exit 1
181
+ ;;
182
+ *)
183
+ OUTPUT_FILE="$1"
184
+ shift
185
+ ;;
186
+ esac
187
+ done
188
+
189
+ # Handle --list-tools mode
190
+ if [[ "$LIST_TOOLS" == "true" ]]; then
191
+ echo "=============================================="
192
+ echo "Available Validation Tools for $SKILL_NAME"
193
+ echo "=============================================="
194
+ echo ""
195
+ echo "Required tools (validation fails if missing):"
196
+ for tool in "${REQUIRED_TOOLS[@]}"; do
197
+ if command_exists "$tool"; then
198
+ version=$($tool --version 2>&1 | head -1 || echo "installed")
199
+ echo " [OK] $tool - $version"
200
+ else
201
+ echo " [MISSING] $tool"
202
+ fi
203
+ done
204
+ echo ""
205
+ echo "Optional tools (enhances validation):"
206
+ for tool in "${OPTIONAL_TOOLS[@]}"; do
207
+ if command_exists "$tool"; then
208
+ version=""
209
+ case "$tool" in
210
+ k6) version=$(k6 version 2>&1 | head -1 || echo "installed") ;;
211
+ artillery) version=$(artillery --version 2>&1 | head -1 || echo "installed") ;;
212
+ jmeter) version=$(jmeter --version 2>&1 | grep -oP 'Version.*' | head -1 || echo "installed") ;;
213
+ node) version=$(node --version 2>&1 | head -1 || echo "installed") ;;
214
+ python3) version=$(python3 --version 2>&1 | head -1 || echo "installed") ;;
215
+ *) version="installed" ;;
216
+ esac
217
+ echo " [OK] $tool - $version"
218
+ else
219
+ echo " [MISSING] $tool"
220
+ fi
221
+ done
222
+ echo ""
223
+ echo "Performance Testing Capabilities:"
224
+ if command_exists "k6"; then
225
+ echo " [OK] k6 - Modern JavaScript-based load testing"
226
+ else
227
+ echo " [MISSING] k6 - Install k6 for JavaScript-based load testing"
228
+ fi
229
+ if command_exists "artillery"; then
230
+ echo " [OK] artillery - YAML-based load testing"
231
+ else
232
+ echo " [MISSING] artillery - Install artillery for YAML-based testing"
233
+ fi
234
+ if command_exists "jmeter"; then
235
+ echo " [OK] jmeter - Enterprise Java-based load testing"
236
+ else
237
+ echo " [MISSING] jmeter - Install JMeter for enterprise testing"
238
+ fi
239
+ exit 0
240
+ fi
241
+
242
+ # =============================================================================
243
+ # Self-Test Mode
244
+ # =============================================================================
245
+
246
+ if [[ "$SELF_TEST" == "true" ]]; then
247
+ echo "=============================================="
248
+ info "Running $SKILL_NAME Validator Self-Test"
249
+ echo "=============================================="
250
+ echo ""
251
+ echo "Validator version: $AQE_VALIDATOR_VERSION"
252
+ echo "Skill version: $SKILL_VERSION"
253
+ echo ""
254
+
255
+ self_test_passed=true
256
+ self_test_warnings=0
257
+
258
+ # Step 1: Check Required Tools
259
+ echo "--- Step 1: Required Tools ---"
260
+ for tool in "${REQUIRED_TOOLS[@]}"; do
261
+ if command_exists "$tool"; then
262
+ success "Required tool available: $tool"
263
+ else
264
+ error "Required tool MISSING: $tool"
265
+ self_test_passed=false
266
+ fi
267
+ done
268
+ echo ""
269
+
270
+ # Step 2: Check Optional Performance Testing Tools
271
+ echo "--- Step 2: Performance Testing Tools ---"
272
+ perf_tools=("k6" "artillery" "jmeter")
273
+ available_perf=0
274
+ for tool in "${perf_tools[@]}"; do
275
+ if command_exists "$tool"; then
276
+ success "Performance tool available: $tool"
277
+ ((available_perf++)) || true
278
+ else
279
+ warn "Performance tool missing: $tool"
280
+ ((self_test_warnings++)) || true
281
+ fi
282
+ done
283
+
284
+ if [[ $available_perf -eq 0 ]]; then
285
+ warn "No performance testing tools available"
286
+ ((self_test_warnings++)) || true
287
+ fi
288
+ echo ""
289
+
290
+ # Step 3: Check Schema File
291
+ echo "--- Step 3: Schema File ---"
292
+ if [[ -f "$SCHEMA_PATH" ]]; then
293
+ success "Schema file exists: $SCHEMA_PATH"
294
+ if validate_json "$SCHEMA_PATH" 2>/dev/null; then
295
+ success "Schema file is valid JSON"
296
+
297
+ # Check for performance-specific schema elements
298
+ if grep -q "responseTime" "$SCHEMA_PATH" 2>/dev/null; then
299
+ success "Schema includes response time metrics"
300
+ else
301
+ warn "Schema may be missing response time definition"
302
+ ((self_test_warnings++)) || true
303
+ fi
304
+
305
+ if grep -q "throughput" "$SCHEMA_PATH" 2>/dev/null; then
306
+ success "Schema includes throughput metrics"
307
+ else
308
+ warn "Schema may be missing throughput definition"
309
+ ((self_test_warnings++)) || true
310
+ fi
311
+
312
+ if grep -q "p95" "$SCHEMA_PATH" 2>/dev/null; then
313
+ success "Schema includes percentile metrics"
314
+ else
315
+ warn "Schema may be missing percentile definitions"
316
+ ((self_test_warnings++)) || true
317
+ fi
318
+ else
319
+ error "Schema file is NOT valid JSON"
320
+ self_test_passed=false
321
+ fi
322
+ else
323
+ error "Schema file not found: $SCHEMA_PATH"
324
+ self_test_passed=false
325
+ fi
326
+ echo ""
327
+
328
+ # Step 4: Test with Sample Data
329
+ echo "--- Step 4: Sample Data Validation ---"
330
+ if [[ -f "$SAMPLE_OUTPUT_PATH" ]]; then
331
+ success "Sample output file exists"
332
+
333
+ if validate_json "$SAMPLE_OUTPUT_PATH" 2>/dev/null; then
334
+ success "Sample output is valid JSON"
335
+
336
+ # Test performance-specific validation
337
+ if validate_percentile_order "$SAMPLE_OUTPUT_PATH" 2>/dev/null; then
338
+ success "Sample output has valid percentile ordering"
339
+ else
340
+ warn "Sample output percentile validation issue"
341
+ ((self_test_warnings++)) || true
342
+ fi
343
+ else
344
+ error "Sample output is NOT valid JSON"
345
+ self_test_passed=false
346
+ fi
347
+ else
348
+ info "No sample output file found at: $SAMPLE_OUTPUT_PATH"
349
+ info "Skipping sample data validation"
350
+ fi
351
+ echo ""
352
+
353
+ # Step 5: Library Self-Test
354
+ echo "--- Step 5: Validator Library Self-Test ---"
355
+ if run_self_test 2>/dev/null; then
356
+ success "Library self-test passed"
357
+ else
358
+ error "Library self-test FAILED"
359
+ self_test_passed=false
360
+ fi
361
+ echo ""
362
+
363
+ # Summary
364
+ echo "=============================================="
365
+ echo "Self-Test Summary for $SKILL_NAME"
366
+ echo "=============================================="
367
+
368
+ if [[ "$self_test_passed" == "true" ]]; then
369
+ if [[ $self_test_warnings -gt 0 ]]; then
370
+ warn "Self-test PASSED with $self_test_warnings warning(s)"
371
+ exit 0
372
+ else
373
+ success "Self-test PASSED"
374
+ exit 0
375
+ fi
376
+ else
377
+ error "Self-test FAILED"
378
+ exit 1
379
+ fi
380
+ fi
381
+
382
+ # =============================================================================
383
+ # SKILL-SPECIFIC VALIDATION FUNCTIONS
384
+ # =============================================================================
385
+
386
+ # Validate percentile values are properly ordered (p50 <= p75 <= p90 <= p95 <= p99)
387
+ # Returns: 0 if valid, 1 if invalid
388
+ validate_percentile_order() {
389
+ local output_file="$1"
390
+
391
+ # Extract percentiles from response time metrics
392
+ local p50 p75 p90 p95 p99
393
+ p50=$(json_get "$output_file" ".output.metrics.responseTime.p50" 2>/dev/null)
394
+ p75=$(json_get "$output_file" ".output.metrics.responseTime.p75" 2>/dev/null)
395
+ p90=$(json_get "$output_file" ".output.metrics.responseTime.p90" 2>/dev/null)
396
+ p95=$(json_get "$output_file" ".output.metrics.responseTime.p95" 2>/dev/null)
397
+ p99=$(json_get "$output_file" ".output.metrics.responseTime.p99" 2>/dev/null)
398
+
399
+ # If no percentiles, skip validation
400
+ if [[ -z "$p50" ]] && [[ -z "$p95" ]] && [[ -z "$p99" ]]; then
401
+ debug "No percentile metrics found, skipping order validation"
402
+ return 0
403
+ fi
404
+
405
+ # Validate ordering where values exist
406
+ local has_errors=false
407
+
408
+ # Helper function to compare with null/empty handling
409
+ compare_percentiles() {
410
+ local lower="$1"
411
+ local higher="$2"
412
+ local lower_name="$3"
413
+ local higher_name="$4"
414
+
415
+ if [[ -n "$lower" ]] && [[ "$lower" != "null" ]] && \
416
+ [[ -n "$higher" ]] && [[ "$higher" != "null" ]]; then
417
+ if command_exists "bc"; then
418
+ if (( $(echo "$lower > $higher" | bc -l 2>/dev/null || echo "0") )); then
419
+ error "Percentile ordering violated: $lower_name ($lower) > $higher_name ($higher)"
420
+ return 1
421
+ fi
422
+ fi
423
+ fi
424
+ return 0
425
+ }
426
+
427
+ compare_percentiles "$p50" "$p75" "p50" "p75" || has_errors=true
428
+ compare_percentiles "$p75" "$p90" "p75" "p90" || has_errors=true
429
+ compare_percentiles "$p90" "$p95" "p90" "p95" || has_errors=true
430
+ compare_percentiles "$p95" "$p99" "p95" "p99" || has_errors=true
431
+
432
+ if [[ "$has_errors" == "true" ]]; then
433
+ return 1
434
+ fi
435
+
436
+ debug "Percentile ordering is valid"
437
+ return 0
438
+ }
439
+
440
+ # Validate throughput metrics have reasonable values
441
+ # Returns: 0 if valid, 1 if invalid
442
+ validate_throughput_metrics() {
443
+ local output_file="$1"
444
+
445
+ local rps total_requests successful_requests failed_requests
446
+ rps=$(json_get "$output_file" ".output.metrics.throughput.requestsPerSecond" 2>/dev/null)
447
+ total_requests=$(json_get "$output_file" ".output.metrics.throughput.totalRequests" 2>/dev/null)
448
+ successful_requests=$(json_get "$output_file" ".output.metrics.throughput.successfulRequests" 2>/dev/null)
449
+ failed_requests=$(json_get "$output_file" ".output.metrics.throughput.failedRequests" 2>/dev/null)
450
+
451
+ # Skip if no throughput data
452
+ if [[ -z "$total_requests" ]] || [[ "$total_requests" == "null" ]]; then
453
+ debug "No throughput data found, skipping throughput validation"
454
+ return 0
455
+ fi
456
+
457
+ # Validate total = successful + failed if both are present
458
+ if [[ -n "$successful_requests" ]] && [[ "$successful_requests" != "null" ]] && \
459
+ [[ -n "$failed_requests" ]] && [[ "$failed_requests" != "null" ]]; then
460
+ local calculated_total=$((successful_requests + failed_requests))
461
+ if [[ "$calculated_total" -ne "$total_requests" ]] && [[ "$total_requests" -gt 0 ]]; then
462
+ warn "Throughput inconsistency: successful ($successful_requests) + failed ($failed_requests) != total ($total_requests)"
463
+ # This is a warning, not an error
464
+ fi
465
+ fi
466
+
467
+ # Validate RPS is non-negative
468
+ if [[ -n "$rps" ]] && [[ "$rps" != "null" ]]; then
469
+ if command_exists "bc"; then
470
+ if (( $(echo "$rps < 0" | bc -l 2>/dev/null || echo "0") )); then
471
+ error "Invalid requests per second: $rps (must be >= 0)"
472
+ return 1
473
+ fi
474
+ fi
475
+ fi
476
+
477
+ debug "Throughput metrics validation passed"
478
+ return 0
479
+ }
480
+
481
+ # Validate error rate is within reasonable bounds
482
+ # Returns: 0 if valid, 1 if invalid
483
+ validate_error_rate() {
484
+ local output_file="$1"
485
+
486
+ local error_rate
487
+ error_rate=$(json_get "$output_file" ".output.metrics.errorRate.percentage" 2>/dev/null)
488
+
489
+ if [[ -z "$error_rate" ]] || [[ "$error_rate" == "null" ]]; then
490
+ debug "No error rate found, skipping error rate validation"
491
+ return 0
492
+ fi
493
+
494
+ # Validate error rate is between 0 and 100
495
+ if command_exists "bc"; then
496
+ if (( $(echo "$error_rate < 0 || $error_rate > 100" | bc -l 2>/dev/null || echo "0") )); then
497
+ error "Invalid error rate: $error_rate (must be 0-100)"
498
+ return 1
499
+ fi
500
+ fi
501
+
502
+ debug "Error rate validation passed: ${error_rate}%"
503
+ return 0
504
+ }
505
+
506
+ # Validate SLA compliance structure
507
+ # Returns: 0 if valid, 1 if invalid
508
+ validate_sla_compliance() {
509
+ local output_file="$1"
510
+
511
+ local sla_data
512
+ sla_data=$(json_get "$output_file" ".output.slaCompliance" 2>/dev/null)
513
+
514
+ if [[ -z "$sla_data" ]] || [[ "$sla_data" == "null" ]]; then
515
+ debug "No SLA compliance data found"
516
+ return 0
517
+ fi
518
+
519
+ # Check overallCompliant is boolean
520
+ local overall_compliant
521
+ overall_compliant=$(json_get "$output_file" ".output.slaCompliance.overallCompliant" 2>/dev/null)
522
+
523
+ if [[ -n "$overall_compliant" ]] && [[ "$overall_compliant" != "null" ]]; then
524
+ if [[ "$overall_compliant" != "true" ]] && [[ "$overall_compliant" != "false" ]]; then
525
+ error "Invalid overallCompliant value: $overall_compliant (must be boolean)"
526
+ return 1
527
+ fi
528
+ fi
529
+
530
+ # Validate thresholds if present
531
+ local threshold_count
532
+ threshold_count=$(json_count "$output_file" ".output.slaCompliance.thresholds" 2>/dev/null)
533
+
534
+ if [[ -n "$threshold_count" ]] && [[ "$threshold_count" != "null" ]] && [[ "$threshold_count" -gt 0 ]]; then
535
+ debug "Found $threshold_count SLA thresholds"
536
+
537
+ # Check first threshold has required fields
538
+ local first_metric first_passed
539
+ first_metric=$(json_get "$output_file" ".output.slaCompliance.thresholds[0].metric" 2>/dev/null)
540
+ first_passed=$(json_get "$output_file" ".output.slaCompliance.thresholds[0].passed" 2>/dev/null)
541
+
542
+ if [[ -z "$first_metric" ]] || [[ "$first_metric" == "null" ]]; then
543
+ warn "SLA threshold missing 'metric' field"
544
+ fi
545
+ fi
546
+
547
+ return 0
548
+ }
549
+
550
+ # Validate bottleneck structure
551
+ # Returns: 0 if valid, 1 if invalid
552
+ validate_bottlenecks() {
553
+ local output_file="$1"
554
+
555
+ local bottleneck_count
556
+ bottleneck_count=$(json_count "$output_file" ".output.bottlenecks" 2>/dev/null)
557
+
558
+ if [[ -z "$bottleneck_count" ]] || [[ "$bottleneck_count" == "null" ]]; then
559
+ bottleneck_count=0
560
+ fi
561
+
562
+ debug "Found $bottleneck_count bottlenecks"
563
+
564
+ if [[ "$bottleneck_count" -gt 0 ]]; then
565
+ # Validate first bottleneck structure
566
+ local first_id first_type first_severity
567
+ first_id=$(json_get "$output_file" ".output.bottlenecks[0].id" 2>/dev/null)
568
+ first_type=$(json_get "$output_file" ".output.bottlenecks[0].type" 2>/dev/null)
569
+ first_severity=$(json_get "$output_file" ".output.bottlenecks[0].severity" 2>/dev/null)
570
+
571
+ if [[ -z "$first_id" ]] || [[ "$first_id" == "null" ]]; then
572
+ error "Bottleneck missing 'id' field"
573
+ return 1
574
+ fi
575
+
576
+ if [[ -n "$first_severity" ]] && [[ "$first_severity" != "null" ]]; then
577
+ if ! validate_enum "$first_severity" "critical" "high" "medium" "low"; then
578
+ error "Bottleneck has invalid severity: $first_severity"
579
+ return 1
580
+ fi
581
+ fi
582
+
583
+ # Validate bottleneck type if present
584
+ if [[ -n "$first_type" ]] && [[ "$first_type" != "null" ]]; then
585
+ local valid_types=("cpu" "memory" "disk" "network" "database" "api" "cache" "queue" "thread-pool" "connection-pool" "external-service" "application" "other")
586
+ local type_valid=false
587
+ for vt in "${valid_types[@]}"; do
588
+ if [[ "$first_type" == "$vt" ]]; then
589
+ type_valid=true
590
+ break
591
+ fi
592
+ done
593
+ if [[ "$type_valid" == "false" ]]; then
594
+ warn "Bottleneck has non-standard type: $first_type"
595
+ fi
596
+ fi
597
+ fi
598
+
599
+ return 0
600
+ }
601
+
602
+ # Validate test configuration
603
+ # Returns: 0 if valid, 1 if invalid
604
+ validate_test_configuration() {
605
+ local output_file="$1"
606
+
607
+ local config_data
608
+ config_data=$(json_get "$output_file" ".output.testConfiguration" 2>/dev/null)
609
+
610
+ if [[ -z "$config_data" ]] || [[ "$config_data" == "null" ]]; then
611
+ debug "No test configuration found"
612
+ return 0
613
+ fi
614
+
615
+ # Validate tool if specified
616
+ local tool
617
+ tool=$(json_get "$output_file" ".output.testConfiguration.tool" 2>/dev/null)
618
+
619
+ if [[ -n "$tool" ]] && [[ "$tool" != "null" ]]; then
620
+ local valid_tools=("k6" "artillery" "jmeter" "gatling" "locust" "wrk" "ab" "vegeta" "custom")
621
+ local tool_valid=false
622
+ for vt in "${valid_tools[@]}"; do
623
+ if [[ "$tool" == "$vt" ]]; then
624
+ tool_valid=true
625
+ break
626
+ fi
627
+ done
628
+ if [[ "$tool_valid" == "false" ]]; then
629
+ warn "Non-standard performance testing tool: $tool"
630
+ fi
631
+ fi
632
+
633
+ # Validate duration is reasonable (not negative)
634
+ local duration
635
+ duration=$(json_get "$output_file" ".output.testConfiguration.duration" 2>/dev/null)
636
+
637
+ if [[ -n "$duration" ]] && [[ "$duration" != "null" ]]; then
638
+ if [[ "$duration" -lt 0 ]]; then
639
+ error "Invalid test duration: $duration (must be >= 0)"
640
+ return 1
641
+ fi
642
+ fi
643
+
644
+ return 0
645
+ }
646
+
647
+ # Main skill-specific validation function
648
+ # Returns: 0 if valid, 1 if invalid
649
+ validate_skill_specific() {
650
+ local output_file="$1"
651
+ local has_errors=false
652
+
653
+ debug "Running performance-testing specific validations..."
654
+
655
+ # Validate percentile ordering
656
+ if ! validate_percentile_order "$output_file"; then
657
+ has_errors=true
658
+ else
659
+ success "Percentile ordering validation passed"
660
+ fi
661
+
662
+ # Validate throughput metrics
663
+ if ! validate_throughput_metrics "$output_file"; then
664
+ has_errors=true
665
+ else
666
+ success "Throughput metrics validation passed"
667
+ fi
668
+
669
+ # Validate error rate
670
+ if ! validate_error_rate "$output_file"; then
671
+ has_errors=true
672
+ else
673
+ success "Error rate validation passed"
674
+ fi
675
+
676
+ # Validate SLA compliance
677
+ if ! validate_sla_compliance "$output_file"; then
678
+ has_errors=true
679
+ else
680
+ success "SLA compliance validation passed"
681
+ fi
682
+
683
+ # Validate bottlenecks
684
+ if ! validate_bottlenecks "$output_file"; then
685
+ has_errors=true
686
+ else
687
+ success "Bottleneck validation passed"
688
+ fi
689
+
690
+ # Validate test configuration
691
+ if ! validate_test_configuration "$output_file"; then
692
+ has_errors=true
693
+ else
694
+ success "Test configuration validation passed"
695
+ fi
696
+
697
+ # Check for performance tool attribution
698
+ local tools_used
699
+ tools_used=$(json_get "$output_file" ".metadata.toolsUsed" 2>/dev/null)
700
+ if [[ -z "$tools_used" ]] || [[ "$tools_used" == "null" ]] || [[ "$tools_used" == "[]" ]]; then
701
+ warn "No performance tools listed in metadata.toolsUsed"
702
+ else
703
+ debug "Performance tools used: $tools_used"
704
+ fi
705
+
706
+ if [[ "$has_errors" == "true" ]]; then
707
+ return 1
708
+ fi
709
+
710
+ return 0
711
+ }
712
+
713
+ # =============================================================================
714
+ # Validation Functions (Override base template as needed)
715
+ # =============================================================================
716
+
717
+ validate_tools() {
718
+ if [[ ${#REQUIRED_TOOLS[@]} -eq 0 ]]; then
719
+ debug "No required tools specified"
720
+ return 0
721
+ fi
722
+
723
+ local missing=()
724
+ for tool in "${REQUIRED_TOOLS[@]}"; do
725
+ if ! command_exists "$tool"; then
726
+ missing+=("$tool")
727
+ fi
728
+ done
729
+
730
+ if [[ ${#missing[@]} -gt 0 ]]; then
731
+ error "Missing required tools: ${missing[*]}"
732
+ return 1
733
+ fi
734
+
735
+ debug "All required tools available"
736
+ return 0
737
+ }
738
+
739
+ validate_schema() {
740
+ local output_file="$1"
741
+
742
+ if [[ -z "$SCHEMA_PATH" ]]; then
743
+ debug "No schema path configured, skipping schema validation"
744
+ return 2
745
+ fi
746
+
747
+ if [[ ! -f "$SCHEMA_PATH" ]]; then
748
+ warn "Schema file not found: $SCHEMA_PATH"
749
+ return 2
750
+ fi
751
+
752
+ debug "Validating against schema: $SCHEMA_PATH"
753
+
754
+ local result
755
+ result=$(validate_json_schema "$SCHEMA_PATH" "$output_file" 2>&1)
756
+ local status=$?
757
+
758
+ case $status in
759
+ 0)
760
+ success "Schema validation passed"
761
+ return 0
762
+ ;;
763
+ 1)
764
+ error "Schema validation failed"
765
+ if [[ "$VERBOSE" == "true" ]]; then
766
+ echo "$result" | while read -r line; do
767
+ echo " $line"
768
+ done
769
+ fi
770
+ return 1
771
+ ;;
772
+ 2)
773
+ warn "Schema validation skipped (no validator available)"
774
+ return 2
775
+ ;;
776
+ esac
777
+ }
778
+
779
+ validate_required_fields() {
780
+ local output_file="$1"
781
+ local missing=()
782
+ local empty=()
783
+
784
+ for field in "${REQUIRED_FIELDS[@]}"; do
785
+ local value
786
+ value=$(json_get "$output_file" ".$field" 2>/dev/null)
787
+ if [[ -z "$value" ]] || [[ "$value" == "null" ]]; then
788
+ missing+=("$field")
789
+ fi
790
+ done
791
+
792
+ for field in "${REQUIRED_NON_EMPTY_FIELDS[@]}"; do
793
+ local value
794
+ value=$(json_get "$output_file" ".$field" 2>/dev/null)
795
+ if [[ -z "$value" ]] || [[ "$value" == "null" ]] || [[ "$value" == "" ]] || [[ "$value" == "[]" ]] || [[ "$value" == "{}" ]]; then
796
+ empty+=("$field")
797
+ fi
798
+ done
799
+
800
+ local has_errors=false
801
+
802
+ if [[ ${#missing[@]} -gt 0 ]]; then
803
+ error "Missing required fields: ${missing[*]}"
804
+ has_errors=true
805
+ fi
806
+
807
+ if [[ ${#empty[@]} -gt 0 ]]; then
808
+ error "Empty required fields: ${empty[*]}"
809
+ has_errors=true
810
+ fi
811
+
812
+ if [[ "$has_errors" == "true" ]]; then
813
+ return 1
814
+ fi
815
+
816
+ success "All required fields present and valid"
817
+ return 0
818
+ }
819
+
820
+ validate_enum_fields() {
821
+ local output_file="$1"
822
+
823
+ if [[ ${#ENUM_VALIDATIONS[@]} -eq 0 ]]; then
824
+ return 0
825
+ fi
826
+
827
+ local has_errors=false
828
+
829
+ for validation in "${ENUM_VALIDATIONS[@]}"; do
830
+ local field_path="${validation%%:*}"
831
+ local allowed_values="${validation#*:}"
832
+
833
+ local actual_value
834
+ actual_value=$(json_get "$output_file" "$field_path" 2>/dev/null)
835
+
836
+ if [[ -z "$actual_value" ]] || [[ "$actual_value" == "null" ]]; then
837
+ continue
838
+ fi
839
+
840
+ local found=false
841
+ IFS=',' read -ra allowed_array <<< "$allowed_values"
842
+ for allowed in "${allowed_array[@]}"; do
843
+ if [[ "$actual_value" == "$allowed" ]]; then
844
+ found=true
845
+ break
846
+ fi
847
+ done
848
+
849
+ if [[ "$found" == "false" ]]; then
850
+ error "Invalid value for $field_path: '$actual_value' (allowed: $allowed_values)"
851
+ has_errors=true
852
+ fi
853
+ done
854
+
855
+ if [[ "$has_errors" == "true" ]]; then
856
+ return 1
857
+ fi
858
+
859
+ success "All enum fields have valid values"
860
+ return 0
861
+ }
862
+
863
+ validate_content_terms() {
864
+ local output_file="$1"
865
+ local content
866
+ content=$(cat "$output_file")
867
+
868
+ local has_errors=false
869
+
870
+ if [[ ${#MUST_CONTAIN_TERMS[@]} -gt 0 ]]; then
871
+ local missing_terms=()
872
+ for term in "${MUST_CONTAIN_TERMS[@]}"; do
873
+ if ! grep -qi "$term" <<< "$content"; then
874
+ missing_terms+=("$term")
875
+ fi
876
+ done
877
+
878
+ if [[ ${#missing_terms[@]} -gt 0 ]]; then
879
+ error "Output missing required performance terms: ${missing_terms[*]}"
880
+ has_errors=true
881
+ else
882
+ success "All required performance terms found"
883
+ fi
884
+ fi
885
+
886
+ if [[ ${#MUST_NOT_CONTAIN_TERMS[@]} -gt 0 ]]; then
887
+ local found_forbidden=()
888
+ for term in "${MUST_NOT_CONTAIN_TERMS[@]}"; do
889
+ if grep -qi "$term" <<< "$content"; then
890
+ found_forbidden+=("$term")
891
+ fi
892
+ done
893
+
894
+ if [[ ${#found_forbidden[@]} -gt 0 ]]; then
895
+ error "Output contains forbidden terms: ${found_forbidden[*]}"
896
+ has_errors=true
897
+ else
898
+ success "No forbidden terms found"
899
+ fi
900
+ fi
901
+
902
+ if [[ "$has_errors" == "true" ]]; then
903
+ return 1
904
+ fi
905
+
906
+ return 0
907
+ }
908
+
909
+ # =============================================================================
910
+ # Main Validation Flow
911
+ # =============================================================================
912
+
913
+ main() {
914
+ if [[ -z "$OUTPUT_FILE" ]]; then
915
+ error "No output file specified"
916
+ echo "Usage: $0 <output-file> [options]"
917
+ echo "Use --help for more information"
918
+ exit 1
919
+ fi
920
+
921
+ if [[ ! -f "$OUTPUT_FILE" ]]; then
922
+ error "Output file not found: $OUTPUT_FILE"
923
+ exit 1
924
+ fi
925
+
926
+ if [[ "$JSON_ONLY" != "true" ]]; then
927
+ echo "=============================================="
928
+ info "Validating $SKILL_NAME Output"
929
+ echo "=============================================="
930
+ echo ""
931
+ echo " Skill: $SKILL_NAME v$SKILL_VERSION"
932
+ echo " File: $OUTPUT_FILE"
933
+ echo " Schema: ${SCHEMA_PATH:-none}"
934
+ echo ""
935
+ fi
936
+
937
+ # Track validation status
938
+ local tool_status="passed"
939
+ local json_status="passed"
940
+ local schema_status="passed"
941
+ local fields_status="passed"
942
+ local enums_status="passed"
943
+ local content_status="passed"
944
+ local specific_status="passed"
945
+ local error_count=0
946
+ local warning_count=0
947
+
948
+ # Step 1: Check Required Tools
949
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 1: Tool Availability ---"
950
+
951
+ if ! validate_tools; then
952
+ tool_status="failed"
953
+ ((error_count++)) || true
954
+ if [[ "$JSON_ONLY" == "true" ]]; then
955
+ output_validation_report "$SKILL_NAME" "skipped" "skipped" "failed"
956
+ fi
957
+ exit $EXIT_SKIP
958
+ fi
959
+
960
+ [[ "$JSON_ONLY" != "true" ]] && success "Tool check passed" && echo ""
961
+
962
+ # Step 2: Validate JSON Syntax
963
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 2: JSON Syntax ---"
964
+
965
+ if ! validate_json "$OUTPUT_FILE"; then
966
+ json_status="failed"
967
+ ((error_count++)) || true
968
+ [[ "$JSON_ONLY" != "true" ]] && error "File is not valid JSON"
969
+ if [[ "$JSON_ONLY" == "true" ]]; then
970
+ output_validation_report "$SKILL_NAME" "failed" "failed" "$tool_status"
971
+ fi
972
+ exit $EXIT_FAIL
973
+ fi
974
+
975
+ [[ "$JSON_ONLY" != "true" ]] && success "JSON syntax valid" && echo ""
976
+
977
+ # Step 3: Validate Against Schema
978
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 3: Schema Validation ---"
979
+
980
+ local schema_exit_code
981
+ validate_schema "$OUTPUT_FILE" && schema_exit_code=0 || schema_exit_code=$?
982
+
983
+ case $schema_exit_code in
984
+ 0) [[ "$JSON_ONLY" != "true" ]] && echo "" ;;
985
+ 1) schema_status="failed"; ((error_count++)) || true; [[ "$JSON_ONLY" != "true" ]] && echo "" ;;
986
+ 2) schema_status="skipped"; ((warning_count++)) || true; [[ "$JSON_ONLY" != "true" ]] && echo "" ;;
987
+ esac
988
+
989
+ # Step 4: Validate Required Fields
990
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 4: Required Fields ---"
991
+
992
+ if ! validate_required_fields "$OUTPUT_FILE"; then
993
+ fields_status="failed"
994
+ ((error_count++)) || true
995
+ fi
996
+
997
+ [[ "$JSON_ONLY" != "true" ]] && echo ""
998
+
999
+ # Step 5: Validate Enum Values
1000
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 5: Enum Validation ---"
1001
+
1002
+ if ! validate_enum_fields "$OUTPUT_FILE"; then
1003
+ enums_status="failed"
1004
+ ((error_count++)) || true
1005
+ fi
1006
+
1007
+ [[ "$JSON_ONLY" != "true" ]] && echo ""
1008
+
1009
+ # Step 6: Validate Performance Content Terms
1010
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 6: Performance Content Terms ---"
1011
+
1012
+ if ! validate_content_terms "$OUTPUT_FILE"; then
1013
+ content_status="failed"
1014
+ ((error_count++)) || true
1015
+ fi
1016
+
1017
+ [[ "$JSON_ONLY" != "true" ]] && echo ""
1018
+
1019
+ # Step 7: Performance-Specific Validation
1020
+ [[ "$JSON_ONLY" != "true" ]] && echo "--- Step 7: Performance-Specific Validation ---"
1021
+
1022
+ if ! validate_skill_specific "$OUTPUT_FILE"; then
1023
+ specific_status="failed"
1024
+ ((error_count++)) || true
1025
+ fi
1026
+
1027
+ [[ "$JSON_ONLY" != "true" ]] && echo ""
1028
+
1029
+ # Determine Overall Status
1030
+ local overall_status="passed"
1031
+ local content_overall="passed"
1032
+
1033
+ if [[ "$fields_status" == "failed" ]] || \
1034
+ [[ "$enums_status" == "failed" ]] || \
1035
+ [[ "$content_status" == "failed" ]] || \
1036
+ [[ "$specific_status" == "failed" ]]; then
1037
+ content_overall="failed"
1038
+ fi
1039
+
1040
+ if [[ "$json_status" == "failed" ]] || \
1041
+ [[ "$schema_status" == "failed" ]] || \
1042
+ [[ "$content_overall" == "failed" ]]; then
1043
+ overall_status="failed"
1044
+ elif [[ "$schema_status" == "skipped" ]]; then
1045
+ overall_status="partial"
1046
+ fi
1047
+
1048
+ # Output Results
1049
+ if [[ "$JSON_ONLY" == "true" ]]; then
1050
+ output_validation_report "$SKILL_NAME" "$schema_status" "$content_overall" "$tool_status"
1051
+ else
1052
+ echo "=============================================="
1053
+ echo "Validation Summary for $SKILL_NAME"
1054
+ echo "=============================================="
1055
+ echo ""
1056
+ echo " Tools: $tool_status"
1057
+ echo " JSON Syntax: $json_status"
1058
+ echo " Schema: $schema_status"
1059
+ echo " Required Fields: $fields_status"
1060
+ echo " Enum Values: $enums_status"
1061
+ echo " Content Terms: $content_status"
1062
+ echo " Performance-Specific: $specific_status"
1063
+ echo ""
1064
+ echo " ------------------------------"
1065
+ echo " Overall: $overall_status"
1066
+ echo " Errors: $error_count"
1067
+ echo " Warnings: $warning_count"
1068
+ echo "=============================================="
1069
+ echo ""
1070
+ fi
1071
+
1072
+ # Exit with appropriate code
1073
+ case "$overall_status" in
1074
+ "passed")
1075
+ [[ "$JSON_ONLY" != "true" ]] && success "Validation PASSED"
1076
+ exit $EXIT_PASS
1077
+ ;;
1078
+ "partial")
1079
+ [[ "$JSON_ONLY" != "true" ]] && warn "Validation PARTIAL (some checks skipped)"
1080
+ exit $EXIT_PASS
1081
+ ;;
1082
+ "failed")
1083
+ [[ "$JSON_ONLY" != "true" ]] && error "Validation FAILED"
1084
+ exit $EXIT_FAIL
1085
+ ;;
1086
+ esac
1087
+ }
1088
+
1089
+ # Run main function
1090
+ main