mustflow 1.15.97
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 +16 -0
- package/README.md +422 -0
- package/dist/cli/commands/check.js +73 -0
- package/dist/cli/commands/classify.js +104 -0
- package/dist/cli/commands/context.js +95 -0
- package/dist/cli/commands/contract-lint.js +74 -0
- package/dist/cli/commands/dashboard.js +654 -0
- package/dist/cli/commands/docs.js +382 -0
- package/dist/cli/commands/doctor.js +232 -0
- package/dist/cli/commands/explain.js +293 -0
- package/dist/cli/commands/help.js +148 -0
- package/dist/cli/commands/impact.js +120 -0
- package/dist/cli/commands/index.js +70 -0
- package/dist/cli/commands/init.js +986 -0
- package/dist/cli/commands/line-endings.js +102 -0
- package/dist/cli/commands/map.js +95 -0
- package/dist/cli/commands/run.js +442 -0
- package/dist/cli/commands/search.js +166 -0
- package/dist/cli/commands/status.js +65 -0
- package/dist/cli/commands/update.js +443 -0
- package/dist/cli/commands/verify.js +448 -0
- package/dist/cli/commands/version-sources.js +79 -0
- package/dist/cli/commands/version.js +57 -0
- package/dist/cli/i18n/en.js +702 -0
- package/dist/cli/i18n/es.js +702 -0
- package/dist/cli/i18n/fr.js +702 -0
- package/dist/cli/i18n/hi.js +702 -0
- package/dist/cli/i18n/ko.js +702 -0
- package/dist/cli/i18n/zh.js +702 -0
- package/dist/cli/index.js +218 -0
- package/dist/cli/lib/agent-context.js +342 -0
- package/dist/cli/lib/browser-open.js +58 -0
- package/dist/cli/lib/cli-output.js +36 -0
- package/dist/cli/lib/command-contract.js +1 -0
- package/dist/cli/lib/command-registry.js +107 -0
- package/dist/cli/lib/dashboard-html.js +1866 -0
- package/dist/cli/lib/dashboard-locale.js +309 -0
- package/dist/cli/lib/dashboard-preferences.js +405 -0
- package/dist/cli/lib/doc-review-ledger.js +226 -0
- package/dist/cli/lib/filesystem.js +125 -0
- package/dist/cli/lib/git-changes.js +13 -0
- package/dist/cli/lib/i18n.js +55 -0
- package/dist/cli/lib/local-index.js +1014 -0
- package/dist/cli/lib/locale-tags.js +4 -0
- package/dist/cli/lib/manifest-lock.js +131 -0
- package/dist/cli/lib/npm-version-check.js +97 -0
- package/dist/cli/lib/package-info.js +13 -0
- package/dist/cli/lib/preferences-options.js +8 -0
- package/dist/cli/lib/project-root.js +23 -0
- package/dist/cli/lib/repo-map.js +635 -0
- package/dist/cli/lib/reporter.js +8 -0
- package/dist/cli/lib/run-receipt.js +1 -0
- package/dist/cli/lib/template-i18n.js +265 -0
- package/dist/cli/lib/templates.js +188 -0
- package/dist/cli/lib/toml.js +1 -0
- package/dist/cli/lib/validation.js +1639 -0
- package/dist/cli/lib/version-sources.js +1 -0
- package/dist/core/authority-resolution.js +155 -0
- package/dist/core/change-classification.js +122 -0
- package/dist/core/change-verification.js +80 -0
- package/dist/core/check-issues.js +67 -0
- package/dist/core/command-classification.js +22 -0
- package/dist/core/command-contract-rules.js +27 -0
- package/dist/core/command-contract-validation.js +197 -0
- package/dist/core/command-cwd.js +12 -0
- package/dist/core/command-effects.js +182 -0
- package/dist/core/command-explanation.js +135 -0
- package/dist/core/command-intent-eligibility.js +76 -0
- package/dist/core/config-loading.js +54 -0
- package/dist/core/contract-lint.js +110 -0
- package/dist/core/contract-models.js +53 -0
- package/dist/core/dashboard-verification.js +132 -0
- package/dist/core/doc-review-triage.js +92 -0
- package/dist/core/line-endings.js +144 -0
- package/dist/core/public-json-contracts.js +112 -0
- package/dist/core/public-surface-explanation.js +49 -0
- package/dist/core/release-version-validation.js +53 -0
- package/dist/core/retention-explanation.js +74 -0
- package/dist/core/retention-policy.js +57 -0
- package/dist/core/run-receipt.js +77 -0
- package/dist/core/skill-route-alignment.js +100 -0
- package/dist/core/skill-route-explanation.js +117 -0
- package/dist/core/source-anchor-explanation.js +33 -0
- package/dist/core/source-anchor-status.js +269 -0
- package/dist/core/source-anchor-symbols.js +181 -0
- package/dist/core/source-anchor-validation.js +158 -0
- package/dist/core/source-anchors.js +194 -0
- package/dist/core/surface-decision-model.js +18 -0
- package/dist/core/toml.js +11 -0
- package/dist/core/verification-plan.js +41 -0
- package/dist/core/verification-scheduler.js +92 -0
- package/dist/core/version-impact.js +54 -0
- package/dist/core/version-sources.js +235 -0
- package/dist/core/version-sync-policy.js +85 -0
- package/examples/README.md +13 -0
- package/examples/docs-only/README.md +72 -0
- package/examples/host-instruction-conflicts/README.md +47 -0
- package/examples/minimal-js/README.md +98 -0
- package/examples/missing-command-contracts/README.md +70 -0
- package/examples/nested-repos/README.md +62 -0
- package/package.json +80 -0
- package/schemas/README.md +32 -0
- package/schemas/change-verification-report.schema.json +319 -0
- package/schemas/classify-report.schema.json +113 -0
- package/schemas/commands.schema.json +116 -0
- package/schemas/context-report.schema.json +341 -0
- package/schemas/contract-lint-report.schema.json +61 -0
- package/schemas/docs-review-list.schema.json +72 -0
- package/schemas/doctor-report.schema.json +175 -0
- package/schemas/explain-report.schema.json +471 -0
- package/schemas/impact-report.schema.json +121 -0
- package/schemas/line-endings-report.schema.json +63 -0
- package/schemas/run-receipt.schema.json +75 -0
- package/schemas/verify-report.schema.json +67 -0
- package/schemas/version-sources-report.schema.json +42 -0
- package/templates/default/common/.mustflow/config/commands.toml +251 -0
- package/templates/default/common/.mustflow/config/mustflow.toml +424 -0
- package/templates/default/common/.mustflow/config/preferences.toml +125 -0
- package/templates/default/common/gitignore.mustflow +9 -0
- package/templates/default/i18n.toml +483 -0
- package/templates/default/locales/en/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/en/.mustflow/context/PROJECT.md +66 -0
- package/templates/default/locales/en/.mustflow/docs/agent-workflow.md +345 -0
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/en/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/en/.mustflow/skills/artifact-integrity-check/SKILL.md +121 -0
- package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/en/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/en/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +143 -0
- package/templates/default/locales/en/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/en/.mustflow/skills/docs-update/SKILL.md +100 -0
- package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +124 -0
- package/templates/default/locales/en/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/en/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/en/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/en/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/en/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/en/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/en/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/en/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/en/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/en/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/en/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/en/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/en/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/en/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +130 -0
- package/templates/default/locales/en/.mustflow/skills/security-regression-tests/SKILL.md +157 -0
- package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/en/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/en/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/en/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/en/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +119 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/en/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/en/AGENTS.md +114 -0
- package/templates/default/locales/es/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/es/.mustflow/context/PROJECT.md +63 -0
- package/templates/default/locales/es/.mustflow/docs/agent-workflow.md +365 -0
- package/templates/default/locales/es/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/es/AGENTS.md +83 -0
- package/templates/default/locales/fr/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/fr/.mustflow/context/PROJECT.md +63 -0
- package/templates/default/locales/fr/.mustflow/docs/agent-workflow.md +368 -0
- package/templates/default/locales/fr/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/fr/AGENTS.md +84 -0
- package/templates/default/locales/hi/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/hi/.mustflow/context/PROJECT.md +65 -0
- package/templates/default/locales/hi/.mustflow/docs/agent-workflow.md +359 -0
- package/templates/default/locales/hi/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/hi/AGENTS.md +83 -0
- package/templates/default/locales/ko/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/ko/.mustflow/context/PROJECT.md +66 -0
- package/templates/default/locales/ko/.mustflow/docs/agent-workflow.md +506 -0
- package/templates/default/locales/ko/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +118 -0
- package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +107 -0
- package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +119 -0
- package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +259 -0
- package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +130 -0
- package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/ko/AGENTS.md +85 -0
- package/templates/default/locales/zh/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/zh/.mustflow/context/PROJECT.md +64 -0
- package/templates/default/locales/zh/.mustflow/docs/agent-workflow.md +310 -0
- package/templates/default/locales/zh/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +96 -0
- package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/zh/AGENTS.md +86 -0
- package/templates/default/manifest.toml +339 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.composition-over-inheritance
|
|
3
|
+
locale: ko
|
|
4
|
+
canonical: false
|
|
5
|
+
revision: 4
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: composition-over-inheritance
|
|
9
|
+
description: Apply this skill when code introduces, extends, reviews, or refactors class inheritance, base classes, abstract classes, template methods, protected state, mixins, framework subclasses, or subtype hierarchies, especially when behavior reuse, feature variants, provider implementations, policies, strategies, adapters, or test seams could be expressed with composition instead.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.composition-over-inheritance
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- test_related
|
|
19
|
+
- test
|
|
20
|
+
- lint
|
|
21
|
+
- build
|
|
22
|
+
- docs_validate_fast
|
|
23
|
+
- test_release
|
|
24
|
+
- mustflow_check
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Composition Over Inheritance
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Treat inheritance as an exception, not the default way to reuse implementation. Prefer explicit collaborators: small role objects, functions, policies, strategies, adapters, state machines, decorators, and injected dependencies.
|
|
33
|
+
|
|
34
|
+
The goal is to keep change dimensions separate, avoid fragile parent-child coupling, make tests easy to assemble, and prevent subclass counts from growing with every feature combination.
|
|
35
|
+
|
|
36
|
+
<!-- mustflow-section: use-when -->
|
|
37
|
+
## Use When
|
|
38
|
+
|
|
39
|
+
- New code introduces `extends`, `abstract class`, `Base*`, `Abstract*`, `Common*`, `Core*`, mixins, template methods, `protected` fields, or deep class hierarchies.
|
|
40
|
+
- Existing code is being refactored from inheritance, template methods, no-op overrides, or shared base classes.
|
|
41
|
+
- A feature has multiple change dimensions such as format, storage, notification, provider, environment, permission policy, pricing policy, state transition, or retry behavior.
|
|
42
|
+
- Framework code requires subclassing, but business logic should stay outside the framework subclass.
|
|
43
|
+
- Tests are hard to write because parent setup, `super()` order, protected state, or subclass-specific behavior is entangled.
|
|
44
|
+
- The design could use strategy objects, policy objects, adapters, decorators, state machines, discriminated unions, functions, or dependency injection instead of inheritance.
|
|
45
|
+
- State-specific subclasses are proposed or already exist to represent lifecycle behavior that could be expressed as an explicit transition table.
|
|
46
|
+
|
|
47
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
48
|
+
## Do Not Use When
|
|
49
|
+
|
|
50
|
+
- The code has no inheritance, base-class, subtype, or behavior-combination decision.
|
|
51
|
+
- The inheritance is a shallow and conventional language or ecosystem type, such as `Error`, `Exception`, a required test framework base class, or a required framework lifecycle class.
|
|
52
|
+
- The task is only about external provider boundaries; use `adapter-boundary`.
|
|
53
|
+
- The task is only about hidden dependency construction or global lookup; use `dependency-injection`.
|
|
54
|
+
- The task is a pure data or function refactor where no type hierarchy or collaborator split is being considered.
|
|
55
|
+
|
|
56
|
+
<!-- mustflow-section: required-inputs -->
|
|
57
|
+
## Required Inputs
|
|
58
|
+
|
|
59
|
+
- The class or module under change and any existing inheritance chain, base class, template method, mixin, or protected state.
|
|
60
|
+
- The behavior that needs reuse and the change dimensions that may vary independently.
|
|
61
|
+
- Local patterns for functions, policies, strategies, adapters, state machines, decorators, dependency injection, and tests.
|
|
62
|
+
- Compatibility constraints: public API, framework inheritance requirements, migration wrappers, and existing tests.
|
|
63
|
+
- Relevant command-intent contract entries for tests, builds, docs, templates, release metadata, and mustflow validation.
|
|
64
|
+
|
|
65
|
+
<!-- mustflow-section: preconditions -->
|
|
66
|
+
## Preconditions
|
|
67
|
+
|
|
68
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
69
|
+
- The intended behavior is understood well enough to avoid changing semantics while changing structure.
|
|
70
|
+
- If the existing area is unfamiliar, use `pattern-scout` or `codebase-orientation` before changing type boundaries.
|
|
71
|
+
- If the refactor must preserve behavior, use `behavior-preserving-refactor` together with this skill.
|
|
72
|
+
- If multiple algorithms, policies, scoring methods, pricing rules, provider choices, or feature variants share one purpose, use `strategy-pattern` before inventing subclasses.
|
|
73
|
+
|
|
74
|
+
<!-- mustflow-section: allowed-edits -->
|
|
75
|
+
## Allowed Edits
|
|
76
|
+
|
|
77
|
+
- Replace implementation inheritance with functions, role interfaces, policies, strategies, adapters, decorators, state machines, discriminated unions, or small orchestrating objects.
|
|
78
|
+
- Keep required framework subclasses thin and delegate business behavior to injected use cases or collaborators.
|
|
79
|
+
- Add temporary compatibility wrappers when needed for a safe migration away from existing subclasses.
|
|
80
|
+
- Add focused tests or fixtures that lock current behavior before changing inheritance structure.
|
|
81
|
+
- Do not create broad `Base`, `Abstract`, `Common`, `Core`, or `Manager` classes to share miscellaneous methods.
|
|
82
|
+
|
|
83
|
+
<!-- mustflow-section: procedure -->
|
|
84
|
+
## Procedure
|
|
85
|
+
|
|
86
|
+
1. Identify why inheritance is present or being proposed.
|
|
87
|
+
- Allowed reasons: required framework base class, conventional error or exception type, required test framework base class, sealed or closed type hierarchy, or a true substitutable subtype relationship.
|
|
88
|
+
- Suspicious reasons: sharing common methods, toggling optional behavior, swapping providers, reducing conditionals, hiding setup, reusing validation, or grouping unrelated helpers.
|
|
89
|
+
2. Apply the substitution check before keeping inheritance.
|
|
90
|
+
- A child must be safe everywhere the parent is expected.
|
|
91
|
+
- The child must not require stricter inputs, return weaker outputs, no-op parent behavior, throw for normal parent methods, or require callers to check `instanceof`, class name, kind, mode, or type before use.
|
|
92
|
+
3. Count independent change dimensions.
|
|
93
|
+
- If format, storage, notification, provider, policy, environment, permission, state, retry, logging, caching, or transport can change independently, do not encode the combination as subclasses.
|
|
94
|
+
- Split each meaningful dimension into a role object, function, strategy, policy, adapter, decorator, state machine, or data field.
|
|
95
|
+
4. Inspect the inheritance depth and coupling.
|
|
96
|
+
- Application code should have inheritance depth 0 or 1.
|
|
97
|
+
- Reject chains where behavior depends on `super()` order, parent constructor side effects, protected mutable state, or parent methods calling overridable child methods.
|
|
98
|
+
5. Replace shared implementation with simpler composition first.
|
|
99
|
+
- Use pure functions for stateless calculations and formatting.
|
|
100
|
+
- Use role objects for replaceable collaborators.
|
|
101
|
+
- Use policy objects for business decisions.
|
|
102
|
+
- Use strategy objects for algorithms, policies, scoring methods, provider choices, and feature variants. Use `strategy-pattern` before adding or refactoring a strategy family.
|
|
103
|
+
- Use facade objects for stable high-level subsystem entry points that coordinate several collaborators. Use `facade-pattern` before adding or refactoring a facade.
|
|
104
|
+
- Use adapters for external services and provider-specific data.
|
|
105
|
+
- Use decorators for cross-cutting behavior such as logging, caching, retry, rate limiting, timing, and authorization.
|
|
106
|
+
- Use state machines or transition tables when state controls allowed actions. Use `state-machine-pattern` before editing lifecycle state transitions, status fields, guards, terminal states, or transition effects.
|
|
107
|
+
- Use discriminated unions or sealed types for closed data variants when the language supports them.
|
|
108
|
+
6. Keep orchestration explicit. A composed object may own the workflow, but it should delegate each variable behavior to a collaborator rather than reaching into subclass hooks.
|
|
109
|
+
7. Keep construction outside the core object when collaborators are replaceable or external. If the change introduces injected collaborators, apply `dependency-injection`; if those collaborators cross provider or protocol boundaries, also apply `adapter-boundary`.
|
|
110
|
+
8. Keep framework subclasses thin when inheritance is unavoidable.
|
|
111
|
+
- They may parse requests, extract framework context, call use cases, and map responses.
|
|
112
|
+
- They should not contain domain policy, external API calls, database queries, complex state transitions, or provider-specific translation.
|
|
113
|
+
9. Use temporary wrappers only for migration.
|
|
114
|
+
- A legacy subclass may delegate to a new composed implementation to preserve public API.
|
|
115
|
+
- New code should use the composed implementation directly.
|
|
116
|
+
- Remove wrappers after callers have migrated.
|
|
117
|
+
10. Guard against over-composition.
|
|
118
|
+
- Do not create interfaces for one-line pure functions, stable internal helpers, or single implementations with no external boundary and no test replacement need.
|
|
119
|
+
- If every class only delegates once, constructor setup becomes harder than the business logic, or a dependency object becomes broad, simplify.
|
|
120
|
+
11. Protect behavior with tests.
|
|
121
|
+
- Before refactoring an inheritance tree, add or reuse tests around the observable behavior.
|
|
122
|
+
- Prefer fake collaborators over parent-state setup.
|
|
123
|
+
- Add tests for each extracted policy, strategy, adapter, decorator, or state transition when the behavior is meaningful.
|
|
124
|
+
12. Verify with the narrowest configured command intents that cover changed source, tests, templates, docs, release metadata, and mustflow checks.
|
|
125
|
+
|
|
126
|
+
<!-- mustflow-section: postconditions -->
|
|
127
|
+
## Postconditions
|
|
128
|
+
|
|
129
|
+
- New application code does not add inheritance for implementation reuse.
|
|
130
|
+
- Any remaining inheritance is shallow, justified, and isolated to framework, error, test, or closed-type cases.
|
|
131
|
+
- Shared behavior lives in functions, role objects, policies, strategies, adapters, decorators, state machines, or explicit data structures.
|
|
132
|
+
- Variable behavior is selected by composition rather than subclass explosion.
|
|
133
|
+
- There is no protected mutable state, no-op override, parent-child type check, or `super()` call-order dependency in core logic.
|
|
134
|
+
- Tests can replace collaborators without constructing a fragile parent hierarchy.
|
|
135
|
+
|
|
136
|
+
<!-- mustflow-section: verification -->
|
|
137
|
+
## Verification
|
|
138
|
+
|
|
139
|
+
Use configured oneshot command intents when available:
|
|
140
|
+
|
|
141
|
+
- `changes_status`
|
|
142
|
+
- `changes_diff_summary`
|
|
143
|
+
- `test_related`
|
|
144
|
+
- `test`
|
|
145
|
+
- `lint`
|
|
146
|
+
- `build`
|
|
147
|
+
- `docs_validate_fast`
|
|
148
|
+
- `test_release`
|
|
149
|
+
- `mustflow_check`
|
|
150
|
+
|
|
151
|
+
Prefer the narrowest configured test or build intent that proves the affected behavior. Use documentation and release checks when skill routes, templates, public docs, package metadata, or installed-file surfaces change.
|
|
152
|
+
|
|
153
|
+
<!-- mustflow-section: failure-handling -->
|
|
154
|
+
## Failure Handling
|
|
155
|
+
|
|
156
|
+
- If inheritance is required by a framework, keep the subclass as an adapter and move business behavior to composed collaborators.
|
|
157
|
+
- If an inheritance refactor would break public API, add a temporary wrapper and report the migration path.
|
|
158
|
+
- If extracted collaborators are too many or too vague, collapse them into fewer functions or role objects with clearer ownership.
|
|
159
|
+
- If tests require protected state or parent internals, add higher-level behavior tests before changing structure.
|
|
160
|
+
- If a class still needs many collaborators after composition, look for mixed responsibilities and split the use case rather than adding a broad dependency bag.
|
|
161
|
+
- If local language features make a sealed hierarchy or discriminated union clearer than strategy objects, use the simpler closed-data representation and report why.
|
|
162
|
+
|
|
163
|
+
<!-- mustflow-section: output-format -->
|
|
164
|
+
## Output Format
|
|
165
|
+
|
|
166
|
+
- Inheritance or base-class surface reviewed
|
|
167
|
+
- Reason for keeping or replacing inheritance
|
|
168
|
+
- Change dimensions identified
|
|
169
|
+
- Composition pattern selected
|
|
170
|
+
- Framework or error inheritance exceptions, if any
|
|
171
|
+
- Collaborators, functions, policies, strategies, facades, adapters, decorators, or state machines added or reused
|
|
172
|
+
- Temporary compatibility wrappers, if any
|
|
173
|
+
- Tests added or reused
|
|
174
|
+
- Command intents run
|
|
175
|
+
- Skipped checks and reasons
|
|
176
|
+
- Remaining inheritance or composition risk
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.contract-sync-check
|
|
3
|
+
locale: ko
|
|
4
|
+
canonical: false
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: contract-sync-check
|
|
9
|
+
description: 코드, 스키마, 템플릿, 테스트, 문서 사이에 맞춰져야 하는 선언된 계약에 변경이 영향을 줄 때 적용합니다.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.contract-sync-check
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- docs_validate_fast
|
|
19
|
+
- test_release
|
|
20
|
+
- mustflow_check
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# 계약 동기화 확인
|
|
24
|
+
|
|
25
|
+
<!-- mustflow-section: purpose -->
|
|
26
|
+
## 목적
|
|
27
|
+
|
|
28
|
+
선언된 동작, 기계가 읽는 계약, 설치 템플릿, 테스트, 공개 문서가 변경 뒤 서로 어긋나지 않게 합니다.
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: use-when -->
|
|
31
|
+
## 사용할 때
|
|
32
|
+
|
|
33
|
+
- 명령, 옵션, JSON 출력, 스키마, 템플릿 파일, 매니페스트, 잠금 항목, 선호값, 공개 문서가 바뀝니다.
|
|
34
|
+
- mustflow가 소유한 파일을 추가, 삭제, 이름 변경, 재분류합니다.
|
|
35
|
+
- 테스트가 패키지, 템플릿, 스키마, 명령, 대시보드, 문서 동작을 기대값으로 고정합니다.
|
|
36
|
+
- 사용자가 문서, 설정, 설치 템플릿 동작도 함께 바꿔야 하는지 묻습니다.
|
|
37
|
+
|
|
38
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
39
|
+
## 사용하지 않을 때
|
|
40
|
+
|
|
41
|
+
- 선언된 계약이나 공개 표면이 없는 내부 구현 리팩터링입니다.
|
|
42
|
+
- 변경 파일이 더 좁은 스킬로 이미 덮이고, 그 절차가 영향을 받는 계약을 모두 확인합니다.
|
|
43
|
+
- 사용자가 공개 또는 설치 표면을 갱신하지 않는 로컬 실험을 명시적으로 요청했습니다.
|
|
44
|
+
|
|
45
|
+
<!-- mustflow-section: required-inputs -->
|
|
46
|
+
## 필요한 입력
|
|
47
|
+
|
|
48
|
+
- 변경 파일 목록과 의도한 동작 변경.
|
|
49
|
+
- 코드, 스키마, 설정, 템플릿 메타데이터, 문서 같은 기본 계약 출처.
|
|
50
|
+
- 알려진 파생 표면: 테스트, README, 문서 사이트, 지역화 템플릿, 매니페스트, 잠금 파일, JSON 스키마.
|
|
51
|
+
- 관련 명령 의도 계약 항목.
|
|
52
|
+
|
|
53
|
+
<!-- mustflow-section: preconditions -->
|
|
54
|
+
## 전제 조건
|
|
55
|
+
|
|
56
|
+
- 작업이 사용할 때 조건에 맞고 사용하지 않을 때 조건에는 해당하지 않습니다.
|
|
57
|
+
- 필요한 입력이 있거나, 부족한 입력을 추측하지 않고 보고할 수 있습니다.
|
|
58
|
+
- 현재 범위의 상위 지시와 `.mustflow/config/commands.toml`을 확인했습니다.
|
|
59
|
+
|
|
60
|
+
<!-- mustflow-section: allowed-edits -->
|
|
61
|
+
## 허용되는 수정
|
|
62
|
+
|
|
63
|
+
- 계약을 일관되게 유지하는 데 필요한 표면만 갱신합니다.
|
|
64
|
+
- 변경된 계약이나 패키징 표면을 고정할 때만 테스트를 추가하거나 조정합니다.
|
|
65
|
+
- 정확한 문구를 자신 있게 지역화할 수 없으면 번역이나 문장 중심 문서를 검수 대상으로 표시합니다.
|
|
66
|
+
- 명령 권한을 넓히거나, 새 계약 파일을 지어내거나, 탐색 메모를 구속력 있는 정책으로 바꾸지 않습니다.
|
|
67
|
+
|
|
68
|
+
<!-- mustflow-section: procedure -->
|
|
69
|
+
## 절차
|
|
70
|
+
|
|
71
|
+
1. 변경되는 계약의 이름을 붙이고 기준 출처를 확인합니다.
|
|
72
|
+
2. 그 계약에 맞춰야 하는 표면을 나열합니다. 예: 소스 코드, 스키마, 명령 메타데이터, 템플릿, 매니페스트, 잠금 파일, 테스트, README, 문서 사이트, 지역화 사본.
|
|
73
|
+
3. 변경 파일 목록을 그 표면 목록과 비교하고 빠진 필수 표면을 추가합니다.
|
|
74
|
+
4. 파생 파일은 기준 출처와 기계적으로 맞춥니다. 일부 표면을 의도적으로 갱신하지 않았다면 이유를 기록합니다.
|
|
75
|
+
5. 명령 의도 이름, 스키마 식별자, 앞부분 메타데이터 리비전, 템플릿 항목, 버전 문자열, 문서 예시가 일치해야 하는 곳에서 정확히 일치하는지 확인합니다.
|
|
76
|
+
6. 계약과 건드린 패키징 또는 문서 표면을 덮는 가장 좁은 구성된 검증을 사용합니다.
|
|
77
|
+
7. 최종 보고에서 동기화한 표면과 건너뛰거나 미룬 표면을 구분합니다.
|
|
78
|
+
|
|
79
|
+
<!-- mustflow-section: postconditions -->
|
|
80
|
+
## 완료 조건
|
|
81
|
+
|
|
82
|
+
- 계약 기준 출처와 필요한 모든 파생 표면이 일치합니다.
|
|
83
|
+
- 의도적으로 오래 두거나 미루거나 검수가 필요한 표면을 명시합니다.
|
|
84
|
+
- 최종 보고에는 계약 정합성 검증에 사용한 명령 의도가 포함됩니다.
|
|
85
|
+
|
|
86
|
+
<!-- mustflow-section: verification -->
|
|
87
|
+
## 검증
|
|
88
|
+
|
|
89
|
+
사용 가능한 구성된 일회성 명령 의도를 사용합니다.
|
|
90
|
+
|
|
91
|
+
- `changes_status`
|
|
92
|
+
- `changes_diff_summary`
|
|
93
|
+
- `docs_validate_fast`
|
|
94
|
+
- `test_release`
|
|
95
|
+
- `mustflow_check`
|
|
96
|
+
|
|
97
|
+
계약이 실행 동작에 영향을 주면 더 좁은 구성된 테스트나 빌드 의도도 실행합니다.
|
|
98
|
+
|
|
99
|
+
<!-- mustflow-section: failure-handling -->
|
|
100
|
+
## 실패 처리
|
|
101
|
+
|
|
102
|
+
- 검증에서 불일치가 나오면 새 동작을 더하기 전에 첫 계약 불일치부터 고칩니다.
|
|
103
|
+
- 기준 출처가 불분명하면 조용히 하나를 고르지 말고 경쟁하는 출처를 보고합니다.
|
|
104
|
+
- 필요한 표면이 현재 작업에서 검증하기에 너무 넓으면 건너뛴 표면과 위험을 보고합니다.
|
|
105
|
+
- 지역화 표면을 자신 있게 갱신할 수 없으면 출처 메타데이터를 정확히 유지하고 번역을 검수 대상으로 표시합니다.
|
|
106
|
+
|
|
107
|
+
<!-- mustflow-section: output-format -->
|
|
108
|
+
## 출력 형식
|
|
109
|
+
|
|
110
|
+
- 변경된 계약
|
|
111
|
+
- 사용한 기준 출처
|
|
112
|
+
- 동기화한 표면
|
|
113
|
+
- 미루었거나 검수가 필요한 표면
|
|
114
|
+
- 실행한 명령 의도
|
|
115
|
+
- 건너뛴 검증과 이유
|
|
116
|
+
- 남은 불일치 위험
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.date-number-audit
|
|
3
|
+
locale: ko
|
|
4
|
+
canonical: false
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: date-number-audit
|
|
9
|
+
description: 날짜, 버전, 개수, 기간, 한도, 지표, 벤치마크, 가격, 비율 또는 다른 숫자 사실을 만들거나 수정하거나 보고할 때 적용합니다.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.date-number-audit
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- docs_validate_fast
|
|
19
|
+
- test_release
|
|
20
|
+
- mustflow_check
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# 날짜와 숫자 검수
|
|
24
|
+
|
|
25
|
+
<!-- mustflow-section: purpose -->
|
|
26
|
+
## 목적
|
|
27
|
+
|
|
28
|
+
코드, 문서, 테스트, 최종 보고가 날짜와 숫자 사실을 지어내거나 오래된 값을 복사하거나 서로 맞지 않게 두지 않도록 합니다.
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: use-when -->
|
|
31
|
+
## 사용할 때
|
|
32
|
+
|
|
33
|
+
- 날짜, 마감일, 릴리스 버전, 개수, 기간, 제한 시간, 한도, 할당량, 크기, 비율, 가격, 벤치마크, 점수, 테스트 커버리지 값, 생성 파일 총계를 추가, 수정, 제거, 보고합니다.
|
|
34
|
+
- 문서가 명령, 파일, 페이지, 템플릿, 언어, 테스트, 검사, 지원 항목의 개수를 요약합니다.
|
|
35
|
+
- 최종 보고나 사용자에게 보이는 문구가 코드, 템플릿, 패키지, 문서, 생성 출력 변경 뒤에 달라질 수 있는 숫자에 의존합니다.
|
|
36
|
+
- 실패한 검사가 오래된 리비전, 맞지 않는 버전, 잘못된 개수, 지난 날짜, 일관되지 않은 숫자 기준을 가리킵니다.
|
|
37
|
+
|
|
38
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
39
|
+
## 사용하지 않을 때
|
|
40
|
+
|
|
41
|
+
- 숫자가 공개 의미나 파일 간 의미가 없는 지역 변수, 반복문 인덱스, 열거형 값, 테스트 fixture입니다.
|
|
42
|
+
- 작업이 기존 숫자 문구를 그대로 보존할 뿐 그 값에 의존하지 않습니다.
|
|
43
|
+
- 릴리스 버전, 의존성 실재 확인, 산출물 무결성, 출처 최신성에 관한 더 좁은 스킬이 맞습니다.
|
|
44
|
+
|
|
45
|
+
<!-- mustflow-section: required-inputs -->
|
|
46
|
+
## 필요한 입력
|
|
47
|
+
|
|
48
|
+
- 날짜 또는 숫자 사실과 그것을 말하거나, 파생하거나, 검증하는 모든 표면.
|
|
49
|
+
- 패키지 메타데이터, 템플릿 메타데이터, 스키마, 코드 상수, 생성 출력, 테스트 단언, 현재 명령 결과 같은 값의 기준 출처.
|
|
50
|
+
- 값이 근사치, 표본, 로컬 전용, 시간에 민감한 정보일 때 허용되는 정밀도와 표현.
|
|
51
|
+
- 문서, 패키징, 빌드, mustflow 검증에 관한 명령 의도 계약 항목.
|
|
52
|
+
|
|
53
|
+
<!-- mustflow-section: preconditions -->
|
|
54
|
+
## 전제 조건
|
|
55
|
+
|
|
56
|
+
- 작업이 사용할 때 조건에 맞고 사용하지 않을 때 조건에는 해당하지 않습니다.
|
|
57
|
+
- 필요한 입력이 있거나, 부족한 입력을 추측하지 않고 보고할 수 있습니다.
|
|
58
|
+
- 현재 범위의 상위 지시와 `.mustflow/config/commands.toml`을 확인했습니다.
|
|
59
|
+
|
|
60
|
+
<!-- mustflow-section: allowed-edits -->
|
|
61
|
+
## 허용되는 수정
|
|
62
|
+
|
|
63
|
+
- 날짜와 숫자 사실을 원본 파일, 생성 메타데이터, 테스트, 문서, 최종 보고 사이에서 맞춥니다.
|
|
64
|
+
- 정확한 숫자가 안정적이지 않다면 범위를 둔 표현이나 출처가 드러나는 표현으로 바꿉니다.
|
|
65
|
+
- 문서를 채워 보이게 하려고 숫자를 지어내지 않습니다.
|
|
66
|
+
- 작업과 기준 출처가 뒷받침하지 않으면 동작 기준값, 제한 시간, 한도, 릴리스 버전을 바꾸지 않습니다.
|
|
67
|
+
|
|
68
|
+
<!-- mustflow-section: procedure -->
|
|
69
|
+
## 절차
|
|
70
|
+
|
|
71
|
+
1. 작업이 만들거나 수정하거나 보고하는 날짜와 숫자 사실을 나열합니다.
|
|
72
|
+
2. 의존 표면을 바꾸기 전에 각 값의 기준 출처를 확인합니다.
|
|
73
|
+
3. 관련 코드, 템플릿, 문서, 스키마, 테스트, 생성 메타데이터에서 같은 값을 중복해서 말하는 곳을 찾습니다.
|
|
74
|
+
4. 기준 출처에 맞춰 의존 표면을 갱신하거나, 정확한 검증이 불가능하면 근사치, 로컬 값, 표본, 미검증 값으로 표시합니다.
|
|
75
|
+
5. 버전 번호, 템플릿 리비전, 스키마 리비전, 언어별 원문 리비전, 패키지 단언, 공개 예시를 함께 맞춥니다.
|
|
76
|
+
6. 불확실성이 실제로 있고 도움이 될 때만 "약", "현재", "이 확인 시점 기준", "최신 생성 출력 기준" 같은 표현을 씁니다.
|
|
77
|
+
7. 값과 의존 표면이 여전히 일치함을 증명하는 가장 좁은 구성된 검증을 실행합니다.
|
|
78
|
+
|
|
79
|
+
<!-- mustflow-section: postconditions -->
|
|
80
|
+
## 완료 조건
|
|
81
|
+
|
|
82
|
+
- 공개되거나 파일 간에 의미가 있는 모든 날짜와 숫자 사실에는 이름 붙인 기준 출처나 명시한 불확실성 설명이 있습니다.
|
|
83
|
+
- 숫자를 단언하는 테스트와 메타데이터가 변경된 기준 출처와 맞습니다.
|
|
84
|
+
- 최종 보고는 의도적으로 근사치나 미검증 상태로 둔 값을 밝힙니다.
|
|
85
|
+
|
|
86
|
+
<!-- mustflow-section: verification -->
|
|
87
|
+
## 검증
|
|
88
|
+
|
|
89
|
+
사용 가능한 구성된 일회성 명령 의도를 사용합니다.
|
|
90
|
+
|
|
91
|
+
- `changes_status`
|
|
92
|
+
- `changes_diff_summary`
|
|
93
|
+
- `docs_validate_fast`
|
|
94
|
+
- `test_release`
|
|
95
|
+
- `mustflow_check`
|
|
96
|
+
|
|
97
|
+
변경된 숫자 표면을 더 잘 증명하는 좁은 테스트, 빌드, 문서 의도가 있으면 그 의도를 사용합니다.
|
|
98
|
+
|
|
99
|
+
<!-- mustflow-section: failure-handling -->
|
|
100
|
+
## 실패 처리
|
|
101
|
+
|
|
102
|
+
- 두 출처가 다르면 추측하지 않습니다. 더 높은 권위의 출처를 확인하거나 충돌을 보고합니다.
|
|
103
|
+
- 값이 시간, 네트워크 상태, 패키지 저장소 상태, 생성 출력, 외부 데이터에 의존하지만 새로 확인하지 않았다면 그 경계를 밝힙니다.
|
|
104
|
+
- 정확한 숫자가 필요 없고 최신으로 유지하기 비싸다면 깨지기 쉬운 정밀도를 피하도록 문장을 바꿉니다.
|
|
105
|
+
- 숫자 변경이 동작에 영향을 준다면 계속하기 전에 관련 코드, 테스트, 릴리스, 의존성 스킬을 적용합니다.
|
|
106
|
+
|
|
107
|
+
<!-- mustflow-section: output-format -->
|
|
108
|
+
## 출력 형식
|
|
109
|
+
|
|
110
|
+
- 검수한 날짜 또는 숫자 사실
|
|
111
|
+
- 각 값의 기준 출처
|
|
112
|
+
- 맞춘 표면
|
|
113
|
+
- 바꾼 정확한 값 또는 근사 표현으로 바꾼 값
|
|
114
|
+
- 실행한 명령 의도
|
|
115
|
+
- 건너뛴 검사와 이유
|
|
116
|
+
- 남은 날짜 또는 숫자 위험
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.dependency-injection
|
|
3
|
+
locale: ko
|
|
4
|
+
canonical: false
|
|
5
|
+
revision: 3
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: dependency-injection
|
|
9
|
+
description: Apply this skill when core or application logic creates, imports, resolves, or hides external dependencies such as databases, APIs, SDKs, filesystems, clocks, random generators, identifiers, loggers, configuration, framework request objects, AI clients, queues, or payment/email providers.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.dependency-injection
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- test_related
|
|
19
|
+
- test
|
|
20
|
+
- lint
|
|
21
|
+
- build
|
|
22
|
+
- docs_validate_fast
|
|
23
|
+
- test_release
|
|
24
|
+
- mustflow_check
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Dependency Injection
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Keep business logic from creating, finding, or importing the tools it needs. External-world objects belong at assembly boundaries; core logic receives narrow ports, explicit values, or request context from the outside.
|
|
33
|
+
|
|
34
|
+
Dependency injection is not an abstraction quota. Use it to keep replaceable infrastructure, hidden global state, and side effects from leaking into domain and use-case code.
|
|
35
|
+
|
|
36
|
+
<!-- mustflow-section: use-when -->
|
|
37
|
+
## Use When
|
|
38
|
+
|
|
39
|
+
- Core, domain, application, service, or use-case code directly constructs a database client, external SDK, queue, file storage, logger, clock, random generator, identifier generator, AI model client, email sender, payment gateway, HTTP client, or framework object.
|
|
40
|
+
- Code reads `process.env`, current time, random values, UUIDs, files, local storage, global containers, or global loggers away from the assembly boundary.
|
|
41
|
+
- A refactor aims to make behavior easier to test without real databases, network calls, API keys, filesystem writes, current time, or random identifiers.
|
|
42
|
+
- New ports, adapters, provider modules, transaction runners, or composition roots are being introduced.
|
|
43
|
+
- A function's signature hides required collaborators or accepts broad technical objects instead of the narrow capability it actually needs.
|
|
44
|
+
- An optional collaborator should be wired as a real implementation or a safe null, no-op, disabled, identity, empty, deny-all, or failing implementation at the assembly boundary.
|
|
45
|
+
|
|
46
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
47
|
+
## Do Not Use When
|
|
48
|
+
|
|
49
|
+
- The code is a pure function, value object, entity constructor, small data formatter, or internal helper with no external dependency.
|
|
50
|
+
- The task is a disposable one-off script that is not imported, tested, repeated, used in production, or connected to external services.
|
|
51
|
+
- A framework's dependency injection mechanism is already confined to the application boundary and does not leak into domain code.
|
|
52
|
+
- The only change needed is to confirm a package or tool exists; use `dependency-reality-check`.
|
|
53
|
+
|
|
54
|
+
<!-- mustflow-section: required-inputs -->
|
|
55
|
+
## Required Inputs
|
|
56
|
+
|
|
57
|
+
- The target code area and the direct dependency, global state, or hidden collaborator being introduced or removed.
|
|
58
|
+
- The intended business capability and which layer owns the rule: domain, application, infrastructure, adapter, route, worker, or assembly root.
|
|
59
|
+
- Existing local patterns for ports, adapters, fakes, transaction runners, clocks, configuration loading, and test setup.
|
|
60
|
+
- Current changed files and command-intent contract entries relevant to tests, builds, docs, release metadata, and mustflow validation.
|
|
61
|
+
|
|
62
|
+
<!-- mustflow-section: preconditions -->
|
|
63
|
+
## Preconditions
|
|
64
|
+
|
|
65
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
66
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
67
|
+
- If the local structure is unfamiliar, use `pattern-scout` or `codebase-orientation` before introducing new folders or naming conventions.
|
|
68
|
+
|
|
69
|
+
<!-- mustflow-section: allowed-edits -->
|
|
70
|
+
## Allowed Edits
|
|
71
|
+
|
|
72
|
+
- Define narrow consumer-owned ports where core logic needs external behavior.
|
|
73
|
+
- Move concrete client creation, environment reads, lifecycle setup, and disposal to assembly boundaries.
|
|
74
|
+
- Add infrastructure adapters that implement the ports and translate external rows, responses, errors, and identifiers into internal types.
|
|
75
|
+
- Add local fakes, fixed clocks, fixed identifiers, and contract tests when needed to preserve behavior.
|
|
76
|
+
- Wire optional collaborators with `null-object-pattern` when absence is explicit, safe, and should not leak nullable checks into business logic.
|
|
77
|
+
- Do not add a service locator, global container access, broad application dependency bag, framework decorator in domain code, or speculative interface for every class.
|
|
78
|
+
- When the dependency also crosses an external protocol, provider, database, webhook, queue, file, cache, AI model, or framework boundary, use `adapter-boundary` for the translation and failure-handling rules.
|
|
79
|
+
|
|
80
|
+
<!-- mustflow-section: procedure -->
|
|
81
|
+
## Procedure
|
|
82
|
+
|
|
83
|
+
1. Classify the code under change:
|
|
84
|
+
- Core logic: domain rules, use cases, state transitions, policy checks, calculations, and business decisions.
|
|
85
|
+
- Edge logic: routes, controllers, workers, command handlers, adapters, repositories, SDK wrappers, and assembly roots.
|
|
86
|
+
2. Find direct external dependencies before editing. Look for concrete SDK construction, database clients, HTTP clients, file APIs, environment reads, current-time calls, random or UUID generation, global loggers, global containers, framework request or response objects, and external error types.
|
|
87
|
+
3. Decide whether dependency injection is warranted. Inject only collaborators that cross a boundary, are hard to test, may change implementation, or represent hidden global state. Do not wrap pure helpers, value objects, or stable internal data structures just to add ceremony.
|
|
88
|
+
4. Define ports from the consumer's need, not from the provider's API.
|
|
89
|
+
- Prefer `PaymentGateway`, `UserRepository`, `EmailSender`, `ImageStorage`, or `TextGenerator`.
|
|
90
|
+
- Avoid provider-shaped ports such as `StripeService`, `PrismaUserStore`, `ResendMailer`, `S3ImageStorage`, or `OpenAITextGenerator` at the core boundary.
|
|
91
|
+
5. Choose the injection style:
|
|
92
|
+
- Use constructor injection or a dependency object for classes with stable collaborators.
|
|
93
|
+
- Use function-closure injection for small use cases or function-oriented modules.
|
|
94
|
+
- Use method parameters for per-call data such as actor, tenant, locale, request id, pagination, filters, or command input.
|
|
95
|
+
- Use factories only when runtime values decide the implementation, lifecycle, or resource handle.
|
|
96
|
+
6. Keep construction at the assembly boundary. Create concrete clients, load and validate configuration, register containers, open connections, and wire adapters in files such as bootstrap, server setup, worker setup, route setup, module registration, or test setup.
|
|
97
|
+
- If a dependency is optional and disabled by explicit configuration, choose the real collaborator or the safe neutral implementation here, not inside business logic.
|
|
98
|
+
- If a dependency is required, validate configuration here and fail early instead of injecting a null object.
|
|
99
|
+
7. Treat time, random values, identifiers, configuration, logging, transactions, and framework objects as dependencies.
|
|
100
|
+
- For domain decisions, prefer an already captured instant or time context over passing a clock that can be queried inside the domain.
|
|
101
|
+
- Pass fixed implementations in tests so time, identifiers, and random choices are reproducible.
|
|
102
|
+
8. Keep adapters responsible for translation. Repositories and provider adapters should convert database rows, external responses, external errors, and provider identifiers before returning to core logic.
|
|
103
|
+
9. If the injected collaborator is an external boundary, apply `adapter-boundary` before finalizing the port and adapter. Dependency injection decides how core logic receives the collaborator; adapter boundaries decide how external protocols, data, errors, timeouts, retries, idempotency, security, and observability are translated.
|
|
104
|
+
10. Keep transaction ownership explicit. Inject a transaction runner when a use case needs atomic persistence across multiple repositories. Do not hide transaction boundaries inside repositories when the use case owns the unit of work, and do not call external APIs inside a database transaction.
|
|
105
|
+
11. Reject hidden dependency patterns:
|
|
106
|
+
- no property injection for required collaborators
|
|
107
|
+
- no service locator or `container.resolve` in core logic
|
|
108
|
+
- no process-wide mutable singleton holding request state
|
|
109
|
+
- no broad `AppDeps` object when a use case needs only a few collaborators
|
|
110
|
+
- no circular service dependencies unless a smaller use case, shared policy, or event boundary has been considered first
|
|
111
|
+
12. Keep tests honest. Unit tests for core logic should use fakes or fixed collaborators and should not require a real database, real network, real API key, real email, real payment, real filesystem side effect, current time, or random UUID. Test real adapters separately with integration or contract coverage.
|
|
112
|
+
13. Verify with the narrowest configured command intents that cover the changed code, tests, template files, docs, and release metadata.
|
|
113
|
+
|
|
114
|
+
<!-- mustflow-section: postconditions -->
|
|
115
|
+
## Postconditions
|
|
116
|
+
|
|
117
|
+
- Core logic declares its collaborators through constructor parameters, function parameters, or narrow context objects.
|
|
118
|
+
- Concrete external implementation creation is easy to find at assembly boundaries.
|
|
119
|
+
- Core logic does not import provider SDKs, database clients, framework request or response objects, global containers, or external provider error types.
|
|
120
|
+
- Tests can replace external collaborators, time, identifiers, and random values without live infrastructure.
|
|
121
|
+
- Adapter boundaries translate external data and failures before they reach core logic.
|
|
122
|
+
|
|
123
|
+
<!-- mustflow-section: verification -->
|
|
124
|
+
## Verification
|
|
125
|
+
|
|
126
|
+
Use configured oneshot command intents when available:
|
|
127
|
+
|
|
128
|
+
- `changes_status`
|
|
129
|
+
- `changes_diff_summary`
|
|
130
|
+
- `test_related`
|
|
131
|
+
- `test`
|
|
132
|
+
- `lint`
|
|
133
|
+
- `build`
|
|
134
|
+
- `docs_validate_fast`
|
|
135
|
+
- `test_release`
|
|
136
|
+
- `mustflow_check`
|
|
137
|
+
|
|
138
|
+
Prefer the narrowest configured test or build intent that proves the affected boundary. Use documentation and release checks when templates, skill routes, public docs, package metadata, or installed-file surfaces change.
|
|
139
|
+
|
|
140
|
+
<!-- mustflow-section: failure-handling -->
|
|
141
|
+
## Failure Handling
|
|
142
|
+
|
|
143
|
+
- If extracting a port would duplicate an existing local interface, reuse or narrow the existing local pattern instead of creating a parallel abstraction.
|
|
144
|
+
- If a class needs many collaborators, stop before adding a giant dependency object and look for mixed responsibilities, smaller use cases, or adapter boundaries.
|
|
145
|
+
- If a framework forces decorators or container registration, keep that integration in the application boundary and do not let it shape domain types.
|
|
146
|
+
- If a direct dependency cannot be removed in one safe step, first wrap it at the smallest local boundary and report the remaining leakage.
|
|
147
|
+
- If tests still need real infrastructure after the refactor, report which dependency is still not injectable and why.
|
|
148
|
+
|
|
149
|
+
<!-- mustflow-section: output-format -->
|
|
150
|
+
## Output Format
|
|
151
|
+
|
|
152
|
+
- Dependency boundary reviewed
|
|
153
|
+
- Direct external dependencies found
|
|
154
|
+
- Injection style selected
|
|
155
|
+
- Ports and adapters added or reused
|
|
156
|
+
- Assembly boundary used
|
|
157
|
+
- External data or error translation handled
|
|
158
|
+
- Tests, fakes, or fixed collaborators added or reused
|
|
159
|
+
- Command intents run
|
|
160
|
+
- Skipped checks and reasons
|
|
161
|
+
- Remaining dependency leakage or lifecycle risk
|