ma-agents 3.4.7 → 3.4.8

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 (575) hide show
  1. package/.opencode/skills/.ma-agents.json +48 -167
  2. package/.opencode/skills/MANIFEST.yaml +0 -128
  3. package/.opencode/skills/add-sprint/.gitkeep +0 -0
  4. package/.opencode/skills/add-sprint/SKILL.md +207 -0
  5. package/.opencode/skills/add-sprint/bmad-skill-manifest.yaml +3 -0
  6. package/.opencode/skills/add-to-sprint/.gitkeep +0 -0
  7. package/.opencode/skills/add-to-sprint/SKILL.md +189 -0
  8. package/.opencode/skills/add-to-sprint/bmad-skill-manifest.yaml +3 -0
  9. package/.opencode/skills/bmad-advanced-elicitation/SKILL.md +137 -0
  10. package/.opencode/skills/bmad-advanced-elicitation/methods.csv +51 -0
  11. package/.opencode/skills/bmad-agent-analyst/SKILL.md +56 -0
  12. package/.opencode/skills/bmad-agent-analyst/bmad-skill-manifest.yaml +11 -0
  13. package/.opencode/skills/bmad-agent-architect/SKILL.md +52 -0
  14. package/.opencode/skills/bmad-agent-architect/bmad-skill-manifest.yaml +11 -0
  15. package/.opencode/skills/bmad-agent-dev/SKILL.md +62 -0
  16. package/.opencode/skills/bmad-agent-dev/bmad-skill-manifest.yaml +11 -0
  17. package/.opencode/skills/bmad-agent-pm/SKILL.md +57 -0
  18. package/.opencode/skills/bmad-agent-pm/bmad-skill-manifest.yaml +11 -0
  19. package/.opencode/skills/bmad-agent-qa/SKILL.md +59 -0
  20. package/.opencode/skills/bmad-agent-qa/bmad-skill-manifest.yaml +11 -0
  21. package/.opencode/skills/bmad-agent-quick-flow-solo-dev/SKILL.md +51 -0
  22. package/.opencode/skills/bmad-agent-quick-flow-solo-dev/bmad-skill-manifest.yaml +11 -0
  23. package/.opencode/skills/bmad-agent-sm/SKILL.md +53 -0
  24. package/.opencode/skills/bmad-agent-sm/bmad-skill-manifest.yaml +11 -0
  25. package/.opencode/skills/bmad-agent-tech-writer/SKILL.md +55 -0
  26. package/.opencode/skills/bmad-agent-tech-writer/bmad-skill-manifest.yaml +11 -0
  27. package/.opencode/skills/bmad-agent-tech-writer/explain-concept.md +20 -0
  28. package/.opencode/skills/bmad-agent-tech-writer/mermaid-gen.md +20 -0
  29. package/.opencode/skills/bmad-agent-tech-writer/validate-doc.md +19 -0
  30. package/.opencode/skills/bmad-agent-tech-writer/write-document.md +20 -0
  31. package/.opencode/skills/bmad-agent-ux-designer/SKILL.md +53 -0
  32. package/.opencode/skills/bmad-agent-ux-designer/bmad-skill-manifest.yaml +11 -0
  33. package/.opencode/skills/bmad-brainstorming/SKILL.md +6 -0
  34. package/.opencode/skills/bmad-brainstorming/brain-methods.csv +62 -0
  35. package/.opencode/skills/bmad-brainstorming/steps/step-01-session-setup.md +214 -0
  36. package/.opencode/skills/bmad-brainstorming/steps/step-01b-continue.md +124 -0
  37. package/.opencode/skills/bmad-brainstorming/steps/step-02a-user-selected.md +229 -0
  38. package/.opencode/skills/bmad-brainstorming/steps/step-02b-ai-recommended.md +239 -0
  39. package/.opencode/skills/bmad-brainstorming/steps/step-02c-random-selection.md +211 -0
  40. package/.opencode/skills/bmad-brainstorming/steps/step-02d-progressive-flow.md +266 -0
  41. package/.opencode/skills/bmad-brainstorming/steps/step-03-technique-execution.md +401 -0
  42. package/.opencode/skills/bmad-brainstorming/steps/step-04-idea-organization.md +305 -0
  43. package/.opencode/skills/bmad-brainstorming/template.md +15 -0
  44. package/.opencode/skills/bmad-brainstorming/workflow.md +53 -0
  45. package/.opencode/skills/bmad-check-implementation-readiness/SKILL.md +6 -0
  46. package/.opencode/skills/bmad-check-implementation-readiness/steps/step-01-document-discovery.md +179 -0
  47. package/.opencode/skills/bmad-check-implementation-readiness/steps/step-02-prd-analysis.md +168 -0
  48. package/.opencode/skills/bmad-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +169 -0
  49. package/.opencode/skills/bmad-check-implementation-readiness/steps/step-04-ux-alignment.md +129 -0
  50. package/.opencode/skills/bmad-check-implementation-readiness/steps/step-05-epic-quality-review.md +241 -0
  51. package/.opencode/skills/bmad-check-implementation-readiness/steps/step-06-final-assessment.md +126 -0
  52. package/.opencode/skills/bmad-check-implementation-readiness/templates/readiness-report-template.md +4 -0
  53. package/.opencode/skills/bmad-check-implementation-readiness/workflow.md +49 -0
  54. package/.opencode/skills/bmad-cis-design-thinking/SKILL.md +6 -0
  55. package/.opencode/skills/bmad-cis-design-thinking/bmad-skill-manifest.yaml +1 -0
  56. package/.opencode/skills/bmad-cis-design-thinking/design-methods.csv +31 -0
  57. package/.opencode/skills/bmad-cis-design-thinking/template.md +111 -0
  58. package/.opencode/skills/bmad-cis-design-thinking/workflow.md +242 -0
  59. package/.opencode/skills/bmad-cis-innovation-strategy/SKILL.md +6 -0
  60. package/.opencode/skills/bmad-cis-innovation-strategy/bmad-skill-manifest.yaml +1 -0
  61. package/.opencode/skills/bmad-cis-innovation-strategy/innovation-frameworks.csv +31 -0
  62. package/.opencode/skills/bmad-cis-innovation-strategy/template.md +189 -0
  63. package/.opencode/skills/bmad-cis-innovation-strategy/workflow.md +315 -0
  64. package/.opencode/skills/bmad-cis-problem-solving/SKILL.md +6 -0
  65. package/.opencode/skills/bmad-cis-problem-solving/bmad-skill-manifest.yaml +1 -0
  66. package/.opencode/skills/bmad-cis-problem-solving/solving-methods.csv +31 -0
  67. package/.opencode/skills/bmad-cis-problem-solving/template.md +165 -0
  68. package/.opencode/skills/bmad-cis-problem-solving/workflow.md +291 -0
  69. package/.opencode/skills/bmad-cis-storytelling/SKILL.md +6 -0
  70. package/.opencode/skills/bmad-cis-storytelling/bmad-skill-manifest.yaml +1 -0
  71. package/.opencode/skills/bmad-cis-storytelling/story-types.csv +26 -0
  72. package/.opencode/skills/bmad-cis-storytelling/template.md +113 -0
  73. package/.opencode/skills/bmad-cis-storytelling/workflow.md +321 -0
  74. package/.opencode/skills/bmad-code-review/SKILL.md +6 -0
  75. package/.opencode/skills/bmad-code-review/steps/step-01-gather-context.md +62 -0
  76. package/.opencode/skills/bmad-code-review/steps/step-02-review.md +34 -0
  77. package/.opencode/skills/bmad-code-review/steps/step-03-triage.md +49 -0
  78. package/.opencode/skills/bmad-code-review/steps/step-04-present.md +129 -0
  79. package/.opencode/skills/bmad-code-review/workflow.md +55 -0
  80. package/.opencode/skills/bmad-correct-course/SKILL.md +6 -0
  81. package/.opencode/skills/bmad-correct-course/checklist.md +288 -0
  82. package/.opencode/skills/bmad-correct-course/workflow.md +267 -0
  83. package/.opencode/skills/bmad-create-architecture/SKILL.md +6 -0
  84. package/.opencode/skills/bmad-create-architecture/architecture-decision-template.md +12 -0
  85. package/.opencode/skills/bmad-create-architecture/data/domain-complexity.csv +13 -0
  86. package/.opencode/skills/bmad-create-architecture/data/project-types.csv +7 -0
  87. package/.opencode/skills/bmad-create-architecture/steps/step-01-init.md +153 -0
  88. package/.opencode/skills/bmad-create-architecture/steps/step-01b-continue.md +173 -0
  89. package/.opencode/skills/bmad-create-architecture/steps/step-02-context.md +224 -0
  90. package/.opencode/skills/bmad-create-architecture/steps/step-03-starter.md +329 -0
  91. package/.opencode/skills/bmad-create-architecture/steps/step-04-decisions.md +318 -0
  92. package/.opencode/skills/bmad-create-architecture/steps/step-05-patterns.md +359 -0
  93. package/.opencode/skills/bmad-create-architecture/steps/step-06-structure.md +379 -0
  94. package/.opencode/skills/bmad-create-architecture/steps/step-07-validation.md +359 -0
  95. package/.opencode/skills/bmad-create-architecture/steps/step-08-complete.md +76 -0
  96. package/.opencode/skills/bmad-create-architecture/workflow.md +38 -0
  97. package/.opencode/skills/bmad-create-epics-and-stories/SKILL.md +6 -0
  98. package/.opencode/skills/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +255 -0
  99. package/.opencode/skills/bmad-create-epics-and-stories/steps/step-02-design-epics.md +212 -0
  100. package/.opencode/skills/bmad-create-epics-and-stories/steps/step-03-create-stories.md +255 -0
  101. package/.opencode/skills/bmad-create-epics-and-stories/steps/step-04-final-validation.md +131 -0
  102. package/.opencode/skills/bmad-create-epics-and-stories/templates/epics-template.md +61 -0
  103. package/.opencode/skills/bmad-create-epics-and-stories/workflow.md +53 -0
  104. package/.opencode/skills/bmad-create-prd/SKILL.md +6 -0
  105. package/.opencode/skills/bmad-create-prd/data/domain-complexity.csv +15 -0
  106. package/.opencode/skills/bmad-create-prd/data/prd-purpose.md +197 -0
  107. package/.opencode/skills/bmad-create-prd/data/project-types.csv +11 -0
  108. package/.opencode/skills/bmad-create-prd/steps-c/step-01-init.md +178 -0
  109. package/.opencode/skills/bmad-create-prd/steps-c/step-01b-continue.md +161 -0
  110. package/.opencode/skills/bmad-create-prd/steps-c/step-02-discovery.md +208 -0
  111. package/.opencode/skills/bmad-create-prd/steps-c/step-02b-vision.md +142 -0
  112. package/.opencode/skills/bmad-create-prd/steps-c/step-02c-executive-summary.md +158 -0
  113. package/.opencode/skills/bmad-create-prd/steps-c/step-03-success.md +214 -0
  114. package/.opencode/skills/bmad-create-prd/steps-c/step-04-journeys.md +201 -0
  115. package/.opencode/skills/bmad-create-prd/steps-c/step-05-domain.md +194 -0
  116. package/.opencode/skills/bmad-create-prd/steps-c/step-06-innovation.md +211 -0
  117. package/.opencode/skills/bmad-create-prd/steps-c/step-07-project-type.md +222 -0
  118. package/.opencode/skills/bmad-create-prd/steps-c/step-08-scoping.md +216 -0
  119. package/.opencode/skills/bmad-create-prd/steps-c/step-09-functional.md +219 -0
  120. package/.opencode/skills/bmad-create-prd/steps-c/step-10-nonfunctional.md +230 -0
  121. package/.opencode/skills/bmad-create-prd/steps-c/step-11-polish.md +221 -0
  122. package/.opencode/skills/bmad-create-prd/steps-c/step-12-complete.md +115 -0
  123. package/.opencode/skills/bmad-create-prd/templates/prd-template.md +10 -0
  124. package/.opencode/skills/bmad-create-prd/workflow.md +62 -0
  125. package/.opencode/skills/bmad-create-story/SKILL.md +6 -0
  126. package/.opencode/skills/bmad-create-story/checklist.md +357 -0
  127. package/.opencode/skills/bmad-create-story/discover-inputs.md +88 -0
  128. package/.opencode/skills/bmad-create-story/template.md +49 -0
  129. package/.opencode/skills/bmad-create-story/workflow.md +380 -0
  130. package/.opencode/skills/bmad-create-ux-design/SKILL.md +6 -0
  131. package/.opencode/skills/bmad-create-ux-design/steps/step-01-init.md +135 -0
  132. package/.opencode/skills/bmad-create-ux-design/steps/step-01b-continue.md +127 -0
  133. package/.opencode/skills/bmad-create-ux-design/steps/step-02-discovery.md +190 -0
  134. package/.opencode/skills/bmad-create-ux-design/steps/step-03-core-experience.md +217 -0
  135. package/.opencode/skills/bmad-create-ux-design/steps/step-04-emotional-response.md +220 -0
  136. package/.opencode/skills/bmad-create-ux-design/steps/step-05-inspiration.md +235 -0
  137. package/.opencode/skills/bmad-create-ux-design/steps/step-06-design-system.md +253 -0
  138. package/.opencode/skills/bmad-create-ux-design/steps/step-07-defining-experience.md +255 -0
  139. package/.opencode/skills/bmad-create-ux-design/steps/step-08-visual-foundation.md +225 -0
  140. package/.opencode/skills/bmad-create-ux-design/steps/step-09-design-directions.md +225 -0
  141. package/.opencode/skills/bmad-create-ux-design/steps/step-10-user-journeys.md +242 -0
  142. package/.opencode/skills/bmad-create-ux-design/steps/step-11-component-strategy.md +249 -0
  143. package/.opencode/skills/bmad-create-ux-design/steps/step-12-ux-patterns.md +238 -0
  144. package/.opencode/skills/bmad-create-ux-design/steps/step-13-responsive-accessibility.md +265 -0
  145. package/.opencode/skills/bmad-create-ux-design/steps/step-14-complete.md +171 -0
  146. package/.opencode/skills/bmad-create-ux-design/ux-design-template.md +13 -0
  147. package/.opencode/skills/bmad-create-ux-design/workflow.md +36 -0
  148. package/.opencode/skills/bmad-dev-story/SKILL.md +6 -0
  149. package/.opencode/skills/bmad-dev-story/checklist.md +80 -0
  150. package/.opencode/skills/bmad-dev-story/workflow.md +450 -0
  151. package/.opencode/skills/bmad-distillator/SKILL.md +178 -0
  152. package/.opencode/skills/bmad-distillator/agents/distillate-compressor.md +116 -0
  153. package/.opencode/skills/bmad-distillator/agents/round-trip-reconstructor.md +68 -0
  154. package/.opencode/skills/bmad-distillator/resources/compression-rules.md +51 -0
  155. package/.opencode/skills/bmad-distillator/resources/distillate-format-reference.md +227 -0
  156. package/.opencode/skills/bmad-distillator/resources/splitting-strategy.md +78 -0
  157. package/.opencode/skills/bmad-distillator/scripts/analyze_sources.py +300 -0
  158. package/.opencode/skills/bmad-distillator/scripts/tests/test_analyze_sources.py +204 -0
  159. package/.opencode/skills/bmad-document-project/SKILL.md +6 -0
  160. package/.opencode/skills/bmad-document-project/checklist.md +245 -0
  161. package/.opencode/skills/bmad-document-project/documentation-requirements.csv +12 -0
  162. package/.opencode/skills/bmad-document-project/instructions.md +128 -0
  163. package/.opencode/skills/bmad-document-project/templates/deep-dive-template.md +345 -0
  164. package/.opencode/skills/bmad-document-project/templates/index-template.md +169 -0
  165. package/.opencode/skills/bmad-document-project/templates/project-overview-template.md +103 -0
  166. package/.opencode/skills/bmad-document-project/templates/project-scan-report-schema.json +160 -0
  167. package/.opencode/skills/bmad-document-project/templates/source-tree-template.md +135 -0
  168. package/.opencode/skills/bmad-document-project/workflow.md +27 -0
  169. package/.opencode/skills/bmad-document-project/workflows/deep-dive-instructions.md +299 -0
  170. package/.opencode/skills/bmad-document-project/workflows/deep-dive-workflow.md +34 -0
  171. package/.opencode/skills/bmad-document-project/workflows/full-scan-instructions.md +1107 -0
  172. package/.opencode/skills/bmad-document-project/workflows/full-scan-workflow.md +34 -0
  173. package/.opencode/skills/bmad-domain-research/SKILL.md +6 -0
  174. package/.opencode/skills/bmad-domain-research/domain-steps/step-01-init.md +137 -0
  175. package/.opencode/skills/bmad-domain-research/domain-steps/step-02-domain-analysis.md +229 -0
  176. package/.opencode/skills/bmad-domain-research/domain-steps/step-03-competitive-landscape.md +238 -0
  177. package/.opencode/skills/bmad-domain-research/domain-steps/step-04-regulatory-focus.md +206 -0
  178. package/.opencode/skills/bmad-domain-research/domain-steps/step-05-technical-trends.md +234 -0
  179. package/.opencode/skills/bmad-domain-research/domain-steps/step-06-research-synthesis.md +444 -0
  180. package/.opencode/skills/bmad-domain-research/research.template.md +29 -0
  181. package/.opencode/skills/bmad-domain-research/workflow.md +49 -0
  182. package/.opencode/skills/bmad-edit-prd/SKILL.md +6 -0
  183. package/.opencode/skills/bmad-edit-prd/steps-e/step-e-01-discovery.md +242 -0
  184. package/.opencode/skills/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md +204 -0
  185. package/.opencode/skills/bmad-edit-prd/steps-e/step-e-02-review.md +245 -0
  186. package/.opencode/skills/bmad-edit-prd/steps-e/step-e-03-edit.md +250 -0
  187. package/.opencode/skills/bmad-edit-prd/steps-e/step-e-04-complete.md +165 -0
  188. package/.opencode/skills/bmad-edit-prd/workflow.md +63 -0
  189. package/.opencode/skills/bmad-editorial-review-prose/SKILL.md +86 -0
  190. package/.opencode/skills/bmad-editorial-review-structure/SKILL.md +179 -0
  191. package/.opencode/skills/bmad-generate-project-context/SKILL.md +6 -0
  192. package/.opencode/skills/bmad-generate-project-context/project-context-template.md +21 -0
  193. package/.opencode/skills/bmad-generate-project-context/steps/step-01-discover.md +186 -0
  194. package/.opencode/skills/bmad-generate-project-context/steps/step-02-generate.md +321 -0
  195. package/.opencode/skills/bmad-generate-project-context/steps/step-03-complete.md +278 -0
  196. package/.opencode/skills/bmad-generate-project-context/workflow.md +43 -0
  197. package/.opencode/skills/bmad-help/SKILL.md +73 -0
  198. package/.opencode/skills/bmad-index-docs/SKILL.md +66 -0
  199. package/.opencode/skills/bmad-init/SKILL.md +100 -0
  200. package/.opencode/skills/bmad-init/resources/core-module.yaml +25 -0
  201. package/.opencode/skills/bmad-init/scripts/bmad_init.py +593 -0
  202. package/.opencode/skills/bmad-init/scripts/tests/test_bmad_init.py +329 -0
  203. package/.opencode/skills/bmad-ma-agent-cyber/.gitkeep +0 -0
  204. package/.opencode/skills/bmad-ma-agent-cyber/SKILL.md +49 -0
  205. package/.opencode/skills/bmad-ma-agent-cyber/bmad-skill-manifest.yaml +11 -0
  206. package/.opencode/skills/bmad-ma-agent-devops/.gitkeep +0 -0
  207. package/.opencode/skills/bmad-ma-agent-devops/SKILL.md +49 -0
  208. package/.opencode/skills/bmad-ma-agent-devops/bmad-skill-manifest.yaml +11 -0
  209. package/.opencode/skills/bmad-ma-agent-mil498/.gitkeep +0 -0
  210. package/.opencode/skills/bmad-ma-agent-mil498/SKILL.md +53 -0
  211. package/.opencode/skills/bmad-ma-agent-mil498/bmad-skill-manifest.yaml +11 -0
  212. package/.opencode/skills/bmad-ma-agent-ml/.gitkeep +0 -0
  213. package/.opencode/skills/bmad-ma-agent-ml/SKILL.md +59 -0
  214. package/.opencode/skills/bmad-ma-agent-ml/bmad-skill-manifest.yaml +11 -0
  215. package/.opencode/skills/bmad-ma-agent-sre/.gitkeep +0 -0
  216. package/.opencode/skills/bmad-ma-agent-sre/SKILL.md +49 -0
  217. package/.opencode/skills/bmad-ma-agent-sre/bmad-skill-manifest.yaml +11 -0
  218. package/.opencode/skills/bmad-market-research/SKILL.md +6 -0
  219. package/.opencode/skills/bmad-market-research/research.template.md +29 -0
  220. package/.opencode/skills/bmad-market-research/steps/step-01-init.md +184 -0
  221. package/.opencode/skills/bmad-market-research/steps/step-02-customer-behavior.md +239 -0
  222. package/.opencode/skills/bmad-market-research/steps/step-03-customer-pain-points.md +251 -0
  223. package/.opencode/skills/bmad-market-research/steps/step-04-customer-decisions.md +261 -0
  224. package/.opencode/skills/bmad-market-research/steps/step-05-competitive-analysis.md +173 -0
  225. package/.opencode/skills/bmad-market-research/steps/step-06-research-completion.md +478 -0
  226. package/.opencode/skills/bmad-market-research/workflow.md +49 -0
  227. package/.opencode/skills/bmad-party-mode/SKILL.md +6 -0
  228. package/.opencode/skills/bmad-party-mode/steps/step-01-agent-loading.md +138 -0
  229. package/.opencode/skills/bmad-party-mode/steps/step-02-discussion-orchestration.md +187 -0
  230. package/.opencode/skills/bmad-party-mode/steps/step-03-graceful-exit.md +167 -0
  231. package/.opencode/skills/bmad-party-mode/workflow.md +190 -0
  232. package/.opencode/skills/bmad-product-brief/SKILL.md +87 -0
  233. package/.opencode/skills/bmad-product-brief/agents/artifact-analyzer.md +60 -0
  234. package/.opencode/skills/bmad-product-brief/agents/opportunity-reviewer.md +44 -0
  235. package/.opencode/skills/bmad-product-brief/agents/skeptic-reviewer.md +44 -0
  236. package/.opencode/skills/bmad-product-brief/agents/web-researcher.md +49 -0
  237. package/.opencode/skills/bmad-product-brief/bmad-manifest.json +17 -0
  238. package/.opencode/skills/bmad-product-brief/prompts/contextual-discovery.md +57 -0
  239. package/.opencode/skills/bmad-product-brief/prompts/draft-and-review.md +86 -0
  240. package/.opencode/skills/bmad-product-brief/prompts/finalize.md +75 -0
  241. package/.opencode/skills/bmad-product-brief/prompts/guided-elicitation.md +70 -0
  242. package/.opencode/skills/bmad-product-brief/resources/brief-template.md +60 -0
  243. package/.opencode/skills/bmad-qa-generate-e2e-tests/SKILL.md +6 -0
  244. package/.opencode/skills/bmad-qa-generate-e2e-tests/checklist.md +33 -0
  245. package/.opencode/skills/bmad-qa-generate-e2e-tests/workflow.md +136 -0
  246. package/.opencode/skills/bmad-quick-dev/SKILL.md +6 -0
  247. package/.opencode/skills/bmad-quick-dev/spec-template.md +88 -0
  248. package/.opencode/skills/bmad-quick-dev/step-01-clarify-and-route.md +64 -0
  249. package/.opencode/skills/bmad-quick-dev/step-02-plan.md +35 -0
  250. package/.opencode/skills/bmad-quick-dev/step-03-implement.md +37 -0
  251. package/.opencode/skills/bmad-quick-dev/step-04-review.md +49 -0
  252. package/.opencode/skills/bmad-quick-dev/step-05-present.md +63 -0
  253. package/.opencode/skills/bmad-quick-dev/step-oneshot.md +49 -0
  254. package/.opencode/skills/bmad-quick-dev/workflow.md +79 -0
  255. package/.opencode/skills/bmad-retrospective/SKILL.md +6 -0
  256. package/.opencode/skills/bmad-retrospective/workflow.md +1479 -0
  257. package/.opencode/skills/bmad-review-adversarial-general/SKILL.md +37 -0
  258. package/.opencode/skills/bmad-review-edge-case-hunter/SKILL.md +67 -0
  259. package/.opencode/skills/bmad-shard-doc/SKILL.md +105 -0
  260. package/.opencode/skills/bmad-sprint-planning/SKILL.md +6 -0
  261. package/.opencode/skills/bmad-sprint-planning/checklist.md +33 -0
  262. package/.opencode/skills/bmad-sprint-planning/sprint-status-template.yaml +56 -0
  263. package/.opencode/skills/bmad-sprint-planning/workflow.md +263 -0
  264. package/.opencode/skills/bmad-sprint-status/SKILL.md +6 -0
  265. package/.opencode/skills/bmad-sprint-status/workflow.md +261 -0
  266. package/.opencode/skills/bmad-technical-research/SKILL.md +6 -0
  267. package/.opencode/skills/bmad-technical-research/research.template.md +29 -0
  268. package/.opencode/skills/bmad-technical-research/technical-steps/step-01-init.md +137 -0
  269. package/.opencode/skills/bmad-technical-research/technical-steps/step-02-technical-overview.md +239 -0
  270. package/.opencode/skills/bmad-technical-research/technical-steps/step-03-integration-patterns.md +248 -0
  271. package/.opencode/skills/bmad-technical-research/technical-steps/step-04-architectural-patterns.md +202 -0
  272. package/.opencode/skills/bmad-technical-research/technical-steps/step-05-implementation-research.md +233 -0
  273. package/.opencode/skills/bmad-technical-research/technical-steps/step-06-research-synthesis.md +487 -0
  274. package/.opencode/skills/bmad-technical-research/workflow.md +50 -0
  275. package/.opencode/skills/bmad-validate-prd/SKILL.md +6 -0
  276. package/.opencode/skills/bmad-validate-prd/data/domain-complexity.csv +15 -0
  277. package/.opencode/skills/bmad-validate-prd/data/prd-purpose.md +197 -0
  278. package/.opencode/skills/bmad-validate-prd/data/project-types.csv +11 -0
  279. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-01-discovery.md +221 -0
  280. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-02-format-detection.md +188 -0
  281. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-02b-parity-check.md +206 -0
  282. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-03-density-validation.md +171 -0
  283. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +211 -0
  284. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-05-measurability-validation.md +225 -0
  285. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-06-traceability-validation.md +214 -0
  286. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +202 -0
  287. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +240 -0
  288. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-09-project-type-validation.md +260 -0
  289. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-10-smart-validation.md +206 -0
  290. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +261 -0
  291. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-12-completeness-validation.md +239 -0
  292. package/.opencode/skills/bmad-validate-prd/steps-v/step-v-13-report-complete.md +229 -0
  293. package/.opencode/skills/bmad-validate-prd/workflow.md +62 -0
  294. package/.opencode/skills/cleanup-done/.gitkeep +0 -0
  295. package/.opencode/skills/cleanup-done/SKILL.md +159 -0
  296. package/.opencode/skills/cleanup-done/bmad-skill-manifest.yaml +3 -0
  297. package/.opencode/skills/create-bug-story/.gitkeep +0 -0
  298. package/.opencode/skills/create-bug-story/SKILL.md +263 -0
  299. package/.opencode/skills/create-bug-story/bmad-skill-manifest.yaml +3 -0
  300. package/.opencode/skills/cyber-generate-certs/.gitkeep +0 -0
  301. package/.opencode/skills/cyber-generate-certs/SKILL.md +27 -0
  302. package/.opencode/skills/cyber-generate-certs/bmad-skill-manifest.yaml +3 -0
  303. package/.opencode/skills/cyber-immunity-estimation/.gitkeep +0 -0
  304. package/.opencode/skills/cyber-immunity-estimation/SKILL.md +29 -0
  305. package/.opencode/skills/cyber-immunity-estimation/bmad-skill-manifest.yaml +3 -0
  306. package/.opencode/skills/cyber-security-audit/.gitkeep +0 -0
  307. package/.opencode/skills/cyber-security-audit/SKILL.md +27 -0
  308. package/.opencode/skills/cyber-security-audit/bmad-skill-manifest.yaml +3 -0
  309. package/.opencode/skills/cyber-vault-secrets/.gitkeep +0 -0
  310. package/.opencode/skills/cyber-vault-secrets/SKILL.md +28 -0
  311. package/.opencode/skills/cyber-vault-secrets/bmad-skill-manifest.yaml +3 -0
  312. package/.opencode/skills/cyber-verify-docker-users/.gitkeep +0 -0
  313. package/.opencode/skills/cyber-verify-docker-users/SKILL.md +23 -0
  314. package/.opencode/skills/cyber-verify-docker-users/bmad-skill-manifest.yaml +3 -0
  315. package/.opencode/skills/cyber-verify-image-signature/.gitkeep +0 -0
  316. package/.opencode/skills/cyber-verify-image-signature/SKILL.md +22 -0
  317. package/.opencode/skills/cyber-verify-image-signature/bmad-skill-manifest.yaml +3 -0
  318. package/.opencode/skills/cyber-vulnerability-scan/.gitkeep +0 -0
  319. package/.opencode/skills/cyber-vulnerability-scan/SKILL.md +28 -0
  320. package/.opencode/skills/cyber-vulnerability-scan/bmad-skill-manifest.yaml +3 -0
  321. package/.opencode/skills/devops-configure-infrastructure/.gitkeep +0 -0
  322. package/.opencode/skills/devops-configure-infrastructure/SKILL.md +27 -0
  323. package/.opencode/skills/devops-configure-infrastructure/bmad-skill-manifest.yaml +3 -0
  324. package/.opencode/skills/devops-disconnected-deployment/.gitkeep +0 -0
  325. package/.opencode/skills/devops-disconnected-deployment/SKILL.md +27 -0
  326. package/.opencode/skills/devops-disconnected-deployment/bmad-skill-manifest.yaml +3 -0
  327. package/.opencode/skills/devops-docker-compose-setup/.gitkeep +0 -0
  328. package/.opencode/skills/devops-docker-compose-setup/SKILL.md +26 -0
  329. package/.opencode/skills/devops-docker-compose-setup/bmad-skill-manifest.yaml +3 -0
  330. package/.opencode/skills/devops-manage-helm/.gitkeep +0 -0
  331. package/.opencode/skills/devops-manage-helm/SKILL.md +28 -0
  332. package/.opencode/skills/devops-manage-helm/bmad-skill-manifest.yaml +3 -0
  333. package/.opencode/skills/devops-sign-docker-image/.gitkeep +0 -0
  334. package/.opencode/skills/devops-sign-docker-image/SKILL.md +24 -0
  335. package/.opencode/skills/devops-sign-docker-image/bmad-skill-manifest.yaml +3 -0
  336. package/.opencode/skills/generate-backlog/.gitkeep +0 -0
  337. package/.opencode/skills/generate-backlog/SKILL.md +183 -0
  338. package/.opencode/skills/generate-backlog/bmad-skill-manifest.yaml +3 -0
  339. package/.opencode/skills/mil498-ocd/.gitkeep +0 -0
  340. package/.opencode/skills/mil498-ocd/SKILL.md +30 -0
  341. package/.opencode/skills/mil498-ocd/bmad-skill-manifest.yaml +5 -0
  342. package/.opencode/skills/mil498-ocd/prompts/01-discover-project-artifacts.md +26 -0
  343. package/.opencode/skills/mil498-ocd/prompts/02-load-template.md +10 -0
  344. package/.opencode/skills/mil498-ocd/prompts/03-generate-document.md +90 -0
  345. package/.opencode/skills/mil498-ocd/prompts/04-validate.md +14 -0
  346. package/.opencode/skills/mil498-ocd/prompts/05-review.md +15 -0
  347. package/.opencode/skills/mil498-ocd/prompts/06-save.md +15 -0
  348. package/.opencode/skills/mil498-ocd/template.md +169 -0
  349. package/.opencode/skills/mil498-sdd/.gitkeep +0 -0
  350. package/.opencode/skills/mil498-sdd/SKILL.md +30 -0
  351. package/.opencode/skills/mil498-sdd/bmad-skill-manifest.yaml +5 -0
  352. package/.opencode/skills/mil498-sdd/prompts/01-discover-project-artifacts.md +50 -0
  353. package/.opencode/skills/mil498-sdd/prompts/02-load-template.md +10 -0
  354. package/.opencode/skills/mil498-sdd/prompts/03-generate-document.md +98 -0
  355. package/.opencode/skills/mil498-sdd/prompts/04-validate.md +16 -0
  356. package/.opencode/skills/mil498-sdd/prompts/05-review.md +15 -0
  357. package/.opencode/skills/mil498-sdd/prompts/06-save.md +19 -0
  358. package/.opencode/skills/mil498-sdd/template.md +163 -0
  359. package/.opencode/skills/mil498-sdp/.gitkeep +0 -0
  360. package/.opencode/skills/mil498-sdp/SKILL.md +30 -0
  361. package/.opencode/skills/mil498-sdp/bmad-skill-manifest.yaml +5 -0
  362. package/.opencode/skills/mil498-sdp/prompts/01-discover-project-artifacts.md +32 -0
  363. package/.opencode/skills/mil498-sdp/prompts/02-load-template.md +10 -0
  364. package/.opencode/skills/mil498-sdp/prompts/03-generate-document.md +187 -0
  365. package/.opencode/skills/mil498-sdp/prompts/04-validate.md +13 -0
  366. package/.opencode/skills/mil498-sdp/prompts/05-review.md +15 -0
  367. package/.opencode/skills/mil498-sdp/prompts/06-save.md +14 -0
  368. package/.opencode/skills/mil498-sdp/template.md +307 -0
  369. package/.opencode/skills/mil498-srs/.gitkeep +0 -0
  370. package/.opencode/skills/mil498-srs/SKILL.md +30 -0
  371. package/.opencode/skills/mil498-srs/bmad-skill-manifest.yaml +5 -0
  372. package/.opencode/skills/mil498-srs/prompts/01-discover-project-artifacts.md +42 -0
  373. package/.opencode/skills/mil498-srs/prompts/02-load-template.md +10 -0
  374. package/.opencode/skills/mil498-srs/prompts/03-generate-document.md +100 -0
  375. package/.opencode/skills/mil498-srs/prompts/04-validate.md +16 -0
  376. package/.opencode/skills/mil498-srs/prompts/05-review.md +15 -0
  377. package/.opencode/skills/mil498-srs/prompts/06-save.md +18 -0
  378. package/.opencode/skills/mil498-srs/template.md +219 -0
  379. package/.opencode/skills/mil498-ssdd/.gitkeep +0 -0
  380. package/.opencode/skills/mil498-ssdd/SKILL.md +32 -0
  381. package/.opencode/skills/mil498-ssdd/bmad-skill-manifest.yaml +5 -0
  382. package/.opencode/skills/mil498-ssdd/prompts/01-discover-project-artifacts.md +32 -0
  383. package/.opencode/skills/mil498-ssdd/prompts/02-load-template.md +10 -0
  384. package/.opencode/skills/mil498-ssdd/prompts/03-csci-discovery-interview.md +43 -0
  385. package/.opencode/skills/mil498-ssdd/prompts/04-generate-document.md +96 -0
  386. package/.opencode/skills/mil498-ssdd/prompts/05-validate.md +14 -0
  387. package/.opencode/skills/mil498-ssdd/prompts/06-review.md +16 -0
  388. package/.opencode/skills/mil498-ssdd/prompts/07-save.md +16 -0
  389. package/.opencode/skills/mil498-ssdd/template.md +154 -0
  390. package/.opencode/skills/mil498-sss/.gitkeep +0 -0
  391. package/.opencode/skills/mil498-sss/SKILL.md +31 -0
  392. package/.opencode/skills/mil498-sss/bmad-skill-manifest.yaml +5 -0
  393. package/.opencode/skills/mil498-sss/prompts/01-discover-project-artifacts.md +31 -0
  394. package/.opencode/skills/mil498-sss/prompts/02-load-template.md +10 -0
  395. package/.opencode/skills/mil498-sss/prompts/03-generate-document.md +108 -0
  396. package/.opencode/skills/mil498-sss/prompts/04-validate.md +16 -0
  397. package/.opencode/skills/mil498-sss/prompts/05-review.md +15 -0
  398. package/.opencode/skills/mil498-sss/prompts/06-save.md +15 -0
  399. package/.opencode/skills/mil498-sss/template.md +225 -0
  400. package/.opencode/skills/mil498-std/.gitkeep +0 -0
  401. package/.opencode/skills/mil498-std/SKILL.md +30 -0
  402. package/.opencode/skills/mil498-std/bmad-skill-manifest.yaml +5 -0
  403. package/.opencode/skills/mil498-std/prompts/01-discover-project-artifacts.md +42 -0
  404. package/.opencode/skills/mil498-std/prompts/02-load-template.md +10 -0
  405. package/.opencode/skills/mil498-std/prompts/03-generate-document.md +117 -0
  406. package/.opencode/skills/mil498-std/prompts/04-validate.md +15 -0
  407. package/.opencode/skills/mil498-std/prompts/05-review.md +15 -0
  408. package/.opencode/skills/mil498-std/prompts/06-save.md +15 -0
  409. package/.opencode/skills/mil498-std/template.md +188 -0
  410. package/.opencode/skills/ml-advise/.gitkeep +0 -0
  411. package/.opencode/skills/ml-advise/SKILL.md +76 -0
  412. package/.opencode/skills/ml-advise/bmad-skill-manifest.yaml +3 -0
  413. package/.opencode/skills/ml-advise/skill.json +7 -0
  414. package/.opencode/skills/ml-analysis/.gitkeep +0 -0
  415. package/.opencode/skills/ml-analysis/SKILL.md +60 -0
  416. package/.opencode/skills/ml-analysis/bmad-skill-manifest.yaml +3 -0
  417. package/.opencode/skills/ml-analysis/skill.json +7 -0
  418. package/.opencode/skills/ml-architecture/.gitkeep +0 -0
  419. package/.opencode/skills/ml-architecture/SKILL.md +55 -0
  420. package/.opencode/skills/ml-architecture/bmad-skill-manifest.yaml +3 -0
  421. package/.opencode/skills/ml-architecture/skill.json +7 -0
  422. package/.opencode/skills/ml-detailed-design/.gitkeep +0 -0
  423. package/.opencode/skills/ml-detailed-design/SKILL.md +67 -0
  424. package/.opencode/skills/ml-detailed-design/bmad-skill-manifest.yaml +3 -0
  425. package/.opencode/skills/ml-detailed-design/skill.json +7 -0
  426. package/.opencode/skills/ml-eda/.gitkeep +0 -0
  427. package/.opencode/skills/ml-eda/SKILL.md +56 -0
  428. package/.opencode/skills/ml-eda/bmad-skill-manifest.yaml +3 -0
  429. package/.opencode/skills/ml-eda/scripts/baseline_classifier.py +522 -0
  430. package/.opencode/skills/ml-eda/scripts/class_weights_calculator.py +295 -0
  431. package/.opencode/skills/ml-eda/scripts/clustering_explorer.py +383 -0
  432. package/.opencode/skills/ml-eda/scripts/eda_analyzer.py +654 -0
  433. package/.opencode/skills/ml-eda/skill.json +7 -0
  434. package/.opencode/skills/ml-experiment/.gitkeep +0 -0
  435. package/.opencode/skills/ml-experiment/SKILL.md +74 -0
  436. package/.opencode/skills/ml-experiment/assets/advanced_trainer_configs.py +430 -0
  437. package/.opencode/skills/ml-experiment/assets/quick_trainer_setup.py +233 -0
  438. package/.opencode/skills/ml-experiment/assets/template_datamodule.py +219 -0
  439. package/.opencode/skills/ml-experiment/assets/template_gnn_module.py +341 -0
  440. package/.opencode/skills/ml-experiment/assets/template_lightning_module.py +158 -0
  441. package/.opencode/skills/ml-experiment/bmad-skill-manifest.yaml +3 -0
  442. package/.opencode/skills/ml-experiment/skill.json +7 -0
  443. package/.opencode/skills/ml-hparam/.gitkeep +0 -0
  444. package/.opencode/skills/ml-hparam/SKILL.md +81 -0
  445. package/.opencode/skills/ml-hparam/bmad-skill-manifest.yaml +3 -0
  446. package/.opencode/skills/ml-hparam/skill.json +7 -0
  447. package/.opencode/skills/ml-ideation/.gitkeep +0 -0
  448. package/.opencode/skills/ml-ideation/SKILL.md +50 -0
  449. package/.opencode/skills/ml-ideation/bmad-skill-manifest.yaml +3 -0
  450. package/.opencode/skills/ml-ideation/scripts/validate_ml_prd.py +287 -0
  451. package/.opencode/skills/ml-ideation/skill.json +7 -0
  452. package/.opencode/skills/ml-infra/.gitkeep +0 -0
  453. package/.opencode/skills/ml-infra/SKILL.md +58 -0
  454. package/.opencode/skills/ml-infra/bmad-skill-manifest.yaml +3 -0
  455. package/.opencode/skills/ml-infra/skill.json +7 -0
  456. package/.opencode/skills/ml-retrospective/.gitkeep +0 -0
  457. package/.opencode/skills/ml-retrospective/SKILL.md +63 -0
  458. package/.opencode/skills/ml-retrospective/bmad-skill-manifest.yaml +3 -0
  459. package/.opencode/skills/ml-retrospective/skill.json +7 -0
  460. package/.opencode/skills/ml-revision/.gitkeep +0 -0
  461. package/.opencode/skills/ml-revision/SKILL.md +82 -0
  462. package/.opencode/skills/ml-revision/bmad-skill-manifest.yaml +3 -0
  463. package/.opencode/skills/ml-revision/skill.json +7 -0
  464. package/.opencode/skills/ml-techspec/.gitkeep +0 -0
  465. package/.opencode/skills/ml-techspec/SKILL.md +80 -0
  466. package/.opencode/skills/ml-techspec/bmad-skill-manifest.yaml +3 -0
  467. package/.opencode/skills/ml-techspec/skill.json +7 -0
  468. package/.opencode/skills/modify-sprint/.gitkeep +0 -0
  469. package/.opencode/skills/modify-sprint/SKILL.md +322 -0
  470. package/.opencode/skills/modify-sprint/bmad-skill-manifest.yaml +3 -0
  471. package/.opencode/skills/prioritize-backlog/.gitkeep +0 -0
  472. package/.opencode/skills/prioritize-backlog/SKILL.md +195 -0
  473. package/.opencode/skills/prioritize-backlog/bmad-skill-manifest.yaml +3 -0
  474. package/.opencode/skills/project-context-expansion/.gitkeep +0 -0
  475. package/.opencode/skills/project-context-expansion/SKILL.md +238 -0
  476. package/.opencode/skills/project-context-expansion/bmad-skill-manifest.yaml +3 -0
  477. package/.opencode/skills/remove-from-sprint/.gitkeep +0 -0
  478. package/.opencode/skills/remove-from-sprint/SKILL.md +163 -0
  479. package/.opencode/skills/remove-from-sprint/bmad-skill-manifest.yaml +3 -0
  480. package/.opencode/skills/sprint-status-view/.gitkeep +0 -0
  481. package/.opencode/skills/sprint-status-view/SKILL.md +263 -0
  482. package/.opencode/skills/sprint-status-view/bmad-skill-manifest.yaml +3 -0
  483. package/.opencode/skills/sre-check-deployment-status/.gitkeep +0 -0
  484. package/.opencode/skills/sre-check-deployment-status/SKILL.md +32 -0
  485. package/.opencode/skills/sre-check-deployment-status/bmad-skill-manifest.yaml +3 -0
  486. package/.opencode/skills/sre-check-secrets/.gitkeep +0 -0
  487. package/.opencode/skills/sre-check-secrets/SKILL.md +23 -0
  488. package/.opencode/skills/sre-check-secrets/bmad-skill-manifest.yaml +3 -0
  489. package/.opencode/skills/sre-check-system-status/.gitkeep +0 -0
  490. package/.opencode/skills/sre-check-system-status/SKILL.md +27 -0
  491. package/.opencode/skills/sre-check-system-status/bmad-skill-manifest.yaml +3 -0
  492. package/.opencode/skills/sre-day-2-ops/.gitkeep +0 -0
  493. package/.opencode/skills/sre-day-2-ops/SKILL.md +26 -0
  494. package/.opencode/skills/sre-day-2-ops/bmad-skill-manifest.yaml +3 -0
  495. package/.opencode/skills/sre-deployment-strategies/.gitkeep +0 -0
  496. package/.opencode/skills/sre-deployment-strategies/SKILL.md +28 -0
  497. package/.opencode/skills/sre-deployment-strategies/bmad-skill-manifest.yaml +3 -0
  498. package/.opencode/skills/sre-fix-deployments/.gitkeep +0 -0
  499. package/.opencode/skills/sre-fix-deployments/SKILL.md +25 -0
  500. package/.opencode/skills/sre-fix-deployments/bmad-skill-manifest.yaml +3 -0
  501. package/.opencode/skills/sre-gitops-status/.gitkeep +0 -0
  502. package/.opencode/skills/sre-gitops-status/SKILL.md +25 -0
  503. package/.opencode/skills/sre-gitops-status/bmad-skill-manifest.yaml +3 -0
  504. package/.roo/skills/.ma-agents.json +48 -167
  505. package/.roo/skills/MANIFEST.yaml +0 -128
  506. package/bin/cli.js +20 -6
  507. package/lib/agents.js +5 -50
  508. package/lib/installer.js +13 -5
  509. package/package.json +1 -1
  510. package/.opencode/skills/ai-audit-trail/SKILL.md +0 -23
  511. package/.opencode/skills/auto-bug-detection/SKILL.md +0 -169
  512. package/.opencode/skills/cmake-best-practices/SKILL.md +0 -64
  513. package/.opencode/skills/cmake-best-practices/examples/cmake.md +0 -59
  514. package/.opencode/skills/code-documentation/SKILL.md +0 -57
  515. package/.opencode/skills/code-documentation/examples/cpp.md +0 -29
  516. package/.opencode/skills/code-documentation/examples/csharp.md +0 -28
  517. package/.opencode/skills/code-documentation/examples/javascript_typescript.md +0 -28
  518. package/.opencode/skills/code-documentation/examples/python.md +0 -57
  519. package/.opencode/skills/code-review/SKILL.md +0 -43
  520. package/.opencode/skills/commit-message/SKILL.md +0 -79
  521. package/.opencode/skills/cpp-best-practices/SKILL.md +0 -234
  522. package/.opencode/skills/cpp-best-practices/examples/modern-idioms.md +0 -189
  523. package/.opencode/skills/cpp-best-practices/examples/naming-and-organization.md +0 -102
  524. package/.opencode/skills/cpp-concurrency-safety/SKILL.md +0 -60
  525. package/.opencode/skills/cpp-concurrency-safety/examples/concurrency.md +0 -73
  526. package/.opencode/skills/cpp-const-correctness/SKILL.md +0 -63
  527. package/.opencode/skills/cpp-const-correctness/examples/const_correctness.md +0 -54
  528. package/.opencode/skills/cpp-memory-handling/SKILL.md +0 -42
  529. package/.opencode/skills/cpp-memory-handling/examples/modern-cpp.md +0 -49
  530. package/.opencode/skills/cpp-memory-handling/examples/smart-pointers.md +0 -46
  531. package/.opencode/skills/cpp-modern-composition/SKILL.md +0 -64
  532. package/.opencode/skills/cpp-modern-composition/examples/composition.md +0 -51
  533. package/.opencode/skills/cpp-robust-interfaces/SKILL.md +0 -55
  534. package/.opencode/skills/cpp-robust-interfaces/examples/interfaces.md +0 -56
  535. package/.opencode/skills/create-hardened-docker-skill/SKILL.md +0 -637
  536. package/.opencode/skills/create-hardened-docker-skill/scripts/create-all.sh +0 -489
  537. package/.opencode/skills/csharp-best-practices/SKILL.md +0 -278
  538. package/.opencode/skills/docker-hardening-verification/SKILL.md +0 -28
  539. package/.opencode/skills/docker-hardening-verification/scripts/verify-hardening.sh +0 -39
  540. package/.opencode/skills/docker-image-signing/SKILL.md +0 -28
  541. package/.opencode/skills/docker-image-signing/scripts/sign-image.sh +0 -33
  542. package/.opencode/skills/document-revision-history/SKILL.md +0 -104
  543. package/.roo/skills/ai-audit-trail/SKILL.md +0 -23
  544. package/.roo/skills/auto-bug-detection/SKILL.md +0 -169
  545. package/.roo/skills/cmake-best-practices/SKILL.md +0 -64
  546. package/.roo/skills/cmake-best-practices/examples/cmake.md +0 -59
  547. package/.roo/skills/code-documentation/SKILL.md +0 -57
  548. package/.roo/skills/code-documentation/examples/cpp.md +0 -29
  549. package/.roo/skills/code-documentation/examples/csharp.md +0 -28
  550. package/.roo/skills/code-documentation/examples/javascript_typescript.md +0 -28
  551. package/.roo/skills/code-documentation/examples/python.md +0 -57
  552. package/.roo/skills/code-review/SKILL.md +0 -43
  553. package/.roo/skills/commit-message/SKILL.md +0 -79
  554. package/.roo/skills/cpp-best-practices/SKILL.md +0 -234
  555. package/.roo/skills/cpp-best-practices/examples/modern-idioms.md +0 -189
  556. package/.roo/skills/cpp-best-practices/examples/naming-and-organization.md +0 -102
  557. package/.roo/skills/cpp-concurrency-safety/SKILL.md +0 -60
  558. package/.roo/skills/cpp-concurrency-safety/examples/concurrency.md +0 -73
  559. package/.roo/skills/cpp-const-correctness/SKILL.md +0 -63
  560. package/.roo/skills/cpp-const-correctness/examples/const_correctness.md +0 -54
  561. package/.roo/skills/cpp-memory-handling/SKILL.md +0 -42
  562. package/.roo/skills/cpp-memory-handling/examples/modern-cpp.md +0 -49
  563. package/.roo/skills/cpp-memory-handling/examples/smart-pointers.md +0 -46
  564. package/.roo/skills/cpp-modern-composition/SKILL.md +0 -64
  565. package/.roo/skills/cpp-modern-composition/examples/composition.md +0 -51
  566. package/.roo/skills/cpp-robust-interfaces/SKILL.md +0 -55
  567. package/.roo/skills/cpp-robust-interfaces/examples/interfaces.md +0 -56
  568. package/.roo/skills/create-hardened-docker-skill/SKILL.md +0 -637
  569. package/.roo/skills/create-hardened-docker-skill/scripts/create-all.sh +0 -489
  570. package/.roo/skills/csharp-best-practices/SKILL.md +0 -278
  571. package/.roo/skills/docker-hardening-verification/SKILL.md +0 -28
  572. package/.roo/skills/docker-hardening-verification/scripts/verify-hardening.sh +0 -39
  573. package/.roo/skills/docker-image-signing/SKILL.md +0 -28
  574. package/.roo/skills/docker-image-signing/scripts/sign-image.sh +0 -33
  575. package/.roo/skills/document-revision-history/SKILL.md +0 -104
