ma-agents 3.4.6 → 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.
- package/.opencode/skills/.ma-agents.json +48 -167
- package/.opencode/skills/MANIFEST.yaml +0 -128
- package/.opencode/skills/add-sprint/.gitkeep +0 -0
- package/.opencode/skills/add-sprint/SKILL.md +207 -0
- package/.opencode/skills/add-sprint/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/add-to-sprint/.gitkeep +0 -0
- package/.opencode/skills/add-to-sprint/SKILL.md +189 -0
- package/.opencode/skills/add-to-sprint/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/bmad-advanced-elicitation/SKILL.md +137 -0
- package/.opencode/skills/bmad-advanced-elicitation/methods.csv +51 -0
- package/.opencode/skills/bmad-agent-analyst/SKILL.md +56 -0
- package/.opencode/skills/bmad-agent-analyst/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-architect/SKILL.md +52 -0
- package/.opencode/skills/bmad-agent-architect/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-dev/SKILL.md +62 -0
- package/.opencode/skills/bmad-agent-dev/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-pm/SKILL.md +57 -0
- package/.opencode/skills/bmad-agent-pm/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-qa/SKILL.md +59 -0
- package/.opencode/skills/bmad-agent-qa/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-quick-flow-solo-dev/SKILL.md +51 -0
- package/.opencode/skills/bmad-agent-quick-flow-solo-dev/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-sm/SKILL.md +53 -0
- package/.opencode/skills/bmad-agent-sm/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-tech-writer/SKILL.md +55 -0
- package/.opencode/skills/bmad-agent-tech-writer/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-agent-tech-writer/explain-concept.md +20 -0
- package/.opencode/skills/bmad-agent-tech-writer/mermaid-gen.md +20 -0
- package/.opencode/skills/bmad-agent-tech-writer/validate-doc.md +19 -0
- package/.opencode/skills/bmad-agent-tech-writer/write-document.md +20 -0
- package/.opencode/skills/bmad-agent-ux-designer/SKILL.md +53 -0
- package/.opencode/skills/bmad-agent-ux-designer/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-brainstorming/SKILL.md +6 -0
- package/.opencode/skills/bmad-brainstorming/brain-methods.csv +62 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-01-session-setup.md +214 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-01b-continue.md +124 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-02a-user-selected.md +229 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-02b-ai-recommended.md +239 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-02c-random-selection.md +211 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-02d-progressive-flow.md +266 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-03-technique-execution.md +401 -0
- package/.opencode/skills/bmad-brainstorming/steps/step-04-idea-organization.md +305 -0
- package/.opencode/skills/bmad-brainstorming/template.md +15 -0
- package/.opencode/skills/bmad-brainstorming/workflow.md +53 -0
- package/.opencode/skills/bmad-check-implementation-readiness/SKILL.md +6 -0
- package/.opencode/skills/bmad-check-implementation-readiness/steps/step-01-document-discovery.md +179 -0
- package/.opencode/skills/bmad-check-implementation-readiness/steps/step-02-prd-analysis.md +168 -0
- package/.opencode/skills/bmad-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +169 -0
- package/.opencode/skills/bmad-check-implementation-readiness/steps/step-04-ux-alignment.md +129 -0
- package/.opencode/skills/bmad-check-implementation-readiness/steps/step-05-epic-quality-review.md +241 -0
- package/.opencode/skills/bmad-check-implementation-readiness/steps/step-06-final-assessment.md +126 -0
- package/.opencode/skills/bmad-check-implementation-readiness/templates/readiness-report-template.md +4 -0
- package/.opencode/skills/bmad-check-implementation-readiness/workflow.md +49 -0
- package/.opencode/skills/bmad-cis-design-thinking/SKILL.md +6 -0
- package/.opencode/skills/bmad-cis-design-thinking/bmad-skill-manifest.yaml +1 -0
- package/.opencode/skills/bmad-cis-design-thinking/design-methods.csv +31 -0
- package/.opencode/skills/bmad-cis-design-thinking/template.md +111 -0
- package/.opencode/skills/bmad-cis-design-thinking/workflow.md +242 -0
- package/.opencode/skills/bmad-cis-innovation-strategy/SKILL.md +6 -0
- package/.opencode/skills/bmad-cis-innovation-strategy/bmad-skill-manifest.yaml +1 -0
- package/.opencode/skills/bmad-cis-innovation-strategy/innovation-frameworks.csv +31 -0
- package/.opencode/skills/bmad-cis-innovation-strategy/template.md +189 -0
- package/.opencode/skills/bmad-cis-innovation-strategy/workflow.md +315 -0
- package/.opencode/skills/bmad-cis-problem-solving/SKILL.md +6 -0
- package/.opencode/skills/bmad-cis-problem-solving/bmad-skill-manifest.yaml +1 -0
- package/.opencode/skills/bmad-cis-problem-solving/solving-methods.csv +31 -0
- package/.opencode/skills/bmad-cis-problem-solving/template.md +165 -0
- package/.opencode/skills/bmad-cis-problem-solving/workflow.md +291 -0
- package/.opencode/skills/bmad-cis-storytelling/SKILL.md +6 -0
- package/.opencode/skills/bmad-cis-storytelling/bmad-skill-manifest.yaml +1 -0
- package/.opencode/skills/bmad-cis-storytelling/story-types.csv +26 -0
- package/.opencode/skills/bmad-cis-storytelling/template.md +113 -0
- package/.opencode/skills/bmad-cis-storytelling/workflow.md +321 -0
- package/.opencode/skills/bmad-code-review/SKILL.md +6 -0
- package/.opencode/skills/bmad-code-review/steps/step-01-gather-context.md +62 -0
- package/.opencode/skills/bmad-code-review/steps/step-02-review.md +34 -0
- package/.opencode/skills/bmad-code-review/steps/step-03-triage.md +49 -0
- package/.opencode/skills/bmad-code-review/steps/step-04-present.md +129 -0
- package/.opencode/skills/bmad-code-review/workflow.md +55 -0
- package/.opencode/skills/bmad-correct-course/SKILL.md +6 -0
- package/.opencode/skills/bmad-correct-course/checklist.md +288 -0
- package/.opencode/skills/bmad-correct-course/workflow.md +267 -0
- package/.opencode/skills/bmad-create-architecture/SKILL.md +6 -0
- package/.opencode/skills/bmad-create-architecture/architecture-decision-template.md +12 -0
- package/.opencode/skills/bmad-create-architecture/data/domain-complexity.csv +13 -0
- package/.opencode/skills/bmad-create-architecture/data/project-types.csv +7 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-01-init.md +153 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-01b-continue.md +173 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-02-context.md +224 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-03-starter.md +329 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-04-decisions.md +318 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-05-patterns.md +359 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-06-structure.md +379 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-07-validation.md +359 -0
- package/.opencode/skills/bmad-create-architecture/steps/step-08-complete.md +76 -0
- package/.opencode/skills/bmad-create-architecture/workflow.md +38 -0
- package/.opencode/skills/bmad-create-epics-and-stories/SKILL.md +6 -0
- package/.opencode/skills/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +255 -0
- package/.opencode/skills/bmad-create-epics-and-stories/steps/step-02-design-epics.md +212 -0
- package/.opencode/skills/bmad-create-epics-and-stories/steps/step-03-create-stories.md +255 -0
- package/.opencode/skills/bmad-create-epics-and-stories/steps/step-04-final-validation.md +131 -0
- package/.opencode/skills/bmad-create-epics-and-stories/templates/epics-template.md +61 -0
- package/.opencode/skills/bmad-create-epics-and-stories/workflow.md +53 -0
- package/.opencode/skills/bmad-create-prd/SKILL.md +6 -0
- package/.opencode/skills/bmad-create-prd/data/domain-complexity.csv +15 -0
- package/.opencode/skills/bmad-create-prd/data/prd-purpose.md +197 -0
- package/.opencode/skills/bmad-create-prd/data/project-types.csv +11 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-01-init.md +178 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-01b-continue.md +161 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-02-discovery.md +208 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-02b-vision.md +142 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-02c-executive-summary.md +158 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-03-success.md +214 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-04-journeys.md +201 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-05-domain.md +194 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-06-innovation.md +211 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-07-project-type.md +222 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-08-scoping.md +216 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-09-functional.md +219 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-10-nonfunctional.md +230 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-11-polish.md +221 -0
- package/.opencode/skills/bmad-create-prd/steps-c/step-12-complete.md +115 -0
- package/.opencode/skills/bmad-create-prd/templates/prd-template.md +10 -0
- package/.opencode/skills/bmad-create-prd/workflow.md +62 -0
- package/.opencode/skills/bmad-create-story/SKILL.md +6 -0
- package/.opencode/skills/bmad-create-story/checklist.md +357 -0
- package/.opencode/skills/bmad-create-story/discover-inputs.md +88 -0
- package/.opencode/skills/bmad-create-story/template.md +49 -0
- package/.opencode/skills/bmad-create-story/workflow.md +380 -0
- package/.opencode/skills/bmad-create-ux-design/SKILL.md +6 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-01-init.md +135 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-01b-continue.md +127 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-02-discovery.md +190 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-03-core-experience.md +217 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-04-emotional-response.md +220 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-05-inspiration.md +235 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-06-design-system.md +253 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-07-defining-experience.md +255 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-08-visual-foundation.md +225 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-09-design-directions.md +225 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-10-user-journeys.md +242 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-11-component-strategy.md +249 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-12-ux-patterns.md +238 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-13-responsive-accessibility.md +265 -0
- package/.opencode/skills/bmad-create-ux-design/steps/step-14-complete.md +171 -0
- package/.opencode/skills/bmad-create-ux-design/ux-design-template.md +13 -0
- package/.opencode/skills/bmad-create-ux-design/workflow.md +36 -0
- package/.opencode/skills/bmad-dev-story/SKILL.md +6 -0
- package/.opencode/skills/bmad-dev-story/checklist.md +80 -0
- package/.opencode/skills/bmad-dev-story/workflow.md +450 -0
- package/.opencode/skills/bmad-distillator/SKILL.md +178 -0
- package/.opencode/skills/bmad-distillator/agents/distillate-compressor.md +116 -0
- package/.opencode/skills/bmad-distillator/agents/round-trip-reconstructor.md +68 -0
- package/.opencode/skills/bmad-distillator/resources/compression-rules.md +51 -0
- package/.opencode/skills/bmad-distillator/resources/distillate-format-reference.md +227 -0
- package/.opencode/skills/bmad-distillator/resources/splitting-strategy.md +78 -0
- package/.opencode/skills/bmad-distillator/scripts/analyze_sources.py +300 -0
- package/.opencode/skills/bmad-distillator/scripts/tests/test_analyze_sources.py +204 -0
- package/.opencode/skills/bmad-document-project/SKILL.md +6 -0
- package/.opencode/skills/bmad-document-project/checklist.md +245 -0
- package/.opencode/skills/bmad-document-project/documentation-requirements.csv +12 -0
- package/.opencode/skills/bmad-document-project/instructions.md +128 -0
- package/.opencode/skills/bmad-document-project/templates/deep-dive-template.md +345 -0
- package/.opencode/skills/bmad-document-project/templates/index-template.md +169 -0
- package/.opencode/skills/bmad-document-project/templates/project-overview-template.md +103 -0
- package/.opencode/skills/bmad-document-project/templates/project-scan-report-schema.json +160 -0
- package/.opencode/skills/bmad-document-project/templates/source-tree-template.md +135 -0
- package/.opencode/skills/bmad-document-project/workflow.md +27 -0
- package/.opencode/skills/bmad-document-project/workflows/deep-dive-instructions.md +299 -0
- package/.opencode/skills/bmad-document-project/workflows/deep-dive-workflow.md +34 -0
- package/.opencode/skills/bmad-document-project/workflows/full-scan-instructions.md +1107 -0
- package/.opencode/skills/bmad-document-project/workflows/full-scan-workflow.md +34 -0
- package/.opencode/skills/bmad-domain-research/SKILL.md +6 -0
- package/.opencode/skills/bmad-domain-research/domain-steps/step-01-init.md +137 -0
- package/.opencode/skills/bmad-domain-research/domain-steps/step-02-domain-analysis.md +229 -0
- package/.opencode/skills/bmad-domain-research/domain-steps/step-03-competitive-landscape.md +238 -0
- package/.opencode/skills/bmad-domain-research/domain-steps/step-04-regulatory-focus.md +206 -0
- package/.opencode/skills/bmad-domain-research/domain-steps/step-05-technical-trends.md +234 -0
- package/.opencode/skills/bmad-domain-research/domain-steps/step-06-research-synthesis.md +444 -0
- package/.opencode/skills/bmad-domain-research/research.template.md +29 -0
- package/.opencode/skills/bmad-domain-research/workflow.md +49 -0
- package/.opencode/skills/bmad-edit-prd/SKILL.md +6 -0
- package/.opencode/skills/bmad-edit-prd/steps-e/step-e-01-discovery.md +242 -0
- package/.opencode/skills/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md +204 -0
- package/.opencode/skills/bmad-edit-prd/steps-e/step-e-02-review.md +245 -0
- package/.opencode/skills/bmad-edit-prd/steps-e/step-e-03-edit.md +250 -0
- package/.opencode/skills/bmad-edit-prd/steps-e/step-e-04-complete.md +165 -0
- package/.opencode/skills/bmad-edit-prd/workflow.md +63 -0
- package/.opencode/skills/bmad-editorial-review-prose/SKILL.md +86 -0
- package/.opencode/skills/bmad-editorial-review-structure/SKILL.md +179 -0
- package/.opencode/skills/bmad-generate-project-context/SKILL.md +6 -0
- package/.opencode/skills/bmad-generate-project-context/project-context-template.md +21 -0
- package/.opencode/skills/bmad-generate-project-context/steps/step-01-discover.md +186 -0
- package/.opencode/skills/bmad-generate-project-context/steps/step-02-generate.md +321 -0
- package/.opencode/skills/bmad-generate-project-context/steps/step-03-complete.md +278 -0
- package/.opencode/skills/bmad-generate-project-context/workflow.md +43 -0
- package/.opencode/skills/bmad-help/SKILL.md +73 -0
- package/.opencode/skills/bmad-index-docs/SKILL.md +66 -0
- package/.opencode/skills/bmad-init/SKILL.md +100 -0
- package/.opencode/skills/bmad-init/resources/core-module.yaml +25 -0
- package/.opencode/skills/bmad-init/scripts/bmad_init.py +593 -0
- package/.opencode/skills/bmad-init/scripts/tests/test_bmad_init.py +329 -0
- package/.opencode/skills/bmad-ma-agent-cyber/.gitkeep +0 -0
- package/.opencode/skills/bmad-ma-agent-cyber/SKILL.md +49 -0
- package/.opencode/skills/bmad-ma-agent-cyber/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-ma-agent-devops/.gitkeep +0 -0
- package/.opencode/skills/bmad-ma-agent-devops/SKILL.md +49 -0
- package/.opencode/skills/bmad-ma-agent-devops/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-ma-agent-mil498/.gitkeep +0 -0
- package/.opencode/skills/bmad-ma-agent-mil498/SKILL.md +53 -0
- package/.opencode/skills/bmad-ma-agent-mil498/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-ma-agent-ml/.gitkeep +0 -0
- package/.opencode/skills/bmad-ma-agent-ml/SKILL.md +59 -0
- package/.opencode/skills/bmad-ma-agent-ml/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-ma-agent-sre/.gitkeep +0 -0
- package/.opencode/skills/bmad-ma-agent-sre/SKILL.md +49 -0
- package/.opencode/skills/bmad-ma-agent-sre/bmad-skill-manifest.yaml +11 -0
- package/.opencode/skills/bmad-market-research/SKILL.md +6 -0
- package/.opencode/skills/bmad-market-research/research.template.md +29 -0
- package/.opencode/skills/bmad-market-research/steps/step-01-init.md +184 -0
- package/.opencode/skills/bmad-market-research/steps/step-02-customer-behavior.md +239 -0
- package/.opencode/skills/bmad-market-research/steps/step-03-customer-pain-points.md +251 -0
- package/.opencode/skills/bmad-market-research/steps/step-04-customer-decisions.md +261 -0
- package/.opencode/skills/bmad-market-research/steps/step-05-competitive-analysis.md +173 -0
- package/.opencode/skills/bmad-market-research/steps/step-06-research-completion.md +478 -0
- package/.opencode/skills/bmad-market-research/workflow.md +49 -0
- package/.opencode/skills/bmad-party-mode/SKILL.md +6 -0
- package/.opencode/skills/bmad-party-mode/steps/step-01-agent-loading.md +138 -0
- package/.opencode/skills/bmad-party-mode/steps/step-02-discussion-orchestration.md +187 -0
- package/.opencode/skills/bmad-party-mode/steps/step-03-graceful-exit.md +167 -0
- package/.opencode/skills/bmad-party-mode/workflow.md +190 -0
- package/.opencode/skills/bmad-product-brief/SKILL.md +87 -0
- package/.opencode/skills/bmad-product-brief/agents/artifact-analyzer.md +60 -0
- package/.opencode/skills/bmad-product-brief/agents/opportunity-reviewer.md +44 -0
- package/.opencode/skills/bmad-product-brief/agents/skeptic-reviewer.md +44 -0
- package/.opencode/skills/bmad-product-brief/agents/web-researcher.md +49 -0
- package/.opencode/skills/bmad-product-brief/bmad-manifest.json +17 -0
- package/.opencode/skills/bmad-product-brief/prompts/contextual-discovery.md +57 -0
- package/.opencode/skills/bmad-product-brief/prompts/draft-and-review.md +86 -0
- package/.opencode/skills/bmad-product-brief/prompts/finalize.md +75 -0
- package/.opencode/skills/bmad-product-brief/prompts/guided-elicitation.md +70 -0
- package/.opencode/skills/bmad-product-brief/resources/brief-template.md +60 -0
- package/.opencode/skills/bmad-qa-generate-e2e-tests/SKILL.md +6 -0
- package/.opencode/skills/bmad-qa-generate-e2e-tests/checklist.md +33 -0
- package/.opencode/skills/bmad-qa-generate-e2e-tests/workflow.md +136 -0
- package/.opencode/skills/bmad-quick-dev/SKILL.md +6 -0
- package/.opencode/skills/bmad-quick-dev/spec-template.md +88 -0
- package/.opencode/skills/bmad-quick-dev/step-01-clarify-and-route.md +64 -0
- package/.opencode/skills/bmad-quick-dev/step-02-plan.md +35 -0
- package/.opencode/skills/bmad-quick-dev/step-03-implement.md +37 -0
- package/.opencode/skills/bmad-quick-dev/step-04-review.md +49 -0
- package/.opencode/skills/bmad-quick-dev/step-05-present.md +63 -0
- package/.opencode/skills/bmad-quick-dev/step-oneshot.md +49 -0
- package/.opencode/skills/bmad-quick-dev/workflow.md +79 -0
- package/.opencode/skills/bmad-retrospective/SKILL.md +6 -0
- package/.opencode/skills/bmad-retrospective/workflow.md +1479 -0
- package/.opencode/skills/bmad-review-adversarial-general/SKILL.md +37 -0
- package/.opencode/skills/bmad-review-edge-case-hunter/SKILL.md +67 -0
- package/.opencode/skills/bmad-shard-doc/SKILL.md +105 -0
- package/.opencode/skills/bmad-sprint-planning/SKILL.md +6 -0
- package/.opencode/skills/bmad-sprint-planning/checklist.md +33 -0
- package/.opencode/skills/bmad-sprint-planning/sprint-status-template.yaml +56 -0
- package/.opencode/skills/bmad-sprint-planning/workflow.md +263 -0
- package/.opencode/skills/bmad-sprint-status/SKILL.md +6 -0
- package/.opencode/skills/bmad-sprint-status/workflow.md +261 -0
- package/.opencode/skills/bmad-technical-research/SKILL.md +6 -0
- package/.opencode/skills/bmad-technical-research/research.template.md +29 -0
- package/.opencode/skills/bmad-technical-research/technical-steps/step-01-init.md +137 -0
- package/.opencode/skills/bmad-technical-research/technical-steps/step-02-technical-overview.md +239 -0
- package/.opencode/skills/bmad-technical-research/technical-steps/step-03-integration-patterns.md +248 -0
- package/.opencode/skills/bmad-technical-research/technical-steps/step-04-architectural-patterns.md +202 -0
- package/.opencode/skills/bmad-technical-research/technical-steps/step-05-implementation-research.md +233 -0
- package/.opencode/skills/bmad-technical-research/technical-steps/step-06-research-synthesis.md +487 -0
- package/.opencode/skills/bmad-technical-research/workflow.md +50 -0
- package/.opencode/skills/bmad-validate-prd/SKILL.md +6 -0
- package/.opencode/skills/bmad-validate-prd/data/domain-complexity.csv +15 -0
- package/.opencode/skills/bmad-validate-prd/data/prd-purpose.md +197 -0
- package/.opencode/skills/bmad-validate-prd/data/project-types.csv +11 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-01-discovery.md +221 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-02-format-detection.md +188 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-02b-parity-check.md +206 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-03-density-validation.md +171 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +211 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-05-measurability-validation.md +225 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-06-traceability-validation.md +214 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +202 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +240 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-09-project-type-validation.md +260 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-10-smart-validation.md +206 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +261 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-12-completeness-validation.md +239 -0
- package/.opencode/skills/bmad-validate-prd/steps-v/step-v-13-report-complete.md +229 -0
- package/.opencode/skills/bmad-validate-prd/workflow.md +62 -0
- package/.opencode/skills/cleanup-done/.gitkeep +0 -0
- package/.opencode/skills/cleanup-done/SKILL.md +159 -0
- package/.opencode/skills/cleanup-done/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/create-bug-story/.gitkeep +0 -0
- package/.opencode/skills/create-bug-story/SKILL.md +263 -0
- package/.opencode/skills/create-bug-story/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-generate-certs/.gitkeep +0 -0
- package/.opencode/skills/cyber-generate-certs/SKILL.md +27 -0
- package/.opencode/skills/cyber-generate-certs/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-immunity-estimation/.gitkeep +0 -0
- package/.opencode/skills/cyber-immunity-estimation/SKILL.md +29 -0
- package/.opencode/skills/cyber-immunity-estimation/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-security-audit/.gitkeep +0 -0
- package/.opencode/skills/cyber-security-audit/SKILL.md +27 -0
- package/.opencode/skills/cyber-security-audit/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-vault-secrets/.gitkeep +0 -0
- package/.opencode/skills/cyber-vault-secrets/SKILL.md +28 -0
- package/.opencode/skills/cyber-vault-secrets/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-verify-docker-users/.gitkeep +0 -0
- package/.opencode/skills/cyber-verify-docker-users/SKILL.md +23 -0
- package/.opencode/skills/cyber-verify-docker-users/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-verify-image-signature/.gitkeep +0 -0
- package/.opencode/skills/cyber-verify-image-signature/SKILL.md +22 -0
- package/.opencode/skills/cyber-verify-image-signature/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/cyber-vulnerability-scan/.gitkeep +0 -0
- package/.opencode/skills/cyber-vulnerability-scan/SKILL.md +28 -0
- package/.opencode/skills/cyber-vulnerability-scan/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/devops-configure-infrastructure/.gitkeep +0 -0
- package/.opencode/skills/devops-configure-infrastructure/SKILL.md +27 -0
- package/.opencode/skills/devops-configure-infrastructure/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/devops-disconnected-deployment/.gitkeep +0 -0
- package/.opencode/skills/devops-disconnected-deployment/SKILL.md +27 -0
- package/.opencode/skills/devops-disconnected-deployment/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/devops-docker-compose-setup/.gitkeep +0 -0
- package/.opencode/skills/devops-docker-compose-setup/SKILL.md +26 -0
- package/.opencode/skills/devops-docker-compose-setup/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/devops-manage-helm/.gitkeep +0 -0
- package/.opencode/skills/devops-manage-helm/SKILL.md +28 -0
- package/.opencode/skills/devops-manage-helm/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/devops-sign-docker-image/.gitkeep +0 -0
- package/.opencode/skills/devops-sign-docker-image/SKILL.md +24 -0
- package/.opencode/skills/devops-sign-docker-image/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/generate-backlog/.gitkeep +0 -0
- package/.opencode/skills/generate-backlog/SKILL.md +183 -0
- package/.opencode/skills/generate-backlog/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/mil498-ocd/.gitkeep +0 -0
- package/.opencode/skills/mil498-ocd/SKILL.md +30 -0
- package/.opencode/skills/mil498-ocd/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-ocd/prompts/01-discover-project-artifacts.md +26 -0
- package/.opencode/skills/mil498-ocd/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-ocd/prompts/03-generate-document.md +90 -0
- package/.opencode/skills/mil498-ocd/prompts/04-validate.md +14 -0
- package/.opencode/skills/mil498-ocd/prompts/05-review.md +15 -0
- package/.opencode/skills/mil498-ocd/prompts/06-save.md +15 -0
- package/.opencode/skills/mil498-ocd/template.md +169 -0
- package/.opencode/skills/mil498-sdd/.gitkeep +0 -0
- package/.opencode/skills/mil498-sdd/SKILL.md +30 -0
- package/.opencode/skills/mil498-sdd/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-sdd/prompts/01-discover-project-artifacts.md +50 -0
- package/.opencode/skills/mil498-sdd/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-sdd/prompts/03-generate-document.md +98 -0
- package/.opencode/skills/mil498-sdd/prompts/04-validate.md +16 -0
- package/.opencode/skills/mil498-sdd/prompts/05-review.md +15 -0
- package/.opencode/skills/mil498-sdd/prompts/06-save.md +19 -0
- package/.opencode/skills/mil498-sdd/template.md +163 -0
- package/.opencode/skills/mil498-sdp/.gitkeep +0 -0
- package/.opencode/skills/mil498-sdp/SKILL.md +30 -0
- package/.opencode/skills/mil498-sdp/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-sdp/prompts/01-discover-project-artifacts.md +32 -0
- package/.opencode/skills/mil498-sdp/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-sdp/prompts/03-generate-document.md +187 -0
- package/.opencode/skills/mil498-sdp/prompts/04-validate.md +13 -0
- package/.opencode/skills/mil498-sdp/prompts/05-review.md +15 -0
- package/.opencode/skills/mil498-sdp/prompts/06-save.md +14 -0
- package/.opencode/skills/mil498-sdp/template.md +307 -0
- package/.opencode/skills/mil498-srs/.gitkeep +0 -0
- package/.opencode/skills/mil498-srs/SKILL.md +30 -0
- package/.opencode/skills/mil498-srs/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-srs/prompts/01-discover-project-artifacts.md +42 -0
- package/.opencode/skills/mil498-srs/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-srs/prompts/03-generate-document.md +100 -0
- package/.opencode/skills/mil498-srs/prompts/04-validate.md +16 -0
- package/.opencode/skills/mil498-srs/prompts/05-review.md +15 -0
- package/.opencode/skills/mil498-srs/prompts/06-save.md +18 -0
- package/.opencode/skills/mil498-srs/template.md +219 -0
- package/.opencode/skills/mil498-ssdd/.gitkeep +0 -0
- package/.opencode/skills/mil498-ssdd/SKILL.md +32 -0
- package/.opencode/skills/mil498-ssdd/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-ssdd/prompts/01-discover-project-artifacts.md +32 -0
- package/.opencode/skills/mil498-ssdd/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-ssdd/prompts/03-csci-discovery-interview.md +43 -0
- package/.opencode/skills/mil498-ssdd/prompts/04-generate-document.md +96 -0
- package/.opencode/skills/mil498-ssdd/prompts/05-validate.md +14 -0
- package/.opencode/skills/mil498-ssdd/prompts/06-review.md +16 -0
- package/.opencode/skills/mil498-ssdd/prompts/07-save.md +16 -0
- package/.opencode/skills/mil498-ssdd/template.md +154 -0
- package/.opencode/skills/mil498-sss/.gitkeep +0 -0
- package/.opencode/skills/mil498-sss/SKILL.md +31 -0
- package/.opencode/skills/mil498-sss/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-sss/prompts/01-discover-project-artifacts.md +31 -0
- package/.opencode/skills/mil498-sss/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-sss/prompts/03-generate-document.md +108 -0
- package/.opencode/skills/mil498-sss/prompts/04-validate.md +16 -0
- package/.opencode/skills/mil498-sss/prompts/05-review.md +15 -0
- package/.opencode/skills/mil498-sss/prompts/06-save.md +15 -0
- package/.opencode/skills/mil498-sss/template.md +225 -0
- package/.opencode/skills/mil498-std/.gitkeep +0 -0
- package/.opencode/skills/mil498-std/SKILL.md +30 -0
- package/.opencode/skills/mil498-std/bmad-skill-manifest.yaml +5 -0
- package/.opencode/skills/mil498-std/prompts/01-discover-project-artifacts.md +42 -0
- package/.opencode/skills/mil498-std/prompts/02-load-template.md +10 -0
- package/.opencode/skills/mil498-std/prompts/03-generate-document.md +117 -0
- package/.opencode/skills/mil498-std/prompts/04-validate.md +15 -0
- package/.opencode/skills/mil498-std/prompts/05-review.md +15 -0
- package/.opencode/skills/mil498-std/prompts/06-save.md +15 -0
- package/.opencode/skills/mil498-std/template.md +188 -0
- package/.opencode/skills/ml-advise/.gitkeep +0 -0
- package/.opencode/skills/ml-advise/SKILL.md +76 -0
- package/.opencode/skills/ml-advise/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-advise/skill.json +7 -0
- package/.opencode/skills/ml-analysis/.gitkeep +0 -0
- package/.opencode/skills/ml-analysis/SKILL.md +60 -0
- package/.opencode/skills/ml-analysis/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-analysis/skill.json +7 -0
- package/.opencode/skills/ml-architecture/.gitkeep +0 -0
- package/.opencode/skills/ml-architecture/SKILL.md +55 -0
- package/.opencode/skills/ml-architecture/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-architecture/skill.json +7 -0
- package/.opencode/skills/ml-detailed-design/.gitkeep +0 -0
- package/.opencode/skills/ml-detailed-design/SKILL.md +67 -0
- package/.opencode/skills/ml-detailed-design/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-detailed-design/skill.json +7 -0
- package/.opencode/skills/ml-eda/.gitkeep +0 -0
- package/.opencode/skills/ml-eda/SKILL.md +56 -0
- package/.opencode/skills/ml-eda/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-eda/scripts/baseline_classifier.py +522 -0
- package/.opencode/skills/ml-eda/scripts/class_weights_calculator.py +295 -0
- package/.opencode/skills/ml-eda/scripts/clustering_explorer.py +383 -0
- package/.opencode/skills/ml-eda/scripts/eda_analyzer.py +654 -0
- package/.opencode/skills/ml-eda/skill.json +7 -0
- package/.opencode/skills/ml-experiment/.gitkeep +0 -0
- package/.opencode/skills/ml-experiment/SKILL.md +74 -0
- package/.opencode/skills/ml-experiment/assets/advanced_trainer_configs.py +430 -0
- package/.opencode/skills/ml-experiment/assets/quick_trainer_setup.py +233 -0
- package/.opencode/skills/ml-experiment/assets/template_datamodule.py +219 -0
- package/.opencode/skills/ml-experiment/assets/template_gnn_module.py +341 -0
- package/.opencode/skills/ml-experiment/assets/template_lightning_module.py +158 -0
- package/.opencode/skills/ml-experiment/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-experiment/skill.json +7 -0
- package/.opencode/skills/ml-hparam/.gitkeep +0 -0
- package/.opencode/skills/ml-hparam/SKILL.md +81 -0
- package/.opencode/skills/ml-hparam/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-hparam/skill.json +7 -0
- package/.opencode/skills/ml-ideation/.gitkeep +0 -0
- package/.opencode/skills/ml-ideation/SKILL.md +50 -0
- package/.opencode/skills/ml-ideation/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-ideation/scripts/validate_ml_prd.py +287 -0
- package/.opencode/skills/ml-ideation/skill.json +7 -0
- package/.opencode/skills/ml-infra/.gitkeep +0 -0
- package/.opencode/skills/ml-infra/SKILL.md +58 -0
- package/.opencode/skills/ml-infra/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-infra/skill.json +7 -0
- package/.opencode/skills/ml-retrospective/.gitkeep +0 -0
- package/.opencode/skills/ml-retrospective/SKILL.md +63 -0
- package/.opencode/skills/ml-retrospective/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-retrospective/skill.json +7 -0
- package/.opencode/skills/ml-revision/.gitkeep +0 -0
- package/.opencode/skills/ml-revision/SKILL.md +82 -0
- package/.opencode/skills/ml-revision/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-revision/skill.json +7 -0
- package/.opencode/skills/ml-techspec/.gitkeep +0 -0
- package/.opencode/skills/ml-techspec/SKILL.md +80 -0
- package/.opencode/skills/ml-techspec/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/ml-techspec/skill.json +7 -0
- package/.opencode/skills/modify-sprint/.gitkeep +0 -0
- package/.opencode/skills/modify-sprint/SKILL.md +322 -0
- package/.opencode/skills/modify-sprint/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/prioritize-backlog/.gitkeep +0 -0
- package/.opencode/skills/prioritize-backlog/SKILL.md +195 -0
- package/.opencode/skills/prioritize-backlog/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/project-context-expansion/.gitkeep +0 -0
- package/.opencode/skills/project-context-expansion/SKILL.md +238 -0
- package/.opencode/skills/project-context-expansion/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/remove-from-sprint/.gitkeep +0 -0
- package/.opencode/skills/remove-from-sprint/SKILL.md +163 -0
- package/.opencode/skills/remove-from-sprint/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sprint-status-view/.gitkeep +0 -0
- package/.opencode/skills/sprint-status-view/SKILL.md +263 -0
- package/.opencode/skills/sprint-status-view/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-check-deployment-status/.gitkeep +0 -0
- package/.opencode/skills/sre-check-deployment-status/SKILL.md +32 -0
- package/.opencode/skills/sre-check-deployment-status/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-check-secrets/.gitkeep +0 -0
- package/.opencode/skills/sre-check-secrets/SKILL.md +23 -0
- package/.opencode/skills/sre-check-secrets/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-check-system-status/.gitkeep +0 -0
- package/.opencode/skills/sre-check-system-status/SKILL.md +27 -0
- package/.opencode/skills/sre-check-system-status/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-day-2-ops/.gitkeep +0 -0
- package/.opencode/skills/sre-day-2-ops/SKILL.md +26 -0
- package/.opencode/skills/sre-day-2-ops/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-deployment-strategies/.gitkeep +0 -0
- package/.opencode/skills/sre-deployment-strategies/SKILL.md +28 -0
- package/.opencode/skills/sre-deployment-strategies/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-fix-deployments/.gitkeep +0 -0
- package/.opencode/skills/sre-fix-deployments/SKILL.md +25 -0
- package/.opencode/skills/sre-fix-deployments/bmad-skill-manifest.yaml +3 -0
- package/.opencode/skills/sre-gitops-status/.gitkeep +0 -0
- package/.opencode/skills/sre-gitops-status/SKILL.md +25 -0
- package/.opencode/skills/sre-gitops-status/bmad-skill-manifest.yaml +3 -0
- package/.roo/skills/.ma-agents.json +48 -167
- package/.roo/skills/MANIFEST.yaml +0 -128
- package/bin/cli.js +20 -6
- package/lib/agents.js +5 -50
- package/lib/bmad.js +4 -1
- package/lib/installer.js +13 -5
- package/package.json +1 -1
- package/.opencode/skills/ai-audit-trail/SKILL.md +0 -23
- package/.opencode/skills/auto-bug-detection/SKILL.md +0 -169
- package/.opencode/skills/cmake-best-practices/SKILL.md +0 -64
- package/.opencode/skills/cmake-best-practices/examples/cmake.md +0 -59
- package/.opencode/skills/code-documentation/SKILL.md +0 -57
- package/.opencode/skills/code-documentation/examples/cpp.md +0 -29
- package/.opencode/skills/code-documentation/examples/csharp.md +0 -28
- package/.opencode/skills/code-documentation/examples/javascript_typescript.md +0 -28
- package/.opencode/skills/code-documentation/examples/python.md +0 -57
- package/.opencode/skills/code-review/SKILL.md +0 -43
- package/.opencode/skills/commit-message/SKILL.md +0 -79
- package/.opencode/skills/cpp-best-practices/SKILL.md +0 -234
- package/.opencode/skills/cpp-best-practices/examples/modern-idioms.md +0 -189
- package/.opencode/skills/cpp-best-practices/examples/naming-and-organization.md +0 -102
- package/.opencode/skills/cpp-concurrency-safety/SKILL.md +0 -60
- package/.opencode/skills/cpp-concurrency-safety/examples/concurrency.md +0 -73
- package/.opencode/skills/cpp-const-correctness/SKILL.md +0 -63
- package/.opencode/skills/cpp-const-correctness/examples/const_correctness.md +0 -54
- package/.opencode/skills/cpp-memory-handling/SKILL.md +0 -42
- package/.opencode/skills/cpp-memory-handling/examples/modern-cpp.md +0 -49
- package/.opencode/skills/cpp-memory-handling/examples/smart-pointers.md +0 -46
- package/.opencode/skills/cpp-modern-composition/SKILL.md +0 -64
- package/.opencode/skills/cpp-modern-composition/examples/composition.md +0 -51
- package/.opencode/skills/cpp-robust-interfaces/SKILL.md +0 -55
- package/.opencode/skills/cpp-robust-interfaces/examples/interfaces.md +0 -56
- package/.opencode/skills/create-hardened-docker-skill/SKILL.md +0 -637
- package/.opencode/skills/create-hardened-docker-skill/scripts/create-all.sh +0 -489
- package/.opencode/skills/csharp-best-practices/SKILL.md +0 -278
- package/.opencode/skills/docker-hardening-verification/SKILL.md +0 -28
- package/.opencode/skills/docker-hardening-verification/scripts/verify-hardening.sh +0 -39
- package/.opencode/skills/docker-image-signing/SKILL.md +0 -28
- package/.opencode/skills/docker-image-signing/scripts/sign-image.sh +0 -33
- package/.opencode/skills/document-revision-history/SKILL.md +0 -104
- package/.roo/skills/ai-audit-trail/SKILL.md +0 -23
- package/.roo/skills/auto-bug-detection/SKILL.md +0 -169
- package/.roo/skills/cmake-best-practices/SKILL.md +0 -64
- package/.roo/skills/cmake-best-practices/examples/cmake.md +0 -59
- package/.roo/skills/code-documentation/SKILL.md +0 -57
- package/.roo/skills/code-documentation/examples/cpp.md +0 -29
- package/.roo/skills/code-documentation/examples/csharp.md +0 -28
- package/.roo/skills/code-documentation/examples/javascript_typescript.md +0 -28
- package/.roo/skills/code-documentation/examples/python.md +0 -57
- package/.roo/skills/code-review/SKILL.md +0 -43
- package/.roo/skills/commit-message/SKILL.md +0 -79
- package/.roo/skills/cpp-best-practices/SKILL.md +0 -234
- package/.roo/skills/cpp-best-practices/examples/modern-idioms.md +0 -189
- package/.roo/skills/cpp-best-practices/examples/naming-and-organization.md +0 -102
- package/.roo/skills/cpp-concurrency-safety/SKILL.md +0 -60
- package/.roo/skills/cpp-concurrency-safety/examples/concurrency.md +0 -73
- package/.roo/skills/cpp-const-correctness/SKILL.md +0 -63
- package/.roo/skills/cpp-const-correctness/examples/const_correctness.md +0 -54
- package/.roo/skills/cpp-memory-handling/SKILL.md +0 -42
- package/.roo/skills/cpp-memory-handling/examples/modern-cpp.md +0 -49
- package/.roo/skills/cpp-memory-handling/examples/smart-pointers.md +0 -46
- package/.roo/skills/cpp-modern-composition/SKILL.md +0 -64
- package/.roo/skills/cpp-modern-composition/examples/composition.md +0 -51
- package/.roo/skills/cpp-robust-interfaces/SKILL.md +0 -55
- package/.roo/skills/cpp-robust-interfaces/examples/interfaces.md +0 -56
- package/.roo/skills/create-hardened-docker-skill/SKILL.md +0 -637
- package/.roo/skills/create-hardened-docker-skill/scripts/create-all.sh +0 -489
- package/.roo/skills/csharp-best-practices/SKILL.md +0 -278
- package/.roo/skills/docker-hardening-verification/SKILL.md +0 -28
- package/.roo/skills/docker-hardening-verification/scripts/verify-hardening.sh +0 -39
- package/.roo/skills/docker-image-signing/SKILL.md +0 -28
- package/.roo/skills/docker-image-signing/scripts/sign-image.sh +0 -33
- package/.roo/skills/document-revision-history/SKILL.md +0 -104
|
@@ -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
|
-
```
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: C++ Const-Correctness & Logic
|
|
3
|
-
description: Enforce immutability-by-default and push logic to compile-time using constexpr (C++14+).
|
|
4
|
-
---
|
|
5
|
-
# C++ Const-Correctness & Logic (Core Guidelines Section Con & ES)
|
|
6
|
-
|
|
7
|
-
This skill ensures that C++ code is "immutable by default," reducing side effects and enabling better compiler optimizations.
|
|
8
|
-
|
|
9
|
-
## Policies
|
|
10
|
-
|
|
11
|
-
### 1. By Default, Make Objects Immutable
|
|
12
|
-
* **Rule**: Declare all variables `const` unless they *must* be modified.
|
|
13
|
-
* **Action**:
|
|
14
|
-
- Use `const auto x = ...;` instead of `auto x = ...;`.
|
|
15
|
-
- Use `const` for function results that won't be modified.
|
|
16
|
-
* **Rationale**: Prevents accidental state mutation and improves code reasoning.
|
|
17
|
-
|
|
18
|
-
### 2. Const Member Functions
|
|
19
|
-
* **Rule**: Any member function that does not modify the object's observable state must be `const`.
|
|
20
|
-
* **Action**: Append `const` to the function signature: `T getValue() const { ... }`.
|
|
21
|
-
* **Rationale**: Necessary for calling functions on `const` objects and `const&` parameters.
|
|
22
|
-
|
|
23
|
-
### 3. Compute at Compile-Time (`constexpr`)
|
|
24
|
-
* **Rule**: Prefer `constexpr` for any value or simple logic that *can* be computed at compile-time.
|
|
25
|
-
* **Action**:
|
|
26
|
-
- Use `constexpr` for constants.
|
|
27
|
-
- Declare mathematical or configuration functions as `constexpr` (C++14 allows complex logic in `constexpr`).
|
|
28
|
-
* **Rationale**: Moves work from runtime to compile-time, reducing binary size and execution time.
|
|
29
|
-
|
|
30
|
-
### 4. Consistent Parameter Logic
|
|
31
|
-
* **Rule**: Avoid passing by value for large types; avoid passing by non-const reference unless it's an "out" or "in-out" parameter.
|
|
32
|
-
* **Action**:
|
|
33
|
-
- **In parameters**: Pass cheap types (int, double, pointers, `string_view`) by value. Pass large types by `const&`.
|
|
34
|
-
- **Out/In-out parameters**: Pass by `T&`.
|
|
35
|
-
- **Sinks**: Pass by `T&&` (rvalue reference).
|
|
36
|
-
|
|
37
|
-
## Examples
|
|
38
|
-
|
|
39
|
-
### Before (Mutable/Runtime Logic)
|
|
40
|
-
```cpp
|
|
41
|
-
int getMultiplier(int x) {
|
|
42
|
-
return x * 10;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
void process() {
|
|
46
|
-
auto data = loadData();
|
|
47
|
-
auto mult = getMultiplier(5); // mutable by accident
|
|
48
|
-
data.apply(mult);
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### After (Const/Compile-time Logic)
|
|
53
|
-
```cpp
|
|
54
|
-
constexpr int getMultiplier(int x) {
|
|
55
|
-
return x * 10;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
void process() {
|
|
59
|
-
const auto data = loadData(); // data won't change
|
|
60
|
-
constexpr auto mult = getMultiplier(5); // computed at compile time
|
|
61
|
-
data.apply(mult);
|
|
62
|
-
}
|
|
63
|
-
```
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Const-Correctness Examples (C++14+)
|
|
2
|
-
|
|
3
|
-
### 1. Complex Const Initialization (Lambda)
|
|
4
|
-
Sometimes you need to conditionally initialize a variable, but you want it to be `const` afterward.
|
|
5
|
-
|
|
6
|
-
**Modern (C++14):**
|
|
7
|
-
```cpp
|
|
8
|
-
const auto path = []() {
|
|
9
|
-
if (auto env = std::getenv("APP_PATH")) {
|
|
10
|
-
return std::string(env);
|
|
11
|
-
}
|
|
12
|
-
return std::string("/default/path");
|
|
13
|
-
}(); // Immediately invoked lambda
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### 2. Const-Correct Member Functions
|
|
17
|
-
Ensure getters and inspectors are `const`.
|
|
18
|
-
|
|
19
|
-
```cpp
|
|
20
|
-
class Config {
|
|
21
|
-
int timeout = 30;
|
|
22
|
-
public:
|
|
23
|
-
// This is an inspector, must be const
|
|
24
|
-
int getTimeout() const { return timeout; }
|
|
25
|
-
|
|
26
|
-
// This is a mutator, cannot be const
|
|
27
|
-
void setTimeout(int t) { timeout = t; }
|
|
28
|
-
};
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 3. C++14 constexpr Logic
|
|
32
|
-
C++14 expanded `constexpr` significantly (loops, branches allowed).
|
|
33
|
-
|
|
34
|
-
```cpp
|
|
35
|
-
constexpr int fibonacci(int n) {
|
|
36
|
-
if (n <= 1) return n;
|
|
37
|
-
int a = 0, b = 1;
|
|
38
|
-
for (int i = 2; i <= n; ++i) {
|
|
39
|
-
int next = a + b;
|
|
40
|
-
a = b;
|
|
41
|
-
b = next;
|
|
42
|
-
}
|
|
43
|
-
return b;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Result is computed by the compiler
|
|
47
|
-
constexpr int fib10 = fibonacci(10);
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### 4. Parameter Passing Guide
|
|
51
|
-
- `void f(int)` : Fast to copy (Value)
|
|
52
|
-
- `void f(const LargeObject&)` : Expensive to copy (Const Ref)
|
|
53
|
-
- `void f(LargeObject&)` : I will modify this (Ref)
|
|
54
|
-
- `void f(LargeObject&&)` : I will MOVE/OWN this (Rvalue Ref)
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: C++ Safe Memory Handling
|
|
3
|
-
description: Enforces Modern C++ practices (RAII, Smart Pointers) to prevent memory leaks, dangling pointers, and buffer overflows.
|
|
4
|
-
---
|
|
5
|
-
# C++ Safe Memory Handling
|
|
6
|
-
|
|
7
|
-
Guidelines for writing robust, memory-safe C++ code by leveraging Modern C++ features and RAII principles.
|
|
8
|
-
|
|
9
|
-
## Mandatory Policies
|
|
10
|
-
|
|
11
|
-
### 1. Smart Pointers by Default
|
|
12
|
-
You MUST use smart pointers for all heap allocations.
|
|
13
|
-
- Use `std::unique_ptr` for exclusive ownership. This is the preferred default.
|
|
14
|
-
- Use `std::shared_ptr` only when multiple objects share ownership of a resource.
|
|
15
|
-
- Use `std::weak_ptr` to break circular dependencies or for non-owning references that must be checked for validity.
|
|
16
|
-
|
|
17
|
-
### 2. Forbid raw new/delete
|
|
18
|
-
You MUST NOT use raw `new` and `delete` operators.
|
|
19
|
-
- Use `std::make_unique` (C++14+) or `std::make_shared` to allocate objects on the heap.
|
|
20
|
-
- Exceptions are only allowed within low-level custom container implementations, which must be encapsulated.
|
|
21
|
-
|
|
22
|
-
### 3. Prefer Value Semantics
|
|
23
|
-
Always prefer stack-allocated objects and value semantics over pointer-based indirection unless heap allocation is strictly necessary (e.g., polymorphism, very large objects, or dynamic lifetimes).
|
|
24
|
-
|
|
25
|
-
### 4. RAII for All Resources
|
|
26
|
-
Every resource (file handles, sockets, mutexes, memory) MUST be managed by an object whose constructor acquires the resource and destructor releases it. Never rely on manual cleanup blocks.
|
|
27
|
-
|
|
28
|
-
### 5. Standard Containers
|
|
29
|
-
NEVER use raw buffers or manually managed arrays.
|
|
30
|
-
- Use `std::vector` for dynamic arrays.
|
|
31
|
-
- Use `std::string` for text.
|
|
32
|
-
- Use `std::array` (C++11) for fixed-size stack arrays.
|
|
33
|
-
- Access elements using `.at()` if bounds checking is required for security-critical logic.
|
|
34
|
-
|
|
35
|
-
## Critical Rules
|
|
36
|
-
- **No Dangling Pointers**: Never return a pointer or reference to a local stack-allocated variable.
|
|
37
|
-
- **Rule of Zero/Five**: Follow the "Rule of Zero" (prefer components that handle their own resource management). If manual management is needed, correctly implement the "Rule of Five".
|
|
38
|
-
- **Nullable Checks**: Always check pointers (even smart ones) for `nullptr` before dereferencing if there is any chance they could be empty.
|
|
39
|
-
|
|
40
|
-
## Resources
|
|
41
|
-
- [Modern C++ Examples](file:///skills/cpp-memory-handling/examples/modern-cpp.md)
|
|
42
|
-
- [Smart Pointer Reference](file:///skills/cpp-memory-handling/examples/smart-pointers.md)
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Modern C++ Safe Memory Examples
|
|
2
|
-
|
|
3
|
-
Demonstrating RAII and safe resource management in modern C++.
|
|
4
|
-
|
|
5
|
-
## RAII Resource Management
|
|
6
|
-
|
|
7
|
-
```cpp
|
|
8
|
-
#include <iostream>
|
|
9
|
-
#include <fstream>
|
|
10
|
-
#include <vector>
|
|
11
|
-
#include <memory>
|
|
12
|
-
|
|
13
|
-
class FileHandler {
|
|
14
|
-
public:
|
|
15
|
-
FileHandler(const std::string& filename) : file(filename) {
|
|
16
|
-
if (!file.is_open()) throw std::runtime_error("Could not open file");
|
|
17
|
-
}
|
|
18
|
-
// Destructor automatically closes the file
|
|
19
|
-
~FileHandler() { if (file.is_open()) file.close(); }
|
|
20
|
-
|
|
21
|
-
void write(const std::string& data) { file << data; }
|
|
22
|
-
|
|
23
|
-
private:
|
|
24
|
-
std::ofstream file;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
void log_data(const std::string& message) {
|
|
28
|
-
// RAII handles lifetime. No manual close needed.
|
|
29
|
-
FileHandler handler("app.log");
|
|
30
|
-
handler.write(message);
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Vector vs Raw Arrays
|
|
35
|
-
|
|
36
|
-
```cpp
|
|
37
|
-
// BAD: Manual memory management
|
|
38
|
-
void bad_array() {
|
|
39
|
-
int* arr = new int[100];
|
|
40
|
-
// ... logic ...
|
|
41
|
-
delete[] arr; // Manual cleanup is error-prone
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// GOOD: Automatic memory management
|
|
45
|
-
void safe_vector() {
|
|
46
|
-
std::vector<int> arr(100);
|
|
47
|
-
// Vector manages its own heap memory. RAII cleans up at scope exit.
|
|
48
|
-
}
|
|
49
|
-
```
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# C++ Smart Pointer Reference
|
|
2
|
-
|
|
3
|
-
Guidelines for selecting and using smart pointers correctly.
|
|
4
|
-
|
|
5
|
-
## unique_ptr (Preferred Default)
|
|
6
|
-
- Represents **exclusive ownership**.
|
|
7
|
-
- Zero runtime overhead compared to raw pointers.
|
|
8
|
-
|
|
9
|
-
```cpp
|
|
10
|
-
#include <memory>
|
|
11
|
-
|
|
12
|
-
class Widget { /* ... */ };
|
|
13
|
-
|
|
14
|
-
void exclusive_use() {
|
|
15
|
-
// Use make_unique for safety and efficiency
|
|
16
|
-
auto widget = std::make_unique<Widget>();
|
|
17
|
-
|
|
18
|
-
// Ownership can be moved but not copied
|
|
19
|
-
std::unique_ptr<Widget> other = std::move(widget);
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## shared_ptr (For Shared Ownership)
|
|
24
|
-
- Use only when **multiple** owners truly exist.
|
|
25
|
-
- Reference counting has small overhead.
|
|
26
|
-
|
|
27
|
-
```cpp
|
|
28
|
-
void shared_use() {
|
|
29
|
-
auto shared_widget = std::make_shared<Widget>();
|
|
30
|
-
|
|
31
|
-
auto owner1 = shared_widget; // Count = 2
|
|
32
|
-
auto owner2 = shared_widget; // Count = 3
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## weak_ptr (Breaking Cycles)
|
|
37
|
-
- Non-owning reference. Must be locked before use.
|
|
38
|
-
|
|
39
|
-
```cpp
|
|
40
|
-
void weak_use(std::weak_ptr<Widget> weak_widget) {
|
|
41
|
-
if (auto shared = weak_widget.lock()) {
|
|
42
|
-
// Resource is still alive
|
|
43
|
-
shared->do_something();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
```
|