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,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.adapter-boundary
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 3
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: adapter-boundary
|
|
9
|
+
description: Apply this skill when external systems, protocols, SDKs, databases, webhooks, queues, files, caches, framework requests or responses, AI models, browser storage, or provider data cross into or out of core logic and need ports, adapters, translation, error mapping, timeout, retry, idempotency, security, or observability boundaries.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.adapter-boundary
|
|
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
|
+
# Adapter Boundary
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Keep external-world language, protocols, failures, and operational concerns out of core logic. Core logic speaks in internal use-case and domain terms; adapters translate external requests, responses, rows, messages, errors, identities, and provider behavior at the boundary.
|
|
33
|
+
|
|
34
|
+
This skill is not just a wrapper pattern. A good adapter boundary absorbs provider details, validates or maps untrusted input, classifies failures, applies timeouts and retry policy, preserves idempotency where needed, and records safe observability evidence without leaking secrets or personal data.
|
|
35
|
+
|
|
36
|
+
<!-- mustflow-section: use-when -->
|
|
37
|
+
## Use When
|
|
38
|
+
|
|
39
|
+
- Code receives input from HTTP, CLI, webhooks, message queues, scheduled jobs, browser events, uploaded files, external databases, or external APIs.
|
|
40
|
+
- Code calls external APIs, payment providers, email or SMS providers, file storage, object storage, databases, caches, search engines, analytics, AI models, queues, or browser storage.
|
|
41
|
+
- Provider SDK types, framework request or response objects, database rows, external event objects, raw model responses, or provider error types are visible in domain, application, service, or use-case code.
|
|
42
|
+
- A new or changed port, repository, gateway, provider module, controller, worker, webhook handler, mapper, or integration test is needed.
|
|
43
|
+
- The boundary needs timeout, retry, rate-limit, idempotency, signature verification, duplicate handling, logging, metrics, redaction, or provider-version decisions.
|
|
44
|
+
- An optional external integration may be disabled and needs either a safe neutral adapter or an explicit disabled result without leaking provider absence inward.
|
|
45
|
+
|
|
46
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
47
|
+
## Do Not Use When
|
|
48
|
+
|
|
49
|
+
- The change is a pure calculation, value object, internal formatter, or data-only refactor with no external boundary.
|
|
50
|
+
- The only problem is hidden construction or global lookup of a dependency; use `dependency-injection` first, then return here only if external data, errors, or protocol behavior also need a boundary.
|
|
51
|
+
- The operation coordinates several already-translated ports, repositories, queues, caches, or providers behind one caller-facing workflow; use `facade-pattern` for that high-level entry point while keeping this skill for each external boundary.
|
|
52
|
+
- The task is a disposable one-off script that is not imported, repeated, tested, used in production, or connected to external systems.
|
|
53
|
+
- The repository already has a more specific local integration skill that fully covers the boundary.
|
|
54
|
+
|
|
55
|
+
<!-- mustflow-section: required-inputs -->
|
|
56
|
+
## Required Inputs
|
|
57
|
+
|
|
58
|
+
- The external system or protocol and whether it is inbound, outbound, or both.
|
|
59
|
+
- The internal use case, domain action, or read model that should receive translated data.
|
|
60
|
+
- Existing local patterns for ports, adapters, repositories, controllers, workers, mappers, result types, retries, idempotency, logging, and tests.
|
|
61
|
+
- Provider-specific risk: write effects, duplicate delivery, unknown statuses, money, time, identifiers, secrets, personal data, files, untrusted URLs, rate limits, or provider version changes.
|
|
62
|
+
- Relevant command-intent contract entries for tests, builds, docs, template checks, release checks, and mustflow validation.
|
|
63
|
+
|
|
64
|
+
<!-- mustflow-section: preconditions -->
|
|
65
|
+
## Preconditions
|
|
66
|
+
|
|
67
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
68
|
+
- The boundary direction and owner are clear enough to avoid putting provider names or external protocol terms into core logic.
|
|
69
|
+
- If the local layout is unfamiliar, use `pattern-scout` or `codebase-orientation` before introducing new folders or naming conventions.
|
|
70
|
+
- If the change also introduces hidden collaborators or concrete construction, use `dependency-injection` for that part of the work.
|
|
71
|
+
- If the integration is optional and disabled by explicit configuration, use `null-object-pattern` only when the neutral behavior is safe and honest; required providers must fail closed.
|
|
72
|
+
|
|
73
|
+
<!-- mustflow-section: allowed-edits -->
|
|
74
|
+
## Allowed Edits
|
|
75
|
+
|
|
76
|
+
- Define narrow internal ports in the consuming application or domain language.
|
|
77
|
+
- Add inbound adapters that parse, verify, validate, translate, and map protocol results.
|
|
78
|
+
- Add outbound adapters that call providers and translate requests, responses, errors, identifiers, and operational metadata.
|
|
79
|
+
- Add mapper, error-mapper, fixture, fake-port, contract-test, and adapter-test files directly needed by the boundary.
|
|
80
|
+
- Add or update assembly-root wiring when a new adapter implementation is introduced.
|
|
81
|
+
- Do not copy provider APIs into ports, return provider SDK objects, expose database rows as domain objects, or add a broad catch-all `ExternalAdapter`.
|
|
82
|
+
|
|
83
|
+
<!-- mustflow-section: procedure -->
|
|
84
|
+
## Procedure
|
|
85
|
+
|
|
86
|
+
1. Classify the boundary.
|
|
87
|
+
- Inbound: HTTP route, controller, webhook, CLI command, queue consumer, scheduler, browser event, uploaded file, or external data import.
|
|
88
|
+
- Outbound: provider SDK, HTTP API, database, cache, file storage, search engine, message publisher, email/SMS/push provider, payment provider, AI model, or browser storage.
|
|
89
|
+
2. Name the internal capability in business language. Use names such as `PaymentGateway`, `EmailSender`, `ObjectStorage`, `UserStore`, `OrderReader`, `SummaryGenerator`, or `EventPublisher`. Keep provider names such as Stripe, Prisma, SendGrid, S3, OpenAI, or Redis inside adapter implementation names.
|
|
90
|
+
3. Design the port from the consumer's need, not from the provider's API.
|
|
91
|
+
- Keep ports small and split unrelated reasons to change.
|
|
92
|
+
- Use internal input and output types only.
|
|
93
|
+
- Do not include SDK types, ORM model types, HTTP request objects, provider response objects, or provider error classes.
|
|
94
|
+
4. Build inbound adapters as translators, not business-rule containers.
|
|
95
|
+
- Parse and validate external input.
|
|
96
|
+
- Verify signatures, authentication evidence, request size, file constraints, and allowed URL or host rules where relevant.
|
|
97
|
+
- Extract only the values needed by the use case.
|
|
98
|
+
- Map use-case results back to the protocol response.
|
|
99
|
+
- Keep pricing, permission decisions, state transitions, inventory policy, subscription policy, and other business rules in the application or domain layer.
|
|
100
|
+
5. Build outbound adapters as provider translators, not pass-through wrappers.
|
|
101
|
+
- Create provider requests from internal input.
|
|
102
|
+
- Set timeouts and retry policy where appropriate.
|
|
103
|
+
- Pass idempotency keys for writes when the provider supports them.
|
|
104
|
+
- Distinguish timeout, network error, rate limit, authentication failure, authorization failure, invalid request, business rejection, provider outage, and unknown provider error.
|
|
105
|
+
- Return internal `Result` values or local error types instead of throwing provider errors for expected failures.
|
|
106
|
+
- For optional disabled integrations, return an honest skipped or disabled outcome, or wire a safe null object at the assembly boundary. Do not return fake provider success.
|
|
107
|
+
6. Convert external data immediately at the boundary.
|
|
108
|
+
- Map provider responses, database rows, queue messages, file metadata, model outputs, and browser storage values into internal types.
|
|
109
|
+
- Keep external identifiers distinct from internal identifiers.
|
|
110
|
+
- Represent money in integer minor units and explicit currency.
|
|
111
|
+
- Convert dates and times explicitly according to the repository's time policy.
|
|
112
|
+
- Copy only fields that internal code actually uses.
|
|
113
|
+
7. Separate mappers when translation grows.
|
|
114
|
+
- Split request mapping, response mapping, error mapping, and fixture builders once they become non-trivial or repeated.
|
|
115
|
+
- Keep provider-version differences inside adapter or mapper files.
|
|
116
|
+
8. Treat databases, caches, and queues as external systems.
|
|
117
|
+
- Core logic should use stores, readers, writers, or publishers rather than raw clients.
|
|
118
|
+
- Database rows are persistence shapes, not domain objects.
|
|
119
|
+
- Queue messages and integration events are external envelopes until parsed and translated.
|
|
120
|
+
- Cache keys, time-to-live values, invalidation rules, and stale-data policy must be explicit.
|
|
121
|
+
9. Keep database transactions and external side effects separate by default.
|
|
122
|
+
- Do not call external APIs inside database transactions unless a local rule explicitly justifies the risk.
|
|
123
|
+
- Use explicit states, an outbox, an action ledger, or a reconciliation path when database changes and external effects must be coordinated.
|
|
124
|
+
10. Harden webhooks and duplicate delivery.
|
|
125
|
+
- Verify signatures before trusting payloads.
|
|
126
|
+
- Preserve the raw body or safe raw reference when needed for verification and replay.
|
|
127
|
+
- Use provider event identifiers or action keys to prevent duplicate effects.
|
|
128
|
+
- Translate external event types into internal commands or events before calling the use case.
|
|
129
|
+
11. Keep AI model boundaries explicit.
|
|
130
|
+
- Keep provider request format, model name, temperature, token limits, safety settings, and raw response parsing inside adapter or configuration code.
|
|
131
|
+
- Validate structured output before returning it.
|
|
132
|
+
- Return internal purpose-level outputs such as summaries, classifications, recommendations, or extracted fields.
|
|
133
|
+
12. Make observability safe and useful.
|
|
134
|
+
- Log adapter name, provider, operation, correlation id, safe idempotency-key hash, provider request id, duration, retry count, outcome, and local error kind when available.
|
|
135
|
+
- Do not log API keys, tokens, card data, passwords, identity numbers, raw personal data, full email bodies, full payment requests, full provider responses, or unredacted payloads.
|
|
136
|
+
- Add metrics for latency, failures, retries, rate limits, duplicate handling, and ambiguous or unknown provider outcomes when the boundary is operationally important.
|
|
137
|
+
13. Test at the right layer.
|
|
138
|
+
- Use fake ports in use-case tests; they should not call real external systems.
|
|
139
|
+
- Test adapters with provider fixtures, mock clients, or local test doubles for request mapping, response mapping, error mapping, timeout, retry, idempotency, redaction, and duplicate handling.
|
|
140
|
+
- Add contract or sandbox tests for critical providers when local fixtures cannot catch provider drift.
|
|
141
|
+
14. Verify with the narrowest configured command intents that cover changed source, tests, templates, docs, release metadata, and mustflow checks.
|
|
142
|
+
|
|
143
|
+
<!-- mustflow-section: postconditions -->
|
|
144
|
+
## Postconditions
|
|
145
|
+
|
|
146
|
+
- Core logic has no provider SDK imports, framework request or response objects, ORM clients, database rows, provider response objects, or provider error classes.
|
|
147
|
+
- Ports are named in internal business language and expose only internal input, output, and error types.
|
|
148
|
+
- Inbound adapters validate and translate before calling use cases.
|
|
149
|
+
- Outbound adapters translate internal requests, provider responses, and provider failures before returning.
|
|
150
|
+
- Timeouts, retry policy, idempotency, duplicate handling, security checks, and redacted observability are explicit where the risk requires them.
|
|
151
|
+
- Tests cover core behavior through fakes and adapter behavior through mapping, error, and boundary tests.
|
|
152
|
+
|
|
153
|
+
<!-- mustflow-section: verification -->
|
|
154
|
+
## Verification
|
|
155
|
+
|
|
156
|
+
Use configured oneshot command intents when available:
|
|
157
|
+
|
|
158
|
+
- `changes_status`
|
|
159
|
+
- `changes_diff_summary`
|
|
160
|
+
- `test_related`
|
|
161
|
+
- `test`
|
|
162
|
+
- `lint`
|
|
163
|
+
- `build`
|
|
164
|
+
- `docs_validate_fast`
|
|
165
|
+
- `test_release`
|
|
166
|
+
- `mustflow_check`
|
|
167
|
+
|
|
168
|
+
Prefer the narrowest configured test or build intent that proves the affected boundary. Use documentation and release checks when skill routes, templates, public docs, package metadata, or installed-file surfaces change.
|
|
169
|
+
|
|
170
|
+
<!-- mustflow-section: failure-handling -->
|
|
171
|
+
## Failure Handling
|
|
172
|
+
|
|
173
|
+
- If a port starts mirroring a provider API, narrow it to the consuming use case and move provider details back into the adapter.
|
|
174
|
+
- If an adapter becomes a pass-through wrapper, add explicit mapping and error translation or remove the false boundary.
|
|
175
|
+
- If an adapter begins making business decisions, move the policy into the application or domain layer.
|
|
176
|
+
- If timeout, retry, or idempotency behavior cannot be made safe, fail closed and report the remaining manual or reconciliation requirement.
|
|
177
|
+
- If sensitive data appears in logs, fixtures, metrics, receipts, or test output, stop and route the sensitive surface through the repository's security and privacy review path.
|
|
178
|
+
- If the provider behavior is unknown or drift-prone, keep claims local to verified fixtures or contract evidence and report what still needs live verification.
|
|
179
|
+
|
|
180
|
+
<!-- mustflow-section: output-format -->
|
|
181
|
+
## Output Format
|
|
182
|
+
|
|
183
|
+
- Boundary classified
|
|
184
|
+
- Internal port or use-case input selected
|
|
185
|
+
- Provider or protocol details contained
|
|
186
|
+
- Inbound validation and translation handled
|
|
187
|
+
- Outbound request, response, and error mapping handled
|
|
188
|
+
- Timeout, retry, idempotency, and duplicate behavior handled or explicitly deferred
|
|
189
|
+
- Security and redaction surfaces checked
|
|
190
|
+
- Tests, fixtures, fakes, or contract checks added or reused
|
|
191
|
+
- Command intents run
|
|
192
|
+
- Skipped checks and reasons
|
|
193
|
+
- Remaining boundary leakage or provider risk
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.artifact-integrity-check
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 3
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: artifact-integrity-check
|
|
9
|
+
description: Apply this skill when a task creates, replaces, packages, references, or reports on generated artifacts or binary assets.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.artifact-integrity-check
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- test_release
|
|
19
|
+
- build
|
|
20
|
+
- mustflow_check
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Artifact Integrity Check
|
|
24
|
+
|
|
25
|
+
<!-- mustflow-section: purpose -->
|
|
26
|
+
## Purpose
|
|
27
|
+
|
|
28
|
+
Ensure generated artifacts, packaged files, media assets, reports, and downloadable outputs exist, match their intended source, and are not reported as verified without evidence.
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: use-when -->
|
|
31
|
+
## Use When
|
|
32
|
+
|
|
33
|
+
- A task creates, replaces, moves, deletes, packages, or references an artifact or binary asset.
|
|
34
|
+
- A final report claims that a file was generated, optimized, exported, included in a package, or safe to use.
|
|
35
|
+
- A build or packaging step writes files that may be stale, missing, oversized, or excluded from distribution.
|
|
36
|
+
- A document, README, manifest, or test points to a generated file or asset path.
|
|
37
|
+
- A release, package publish, workflow, or trusted publishing path can modify artifacts before publication.
|
|
38
|
+
- A code-scanning or workflow-security alert involves published artifacts, uploaded artifacts, SARIF files, package tarballs, Pages output, cache contents, or release credentials.
|
|
39
|
+
|
|
40
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
41
|
+
## Do Not Use When
|
|
42
|
+
|
|
43
|
+
- The change is source-only and does not mention generated, packaged, exported, or binary files.
|
|
44
|
+
- Another narrower skill already verifies the exact artifact path, package surface, and output claim.
|
|
45
|
+
- The user explicitly asks for a conceptual plan without producing or validating files.
|
|
46
|
+
|
|
47
|
+
<!-- mustflow-section: required-inputs -->
|
|
48
|
+
## Required Inputs
|
|
49
|
+
|
|
50
|
+
- Artifact paths or expected output locations.
|
|
51
|
+
- Source files, generation steps, or package rules that should produce the artifact.
|
|
52
|
+
- Any size, format, hash, manifest, package, or documentation expectation.
|
|
53
|
+
- Relevant command-intent contract entries for build, packaging, validation, or asset optimization.
|
|
54
|
+
- Workflow steps, action references, publish credentials, OIDC permissions, package registry identity, and pre-publish lifecycle scripts when artifacts are released.
|
|
55
|
+
- Code-scanning artifact paths, upload steps, credential scope, and whether the uploaded artifact can contain checkout credentials, generated secrets, or tampered package contents.
|
|
56
|
+
|
|
57
|
+
<!-- mustflow-section: preconditions -->
|
|
58
|
+
## Preconditions
|
|
59
|
+
|
|
60
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
61
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
62
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
63
|
+
|
|
64
|
+
<!-- mustflow-section: allowed-edits -->
|
|
65
|
+
## Allowed Edits
|
|
66
|
+
|
|
67
|
+
- Update only the artifact, source reference, manifest, package metadata, test, or documentation needed to keep the artifact claim true.
|
|
68
|
+
- Do not commit generated caches, transient build output, or local state unless the repository explicitly versions that artifact.
|
|
69
|
+
- Do not invent hashes, dimensions, file sizes, export results, or package inclusion evidence.
|
|
70
|
+
|
|
71
|
+
<!-- mustflow-section: procedure -->
|
|
72
|
+
## Procedure
|
|
73
|
+
|
|
74
|
+
1. List each artifact or binary asset affected by the task and the claim being made about it.
|
|
75
|
+
2. Identify whether the artifact is source-controlled, generated, packaged, ignored local state, or external output.
|
|
76
|
+
3. Check that source references, manifests, package includes, docs links, and tests point to the same path and format.
|
|
77
|
+
4. For publish workflows, inspect code that runs before artifact publication. Treat mutable third-party actions, lifecycle scripts, package manifests, and generated files as artifact mutation points.
|
|
78
|
+
5. For workflow artifact alerts, check whether checkout credentials persist into the workspace, whether artifacts are uploaded after untrusted code runs, and whether the job permission is broader than the artifact operation needs.
|
|
79
|
+
6. Verify existence, format, and expected inclusion using the narrowest configured command intent available.
|
|
80
|
+
7. If a generated artifact is stale or missing, regenerate it only through a configured command intent or report the missing command.
|
|
81
|
+
8. If an artifact should not be versioned, ensure the final report does not imply that it was committed or distributed.
|
|
82
|
+
9. Report artifact evidence precisely: path checked, command intent run, and any remaining unverified attribute.
|
|
83
|
+
|
|
84
|
+
<!-- mustflow-section: postconditions -->
|
|
85
|
+
## Postconditions
|
|
86
|
+
|
|
87
|
+
- Every artifact claim in code, docs, manifests, tests, and the final report is backed by observed evidence or explicitly marked unverified.
|
|
88
|
+
- Generated and ignored outputs are not treated as project truth unless the repository declares them versioned.
|
|
89
|
+
- Package or distribution claims are verified with the relevant configured intent when available.
|
|
90
|
+
|
|
91
|
+
<!-- mustflow-section: verification -->
|
|
92
|
+
## Verification
|
|
93
|
+
|
|
94
|
+
Use configured oneshot command intents when available:
|
|
95
|
+
|
|
96
|
+
- `changes_status`
|
|
97
|
+
- `changes_diff_summary`
|
|
98
|
+
- `test_release`
|
|
99
|
+
- `build`
|
|
100
|
+
- `mustflow_check`
|
|
101
|
+
|
|
102
|
+
Use a narrower configured asset or documentation validation intent when it better covers the artifact.
|
|
103
|
+
|
|
104
|
+
<!-- mustflow-section: failure-handling -->
|
|
105
|
+
## Failure Handling
|
|
106
|
+
|
|
107
|
+
- If the artifact cannot be generated or inspected, report the missing tool, command intent, or source file.
|
|
108
|
+
- If package inclusion and source references disagree, fix the manifest or docs before reporting the artifact as shipped.
|
|
109
|
+
- If a privileged release workflow runs mutable actions or repository-controlled code before publishing, report the artifact integrity risk or isolate and pin the publish path before claiming the package is trustworthy.
|
|
110
|
+
- If an artifact is too large, stale, or in the wrong format, report the issue and avoid claiming it is production-ready.
|
|
111
|
+
- If verification would require external services or unavailable tools, stop at that boundary and name the unchecked artifact property.
|
|
112
|
+
|
|
113
|
+
<!-- mustflow-section: output-format -->
|
|
114
|
+
## Output Format
|
|
115
|
+
|
|
116
|
+
- Artifact paths checked
|
|
117
|
+
- Artifact source or generation path
|
|
118
|
+
- Inclusion, format, or size evidence
|
|
119
|
+
- Command intents run
|
|
120
|
+
- Skipped artifact checks and reasons
|
|
121
|
+
- Remaining artifact integrity risk
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.behavior-preserving-refactor
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 11
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: behavior-preserving-refactor
|
|
9
|
+
description: Apply this skill when refactoring should reduce change cost while preserving existing behavior and keeping behavior changes separate.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.behavior-preserving-refactor
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- test_related
|
|
19
|
+
- test
|
|
20
|
+
- docs_validate_fast
|
|
21
|
+
- test_release
|
|
22
|
+
- mustflow_check
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Behavior-Preserving Refactor
|
|
26
|
+
|
|
27
|
+
<!-- mustflow-section: purpose -->
|
|
28
|
+
## Purpose
|
|
29
|
+
|
|
30
|
+
Guide refactoring that lowers future change cost without silently changing runtime behavior.
|
|
31
|
+
|
|
32
|
+
Refactoring is not cleanup for aesthetics. It is a controlled way to make code easier to understand, test, and change while keeping bug fixes, feature work, and behavior changes separate.
|
|
33
|
+
|
|
34
|
+
<!-- mustflow-section: use-when -->
|
|
35
|
+
## Use When
|
|
36
|
+
|
|
37
|
+
- The user asks to refactor, clean up, reorganize, simplify, split, extract, rename, remove duplication, or improve structure.
|
|
38
|
+
- A planned change risks mixing renames, moves, extractions, deduplication, bug fixes, and feature behavior in one diff.
|
|
39
|
+
- Existing code is hard to change because responsibilities, names, branches, dependencies, or tests are unclear.
|
|
40
|
+
- Existing inheritance, base classes, abstract classes, template methods, protected state, or subclass variants make behavior harder to test or change.
|
|
41
|
+
- Existing handlers, repositories, adapters, jobs, or services mix business decisions with database access, network calls, logging, current time, generated identifiers, randomness, environment reads, or framework objects.
|
|
42
|
+
- Existing controllers, handlers, jobs, or services mix one state-changing intent with authorization, transactions, idempotency, audit logs, outbox events, retries, concurrency checks, and external side effects.
|
|
43
|
+
- Existing controllers, handlers, workers, command handlers, or services repeat the same multi-step subsystem sequence and should move behind a stable facade without changing behavior.
|
|
44
|
+
- Existing lifecycle state changes are scattered across direct assignments, handlers, repositories, jobs, UI checks, SQL conditions, or provider callbacks.
|
|
45
|
+
- Existing code repeats presence checks for optional collaborators such as loggers, analytics clients, caches, optional notifications, or no-op processors.
|
|
46
|
+
- The task touches legacy or weakly tested code and needs a safer refactoring order.
|
|
47
|
+
|
|
48
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
49
|
+
## Do Not Use When
|
|
50
|
+
|
|
51
|
+
- The requested task is primarily a bug fix or failure diagnosis; use `repro-first-debug` first.
|
|
52
|
+
- The change introduces new folders, modules, routing, data models, or external service boundaries before refactoring scope is clear; use `structure-discovery-gate`.
|
|
53
|
+
- The task is only to review an already completed diff; use `diff-risk-review` or `code-review`.
|
|
54
|
+
- The target code is about to be deleted, the requirement is still unclear, or the next step requires a product decision rather than a refactor.
|
|
55
|
+
|
|
56
|
+
<!-- mustflow-section: required-inputs -->
|
|
57
|
+
## Required Inputs
|
|
58
|
+
|
|
59
|
+
- The refactoring goal, target files or area, and the concrete pain being reduced.
|
|
60
|
+
- Current behavior evidence, such as tests, examples, fixtures, command output, or observed input and output cases.
|
|
61
|
+
- Existing local patterns for naming, file boundaries, dependencies, and tests.
|
|
62
|
+
- Current changed-file list when the worktree is already dirty.
|
|
63
|
+
- Relevant command-intent contract entries for verification.
|
|
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 expected behavior to preserve is known, or the unknown behavior has been reported before edits begin.
|
|
70
|
+
- If the area is unfamiliar, `codebase-orientation` or `pattern-scout` has been used to avoid inventing a parallel structure.
|
|
71
|
+
- If tests are absent or weak, the first safe step is to add characterization coverage, capture input and output cases, or explicitly report the verification gap.
|
|
72
|
+
|
|
73
|
+
<!-- mustflow-section: allowed-edits -->
|
|
74
|
+
## Allowed Edits
|
|
75
|
+
|
|
76
|
+
- Rename unclear identifiers when the rename improves call-site meaning without changing behavior.
|
|
77
|
+
- Extract small functions, policies, or helpers when they have a clear concept, inputs, outputs, and test value.
|
|
78
|
+
- Flatten conditional flow when it preserves the same guard conditions and error behavior.
|
|
79
|
+
- Separate responsibilities, dependencies, or side effects in the smallest useful step.
|
|
80
|
+
- Move domain decisions toward pure functions or narrow policy objects, and keep I/O, clocks, network calls, process spawning, persistence, and logging in the imperative edge.
|
|
81
|
+
- Add or update tests that preserve current behavior or make the refactoring safe.
|
|
82
|
+
- Do not mix behavior changes, bug fixes, new features, broad formatting churn, or unrelated cleanup into the refactor.
|
|
83
|
+
|
|
84
|
+
<!-- mustflow-section: procedure -->
|
|
85
|
+
## Procedure
|
|
86
|
+
|
|
87
|
+
Before broad hotspot scans, compress candidates before reading files.
|
|
88
|
+
|
|
89
|
+
- Exclude generated files, bundled files, lock files, dependency directories, large fixtures, snapshots, build outputs, minified files, and source maps before ranking candidates.
|
|
90
|
+
- Use `[refactoring.hotspots]` preferences as scan limits: `large_file_candidate_kb` for the first size signal, `history_days` for recent change and bug-fix history, and the candidate limits for how many files to inspect at each depth.
|
|
91
|
+
- Prefer overlapping low-cost signals over a single metric: size, recent change frequency, bug-fix history, import/export count, TODO/FIXME/HACK count, type or lint bypasses, missing nearby tests, and architecture-boundary imports.
|
|
92
|
+
- Treat strong combinations as higher priority, such as large files with frequent changes and no tests, small security/payment/permission files with repeated bug fixes, large React client components with many effects, and API/controller files that mix validation, authorization, business logic, database access, and response formatting.
|
|
93
|
+
- Do not read every candidate. Keep the first pass to the configured primary limit, narrow to the configured structure-review limit, and read full file contents only for the configured full-file limit.
|
|
94
|
+
- When opening a candidate, inspect imports, exports, declarations, TODO or type-bypass neighborhoods, and the largest or most branch-heavy function before reading the full file.
|
|
95
|
+
|
|
96
|
+
1. Diagnose whether refactoring is needed.
|
|
97
|
+
- Name the real problem: change cost, unclear responsibility, repeated bug risk, test difficulty, dependency coupling, or confusing flow.
|
|
98
|
+
- Do not refactor only because code looks long, old, or stylistically uneven.
|
|
99
|
+
2. Identify behavior that must stay fixed.
|
|
100
|
+
- Prefer existing tests or examples.
|
|
101
|
+
- If coverage is missing, record representative input and output cases or add focused characterization tests before structural edits.
|
|
102
|
+
- Treat suspected bugs as separate follow-up fixes unless the user explicitly asks to change behavior.
|
|
103
|
+
3. Choose the safest refactoring ladder.
|
|
104
|
+
- Start with names and local clarity.
|
|
105
|
+
- Then extract small concepts with clear inputs and outputs.
|
|
106
|
+
- Then flatten conditions or isolate policies.
|
|
107
|
+
- Then remove duplication only when the duplicated code changes for the same reason.
|
|
108
|
+
- Move files, introduce abstractions, or split modules only after local behavior is easier to see.
|
|
109
|
+
4. Check duplication before merging code.
|
|
110
|
+
- Keep duplication when code only looks similar or will change for different reasons.
|
|
111
|
+
- Prefer common code only when it represents the same rule, simplifies call sites, and does not add parameter or branch complexity.
|
|
112
|
+
- Prefer explicit duplication over a misleading abstraction.
|
|
113
|
+
5. Check extracted functions and names.
|
|
114
|
+
- Extract only concepts that can be named precisely.
|
|
115
|
+
- Avoid vague names such as `process`, `handle`, `do`, or `helper` unless they match established local style.
|
|
116
|
+
- Boolean functions should read naturally at call sites and reveal the condition being tested.
|
|
117
|
+
6. Prefer the low-ceremony structural pattern that matches the pain:
|
|
118
|
+
- Dependency injection when direct construction, global lookup, or hidden imports of tools, clients, clocks, file systems, processes, loggers, configuration, random generators, identifiers, queues, or external SDKs makes behavior hard to test. Use `dependency-injection` before editing that boundary.
|
|
119
|
+
- Adapter or translator boundaries when external formats leak into core logic. Use `adapter-boundary` when provider data, protocols, errors, timeouts, retries, idempotency, security, or observability are part of the boundary.
|
|
120
|
+
- Composition over inheritance when behavior can be assembled from small explicit collaborators. Use `composition-over-inheritance` before editing `extends`, base classes, abstract classes, template methods, protected state, mixins, or subclass combinations.
|
|
121
|
+
- Command pattern when a state-changing user or system intent needs a traceable execution unit with explicit payload, context, authorization, transaction boundary, idempotency, outbox, audit, retry, or concurrency behavior. Use `command-pattern` before editing that execution unit.
|
|
122
|
+
- Pure core with an imperative shell when business decisions, validation, authorization, pricing, eligibility, state transitions, or domain events are mixed with I/O, time, generated identifiers, randomness, environment reads, or framework objects. Use `pure-core-imperative-shell` before editing that split.
|
|
123
|
+
- State machine pattern when status, state, phase, step, or stage controls allowed behavior and transitions are scattered or assigned directly. Use `state-machine-pattern` before editing lifecycle transitions.
|
|
124
|
+
- Strategy pattern when repeated branches choose among interchangeable algorithms, policies, pricing rules, scoring methods, provider choices, or feature variants that share one purpose. Use `strategy-pattern` before editing that strategy family.
|
|
125
|
+
- Result and Option values when expected failures, meaningful absence, null returns, thrown business failures, or ambiguous success flags make behavior hard to follow. Use `result-option` before editing that return-shape contract.
|
|
126
|
+
- Null Object pattern when repeated nullable checks around an optional collaborator can be replaced by a same-interface neutral implementation without hiding required failures. Use `null-object-pattern` before editing that optional dependency boundary.
|
|
127
|
+
- Injected time context when current time affects preserved behavior.
|
|
128
|
+
7. Handle conditional complexity by finding the policy.
|
|
129
|
+
- Use early exits for simple guard conditions when they preserve behavior.
|
|
130
|
+
- Separate state, type, permission, and exceptional-rule branches when they are mixed.
|
|
131
|
+
- Avoid replacing clear branches with a strategy object, table, or abstraction before the policy boundary is proven.
|
|
132
|
+
8. Keep commits and reports reviewable.
|
|
133
|
+
- Separate renames, moves, extractions, deduplication, tests, and behavior changes when possible.
|
|
134
|
+
- If behavior changes are discovered, stop and report them as a separate fix path.
|
|
135
|
+
9. Verify with the narrowest configured command intents that cover the changed code and contract surfaces.
|
|
136
|
+
|
|
137
|
+
<!-- mustflow-section: postconditions -->
|
|
138
|
+
## Postconditions
|
|
139
|
+
|
|
140
|
+
- Existing behavior is preserved or any behavior change is clearly separated and reported.
|
|
141
|
+
- The refactor has a named purpose tied to lower change cost, lower defect risk, or better testability.
|
|
142
|
+
- The diff is small enough for a reviewer to distinguish mechanical changes from semantic changes.
|
|
143
|
+
- Tests or verification evidence cover the behavior most likely to regress.
|
|
144
|
+
|
|
145
|
+
<!-- mustflow-section: verification -->
|
|
146
|
+
## Verification
|
|
147
|
+
|
|
148
|
+
Use configured oneshot command intents when available:
|
|
149
|
+
|
|
150
|
+
- `changes_status`
|
|
151
|
+
- `changes_diff_summary`
|
|
152
|
+
- `test_related`
|
|
153
|
+
- `test`
|
|
154
|
+
- `docs_validate_fast`
|
|
155
|
+
- `test_release`
|
|
156
|
+
- `mustflow_check`
|
|
157
|
+
|
|
158
|
+
Choose the narrowest configured test or build intent that proves the refactored behavior. Use documentation and release checks only when the refactor changes public docs, templates, schemas, package metadata, or release-sensitive surfaces.
|
|
159
|
+
|
|
160
|
+
<!-- mustflow-section: failure-handling -->
|
|
161
|
+
## Failure Handling
|
|
162
|
+
|
|
163
|
+
- If current behavior cannot be observed, stop before broad restructuring and report the missing safety evidence.
|
|
164
|
+
- If a refactor uncovers a bug, keep the refactor behavior-preserving and propose the fix as a separate change.
|
|
165
|
+
- If deduplication creates more options, branches, or vague names, undo or postpone that abstraction.
|
|
166
|
+
- If tests fail after a supposedly behavior-preserving edit, diagnose the behavior difference before continuing.
|
|
167
|
+
- If the next useful step is a large module move or public boundary change, use `structure-discovery-gate` and `contract-sync-check` before proceeding.
|
|
168
|
+
|
|
169
|
+
<!-- mustflow-section: output-format -->
|
|
170
|
+
## Output Format
|
|
171
|
+
|
|
172
|
+
- Refactoring goal
|
|
173
|
+
- Behavior preservation evidence
|
|
174
|
+
- Structural risk signals found
|
|
175
|
+
- Facade extraction used or intentionally avoided
|
|
176
|
+
- Refactoring ladder chosen
|
|
177
|
+
- Structural pattern used or intentionally avoided
|
|
178
|
+
- Changes made or analysis-only recommendation
|
|
179
|
+
- Behavior changes intentionally excluded
|
|
180
|
+
- Verification intents run
|
|
181
|
+
- Skipped checks and reasons
|
|
182
|
+
- Remaining risks or follow-up fix path
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.code-review
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 4
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: code-review
|
|
9
|
+
description: Apply this skill when reviewing code changes, scope, risks, or verification gaps.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.code-review
|
|
15
|
+
command_intents:
|
|
16
|
+
- test
|
|
17
|
+
- test_related
|
|
18
|
+
- test_audit
|
|
19
|
+
- lint
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Code Review
|
|
23
|
+
|
|
24
|
+
<!-- mustflow-section: purpose -->
|
|
25
|
+
## Purpose
|
|
26
|
+
|
|
27
|
+
Verify that a change aligns with the request and ensure that no behavioral risks or verification gaps persist.
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: use-when -->
|
|
30
|
+
## Use When
|
|
31
|
+
|
|
32
|
+
- Code changes, diffs, pull requests, or potential regression risks require review.
|
|
33
|
+
- The primary objective is risk assessment rather than implementing new behavior.
|
|
34
|
+
|
|
35
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
36
|
+
## Do Not Use When
|
|
37
|
+
|
|
38
|
+
- The task involves only wording, translation, or formatting changes.
|
|
39
|
+
- No changed files or diffs are available for review.
|
|
40
|
+
|
|
41
|
+
<!-- mustflow-section: required-inputs -->
|
|
42
|
+
## Required Inputs
|
|
43
|
+
|
|
44
|
+
- Modified files or diffs
|
|
45
|
+
- User-specified review criteria
|
|
46
|
+
- `AGENTS.md`
|
|
47
|
+
- `.mustflow/docs/agent-workflow.md`
|
|
48
|
+
- `.mustflow/config/commands.toml`
|
|
49
|
+
|
|
50
|
+
<!-- mustflow-section: preconditions -->
|
|
51
|
+
## Preconditions
|
|
52
|
+
|
|
53
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
54
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
55
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
56
|
+
|
|
57
|
+
<!-- mustflow-section: allowed-edits -->
|
|
58
|
+
## Allowed Edits
|
|
59
|
+
|
|
60
|
+
- Keep edits within the scope described by this skill, the user request, and the matching route in `.mustflow/skills/INDEX.md`.
|
|
61
|
+
- Do not broaden command permission, invent project facts, or change unrelated workflow files.
|
|
62
|
+
|
|
63
|
+
<!-- mustflow-section: procedure -->
|
|
64
|
+
## Procedure
|
|
65
|
+
|
|
66
|
+
1. Review the list of modified files.
|
|
67
|
+
2. Identify any unrelated or extraneous edits.
|
|
68
|
+
3. Assess the impact on behavior, configuration, commands, and documentation.
|
|
69
|
+
4. Review test relevance:
|
|
70
|
+
- missing tests for new functionality
|
|
71
|
+
- obsolete tests for removed functionality
|
|
72
|
+
- redundant tests that fail to address new risks
|
|
73
|
+
- weakened or insufficient assertions
|
|
74
|
+
- snapshot updates lacking a clear rationale
|
|
75
|
+
- tests that inadvertently reintroduce removed behavior
|
|
76
|
+
5. Verify the existence of relevant command intents.
|
|
77
|
+
6. Document findings categorized by severity.
|
|
78
|
+
|
|
79
|
+
<!-- mustflow-section: postconditions -->
|
|
80
|
+
## Postconditions
|
|
81
|
+
|
|
82
|
+
- The expected output can be produced with clear evidence, executed command intents, skipped checks, and remaining risks.
|
|
83
|
+
- Any missing command intent, unknown input, or authority conflict is reported instead of hidden.
|
|
84
|
+
|
|
85
|
+
<!-- mustflow-section: verification -->
|
|
86
|
+
## Verification
|
|
87
|
+
|
|
88
|
+
Follow `.mustflow/docs/agent-workflow.md#command-execution-policy`.
|
|
89
|
+
|
|
90
|
+
Related command intents:
|
|
91
|
+
|
|
92
|
+
- `test`
|
|
93
|
+
- `test_related`
|
|
94
|
+
- `test_audit`
|
|
95
|
+
- `lint`
|
|
96
|
+
|
|
97
|
+
Avoid introducing raw shell commands; reference the command intent names defined in `.mustflow/config/commands.toml`.
|
|
98
|
+
|
|
99
|
+
<!-- mustflow-section: failure-handling -->
|
|
100
|
+
## Failure Handling
|
|
101
|
+
|
|
102
|
+
- If a command intent is missing, restricted to manual execution, disabled, or unknown, report the status rather than guessing.
|
|
103
|
+
- Document any skipped verifications and the associated remaining risks.
|
|
104
|
+
- Immediately halt and report if sensitive data or destructive command risks are identified.
|
|
105
|
+
|
|
106
|
+
<!-- mustflow-section: output-format -->
|
|
107
|
+
## Output Format
|
|
108
|
+
|
|
109
|
+
- Summary
|
|
110
|
+
- Findings categorized by severity
|
|
111
|
+
- List of reviewed files
|
|
112
|
+
- Command intents executed
|
|
113
|
+
- Skipped command intents and justifications
|
|
114
|
+
- Notes on test relevance
|
|
115
|
+
- Identified remaining risks
|