@@ -1,234 +0,0 @@
1
- ---
2
- name: C++ Best Practices
3
- description: Comprehensive C++ coding standards covering naming conventions, modern C++ idioms (C++17/20/23), error handling, and build guidelines. Cross-references domain-specific C++ skills for deep-dives.
4
- ---
5
- # C++ Best Practices
6
-
7
- This skill establishes baseline C++ coding standards applicable to modern C++ projects (C++17/20/23). It covers naming conventions, code organization, memory management, error handling, modern idioms, and build guidelines. Domain-specific topics are handled by dedicated sibling skills — this skill provides the umbrella foundation and cross-references those skills where relevant.
8
-
9
- ---
10
-
11
- ## 1. Naming Conventions
12
-
13
- ### Rule: Use consistent case styles by identifier type.
14
-
15
- | Identifier | Convention | Example |
16
- |---|---|---|
17
- | Types (class, struct, enum, alias) | `PascalCase` | `UserAccount`, `ConnectionPool` |
18
- | Functions and methods | `camelCase` | `getUserName()`, `processData()` |
19
- | Variables (local, parameter) | `camelCase` | `userName`, `itemCount` |
20
- | Member variables (private) | `camelCase_` with trailing underscore | `name_`, `bufferSize_` |
21
- | Constants and enumerators | `UPPER_SNAKE_CASE` | `MAX_RETRY_COUNT`, `DEFAULT_TIMEOUT` |
22
- | Macros | `UPPER_SNAKE_CASE` | `ASSERT_NOT_NULL`, `LOG_LEVEL` |
23
- | Namespaces | `lowercase_snake_case` | `network::http`, `core::utils` |
24
- | Template parameters | `PascalCase` | `template<typename ValueType>` |
25
- | Files | `snake_case.cpp` / `snake_case.h` | `user_account.cpp`, `connection_pool.h` |
26
-
27
- **Action:** Do not abbreviate unless the abbreviation is universally understood in the domain (e.g., `id`, `url`, `http`). Avoid single-letter names except for loop indices (`i`, `j`, `k`) and template parameters (`T`, `U`).
28
-
29
- ---
30
-
31
- ## 2. Code Organization
32
-
33
- ### Rule: One primary type per header file; name the file after the type.
34
-
35
- **Action:**
36
- - Place class declarations in `.h` files; place definitions in `.cpp` files.
37
- - Use `#pragma once` at the top of every header (preferred over include guards in new code).
38
- - Group headers: project headers first, then third-party, then standard library — each group separated by a blank line.
39
- - Keep headers self-contained: every header must include what it needs to compile in isolation.
40
-
41
- ### Rule: Use namespaces to model the logical module hierarchy.
42
-
43
- **Action:**
44
- - Prefer deeply nested namespaces over flat ones: `namespace myapp::network::http { ... }`.
45
- - Avoid `using namespace` in header files. Restrict `using namespace std;` to `.cpp` file scope if used at all.
46
- - Use `inline namespace` only for versioning public APIs (e.g., `inline namespace v2`).
47
-
48
- ### Rule: Keep translation units small and focused.
49
-
50
- **Action:**
51
- - Limit headers to declarations and inline functions under ~20 lines.
52
- - Move non-trivial inline logic into `.inl` files included at the bottom of the header.
53
- - Use forward declarations in headers to reduce compilation dependencies.
54
-
55
- ---
56
-
57
- ## 3. Memory Management
58
-
59
- **Action:** Apply RAII (Resource Acquisition Is Initialization) for all resources. Never allocate resources without an owning object responsible for releasing them.
60
-
61
- Key policies:
62
- - Prefer stack allocation. Use heap allocation only when lifetime exceeds scope or size is dynamic.
63
- - Use `std::make_unique<T>()` for exclusive ownership; `std::make_shared<T>()` only when shared ownership is truly required.
64
- - Never use raw `new` or `delete` outside of a low-level container implementation.
65
- - Use standard containers (`std::vector`, `std::string`, `std::array`) instead of raw arrays and buffers.
66
-
67
- > For detailed memory management patterns, see the `cpp-memory-handling` skill if installed.
68
- > It covers RAII, smart pointer selection, Rule of Zero/Five, and ownership transfer patterns.
69
-
70
- ---
71
-
72
- ## 4. Modern C++ Idioms
73
-
74
- ### C++17
75
-
76
- **Action:** Use these C++17 features where they improve clarity:
77
-
78
- - **Structured bindings**: `auto [key, value] = myMap.begin()->first;` — prefer over `first`/`second`.
79
- - **`std::optional<T>`**: Return optional values instead of `nullptr` sentinels or output parameters.
80
- - **`std::variant<T...>`**: Model sum types explicitly instead of void pointers or inheritance hierarchies.
81
- - **`if constexpr`**: Replace SFINAE with readable compile-time branching in templates.
82
- - **Fold expressions**: Simplify variadic template expansions: `(args + ... + 0)`.
83
- - **`std::filesystem`**: Use `std::filesystem::path` for all file path manipulation; never concatenate paths with string operations.
84
- - **Class template argument deduction (CTAD)**: Write `std::pair p{1, "hello"s}` instead of `std::make_pair`.
85
-
86
- ### C++20
87
-
88
- **Action:** Adopt C++20 features when targeting C++20 or later:
89
-
90
- - **Concepts**: Constrain template parameters with `requires` clauses instead of relying on substitution failures.
91
- ```cpp
92
- template<std::integral T>
93
- T clamp(T value, T lo, T hi);
94
- ```
95
- - **Ranges**: Replace hand-written loops over containers with range adaptors (`std::views::filter`, `std::views::transform`, `std::ranges::sort`).
96
- - **`std::format`**: Replace `printf`/`sprintf`/`ostringstream` with `std::format("{} has {} items", name, count)`.
97
- - **Three-way comparison (`<=>`)**: Define `operator<=>` to implement all comparison operators at once.
98
- - **Coroutines**: Use for asynchronous I/O and generator patterns; avoid raw `co_await` boilerplate — prefer a library abstraction (e.g., cppcoro, Asio).
99
- - **Modules**: New projects targeting C++20+ should plan for module adoption; existing headers remain valid but prefer named module interface units for new public APIs.
100
-
101
- ### C++23
102
-
103
- **Action:** Use C++23 features when the toolchain supports them:
104
-
105
- - **`std::expected<T, E>`**: Return `expected<Result, ErrorCode>` from functions that can fail, eliminating exception-based control flow for expected failures.
106
- - **`std::print` / `std::println`**: Replace `std::cout` for formatted output.
107
- - **Deducing `this`**: Use explicit object parameter `this` to eliminate CRTP boilerplate and write recursive lambdas cleanly.
108
- - **`std::flat_map` / `std::flat_set`**: Prefer over `std::map`/`std::set` for small to medium sorted collections requiring cache-friendly iteration.
109
-
110
- ---
111
-
112
- ## 5. Const-Correctness
113
-
114
- ### Rule: Make everything const by default; relax only when mutation is required.
115
-
116
- **Action:**
117
- - Declare local variables `const auto` unless reassignment is needed.
118
- - Mark member functions `const` whenever they do not modify observable state.
119
- - Use `constexpr` for values and functions computable at compile-time.
120
- - Pass large types by `const&`; pass cheap types (scalars, pointers, `string_view`) by value.
121
- - Never return `const` by value from a function — it prevents move semantics.
122
-
123
- > For detailed const-correctness policies, see the `cpp-const-correctness` skill if installed.
124
-
125
- ---
126
-
127
- ## 6. Error Handling
128
-
129
- ### Rule: Choose an error-handling strategy per layer and apply it consistently.
130
-
131
- | Context | Preferred Mechanism |
132
- |---|---|
133
- | Programmer errors (precondition violations) | `assert()` or contracts (C++26); never exceptions |
134
- | Expected failures in library APIs | `std::expected<T, E>` (C++23) or error codes |
135
- | Exceptional conditions that prevent normal flow | Exceptions (`std::runtime_error` hierarchy) |
136
- | Async / coroutine code | Error channels in the coroutine framework |
137
-
138
- **Action:**
139
- - Mark functions that cannot throw `noexcept`. Destructors, move constructors, and swap functions MUST be `noexcept`.
140
- - Catch exceptions by `const&` only: `catch (const std::exception& e)`.
141
- - Never catch `...` (catch-all) except at top-level handlers or plugin boundaries.
142
- - Do not use exceptions for control flow or expected failure paths — use `std::optional` or `std::expected` instead.
143
-
144
- ---
145
-
146
- ## 7. Class Design
147
-
148
- ### Rule: Follow the Rule of Zero.
149
-
150
- **Action:**
151
- - Design classes so that the compiler-generated special members (copy/move constructor, copy/move assignment, destructor) are correct by default.
152
- - Use RAII members (smart pointers, standard containers) to make this automatic.
153
- - If you must define any special member function, define all five (destructor, copy ctor, move ctor, copy assign, move assign) — the Rule of Five.
154
-
155
- ### Rule: Prefer composition over inheritance for code reuse.
156
-
157
- **Action:**
158
- - Use `public` inheritance only to model true "is-a" relationships with polymorphic behavior.
159
- - Mark base class destructors `virtual` when the class is intended to be used polymorphically.
160
- - Mark overriding methods `override`; mark non-overridable methods `final`.
161
- - Prefer free functions over member functions for operations that do not require access to private state.
162
- - Mark factory functions and pure query methods with `[[nodiscard]]` (C++17) to turn silent result-discard into a compiler warning.
163
-
164
- > For detailed composition patterns and elimination of legacy C patterns, see the `cpp-modern-composition` skill if installed.
165
- > For interface design contracts and strong typing, see the `cpp-robust-interfaces` skill if installed.
166
-
167
- ---
168
-
169
- ## 8. Concurrency
170
-
171
- ### Rule: Never share mutable state between threads without synchronization.
172
-
173
- **Action:**
174
- - Prefer task-based concurrency (`std::async`, thread pools) over raw `std::thread`. Always specify `std::launch::async` explicitly — `std::async` without a launch policy may run deferred (synchronously on the calling thread), which defeats the purpose of async execution.
175
- - Protect shared data with `std::mutex`; always use `std::lock_guard` or `std::unique_lock` — never call `lock()`/`unlock()` manually.
176
- - Declare data accessed from multiple threads as `std::atomic<T>` when appropriate (single-variable synchronization, counters, flags).
177
- - Avoid `volatile` for inter-thread communication; use `std::atomic` instead.
178
-
179
- > For detailed concurrency safety patterns, see the `cpp-concurrency-safety` skill if installed.
180
-
181
- ---
182
-
183
- ## 9. Build and Compilation Guidelines
184
-
185
- ### Rule: Enable high-warning levels and treat warnings as errors.
186
-
187
- **Action:**
188
- - GCC/Clang: `-Wall -Wextra -Wpedantic -Wconversion -Wshadow -Werror`
189
- - MSVC: `/W4 /WX`
190
- - Do not disable warnings without an inline comment explaining the rationale.
191
-
192
- ### Rule: Use sanitizers during development and CI.
193
-
194
- | Sanitizer | Flag (GCC/Clang) | Detects |
195
- |---|---|---|
196
- | AddressSanitizer | `-fsanitize=address` | Buffer overflows, use-after-free |
197
- | UndefinedBehaviorSanitizer | `-fsanitize=undefined` | UB (integer overflow, null deref) |
198
- | ThreadSanitizer | `-fsanitize=thread` | Data races |
199
-
200
- **Action:** Enable at least `-fsanitize=address,undefined` in Debug and CI builds. Do not ship sanitizer builds.
201
-
202
- ### Rule: Set the C++ standard explicitly.
203
-
204
- **Action:** Always specify `-std=c++17` (or higher) explicitly. Do not rely on compiler defaults, which differ across vendors.
205
-
206
- > For CMake-specific build configuration patterns, see the `cmake-best-practices` skill if installed.
207
- > It covers target-based CMake, `target_compile_options`, and compiler flag propagation.
208
-
209
- ---
210
-
211
- ## 10. General Code Quality
212
-
213
- ### Rule: Prefer clarity over cleverness.
214
-
215
- **Action:**
216
- - Write code for the next reader, not the compiler. Compilers optimize well; humans struggle with obfuscation.
217
- - Extract magic numbers into named `constexpr` constants.
218
- - Prefer algorithms from `<algorithm>` and `<numeric>` over hand-written loops.
219
- - Limit function length to what fits on one screen (~50 lines). If longer, extract named helper functions.
220
- - Avoid deep nesting (more than 3 levels). Use early-return and guard clauses to flatten control flow.
221
-
222
- ### Rule: Use `auto` judiciously.
223
-
224
- **Action:**
225
- - Use `auto` when the type is verbose and already clear from context (e.g., iterators, lambda types, CTAD).
226
- - Do not use `auto` when the type communicates intent and is not immediately obvious from the right-hand side.
227
- - Always specify `auto&` or `const auto&` for range-for loops over containers of non-trivial types.
228
-
229
- ---
230
-
231
- ## Resources
232
-
233
- - [Naming and Organization Examples](examples/naming-and-organization.md)
234
- - [Modern C++ Idioms Examples](examples/modern-idioms.md)
@@ -1,189 +0,0 @@
1
- # Modern C++ Idioms Examples
2
-
3
- ## C++17: Structured Bindings and std::optional
4
-
5
- ```cpp
6
- #include <map>
7
- #include <optional>
8
- #include <string>
9
-
10
- // Structured bindings — prefer over .first/.second
11
- std::map<std::string, int> scores = {{"Alice", 95}, {"Bob", 87}};
12
- for (const auto& [name, score] : scores) {
13
- // name and score are directly named — no .first/.second
14
- }
15
-
16
- // std::optional — no more nullptr sentinels or bool out-parameters
17
- std::optional<std::string> findUser(int id) {
18
- if (id == 42) return "Alice";
19
- return std::nullopt; // Not found — explicit, type-safe
20
- }
21
-
22
- void example() {
23
- if (const auto user = findUser(42); user.has_value()) {
24
- // C++17 if-with-initializer keeps 'user' scoped tightly
25
- doSomethingWith(*user);
26
- }
27
- }
28
- ```
29
-
30
- ## C++17: std::variant for Sum Types
31
-
32
- ```cpp
33
- #include <variant>
34
- #include <string>
35
-
36
- struct Success { std::string message; };
37
- struct NotFound { int id; };
38
- struct PermissionDenied { std::string reason; };
39
-
40
- using LookupResult = std::variant<Success, NotFound, PermissionDenied>;
41
-
42
- LookupResult lookup(int id) {
43
- if (id == 0) return NotFound{id};
44
- if (id < 0) return PermissionDenied{"negative ids reserved"};
45
- return Success{"found item " + std::to_string(id)};
46
- }
47
-
48
- void handle(const LookupResult& result) {
49
- std::visit([](const auto& v) {
50
- using T = std::decay_t<decltype(v)>;
51
- if constexpr (std::is_same_v<T, Success>) {
52
- log(v.message);
53
- } else if constexpr (std::is_same_v<T, NotFound>) {
54
- log("not found: " + std::to_string(v.id));
55
- } else {
56
- log("denied: " + v.reason);
57
- }
58
- }, result);
59
- }
60
- ```
61
-
62
- ## C++20: Concepts
63
-
64
- ```cpp
65
- #include <concepts>
66
- #include <iostream>
67
- #include <vector>
68
-
69
- // Before concepts: SFINAE was required — hard to read and debug
70
- // After concepts: clear, readable constraints
71
-
72
- template<std::integral T>
73
- T clamp(T value, T lo, T hi) {
74
- return std::max(lo, std::min(value, hi));
75
- }
76
-
77
- // Custom concept
78
- template<typename T>
79
- concept Printable = requires(T t) {
80
- { t.toString() } -> std::convertible_to<std::string>;
81
- };
82
-
83
- template<Printable T>
84
- void printAll(const std::vector<T>& items) {
85
- for (const auto& item : items) {
86
- std::cout << item.toString() << '\n';
87
- }
88
- }
89
- ```
90
-
91
- ## C++20: Ranges
92
-
93
- ```cpp
94
- #include <algorithm>
95
- #include <iostream>
96
- #include <ranges>
97
- #include <vector>
98
- #include <string>
99
-
100
- void modernRanges() {
101
- std::vector<int> numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
102
-
103
- // Chain range adaptors — lazy, composable, readable
104
- auto evenSquares = numbers
105
- | std::views::filter([](int n) { return n % 2 == 0; })
106
- | std::views::transform([](int n) { return n * n; });
107
-
108
- // Iterate result without materializing an intermediate container
109
- for (int v : evenSquares) {
110
- std::cout << v << '\n'; // 4 16 36 64 100
111
- }
112
-
113
- // Sorting with ranges — no begin/end iterator boilerplate
114
- std::vector<std::string> names = {"Charlie", "Alice", "Bob"};
115
- std::ranges::sort(names);
116
- }
117
- ```
118
-
119
- ## C++23: std::expected for Error Handling
120
-
121
- ```cpp
122
- #include <expected>
123
- #include <string>
124
- #include <fstream>
125
-
126
- enum class ParseError { InvalidFormat, EmptyInput, Overflow };
127
-
128
- // Return expected<T, E> instead of throwing for anticipated failures
129
- std::expected<int, ParseError> parsePositiveInt(std::string_view input) {
130
- if (input.empty()) return std::unexpected(ParseError::EmptyInput);
131
- int result = 0;
132
- for (char c : input) {
133
- if (c < '0' || c > '9') return std::unexpected(ParseError::InvalidFormat);
134
- result = result * 10 + (c - '0');
135
- if (result < 0) return std::unexpected(ParseError::Overflow);
136
- }
137
- return result;
138
- }
139
-
140
- void usage() {
141
- const auto result = parsePositiveInt("123");
142
- if (result) {
143
- std::println("Parsed: {}", *result);
144
- } else {
145
- // Handle error without try/catch — expected path, not exceptional
146
- switch (result.error()) {
147
- case ParseError::InvalidFormat: std::println("invalid format"); break;
148
- case ParseError::EmptyInput: std::println("empty input"); break;
149
- case ParseError::Overflow: std::println("overflow"); break;
150
- }
151
- }
152
- }
153
- ```
154
-
155
- ## Class Design: Rule of Zero
156
-
157
- ```cpp
158
- #include <memory>
159
- #include <string>
160
- #include <vector>
161
-
162
- // Good: Rule of Zero — all members manage themselves
163
- class Document {
164
- public:
165
- explicit Document(std::string title) : title_(std::move(title)) {}
166
-
167
- void addSection(std::string content) {
168
- sections_.emplace_back(std::move(content));
169
- }
170
-
171
- private:
172
- std::string title_; // manages its own lifetime
173
- std::vector<std::string> sections_; // manages its own lifetime
174
- // No destructor, no copy/move definitions needed — compiler generates correct ones
175
- };
176
-
177
- // Bad: unnecessary manual resource management
178
- class BadDocument {
179
- public:
180
- BadDocument(const char* title) {
181
- title_ = new char[strlen(title) + 1]; // raw new — avoid this
182
- strcpy(title_, title);
183
- }
184
- ~BadDocument() { delete[] title_; } // manual cleanup — fragile
185
- // Must also define copy ctor, copy assign, move ctor, move assign correctly...
186
- private:
187
- char* title_;
188
- };
189
- ```
@@ -1,102 +0,0 @@
1
- # Naming and Organization Examples
2
-
3
- ## Naming Conventions
4
-
5
- ```cpp
6
- // File: user_account.h
7
- #pragma once
8
-
9
- #include <string>
10
- #include <string_view>
11
- #include <optional>
12
-
13
- namespace myapp::domain {
14
-
15
- // Types use PascalCase
16
- class UserAccount {
17
- public:
18
- // Constants use UPPER_SNAKE_CASE
19
- static constexpr int MAX_NAME_LENGTH = 128;
20
-
21
- // Constructors and methods use camelCase
22
- explicit UserAccount(std::string_view userName, int accountId);
23
-
24
- // Const member function — does not modify the object
25
- [[nodiscard]] std::string_view getUserName() const;
26
- [[nodiscard]] int getAccountId() const;
27
-
28
- // Mutating method
29
- void setUserName(std::string_view newName);
30
-
31
- private:
32
- // Private members use camelCase with trailing underscore
33
- std::string userName_;
34
- int accountId_;
35
- };
36
-
37
- } // namespace myapp::domain
38
- ```
39
-
40
- ## Header Organization
41
-
42
- ```cpp
43
- // File: connection_pool.cpp
44
-
45
- // 1. Project headers first
46
- #include "connection_pool.h"
47
- #include "network/socket.h"
48
-
49
- // 2. Third-party headers
50
- #include <boost/asio.hpp>
51
-
52
- // 3. Standard library
53
- #include <algorithm>
54
- #include <chrono>
55
- #include <memory>
56
- #include <vector>
57
-
58
- namespace myapp::network {
59
- // ...
60
- } // namespace myapp::network
61
- ```
62
-
63
- ## Forward Declarations to Reduce Coupling
64
-
65
- ```cpp
66
- // File: request_handler.h
67
- #pragma once
68
-
69
- // Forward declare instead of including the full header
70
- namespace myapp::domain {
71
- class UserAccount;
72
- }
73
-
74
- namespace myapp::network {
75
-
76
- class RequestHandler {
77
- public:
78
- // Only a reference/pointer is needed here — forward declaration is sufficient
79
- void handle(const myapp::domain::UserAccount& user);
80
- };
81
-
82
- } // namespace myapp::network
83
- ```
84
-
85
- ## Namespace Usage
86
-
87
- ```cpp
88
- // Good: deeply nested namespace matching directory structure
89
- namespace myapp::network::http {
90
-
91
- class Client {
92
- // ...
93
- };
94
-
95
- } // namespace myapp::network::http
96
-
97
- // Avoid in headers — pollutes every translation unit that includes this header:
98
- // using namespace std; // BAD in headers
99
-
100
- // OK in .cpp files, restricted to file scope:
101
- // using namespace myapp::network::http;
102
- ```
@@ -1,60 +0,0 @@
1
- ---
2
- name: C++ Safety-First Concurrency
3
- description: Enforce safe multi-threading patterns using RAII locking and task-based parallelism (C++14+).
4
- ---
5
- # C++ Safety-First Concurrency (Core Guidelines Section CP)
6
-
7
- This skill prevents common multi-threading defects like data races, deadlocks, and shared-state corruption.
8
-
9
- ## Policies
10
-
11
- ### 1. RAII Locking Only
12
- * **Rule**: Never call `mutex.lock()` or `mutex.unlock()` manually.
13
- * **Action**:
14
- - Use `std::lock_guard` for single mutexes.
15
- - Use `std::unique_lock` if you need deferred locking or condition variables.
16
- - Use `std::scoped_lock` (C++17) for multiple mutexes to avoid deadlocks.
17
- * **Rationale**: Ensures locks are released even if an exception is thrown.
18
-
19
- ### 2. Task-Based Parallelism
20
- * **Rule**: Prefer tasks (`std::async`, `std::packaged_task`, `std::future`) over raw threads (`std::thread`).
21
- * **Action**: Use `auto result = std::async(std::launch::async, func, args...);`
22
- * **Rationale**: Automates thread management and handles value return/exception propagation naturally.
23
-
24
- ### 3. Minimize Shared Mutable State
25
- * **Rule**: Data should ideally be either "Thread-Local" or "Read-Only".
26
- * **Action**:
27
- - Pass data to threads by value where possible.
28
- - Use `const` for data shared between threads.
29
- - Group mutexes with the data they protect (e.g., in a struct).
30
- * **Rationale**: If data isn't shared or isn't mutable, it cannot have a race condition.
31
-
32
- ### 4. Never Sleep/Wait without a Condition
33
- * **Rule**: Avoid `std::this_thread::sleep_for` for synchronization.
34
- * **Action**: Use `std::condition_variable` with a predicate to wait for work.
35
- * **Rationale**: Sleeping is inefficient and bug-prone; condition variables are precise and responsive.
36
-
37
- ## Examples
38
-
39
- ### Before (Dangerous Concurrency)
40
- ```cpp
41
- std::mutex mtx;
42
- int sharedData = 0;
43
-
44
- void worker() {
45
- mtx.lock();
46
- sharedData++;
47
- mtx.unlock(); // What if an exception happened above?
48
- }
49
- ```
50
-
51
- ### After (Safe Concurrency)
52
- ```cpp
53
- std::mutex mtx;
54
- int sharedData = 0;
55
-
56
- void worker() {
57
- std::lock_guard<std::mutex> lock(mtx);
58
- sharedData++;
59
- } // Lock automatically released here
60
- ```
@@ -1,73 +0,0 @@
1
- # Concurrency Safety Examples (C++14+)
2
-
3
- ### 1. Task-Based Parallelism (Async)
4
- Avoids manual thread joining and handles return values safely.
5
-
6
- ```cpp
7
- #include <future>
8
- #include <vector>
9
- #include <numeric>
10
-
11
- int computeLargeSum(const std::vector<int>& data) {
12
- auto part1 = std::async(std::launch::async, [&data]() {
13
- return std::accumulate(data.begin(), data.begin() + data.size()/2, 0);
14
- });
15
-
16
- auto part2 = std::accumulate(data.begin() + data.size()/2, data.end(), 0);
17
-
18
- return part1.get() + part2;
19
- }
20
- ```
21
-
22
- ### 2. Multi-Lock Safety (C++17 scoped_lock)
23
- Prevents deadlocks when acquiring multiple resources.
24
-
25
- ```cpp
26
- #include <mutex>
27
-
28
- struct Account {
29
- std::mutex mtx;
30
- double balance;
31
- };
32
-
33
- void transfer(Account& from, Account& to, double amount) {
34
- // Acquire both locks simultaneously in a deadlock-free manner
35
- std::scoped_lock lock(from.mtx, to.mtx);
36
-
37
- if (from.balance >= amount) {
38
- from.balance -= amount;
39
- to.balance += amount;
40
- }
41
- }
42
- ```
43
-
44
- ### 3. Condition Variables with Predicates
45
- Always use a predicate to protect against "spurious wakeups."
46
-
47
- ```cpp
48
- #include <mutex>
49
- #include <condition_variable>
50
- #include <queue>
51
-
52
- std::queue<int> workQueue;
53
- std::mutex workMtx;
54
- std::condition_variable workCv;
55
- bool finished = false;
56
-
57
- void consumer() {
58
- while (true) {
59
- std::unique_lock<std::mutex> lock(workMtx);
60
-
61
- // Wait until there is work OR we are finished
62
- workCv.wait(lock, []{ return !workQueue.empty() || finished; });
63
-
64
- if (workQueue.empty() && finished) break;
65
-
66
- int task = workQueue.front();
67
- workQueue.pop();
68
- lock.unlock(); // Release lock before processing
69
-
70
- process(task);
71
- }
72
- }
73
- ```