@cregis-dev/cckit 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/bin/cckit.js +3 -0
- package/package.json +52 -0
- package/registry.json +194 -0
- package/src/adapters/trae-adapter.js +90 -0
- package/src/cli.js +88 -0
- package/src/commands/add.js +192 -0
- package/src/commands/init.js +333 -0
- package/src/commands/status.js +62 -0
- package/src/commands/sync.js +325 -0
- package/src/commands/update.js +425 -0
- package/src/core/config.js +82 -0
- package/src/core/differ.js +57 -0
- package/src/core/installer.js +97 -0
- package/src/core/plugin-installer.js +237 -0
- package/src/core/registry.js +75 -0
- package/src/core/templatize.js +42 -0
- package/src/core/upstream.js +357 -0
- package/src/utils/fs.js +50 -0
- package/src/utils/logger.js +16 -0
- package/templates/bmad/_config/agent-manifest.csv +12 -0
- package/templates/bmad/_config/agents/bmm-analyst.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-architect.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-dev.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-pm.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-qa.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-quick-flow-solo-dev.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-sm.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-tech-writer.customize.yaml +41 -0
- package/templates/bmad/_config/agents/bmm-ux-designer.customize.yaml +41 -0
- package/templates/bmad/_config/agents/core-bmad-master.customize.yaml +41 -0
- package/templates/bmad/_config/agents/tea-tea.customize.yaml +41 -0
- package/templates/bmad/_config/bmad-help.csv +48 -0
- package/templates/bmad/_config/files-manifest.csv +431 -0
- package/templates/bmad/_config/ides/claude-code.yaml +5 -0
- package/templates/bmad/_config/ides/opencode.yaml +5 -0
- package/templates/bmad/_config/ides/trae.yaml +5 -0
- package/templates/bmad/_config/task-manifest.csv +7 -0
- package/templates/bmad/_config/tool-manifest.csv +1 -0
- package/templates/bmad/_config/workflow-manifest.csv +35 -0
- package/templates/bmad/bmm/agents/analyst.md +78 -0
- package/templates/bmad/bmm/agents/architect.md +58 -0
- package/templates/bmad/bmm/agents/dev.md +69 -0
- package/templates/bmad/bmm/agents/pm.md +72 -0
- package/templates/bmad/bmm/agents/qa.md +92 -0
- package/templates/bmad/bmm/agents/quick-flow-solo-dev.md +69 -0
- package/templates/bmad/bmm/agents/sm.md +70 -0
- package/templates/bmad/bmm/agents/tech-writer/tech-writer.md +70 -0
- package/templates/bmad/bmm/agents/ux-designer.md +57 -0
- package/templates/bmad/bmm/config.yaml +15 -0
- package/templates/bmad/bmm/data/project-context-template.md +26 -0
- package/templates/bmad/bmm/module-help.csv +31 -0
- package/templates/bmad/bmm/teams/default-party.csv +20 -0
- package/templates/bmad/bmm/teams/team-fullstack.yaml +12 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/product-brief.template.md +10 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01-init.md +177 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01b-continue.md +161 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +199 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +202 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +205 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +219 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +162 -0
- package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md +57 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/domain-steps/step-01-init.md +137 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +229 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +238 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +206 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +234 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/domain-steps/step-06-research-synthesis.md +444 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +182 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +237 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +249 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +259 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +177 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +476 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/research.template.md +29 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/technical-steps/step-01-init.md +137 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +239 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +248 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +202 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +233 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/technical-steps/step-06-research-synthesis.md +487 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/workflow-domain-research.md +54 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/workflow-market-research.md +54 -0
- package/templates/bmad/bmm/workflows/1-analysis/research/workflow-technical-research.md +54 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/data/domain-complexity.csv +15 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/data/prd-purpose.md +197 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/data/project-types.csv +11 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-01-init.md +191 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-01b-continue.md +152 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md +224 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md +154 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md +170 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md +226 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md +213 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md +207 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md +226 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md +237 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md +228 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md +231 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md +242 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md +217 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-12-complete.md +124 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md +247 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01b-legacy-conversion.md +208 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md +249 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-03-edit.md +253 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-04-complete.md +168 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +226 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-02-format-detection.md +191 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-02b-parity-check.md +209 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-03-density-validation.md +174 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-04-brief-coverage-validation.md +214 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-05-measurability-validation.md +228 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-06-traceability-validation.md +217 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-07-implementation-leakage-validation.md +205 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-08-domain-compliance-validation.md +243 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-09-project-type-validation.md +263 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +209 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +264 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-12-completeness-validation.md +242 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +231 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/templates/prd-template.md +10 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-create-prd.md +63 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-edit-prd.md +65 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +63 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +135 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +127 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +190 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +216 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +219 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +234 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +252 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +254 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +224 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +224 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +241 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +248 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +237 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +264 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +171 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/ux-design-template.md +13 -0
- package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md +42 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-01-document-discovery.md +184 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-02-prd-analysis.md +172 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-03-epic-coverage-validation.md +173 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-04-ux-alignment.md +133 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-05-epic-quality-review.md +245 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +129 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/templates/readiness-report-template.md +4 -0
- package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md +54 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/architecture-decision-template.md +12 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/data/domain-complexity.csv +13 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/data/project-types.csv +7 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01-init.md +153 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01b-continue.md +173 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +224 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +329 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +318 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +359 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +379 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +359 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +76 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md +49 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +259 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +233 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +272 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +149 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md +57 -0
- package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md +58 -0
- package/templates/bmad/bmm/workflows/4-implementation/code-review/checklist.md +23 -0
- package/templates/bmad/bmm/workflows/4-implementation/code-review/instructions.xml +227 -0
- package/templates/bmad/bmm/workflows/4-implementation/code-review/workflow.yaml +43 -0
- package/templates/bmad/bmm/workflows/4-implementation/correct-course/checklist.md +288 -0
- package/templates/bmad/bmm/workflows/4-implementation/correct-course/instructions.md +207 -0
- package/templates/bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +53 -0
- package/templates/bmad/bmm/workflows/4-implementation/create-story/checklist.md +358 -0
- package/templates/bmad/bmm/workflows/4-implementation/create-story/instructions.xml +346 -0
- package/templates/bmad/bmm/workflows/4-implementation/create-story/template.md +49 -0
- package/templates/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml +52 -0
- package/templates/bmad/bmm/workflows/4-implementation/dev-story/checklist.md +80 -0
- package/templates/bmad/bmm/workflows/4-implementation/dev-story/instructions.xml +410 -0
- package/templates/bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml +20 -0
- package/templates/bmad/bmm/workflows/4-implementation/retrospective/instructions.md +1444 -0
- package/templates/bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml +52 -0
- package/templates/bmad/bmm/workflows/4-implementation/sprint-planning/checklist.md +33 -0
- package/templates/bmad/bmm/workflows/4-implementation/sprint-planning/instructions.md +226 -0
- package/templates/bmad/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +55 -0
- package/templates/bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +47 -0
- package/templates/bmad/bmm/workflows/4-implementation/sprint-status/instructions.md +230 -0
- package/templates/bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml +25 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-01-mode-detection.md +174 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-02-context-gathering.md +118 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md +111 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-04-self-check.md +111 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +104 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-06-resolve-findings.md +146 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +50 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-01-understand.md +189 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-02-investigate.md +143 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-03-generate.md +126 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +200 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/tech-spec-template.md +74 -0
- package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +79 -0
- package/templates/bmad/bmm/workflows/document-project/checklist.md +245 -0
- package/templates/bmad/bmm/workflows/document-project/documentation-requirements.csv +12 -0
- package/templates/bmad/bmm/workflows/document-project/instructions.md +130 -0
- package/templates/bmad/bmm/workflows/document-project/templates/deep-dive-template.md +345 -0
- package/templates/bmad/bmm/workflows/document-project/templates/index-template.md +169 -0
- package/templates/bmad/bmm/workflows/document-project/templates/project-overview-template.md +103 -0
- package/templates/bmad/bmm/workflows/document-project/templates/project-scan-report-schema.json +160 -0
- package/templates/bmad/bmm/workflows/document-project/templates/source-tree-template.md +135 -0
- package/templates/bmad/bmm/workflows/document-project/workflow.yaml +22 -0
- package/templates/bmad/bmm/workflows/document-project/workflows/deep-dive-instructions.md +298 -0
- package/templates/bmad/bmm/workflows/document-project/workflows/deep-dive.yaml +31 -0
- package/templates/bmad/bmm/workflows/document-project/workflows/full-scan-instructions.md +1106 -0
- package/templates/bmad/bmm/workflows/document-project/workflows/full-scan.yaml +31 -0
- package/templates/bmad/bmm/workflows/generate-project-context/project-context-template.md +21 -0
- package/templates/bmad/bmm/workflows/generate-project-context/steps/step-01-discover.md +184 -0
- package/templates/bmad/bmm/workflows/generate-project-context/steps/step-02-generate.md +318 -0
- package/templates/bmad/bmm/workflows/generate-project-context/steps/step-03-complete.md +278 -0
- package/templates/bmad/bmm/workflows/generate-project-context/workflow.md +49 -0
- package/templates/bmad/bmm/workflows/qa/automate/checklist.md +33 -0
- package/templates/bmad/bmm/workflows/qa/automate/instructions.md +110 -0
- package/templates/bmad/bmm/workflows/qa/automate/workflow.yaml +44 -0
- package/templates/bmad/bmm/workflows/qa-generate-e2e-tests/checklist.md +33 -0
- package/templates/bmad/bmm/workflows/qa-generate-e2e-tests/instructions.md +110 -0
- package/templates/bmad/bmm/workflows/qa-generate-e2e-tests/workflow.yaml +42 -0
- package/templates/bmad/commands/bmad-agent-bmad-master.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-analyst.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-architect.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-dev.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-pm.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-qa.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-quick-flow-solo-dev.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-sm.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-tech-writer.md +15 -0
- package/templates/bmad/commands/bmad-agent-bmm-ux-designer.md +15 -0
- package/templates/bmad/commands/bmad-agent-tea-tea.md +15 -0
- package/templates/bmad/commands/bmad-bmm-check-implementation-readiness.md +6 -0
- package/templates/bmad/commands/bmad-bmm-code-review.md +14 -0
- package/templates/bmad/commands/bmad-bmm-correct-course.md +14 -0
- package/templates/bmad/commands/bmad-bmm-create-architecture.md +6 -0
- package/templates/bmad/commands/bmad-bmm-create-epics-and-stories.md +6 -0
- package/templates/bmad/commands/bmad-bmm-create-prd.md +6 -0
- package/templates/bmad/commands/bmad-bmm-create-product-brief.md +6 -0
- package/templates/bmad/commands/bmad-bmm-create-story.md +14 -0
- package/templates/bmad/commands/bmad-bmm-create-ux-design.md +6 -0
- package/templates/bmad/commands/bmad-bmm-dev-story.md +14 -0
- package/templates/bmad/commands/bmad-bmm-document-project.md +14 -0
- package/templates/bmad/commands/bmad-bmm-domain-research.md +6 -0
- package/templates/bmad/commands/bmad-bmm-edit-prd.md +6 -0
- package/templates/bmad/commands/bmad-bmm-generate-project-context.md +6 -0
- package/templates/bmad/commands/bmad-bmm-market-research.md +6 -0
- package/templates/bmad/commands/bmad-bmm-qa-automate.md +15 -0
- package/templates/bmad/commands/bmad-bmm-qa-generate-e2e-tests.md +14 -0
- package/templates/bmad/commands/bmad-bmm-quick-dev.md +6 -0
- package/templates/bmad/commands/bmad-bmm-quick-spec.md +6 -0
- package/templates/bmad/commands/bmad-bmm-retrospective.md +14 -0
- package/templates/bmad/commands/bmad-bmm-sprint-planning.md +14 -0
- package/templates/bmad/commands/bmad-bmm-sprint-status.md +14 -0
- package/templates/bmad/commands/bmad-bmm-technical-research.md +6 -0
- package/templates/bmad/commands/bmad-bmm-validate-prd.md +6 -0
- package/templates/bmad/commands/bmad-brainstorming.md +6 -0
- package/templates/bmad/commands/bmad-editorial-review-prose.md +10 -0
- package/templates/bmad/commands/bmad-editorial-review-structure.md +10 -0
- package/templates/bmad/commands/bmad-help.md +10 -0
- package/templates/bmad/commands/bmad-index-docs.md +10 -0
- package/templates/bmad/commands/bmad-party-mode.md +6 -0
- package/templates/bmad/commands/bmad-review-adversarial-general.md +10 -0
- package/templates/bmad/commands/bmad-shard-doc.md +10 -0
- package/templates/bmad/commands/bmad-tea-teach-me-testing.md +6 -0
- package/templates/bmad/commands/bmad-tea-testarch-atdd.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-automate.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-ci.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-framework.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-nfr.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-test-design.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-test-review.md +14 -0
- package/templates/bmad/commands/bmad-tea-testarch-trace.md +14 -0
- package/templates/bmad/core/agents/bmad-master.md +56 -0
- package/templates/bmad/core/config.yaml +8 -0
- package/templates/bmad/core/module-help.csv +9 -0
- package/templates/bmad/core/tasks/editorial-review-prose.xml +102 -0
- package/templates/bmad/core/tasks/editorial-review-structure.xml +208 -0
- package/templates/bmad/core/tasks/help.md +86 -0
- package/templates/bmad/core/tasks/index-docs.xml +65 -0
- package/templates/bmad/core/tasks/review-adversarial-general.xml +49 -0
- package/templates/bmad/core/tasks/shard-doc.xml +108 -0
- package/templates/bmad/core/tasks/workflow.xml +235 -0
- package/templates/bmad/core/workflows/advanced-elicitation/methods.csv +51 -0
- package/templates/bmad/core/workflows/advanced-elicitation/workflow.xml +118 -0
- package/templates/bmad/core/workflows/brainstorming/brain-methods.csv +62 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-01-session-setup.md +197 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-01b-continue.md +122 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-02a-user-selected.md +225 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-02b-ai-recommended.md +237 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-02c-random-selection.md +209 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-02d-progressive-flow.md +264 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-03-technique-execution.md +399 -0
- package/templates/bmad/core/workflows/brainstorming/steps/step-04-idea-organization.md +303 -0
- package/templates/bmad/core/workflows/brainstorming/template.md +15 -0
- package/templates/bmad/core/workflows/brainstorming/workflow.md +58 -0
- package/templates/bmad/core/workflows/party-mode/steps/step-01-agent-loading.md +138 -0
- package/templates/bmad/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +187 -0
- package/templates/bmad/core/workflows/party-mode/steps/step-03-graceful-exit.md +168 -0
- package/templates/bmad/core/workflows/party-mode/workflow.md +194 -0
- package/templates/bmad/tea/agents/tea.md +71 -0
- package/templates/bmad/tea/config.yaml +20 -0
- package/templates/bmad/tea/module-help.csv +10 -0
- package/templates/bmad/tea/teams/default-party.csv +2 -0
- package/templates/bmad/tea/testarch/knowledge/adr-quality-readiness-checklist.md +377 -0
- package/templates/bmad/tea/testarch/knowledge/api-request.md +563 -0
- package/templates/bmad/tea/testarch/knowledge/api-testing-patterns.md +915 -0
- package/templates/bmad/tea/testarch/knowledge/auth-session.md +548 -0
- package/templates/bmad/tea/testarch/knowledge/burn-in.md +273 -0
- package/templates/bmad/tea/testarch/knowledge/ci-burn-in.md +675 -0
- package/templates/bmad/tea/testarch/knowledge/component-tdd.md +486 -0
- package/templates/bmad/tea/testarch/knowledge/contract-testing.md +957 -0
- package/templates/bmad/tea/testarch/knowledge/data-factories.md +500 -0
- package/templates/bmad/tea/testarch/knowledge/email-auth.md +721 -0
- package/templates/bmad/tea/testarch/knowledge/error-handling.md +725 -0
- package/templates/bmad/tea/testarch/knowledge/feature-flags.md +750 -0
- package/templates/bmad/tea/testarch/knowledge/file-utils.md +456 -0
- package/templates/bmad/tea/testarch/knowledge/fixture-architecture.md +401 -0
- package/templates/bmad/tea/testarch/knowledge/fixtures-composition.md +382 -0
- package/templates/bmad/tea/testarch/knowledge/intercept-network-call.md +426 -0
- package/templates/bmad/tea/testarch/knowledge/log.md +426 -0
- package/templates/bmad/tea/testarch/knowledge/network-error-monitor.md +401 -0
- package/templates/bmad/tea/testarch/knowledge/network-first.md +486 -0
- package/templates/bmad/tea/testarch/knowledge/network-recorder.md +527 -0
- package/templates/bmad/tea/testarch/knowledge/nfr-criteria.md +670 -0
- package/templates/bmad/tea/testarch/knowledge/overview.md +286 -0
- package/templates/bmad/tea/testarch/knowledge/playwright-cli.md +165 -0
- package/templates/bmad/tea/testarch/knowledge/playwright-config.md +730 -0
- package/templates/bmad/tea/testarch/knowledge/probability-impact.md +601 -0
- package/templates/bmad/tea/testarch/knowledge/recurse.md +421 -0
- package/templates/bmad/tea/testarch/knowledge/risk-governance.md +615 -0
- package/templates/bmad/tea/testarch/knowledge/selective-testing.md +732 -0
- package/templates/bmad/tea/testarch/knowledge/selector-resilience.md +527 -0
- package/templates/bmad/tea/testarch/knowledge/test-healing-patterns.md +644 -0
- package/templates/bmad/tea/testarch/knowledge/test-levels-framework.md +473 -0
- package/templates/bmad/tea/testarch/knowledge/test-priorities-matrix.md +373 -0
- package/templates/bmad/tea/testarch/knowledge/test-quality.md +664 -0
- package/templates/bmad/tea/testarch/knowledge/timing-debugging.md +372 -0
- package/templates/bmad/tea/testarch/knowledge/visual-debugging.md +524 -0
- package/templates/bmad/tea/testarch/tea-index.csv +36 -0
- package/templates/bmad/tea/workflows/testarch/README.md +74 -0
- package/templates/bmad/tea/workflows/testarch/atdd/atdd-checklist-template.md +371 -0
- package/templates/bmad/tea/workflows/testarch/atdd/checklist.md +374 -0
- package/templates/bmad/tea/workflows/testarch/atdd/instructions.md +45 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-01-preflight-and-context.md +196 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-01b-resume.md +96 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-02-generation-mode.md +125 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-03-test-strategy.md +110 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04-generate-tests.md +229 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04a-subprocess-api-failing.md +215 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04b-subprocess-e2e-failing.md +244 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04c-aggregate.md +354 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-05-validate-and-complete.md +106 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/atdd/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/atdd/validation-report-20260127-095021.md +73 -0
- package/templates/bmad/tea/workflows/testarch/atdd/validation-report-20260127-102401.md +116 -0
- package/templates/bmad/tea/workflows/testarch/atdd/workflow-plan.md +21 -0
- package/templates/bmad/tea/workflows/testarch/atdd/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/atdd/workflow.yaml +46 -0
- package/templates/bmad/tea/workflows/testarch/automate/checklist.md +582 -0
- package/templates/bmad/tea/workflows/testarch/automate/instructions.md +50 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-01-preflight-and-context.md +205 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-01b-resume.md +94 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-02-identify-targets.md +145 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03-generate-tests.md +278 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03a-subprocess-api.md +183 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03b-subprocess-backend.md +246 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03b-subprocess-e2e.md +213 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03c-aggregate.md +377 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-04-validate-and-summarize.md +106 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/automate/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/automate/validation-report-20260127-095021.md +72 -0
- package/templates/bmad/tea/workflows/testarch/automate/validation-report-20260127-102401.md +114 -0
- package/templates/bmad/tea/workflows/testarch/automate/workflow-plan.md +20 -0
- package/templates/bmad/tea/workflows/testarch/automate/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/automate/workflow.yaml +53 -0
- package/templates/bmad/tea/workflows/testarch/ci/azure-pipelines-template.yaml +155 -0
- package/templates/bmad/tea/workflows/testarch/ci/checklist.md +288 -0
- package/templates/bmad/tea/workflows/testarch/ci/github-actions-template.yaml +210 -0
- package/templates/bmad/tea/workflows/testarch/ci/gitlab-ci-template.yaml +158 -0
- package/templates/bmad/tea/workflows/testarch/ci/harness-pipeline-template.yaml +159 -0
- package/templates/bmad/tea/workflows/testarch/ci/instructions.md +45 -0
- package/templates/bmad/tea/workflows/testarch/ci/jenkins-pipeline-template.groovy +129 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-01-preflight.md +158 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-01b-resume.md +110 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-02-generate-pipeline.md +118 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-03-configure-quality-gates.md +105 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-04-validate-and-summary.md +92 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/ci/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/ci/validation-report-20260127-095021.md +72 -0
- package/templates/bmad/tea/workflows/testarch/ci/validation-report-20260127-102401.md +114 -0
- package/templates/bmad/tea/workflows/testarch/ci/workflow-plan.md +20 -0
- package/templates/bmad/tea/workflows/testarch/ci/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/ci/workflow.yaml +48 -0
- package/templates/bmad/tea/workflows/testarch/framework/checklist.md +321 -0
- package/templates/bmad/tea/workflows/testarch/framework/instructions.md +45 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-01-preflight.md +132 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-01b-resume.md +116 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-02-select-framework.md +117 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-03-scaffold-framework.md +196 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-04-docs-and-scripts.md +105 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-05-validate-and-summary.md +93 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/framework/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/framework/validation-report-20260127-095021.md +73 -0
- package/templates/bmad/tea/workflows/testarch/framework/validation-report-20260127-102401.md +116 -0
- package/templates/bmad/tea/workflows/testarch/framework/workflow-plan.md +22 -0
- package/templates/bmad/tea/workflows/testarch/framework/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/framework/workflow.yaml +48 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/checklist.md +407 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/instructions.md +43 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/nfr-report-template.md +470 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-01-load-context.md +138 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-01b-resume.md +106 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-02-define-thresholds.md +107 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-03-gather-evidence.md +108 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04-evaluate-and-score.md +140 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04a-subprocess-security.md +138 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04b-subprocess-performance.md +84 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04c-subprocess-reliability.md +85 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04d-subprocess-scalability.md +88 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04e-aggregate-nfr.md +247 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-05-generate-report.md +108 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/validation-report-20260127-095021.md +73 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/validation-report-20260127-102401.md +116 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/workflow-plan.md +19 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/nfr-assess/workflow.yaml +48 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/checklist.md +197 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/data/curriculum.yaml +129 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/data/quiz-questions.yaml +206 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/data/role-paths.yaml +136 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/data/session-content-map.yaml +207 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/data/tea-resources-index.yaml +359 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/instructions.md +130 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-01-init.md +235 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-01b-continue.md +147 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-02-assess.md +258 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-03-session-menu.md +219 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-01.md +460 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-02.md +465 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-03.md +301 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-04.md +234 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-05.md +234 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-06.md +209 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-04-session-07.md +212 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-c/step-05-completion.md +339 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-e/step-e-01-assess-workflow.md +141 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-e/step-e-02-apply-edits.md +122 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/steps-v/step-v-01-validate.md +263 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/templates/certificate-template.md +86 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/templates/progress-template.yaml +95 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/templates/session-notes-template.md +83 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/workflow-plan-teach-me-testing.md +950 -0
- package/templates/bmad/tea/workflows/testarch/teach-me-testing/workflow.md +90 -0
- package/templates/bmad/tea/workflows/testarch/test-design/checklist.md +464 -0
- package/templates/bmad/tea/workflows/testarch/test-design/instructions.md +105 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-01-detect-mode.md +134 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-01b-resume.md +102 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-02-load-context.md +212 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-03-risk-and-testability.md +110 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-04-coverage-plan.md +123 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-05-generate-output.md +151 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/test-design/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/test-design/test-design-architecture-template.md +230 -0
- package/templates/bmad/tea/workflows/testarch/test-design/test-design-handoff-template.md +70 -0
- package/templates/bmad/tea/workflows/testarch/test-design/test-design-qa-template.md +396 -0
- package/templates/bmad/tea/workflows/testarch/test-design/test-design-template.md +344 -0
- package/templates/bmad/tea/workflows/testarch/test-design/validation-report-20260127-095021.md +73 -0
- package/templates/bmad/tea/workflows/testarch/test-design/validation-report-20260127-102401.md +116 -0
- package/templates/bmad/tea/workflows/testarch/test-design/workflow-plan.md +22 -0
- package/templates/bmad/tea/workflows/testarch/test-design/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/test-design/workflow.yaml +77 -0
- package/templates/bmad/tea/workflows/testarch/test-review/checklist.md +475 -0
- package/templates/bmad/tea/workflows/testarch/test-review/instructions.md +45 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-01-load-context.md +169 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-01b-resume.md +104 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-02-discover-tests.md +113 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03-quality-evaluation.md +173 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03a-subprocess-determinism.md +214 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03b-subprocess-isolation.md +125 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03c-subprocess-maintainability.md +102 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03d-subprocess-coverage.md +111 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03e-subprocess-performance.md +117 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03f-aggregate-scores.md +277 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-04-generate-report.md +111 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/test-review/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/test-review/test-review-template.md +387 -0
- package/templates/bmad/tea/workflows/testarch/test-review/validation-report-20260127-095021.md +72 -0
- package/templates/bmad/tea/workflows/testarch/test-review/validation-report-20260127-102401.md +114 -0
- package/templates/bmad/tea/workflows/testarch/test-review/workflow-plan.md +18 -0
- package/templates/bmad/tea/workflows/testarch/test-review/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/test-review/workflow.yaml +48 -0
- package/templates/bmad/tea/workflows/testarch/trace/checklist.md +647 -0
- package/templates/bmad/tea/workflows/testarch/trace/instructions.md +43 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-01-load-context.md +105 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-01b-resume.md +102 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-02-discover-tests.md +112 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-03-map-criteria.md +97 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-04-analyze-gaps.md +330 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-05-gate-decision.md +266 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-e/step-01-assess.md +65 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-e/step-02-apply-edit.md +60 -0
- package/templates/bmad/tea/workflows/testarch/trace/steps-v/step-01-validate.md +67 -0
- package/templates/bmad/tea/workflows/testarch/trace/trace-template.md +708 -0
- package/templates/bmad/tea/workflows/testarch/trace/validation-report-20260127-095021.md +73 -0
- package/templates/bmad/tea/workflows/testarch/trace/validation-report-20260127-102401.md +116 -0
- package/templates/bmad/tea/workflows/testarch/trace/workflow-plan.md +21 -0
- package/templates/bmad/tea/workflows/testarch/trace/workflow.md +41 -0
- package/templates/bmad/tea/workflows/testarch/trace/workflow.yaml +56 -0
- package/templates/ecc/agents/architect.md +211 -0
- package/templates/ecc/agents/build-error-resolver.md +114 -0
- package/templates/ecc/agents/code-reviewer.md +224 -0
- package/templates/ecc/agents/database-reviewer.md +91 -0
- package/templates/ecc/agents/doc-updater.md +107 -0
- package/templates/ecc/agents/e2e-runner.md +107 -0
- package/templates/ecc/agents/go-build-resolver.md +94 -0
- package/templates/ecc/agents/go-reviewer.md +76 -0
- package/templates/ecc/agents/planner.md +212 -0
- package/templates/ecc/agents/python-reviewer.md +98 -0
- package/templates/ecc/agents/refactor-cleaner.md +85 -0
- package/templates/ecc/agents/security-reviewer.md +108 -0
- package/templates/ecc/agents/tdd-guide.md +80 -0
- package/templates/ecc/commands/build-fix.md +62 -0
- package/templates/ecc/commands/checkpoint.md +74 -0
- package/templates/ecc/commands/code-review.md +40 -0
- package/templates/ecc/commands/e2e.md +363 -0
- package/templates/ecc/commands/eval.md +120 -0
- package/templates/ecc/commands/evolve.md +193 -0
- package/templates/ecc/commands/go-build.md +183 -0
- package/templates/ecc/commands/go-review.md +148 -0
- package/templates/ecc/commands/go-test.md +268 -0
- package/templates/ecc/commands/instinct-export.md +91 -0
- package/templates/ecc/commands/instinct-import.md +142 -0
- package/templates/ecc/commands/instinct-status.md +86 -0
- package/templates/ecc/commands/learn-eval.md +91 -0
- package/templates/ecc/commands/learn.md +70 -0
- package/templates/ecc/commands/multi-backend.md +158 -0
- package/templates/ecc/commands/multi-execute.md +310 -0
- package/templates/ecc/commands/multi-frontend.md +158 -0
- package/templates/ecc/commands/multi-plan.md +261 -0
- package/templates/ecc/commands/multi-workflow.md +183 -0
- package/templates/ecc/commands/orchestrate.md +172 -0
- package/templates/ecc/commands/plan.md +113 -0
- package/templates/ecc/commands/pm2.md +272 -0
- package/templates/ecc/commands/python-review.md +297 -0
- package/templates/ecc/commands/refactor-clean.md +80 -0
- package/templates/ecc/commands/sessions.md +305 -0
- package/templates/ecc/commands/setup-pm.md +80 -0
- package/templates/ecc/commands/skill-create.md +174 -0
- package/templates/ecc/commands/tdd.md +326 -0
- package/templates/ecc/commands/test-coverage.md +69 -0
- package/templates/ecc/commands/update-codemaps.md +72 -0
- package/templates/ecc/commands/update-docs.md +84 -0
- package/templates/ecc/commands/verify.md +59 -0
- package/templates/ecc/rules/README.md +82 -0
- package/templates/ecc/rules/common/agents.md +49 -0
- package/templates/ecc/rules/common/coding-style.md +48 -0
- package/templates/ecc/rules/common/git-workflow.md +45 -0
- package/templates/ecc/rules/common/hooks.md +30 -0
- package/templates/ecc/rules/common/patterns.md +31 -0
- package/templates/ecc/rules/common/performance.md +55 -0
- package/templates/ecc/rules/common/security.md +29 -0
- package/templates/ecc/rules/common/testing.md +29 -0
- package/templates/ecc/rules/golang/coding-style.md +32 -0
- package/templates/ecc/rules/golang/hooks.md +17 -0
- package/templates/ecc/rules/golang/patterns.md +45 -0
- package/templates/ecc/rules/golang/security.md +34 -0
- package/templates/ecc/rules/golang/testing.md +31 -0
- package/templates/ecc/rules/python/coding-style.md +42 -0
- package/templates/ecc/rules/python/hooks.md +19 -0
- package/templates/ecc/rules/python/patterns.md +39 -0
- package/templates/ecc/rules/python/security.md +30 -0
- package/templates/ecc/rules/python/testing.md +38 -0
- package/templates/ecc/rules/typescript/coding-style.md +65 -0
- package/templates/ecc/rules/typescript/hooks.md +22 -0
- package/templates/ecc/rules/typescript/patterns.md +52 -0
- package/templates/ecc/rules/typescript/security.md +28 -0
- package/templates/ecc/rules/typescript/testing.md +18 -0
- package/templates/ecc/skills/api-design/SKILL.md +522 -0
- package/templates/ecc/skills/backend-patterns/SKILL.md +597 -0
- package/templates/ecc/skills/clickhouse-io/SKILL.md +438 -0
- package/templates/ecc/skills/coding-standards/SKILL.md +529 -0
- package/templates/ecc/skills/configure-ecc/SKILL.md +298 -0
- package/templates/ecc/skills/content-hash-cache-pattern/SKILL.md +160 -0
- package/templates/ecc/skills/continuous-learning/SKILL.md +118 -0
- package/templates/ecc/skills/continuous-learning/config.json +18 -0
- package/templates/ecc/skills/continuous-learning/evaluate-session.sh +69 -0
- package/templates/ecc/skills/continuous-learning-v2/SKILL.md +292 -0
- package/templates/ecc/skills/continuous-learning-v2/agents/observer.md +137 -0
- package/templates/ecc/skills/continuous-learning-v2/agents/start-observer.sh +143 -0
- package/templates/ecc/skills/continuous-learning-v2/config.json +41 -0
- package/templates/ecc/skills/continuous-learning-v2/hooks/observe.sh +157 -0
- package/templates/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +575 -0
- package/templates/ecc/skills/continuous-learning-v2/scripts/test_parse_instinct.py +82 -0
- package/templates/ecc/skills/cost-aware-llm-pipeline/SKILL.md +182 -0
- package/templates/ecc/skills/cpp-coding-standards/SKILL.md +722 -0
- package/templates/ecc/skills/cpp-testing/SKILL.md +322 -0
- package/templates/ecc/skills/database-migrations/SKILL.md +334 -0
- package/templates/ecc/skills/deployment-patterns/SKILL.md +426 -0
- package/templates/ecc/skills/django-patterns/SKILL.md +733 -0
- package/templates/ecc/skills/django-security/SKILL.md +592 -0
- package/templates/ecc/skills/django-tdd/SKILL.md +728 -0
- package/templates/ecc/skills/django-verification/SKILL.md +468 -0
- package/templates/ecc/skills/docker-patterns/SKILL.md +363 -0
- package/templates/ecc/skills/e2e-testing/SKILL.md +325 -0
- package/templates/ecc/skills/eval-harness/SKILL.md +235 -0
- package/templates/ecc/skills/frontend-patterns/SKILL.md +641 -0
- package/templates/ecc/skills/golang-patterns/SKILL.md +673 -0
- package/templates/ecc/skills/golang-testing/SKILL.md +719 -0
- package/templates/ecc/skills/iterative-retrieval/SKILL.md +210 -0
- package/templates/ecc/skills/java-coding-standards/SKILL.md +146 -0
- package/templates/ecc/skills/jpa-patterns/SKILL.md +150 -0
- package/templates/ecc/skills/nutrient-document-processing/SKILL.md +165 -0
- package/templates/ecc/skills/postgres-patterns/SKILL.md +146 -0
- package/templates/ecc/skills/project-guidelines-example/SKILL.md +348 -0
- package/templates/ecc/skills/python-patterns/SKILL.md +749 -0
- package/templates/ecc/skills/python-testing/SKILL.md +815 -0
- package/templates/ecc/skills/regex-vs-llm-structured-text/SKILL.md +219 -0
- package/templates/ecc/skills/search-first/SKILL.md +159 -0
- package/templates/ecc/skills/security-review/SKILL.md +494 -0
- package/templates/ecc/skills/security-review/cloud-infrastructure-security.md +361 -0
- package/templates/ecc/skills/security-scan/SKILL.md +164 -0
- package/templates/ecc/skills/springboot-patterns/SKILL.md +313 -0
- package/templates/ecc/skills/springboot-security/SKILL.md +271 -0
- package/templates/ecc/skills/springboot-tdd/SKILL.md +157 -0
- package/templates/ecc/skills/springboot-verification/SKILL.md +230 -0
- package/templates/ecc/skills/strategic-compact/SKILL.md +102 -0
- package/templates/ecc/skills/strategic-compact/suggest-compact.sh +54 -0
- package/templates/ecc/skills/swift-actor-persistence/SKILL.md +142 -0
- package/templates/ecc/skills/swift-protocol-di-testing/SKILL.md +189 -0
- package/templates/ecc/skills/tdd-workflow/SKILL.md +409 -0
- package/templates/ecc/skills/verification-loop/SKILL.md +125 -0
- package/templates/ext-skills/pinchtab/SKILL.md +570 -0
- package/templates/mcp/claude-code/.mcp.json +35 -0
- package/templates/mcp/trae/mcp.json +35 -0
- package/templates/trae-bmad/rules/bmad-agent-bmad-master.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-analyst.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-architect.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-dev.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-pm.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-qa.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-quick-flow-solo-dev.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-sm.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-tech-writer.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-bmm-ux-designer.md +15 -0
- package/templates/trae-bmad/rules/bmad-agent-tea-tea.md +15 -0
- package/templates/trae-bmad/rules/bmad-bmm-check-implementation-readiness.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-code-review.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-correct-course.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-create-architecture.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-create-epics-and-stories.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-create-prd.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-create-product-brief.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-create-story.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-create-ux-design.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-dev-story.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-document-project.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-domain-research.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-edit-prd.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-generate-project-context.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-market-research.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-qa-automate.md +15 -0
- package/templates/trae-bmad/rules/bmad-bmm-qa-generate-e2e-tests.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-quick-dev.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-quick-spec.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-retrospective.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-sprint-planning.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-sprint-status.md +14 -0
- package/templates/trae-bmad/rules/bmad-bmm-technical-research.md +6 -0
- package/templates/trae-bmad/rules/bmad-bmm-validate-prd.md +6 -0
- package/templates/trae-bmad/rules/bmad-brainstorming.md +6 -0
- package/templates/trae-bmad/rules/bmad-editorial-review-prose.md +10 -0
- package/templates/trae-bmad/rules/bmad-editorial-review-structure.md +10 -0
- package/templates/trae-bmad/rules/bmad-help.md +10 -0
- package/templates/trae-bmad/rules/bmad-index-docs.md +10 -0
- package/templates/trae-bmad/rules/bmad-party-mode.md +6 -0
- package/templates/trae-bmad/rules/bmad-review-adversarial-general.md +10 -0
- package/templates/trae-bmad/rules/bmad-shard-doc.md +10 -0
- package/templates/trae-bmad/rules/bmad-tea-teach-me-testing.md +6 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-atdd.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-automate.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-ci.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-framework.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-nfr.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-test-design.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-test-review.md +14 -0
- package/templates/trae-bmad/rules/bmad-tea-testarch-trace.md +14 -0
|
@@ -0,0 +1,749 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: python-patterns
|
|
3
|
+
description: Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python Development Patterns
|
|
7
|
+
|
|
8
|
+
Idiomatic Python patterns and best practices for building robust, efficient, and maintainable applications.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Writing new Python code
|
|
13
|
+
- Reviewing Python code
|
|
14
|
+
- Refactoring existing Python code
|
|
15
|
+
- Designing Python packages/modules
|
|
16
|
+
|
|
17
|
+
## Core Principles
|
|
18
|
+
|
|
19
|
+
### 1. Readability Counts
|
|
20
|
+
|
|
21
|
+
Python prioritizes readability. Code should be obvious and easy to understand.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
# Good: Clear and readable
|
|
25
|
+
def get_active_users(users: list[User]) -> list[User]:
|
|
26
|
+
"""Return only active users from the provided list."""
|
|
27
|
+
return [user for user in users if user.is_active]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Bad: Clever but confusing
|
|
31
|
+
def get_active_users(u):
|
|
32
|
+
return [x for x in u if x.a]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Explicit is Better Than Implicit
|
|
36
|
+
|
|
37
|
+
Avoid magic; be clear about what your code does.
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
# Good: Explicit configuration
|
|
41
|
+
import logging
|
|
42
|
+
|
|
43
|
+
logging.basicConfig(
|
|
44
|
+
level=logging.INFO,
|
|
45
|
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Bad: Hidden side effects
|
|
49
|
+
import some_module
|
|
50
|
+
some_module.setup() # What does this do?
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. EAFP - Easier to Ask Forgiveness Than Permission
|
|
54
|
+
|
|
55
|
+
Python prefers exception handling over checking conditions.
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# Good: EAFP style
|
|
59
|
+
def get_value(dictionary: dict, key: str) -> Any:
|
|
60
|
+
try:
|
|
61
|
+
return dictionary[key]
|
|
62
|
+
except KeyError:
|
|
63
|
+
return default_value
|
|
64
|
+
|
|
65
|
+
# Bad: LBYL (Look Before You Leap) style
|
|
66
|
+
def get_value(dictionary: dict, key: str) -> Any:
|
|
67
|
+
if key in dictionary:
|
|
68
|
+
return dictionary[key]
|
|
69
|
+
else:
|
|
70
|
+
return default_value
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Type Hints
|
|
74
|
+
|
|
75
|
+
### Basic Type Annotations
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from typing import Optional, List, Dict, Any
|
|
79
|
+
|
|
80
|
+
def process_user(
|
|
81
|
+
user_id: str,
|
|
82
|
+
data: Dict[str, Any],
|
|
83
|
+
active: bool = True
|
|
84
|
+
) -> Optional[User]:
|
|
85
|
+
"""Process a user and return the updated User or None."""
|
|
86
|
+
if not active:
|
|
87
|
+
return None
|
|
88
|
+
return User(user_id, data)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Modern Type Hints (Python 3.9+)
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# Python 3.9+ - Use built-in types
|
|
95
|
+
def process_items(items: list[str]) -> dict[str, int]:
|
|
96
|
+
return {item: len(item) for item in items}
|
|
97
|
+
|
|
98
|
+
# Python 3.8 and earlier - Use typing module
|
|
99
|
+
from typing import List, Dict
|
|
100
|
+
|
|
101
|
+
def process_items(items: List[str]) -> Dict[str, int]:
|
|
102
|
+
return {item: len(item) for item in items}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Type Aliases and TypeVar
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from typing import TypeVar, Union
|
|
109
|
+
|
|
110
|
+
# Type alias for complex types
|
|
111
|
+
JSON = Union[dict[str, Any], list[Any], str, int, float, bool, None]
|
|
112
|
+
|
|
113
|
+
def parse_json(data: str) -> JSON:
|
|
114
|
+
return json.loads(data)
|
|
115
|
+
|
|
116
|
+
# Generic types
|
|
117
|
+
T = TypeVar('T')
|
|
118
|
+
|
|
119
|
+
def first(items: list[T]) -> T | None:
|
|
120
|
+
"""Return the first item or None if list is empty."""
|
|
121
|
+
return items[0] if items else None
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Protocol-Based Duck Typing
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from typing import Protocol
|
|
128
|
+
|
|
129
|
+
class Renderable(Protocol):
|
|
130
|
+
def render(self) -> str:
|
|
131
|
+
"""Render the object to a string."""
|
|
132
|
+
|
|
133
|
+
def render_all(items: list[Renderable]) -> str:
|
|
134
|
+
"""Render all items that implement the Renderable protocol."""
|
|
135
|
+
return "\n".join(item.render() for item in items)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Error Handling Patterns
|
|
139
|
+
|
|
140
|
+
### Specific Exception Handling
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
# Good: Catch specific exceptions
|
|
144
|
+
def load_config(path: str) -> Config:
|
|
145
|
+
try:
|
|
146
|
+
with open(path) as f:
|
|
147
|
+
return Config.from_json(f.read())
|
|
148
|
+
except FileNotFoundError as e:
|
|
149
|
+
raise ConfigError(f"Config file not found: {path}") from e
|
|
150
|
+
except json.JSONDecodeError as e:
|
|
151
|
+
raise ConfigError(f"Invalid JSON in config: {path}") from e
|
|
152
|
+
|
|
153
|
+
# Bad: Bare except
|
|
154
|
+
def load_config(path: str) -> Config:
|
|
155
|
+
try:
|
|
156
|
+
with open(path) as f:
|
|
157
|
+
return Config.from_json(f.read())
|
|
158
|
+
except:
|
|
159
|
+
return None # Silent failure!
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Exception Chaining
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
def process_data(data: str) -> Result:
|
|
166
|
+
try:
|
|
167
|
+
parsed = json.loads(data)
|
|
168
|
+
except json.JSONDecodeError as e:
|
|
169
|
+
# Chain exceptions to preserve the traceback
|
|
170
|
+
raise ValueError(f"Failed to parse data: {data}") from e
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Custom Exception Hierarchy
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
class AppError(Exception):
|
|
177
|
+
"""Base exception for all application errors."""
|
|
178
|
+
pass
|
|
179
|
+
|
|
180
|
+
class ValidationError(AppError):
|
|
181
|
+
"""Raised when input validation fails."""
|
|
182
|
+
pass
|
|
183
|
+
|
|
184
|
+
class NotFoundError(AppError):
|
|
185
|
+
"""Raised when a requested resource is not found."""
|
|
186
|
+
pass
|
|
187
|
+
|
|
188
|
+
# Usage
|
|
189
|
+
def get_user(user_id: str) -> User:
|
|
190
|
+
user = db.find_user(user_id)
|
|
191
|
+
if not user:
|
|
192
|
+
raise NotFoundError(f"User not found: {user_id}")
|
|
193
|
+
return user
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Context Managers
|
|
197
|
+
|
|
198
|
+
### Resource Management
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
# Good: Using context managers
|
|
202
|
+
def process_file(path: str) -> str:
|
|
203
|
+
with open(path, 'r') as f:
|
|
204
|
+
return f.read()
|
|
205
|
+
|
|
206
|
+
# Bad: Manual resource management
|
|
207
|
+
def process_file(path: str) -> str:
|
|
208
|
+
f = open(path, 'r')
|
|
209
|
+
try:
|
|
210
|
+
return f.read()
|
|
211
|
+
finally:
|
|
212
|
+
f.close()
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Custom Context Managers
|
|
216
|
+
|
|
217
|
+
```python
|
|
218
|
+
from contextlib import contextmanager
|
|
219
|
+
|
|
220
|
+
@contextmanager
|
|
221
|
+
def timer(name: str):
|
|
222
|
+
"""Context manager to time a block of code."""
|
|
223
|
+
start = time.perf_counter()
|
|
224
|
+
yield
|
|
225
|
+
elapsed = time.perf_counter() - start
|
|
226
|
+
print(f"{name} took {elapsed:.4f} seconds")
|
|
227
|
+
|
|
228
|
+
# Usage
|
|
229
|
+
with timer("data processing"):
|
|
230
|
+
process_large_dataset()
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Context Manager Classes
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
class DatabaseTransaction:
|
|
237
|
+
def __init__(self, connection):
|
|
238
|
+
self.connection = connection
|
|
239
|
+
|
|
240
|
+
def __enter__(self):
|
|
241
|
+
self.connection.begin_transaction()
|
|
242
|
+
return self
|
|
243
|
+
|
|
244
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
245
|
+
if exc_type is None:
|
|
246
|
+
self.connection.commit()
|
|
247
|
+
else:
|
|
248
|
+
self.connection.rollback()
|
|
249
|
+
return False # Don't suppress exceptions
|
|
250
|
+
|
|
251
|
+
# Usage
|
|
252
|
+
with DatabaseTransaction(conn):
|
|
253
|
+
user = conn.create_user(user_data)
|
|
254
|
+
conn.create_profile(user.id, profile_data)
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Comprehensions and Generators
|
|
258
|
+
|
|
259
|
+
### List Comprehensions
|
|
260
|
+
|
|
261
|
+
```python
|
|
262
|
+
# Good: List comprehension for simple transformations
|
|
263
|
+
names = [user.name for user in users if user.is_active]
|
|
264
|
+
|
|
265
|
+
# Bad: Manual loop
|
|
266
|
+
names = []
|
|
267
|
+
for user in users:
|
|
268
|
+
if user.is_active:
|
|
269
|
+
names.append(user.name)
|
|
270
|
+
|
|
271
|
+
# Complex comprehensions should be expanded
|
|
272
|
+
# Bad: Too complex
|
|
273
|
+
result = [x * 2 for x in items if x > 0 if x % 2 == 0]
|
|
274
|
+
|
|
275
|
+
# Good: Use a generator function
|
|
276
|
+
def filter_and_transform(items: Iterable[int]) -> list[int]:
|
|
277
|
+
result = []
|
|
278
|
+
for x in items:
|
|
279
|
+
if x > 0 and x % 2 == 0:
|
|
280
|
+
result.append(x * 2)
|
|
281
|
+
return result
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Generator Expressions
|
|
285
|
+
|
|
286
|
+
```python
|
|
287
|
+
# Good: Generator for lazy evaluation
|
|
288
|
+
total = sum(x * x for x in range(1_000_000))
|
|
289
|
+
|
|
290
|
+
# Bad: Creates large intermediate list
|
|
291
|
+
total = sum([x * x for x in range(1_000_000)])
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Generator Functions
|
|
295
|
+
|
|
296
|
+
```python
|
|
297
|
+
def read_large_file(path: str) -> Iterator[str]:
|
|
298
|
+
"""Read a large file line by line."""
|
|
299
|
+
with open(path) as f:
|
|
300
|
+
for line in f:
|
|
301
|
+
yield line.strip()
|
|
302
|
+
|
|
303
|
+
# Usage
|
|
304
|
+
for line in read_large_file("huge.txt"):
|
|
305
|
+
process(line)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Data Classes and Named Tuples
|
|
309
|
+
|
|
310
|
+
### Data Classes
|
|
311
|
+
|
|
312
|
+
```python
|
|
313
|
+
from dataclasses import dataclass, field
|
|
314
|
+
from datetime import datetime
|
|
315
|
+
|
|
316
|
+
@dataclass
|
|
317
|
+
class User:
|
|
318
|
+
"""User entity with automatic __init__, __repr__, and __eq__."""
|
|
319
|
+
id: str
|
|
320
|
+
name: str
|
|
321
|
+
email: str
|
|
322
|
+
created_at: datetime = field(default_factory=datetime.now)
|
|
323
|
+
is_active: bool = True
|
|
324
|
+
|
|
325
|
+
# Usage
|
|
326
|
+
user = User(
|
|
327
|
+
id="123",
|
|
328
|
+
name="Alice",
|
|
329
|
+
email="alice@example.com"
|
|
330
|
+
)
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Data Classes with Validation
|
|
334
|
+
|
|
335
|
+
```python
|
|
336
|
+
@dataclass
|
|
337
|
+
class User:
|
|
338
|
+
email: str
|
|
339
|
+
age: int
|
|
340
|
+
|
|
341
|
+
def __post_init__(self):
|
|
342
|
+
# Validate email format
|
|
343
|
+
if "@" not in self.email:
|
|
344
|
+
raise ValueError(f"Invalid email: {self.email}")
|
|
345
|
+
# Validate age range
|
|
346
|
+
if self.age < 0 or self.age > 150:
|
|
347
|
+
raise ValueError(f"Invalid age: {self.age}")
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Named Tuples
|
|
351
|
+
|
|
352
|
+
```python
|
|
353
|
+
from typing import NamedTuple
|
|
354
|
+
|
|
355
|
+
class Point(NamedTuple):
|
|
356
|
+
"""Immutable 2D point."""
|
|
357
|
+
x: float
|
|
358
|
+
y: float
|
|
359
|
+
|
|
360
|
+
def distance(self, other: 'Point') -> float:
|
|
361
|
+
return ((self.x - other.x) ** 2 + (self.y - other.y) ** 2) ** 0.5
|
|
362
|
+
|
|
363
|
+
# Usage
|
|
364
|
+
p1 = Point(0, 0)
|
|
365
|
+
p2 = Point(3, 4)
|
|
366
|
+
print(p1.distance(p2)) # 5.0
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Decorators
|
|
370
|
+
|
|
371
|
+
### Function Decorators
|
|
372
|
+
|
|
373
|
+
```python
|
|
374
|
+
import functools
|
|
375
|
+
import time
|
|
376
|
+
|
|
377
|
+
def timer(func: Callable) -> Callable:
|
|
378
|
+
"""Decorator to time function execution."""
|
|
379
|
+
@functools.wraps(func)
|
|
380
|
+
def wrapper(*args, **kwargs):
|
|
381
|
+
start = time.perf_counter()
|
|
382
|
+
result = func(*args, **kwargs)
|
|
383
|
+
elapsed = time.perf_counter() - start
|
|
384
|
+
print(f"{func.__name__} took {elapsed:.4f}s")
|
|
385
|
+
return result
|
|
386
|
+
return wrapper
|
|
387
|
+
|
|
388
|
+
@timer
|
|
389
|
+
def slow_function():
|
|
390
|
+
time.sleep(1)
|
|
391
|
+
|
|
392
|
+
# slow_function() prints: slow_function took 1.0012s
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Parameterized Decorators
|
|
396
|
+
|
|
397
|
+
```python
|
|
398
|
+
def repeat(times: int):
|
|
399
|
+
"""Decorator to repeat a function multiple times."""
|
|
400
|
+
def decorator(func: Callable) -> Callable:
|
|
401
|
+
@functools.wraps(func)
|
|
402
|
+
def wrapper(*args, **kwargs):
|
|
403
|
+
results = []
|
|
404
|
+
for _ in range(times):
|
|
405
|
+
results.append(func(*args, **kwargs))
|
|
406
|
+
return results
|
|
407
|
+
return wrapper
|
|
408
|
+
return decorator
|
|
409
|
+
|
|
410
|
+
@repeat(times=3)
|
|
411
|
+
def greet(name: str) -> str:
|
|
412
|
+
return f"Hello, {name}!"
|
|
413
|
+
|
|
414
|
+
# greet("Alice") returns ["Hello, Alice!", "Hello, Alice!", "Hello, Alice!"]
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Class-Based Decorators
|
|
418
|
+
|
|
419
|
+
```python
|
|
420
|
+
class CountCalls:
|
|
421
|
+
"""Decorator that counts how many times a function is called."""
|
|
422
|
+
def __init__(self, func: Callable):
|
|
423
|
+
functools.update_wrapper(self, func)
|
|
424
|
+
self.func = func
|
|
425
|
+
self.count = 0
|
|
426
|
+
|
|
427
|
+
def __call__(self, *args, **kwargs):
|
|
428
|
+
self.count += 1
|
|
429
|
+
print(f"{self.func.__name__} has been called {self.count} times")
|
|
430
|
+
return self.func(*args, **kwargs)
|
|
431
|
+
|
|
432
|
+
@CountCalls
|
|
433
|
+
def process():
|
|
434
|
+
pass
|
|
435
|
+
|
|
436
|
+
# Each call to process() prints the call count
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
## Concurrency Patterns
|
|
440
|
+
|
|
441
|
+
### Threading for I/O-Bound Tasks
|
|
442
|
+
|
|
443
|
+
```python
|
|
444
|
+
import concurrent.futures
|
|
445
|
+
import threading
|
|
446
|
+
|
|
447
|
+
def fetch_url(url: str) -> str:
|
|
448
|
+
"""Fetch a URL (I/O-bound operation)."""
|
|
449
|
+
import urllib.request
|
|
450
|
+
with urllib.request.urlopen(url) as response:
|
|
451
|
+
return response.read().decode()
|
|
452
|
+
|
|
453
|
+
def fetch_all_urls(urls: list[str]) -> dict[str, str]:
|
|
454
|
+
"""Fetch multiple URLs concurrently using threads."""
|
|
455
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
|
|
456
|
+
future_to_url = {executor.submit(fetch_url, url): url for url in urls}
|
|
457
|
+
results = {}
|
|
458
|
+
for future in concurrent.futures.as_completed(future_to_url):
|
|
459
|
+
url = future_to_url[future]
|
|
460
|
+
try:
|
|
461
|
+
results[url] = future.result()
|
|
462
|
+
except Exception as e:
|
|
463
|
+
results[url] = f"Error: {e}"
|
|
464
|
+
return results
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Multiprocessing for CPU-Bound Tasks
|
|
468
|
+
|
|
469
|
+
```python
|
|
470
|
+
def process_data(data: list[int]) -> int:
|
|
471
|
+
"""CPU-intensive computation."""
|
|
472
|
+
return sum(x ** 2 for x in data)
|
|
473
|
+
|
|
474
|
+
def process_all(datasets: list[list[int]]) -> list[int]:
|
|
475
|
+
"""Process multiple datasets using multiple processes."""
|
|
476
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
|
477
|
+
results = list(executor.map(process_data, datasets))
|
|
478
|
+
return results
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Async/Await for Concurrent I/O
|
|
482
|
+
|
|
483
|
+
```python
|
|
484
|
+
import asyncio
|
|
485
|
+
|
|
486
|
+
async def fetch_async(url: str) -> str:
|
|
487
|
+
"""Fetch a URL asynchronously."""
|
|
488
|
+
import aiohttp
|
|
489
|
+
async with aiohttp.ClientSession() as session:
|
|
490
|
+
async with session.get(url) as response:
|
|
491
|
+
return await response.text()
|
|
492
|
+
|
|
493
|
+
async def fetch_all(urls: list[str]) -> dict[str, str]:
|
|
494
|
+
"""Fetch multiple URLs concurrently."""
|
|
495
|
+
tasks = [fetch_async(url) for url in urls]
|
|
496
|
+
results = await asyncio.gather(*tasks, return_exceptions=True)
|
|
497
|
+
return dict(zip(urls, results))
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
## Package Organization
|
|
501
|
+
|
|
502
|
+
### Standard Project Layout
|
|
503
|
+
|
|
504
|
+
```
|
|
505
|
+
myproject/
|
|
506
|
+
├── src/
|
|
507
|
+
│ └── mypackage/
|
|
508
|
+
│ ├── __init__.py
|
|
509
|
+
│ ├── main.py
|
|
510
|
+
│ ├── api/
|
|
511
|
+
│ │ ├── __init__.py
|
|
512
|
+
│ │ └── routes.py
|
|
513
|
+
│ ├── models/
|
|
514
|
+
│ │ ├── __init__.py
|
|
515
|
+
│ │ └── user.py
|
|
516
|
+
│ └── utils/
|
|
517
|
+
│ ├── __init__.py
|
|
518
|
+
│ └── helpers.py
|
|
519
|
+
├── tests/
|
|
520
|
+
│ ├── __init__.py
|
|
521
|
+
│ ├── conftest.py
|
|
522
|
+
│ ├── test_api.py
|
|
523
|
+
│ └── test_models.py
|
|
524
|
+
├── pyproject.toml
|
|
525
|
+
├── README.md
|
|
526
|
+
└── .gitignore
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### Import Conventions
|
|
530
|
+
|
|
531
|
+
```python
|
|
532
|
+
# Good: Import order - stdlib, third-party, local
|
|
533
|
+
import os
|
|
534
|
+
import sys
|
|
535
|
+
from pathlib import Path
|
|
536
|
+
|
|
537
|
+
import requests
|
|
538
|
+
from fastapi import FastAPI
|
|
539
|
+
|
|
540
|
+
from mypackage.models import User
|
|
541
|
+
from mypackage.utils import format_name
|
|
542
|
+
|
|
543
|
+
# Good: Use isort for automatic import sorting
|
|
544
|
+
# pip install isort
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
### __init__.py for Package Exports
|
|
548
|
+
|
|
549
|
+
```python
|
|
550
|
+
# mypackage/__init__.py
|
|
551
|
+
"""mypackage - A sample Python package."""
|
|
552
|
+
|
|
553
|
+
__version__ = "1.0.0"
|
|
554
|
+
|
|
555
|
+
# Export main classes/functions at package level
|
|
556
|
+
from mypackage.models import User, Post
|
|
557
|
+
from mypackage.utils import format_name
|
|
558
|
+
|
|
559
|
+
__all__ = ["User", "Post", "format_name"]
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
## Memory and Performance
|
|
563
|
+
|
|
564
|
+
### Using __slots__ for Memory Efficiency
|
|
565
|
+
|
|
566
|
+
```python
|
|
567
|
+
# Bad: Regular class uses __dict__ (more memory)
|
|
568
|
+
class Point:
|
|
569
|
+
def __init__(self, x: float, y: float):
|
|
570
|
+
self.x = x
|
|
571
|
+
self.y = y
|
|
572
|
+
|
|
573
|
+
# Good: __slots__ reduces memory usage
|
|
574
|
+
class Point:
|
|
575
|
+
__slots__ = ['x', 'y']
|
|
576
|
+
|
|
577
|
+
def __init__(self, x: float, y: float):
|
|
578
|
+
self.x = x
|
|
579
|
+
self.y = y
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
### Generator for Large Data
|
|
583
|
+
|
|
584
|
+
```python
|
|
585
|
+
# Bad: Returns full list in memory
|
|
586
|
+
def read_lines(path: str) -> list[str]:
|
|
587
|
+
with open(path) as f:
|
|
588
|
+
return [line.strip() for line in f]
|
|
589
|
+
|
|
590
|
+
# Good: Yields lines one at a time
|
|
591
|
+
def read_lines(path: str) -> Iterator[str]:
|
|
592
|
+
with open(path) as f:
|
|
593
|
+
for line in f:
|
|
594
|
+
yield line.strip()
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Avoid String Concatenation in Loops
|
|
598
|
+
|
|
599
|
+
```python
|
|
600
|
+
# Bad: O(n²) due to string immutability
|
|
601
|
+
result = ""
|
|
602
|
+
for item in items:
|
|
603
|
+
result += str(item)
|
|
604
|
+
|
|
605
|
+
# Good: O(n) using join
|
|
606
|
+
result = "".join(str(item) for item in items)
|
|
607
|
+
|
|
608
|
+
# Good: Using StringIO for building
|
|
609
|
+
from io import StringIO
|
|
610
|
+
|
|
611
|
+
buffer = StringIO()
|
|
612
|
+
for item in items:
|
|
613
|
+
buffer.write(str(item))
|
|
614
|
+
result = buffer.getvalue()
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
## Python Tooling Integration
|
|
618
|
+
|
|
619
|
+
### Essential Commands
|
|
620
|
+
|
|
621
|
+
```bash
|
|
622
|
+
# Code formatting
|
|
623
|
+
black .
|
|
624
|
+
isort .
|
|
625
|
+
|
|
626
|
+
# Linting
|
|
627
|
+
ruff check .
|
|
628
|
+
pylint mypackage/
|
|
629
|
+
|
|
630
|
+
# Type checking
|
|
631
|
+
mypy .
|
|
632
|
+
|
|
633
|
+
# Testing
|
|
634
|
+
pytest --cov=mypackage --cov-report=html
|
|
635
|
+
|
|
636
|
+
# Security scanning
|
|
637
|
+
bandit -r .
|
|
638
|
+
|
|
639
|
+
# Dependency management
|
|
640
|
+
pip-audit
|
|
641
|
+
safety check
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
### pyproject.toml Configuration
|
|
645
|
+
|
|
646
|
+
```toml
|
|
647
|
+
[project]
|
|
648
|
+
name = "mypackage"
|
|
649
|
+
version = "1.0.0"
|
|
650
|
+
requires-python = ">=3.9"
|
|
651
|
+
dependencies = [
|
|
652
|
+
"requests>=2.31.0",
|
|
653
|
+
"pydantic>=2.0.0",
|
|
654
|
+
]
|
|
655
|
+
|
|
656
|
+
[project.optional-dependencies]
|
|
657
|
+
dev = [
|
|
658
|
+
"pytest>=7.4.0",
|
|
659
|
+
"pytest-cov>=4.1.0",
|
|
660
|
+
"black>=23.0.0",
|
|
661
|
+
"ruff>=0.1.0",
|
|
662
|
+
"mypy>=1.5.0",
|
|
663
|
+
]
|
|
664
|
+
|
|
665
|
+
[tool.black]
|
|
666
|
+
line-length = 88
|
|
667
|
+
target-version = ['py39']
|
|
668
|
+
|
|
669
|
+
[tool.ruff]
|
|
670
|
+
line-length = 88
|
|
671
|
+
select = ["E", "F", "I", "N", "W"]
|
|
672
|
+
|
|
673
|
+
[tool.mypy]
|
|
674
|
+
python_version = "3.9"
|
|
675
|
+
warn_return_any = true
|
|
676
|
+
warn_unused_configs = true
|
|
677
|
+
disallow_untyped_defs = true
|
|
678
|
+
|
|
679
|
+
[tool.pytest.ini_options]
|
|
680
|
+
testpaths = ["tests"]
|
|
681
|
+
addopts = "--cov=mypackage --cov-report=term-missing"
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
## Quick Reference: Python Idioms
|
|
685
|
+
|
|
686
|
+
| Idiom | Description |
|
|
687
|
+
|-------|-------------|
|
|
688
|
+
| EAFP | Easier to Ask Forgiveness than Permission |
|
|
689
|
+
| Context managers | Use `with` for resource management |
|
|
690
|
+
| List comprehensions | For simple transformations |
|
|
691
|
+
| Generators | For lazy evaluation and large datasets |
|
|
692
|
+
| Type hints | Annotate function signatures |
|
|
693
|
+
| Dataclasses | For data containers with auto-generated methods |
|
|
694
|
+
| `__slots__` | For memory optimization |
|
|
695
|
+
| f-strings | For string formatting (Python 3.6+) |
|
|
696
|
+
| `pathlib.Path` | For path operations (Python 3.4+) |
|
|
697
|
+
| `enumerate` | For index-element pairs in loops |
|
|
698
|
+
|
|
699
|
+
## Anti-Patterns to Avoid
|
|
700
|
+
|
|
701
|
+
```python
|
|
702
|
+
# Bad: Mutable default arguments
|
|
703
|
+
def append_to(item, items=[]):
|
|
704
|
+
items.append(item)
|
|
705
|
+
return items
|
|
706
|
+
|
|
707
|
+
# Good: Use None and create new list
|
|
708
|
+
def append_to(item, items=None):
|
|
709
|
+
if items is None:
|
|
710
|
+
items = []
|
|
711
|
+
items.append(item)
|
|
712
|
+
return items
|
|
713
|
+
|
|
714
|
+
# Bad: Checking type with type()
|
|
715
|
+
if type(obj) == list:
|
|
716
|
+
process(obj)
|
|
717
|
+
|
|
718
|
+
# Good: Use isinstance
|
|
719
|
+
if isinstance(obj, list):
|
|
720
|
+
process(obj)
|
|
721
|
+
|
|
722
|
+
# Bad: Comparing to None with ==
|
|
723
|
+
if value == None:
|
|
724
|
+
process()
|
|
725
|
+
|
|
726
|
+
# Good: Use is
|
|
727
|
+
if value is None:
|
|
728
|
+
process()
|
|
729
|
+
|
|
730
|
+
# Bad: from module import *
|
|
731
|
+
from os.path import *
|
|
732
|
+
|
|
733
|
+
# Good: Explicit imports
|
|
734
|
+
from os.path import join, exists
|
|
735
|
+
|
|
736
|
+
# Bad: Bare except
|
|
737
|
+
try:
|
|
738
|
+
risky_operation()
|
|
739
|
+
except:
|
|
740
|
+
pass
|
|
741
|
+
|
|
742
|
+
# Good: Specific exception
|
|
743
|
+
try:
|
|
744
|
+
risky_operation()
|
|
745
|
+
except SpecificError as e:
|
|
746
|
+
logger.error(f"Operation failed: {e}")
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
__Remember__: Python code should be readable, explicit, and follow the principle of least surprise. When in doubt, prioritize clarity over cleverness.
|