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,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.result-option
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 2
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: result-option
|
|
9
|
+
description: Apply this skill when expected failures, meaningful absence, null or undefined returns, thrown business errors, boolean success flags, raw string errors, repository lookups, validation, parsing, external adapter errors, or boundary error mapping need explicit Result and Option handling.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.result-option
|
|
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
|
+
# Result / Option
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Represent expected failures and meaningful absence as explicit values.
|
|
33
|
+
|
|
34
|
+
Use `Result<T, E>` when an operation can fail and the caller must know why. Use `Option<T>` when a value may be absent and absence is normal. Use `throw` only for programmer errors, impossible states, corrupted invariants, fatal startup failures, or third-party exceptions before an adapter converts them at a boundary.
|
|
35
|
+
|
|
36
|
+
Expected failure must be data. Meaningful absence must be data. Exceptions are only for truly exceptional situations.
|
|
37
|
+
|
|
38
|
+
<!-- mustflow-section: use-when -->
|
|
39
|
+
## Use When
|
|
40
|
+
|
|
41
|
+
- Code throws for normal business failures such as validation failure, not found, permission denied, conflict, invalid state, expired token, insufficient balance, rate limit, timeout, payment rejection, or file validation.
|
|
42
|
+
- Domain, application, or service functions return `null` or `undefined` to signal meaningful absence.
|
|
43
|
+
- Code returns ambiguous success flags, optional error fields, raw string errors, or generic `Error` values.
|
|
44
|
+
- A repository lookup can fail due to persistence and can also legitimately find no record.
|
|
45
|
+
- External SDK, database, HTTP, payment, email, filesystem, or framework exceptions leak into business logic.
|
|
46
|
+
- A controller, adapter, or command handler must convert typed failures into HTTP, UI, CLI, or queue responses.
|
|
47
|
+
- Tests need stable success, failure, and absence cases without relying on thrown exceptions.
|
|
48
|
+
|
|
49
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
50
|
+
## Do Not Use When
|
|
51
|
+
|
|
52
|
+
- A function is a total pure calculation that cannot fail and always returns a value; return `T` directly.
|
|
53
|
+
- Absence is a bug because an invariant promises the value exists; use a stricter type or assert at the invariant boundary.
|
|
54
|
+
- The task is only about separating decision logic from side effects; use `pure-core-imperative-shell`.
|
|
55
|
+
- The task is only about provider mapping, timeout, retry, or protocol containment; use `adapter-boundary`.
|
|
56
|
+
- Absence is an optional collaborator that can safely perform a neutral same-interface behavior without changing caller flow; use `null-object-pattern`.
|
|
57
|
+
- The codebase already has a different established `Result` or `Option` shape and the task does not touch failure or absence handling.
|
|
58
|
+
|
|
59
|
+
<!-- mustflow-section: required-inputs -->
|
|
60
|
+
## Required Inputs
|
|
61
|
+
|
|
62
|
+
- The operation being modeled and whether it can fail, be absent, both, or neither.
|
|
63
|
+
- Existing local `Result`, `Option`, error, `Either`, `Maybe`, exception, and response-mapping conventions.
|
|
64
|
+
- The layer where failure originates and the layer where it should be handled.
|
|
65
|
+
- Error categories, stable error codes, safe user-facing message rules, and sensitive data constraints.
|
|
66
|
+
- Tests or examples that show successful, failing, and absent outcomes.
|
|
67
|
+
- Relevant command-intent contract entries for verification.
|
|
68
|
+
|
|
69
|
+
<!-- mustflow-section: preconditions -->
|
|
70
|
+
## Preconditions
|
|
71
|
+
|
|
72
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
73
|
+
- Existing local result and option helpers have been searched before adding new helpers.
|
|
74
|
+
- If external libraries or providers throw, `adapter-boundary` has been considered for conversion at that boundary.
|
|
75
|
+
- If core logic currently performs I/O or logs while deciding failures, `pure-core-imperative-shell` has been considered.
|
|
76
|
+
|
|
77
|
+
<!-- mustflow-section: allowed-edits -->
|
|
78
|
+
## Allowed Edits
|
|
79
|
+
|
|
80
|
+
- Replace expected-failure `throw` paths with `Result<T, E>`.
|
|
81
|
+
- Replace domain-level `null` or `undefined` absence with `Option<T>`.
|
|
82
|
+
- Convert `Option<T>` to `Result<T, E>` at the point where absence becomes an error.
|
|
83
|
+
- Add or reuse small discriminated-union helpers such as `ok`, `err`, `some`, `none`, `fromNullable`, `isOk`, `isErr`, `isSome`, `isNone`, `map`, `mapErr`, `andThen`, `matchResult`, `matchOption`, `fromPromise`, `okOr`, and `allResults` when local style supports them.
|
|
84
|
+
- Add typed error unions, stable error codes, categories, and boundary mappers.
|
|
85
|
+
- Add tests for success, failure, absence, error code, and error category.
|
|
86
|
+
- Do not introduce a broad functional programming library unless the codebase already uses that style.
|
|
87
|
+
|
|
88
|
+
<!-- mustflow-section: procedure -->
|
|
89
|
+
## Procedure
|
|
90
|
+
|
|
91
|
+
1. Choose the return shape.
|
|
92
|
+
- Return `T` when the value always exists and the operation cannot fail.
|
|
93
|
+
- Return `Option<T>` when absence is normal and needs no explanation.
|
|
94
|
+
- Return `Result<T, E>` when failure is expected and the caller must know why.
|
|
95
|
+
- Return `Promise<Result<T, E>>` for asynchronous expected failures.
|
|
96
|
+
- Return `Result<Option<T>, E>` when an operation can fail and success may still have no value.
|
|
97
|
+
- Return `Result<void, E>` for commands that can fail but have no useful success value.
|
|
98
|
+
- Use `throw` or `assertNever` only for impossible states, programmer errors, corrupted invariants, fatal startup failures, or test assertions.
|
|
99
|
+
- Use a null object only when the absence is an optional dependency with honest neutral behavior and the caller should not branch on presence.
|
|
100
|
+
2. Keep expected failures out of exceptions.
|
|
101
|
+
- Do not throw for invalid input, missing resource, denied access, duplicate state, invalid transition, external timeout, rate limit, persistence failure, or payment rejection.
|
|
102
|
+
- Catch third-party exceptions in adapters and convert them to typed errors before they cross inward.
|
|
103
|
+
3. Keep absence explicit.
|
|
104
|
+
- Domain, application, and service functions should not use `null` or `undefined` as meaningful absence.
|
|
105
|
+
- Raw DTOs, database rows, framework objects, and external API responses may contain `null` or `undefined`, but boundary mappers must convert them before they enter core logic.
|
|
106
|
+
4. Use structured errors.
|
|
107
|
+
- Avoid raw string errors, generic `"ERROR"` codes, and optional error fields.
|
|
108
|
+
- Prefer stable machine-readable codes such as `INVALID_EMAIL`, `USER_NOT_FOUND`, `ORDER_ALREADY_PAID`, or `PAYMENT_PROVIDER_TIMEOUT`.
|
|
109
|
+
- Prefer consistent categories such as `validation`, `authentication`, `permission`, `not_found`, `conflict`, `invariant`, `rate_limit`, `timeout`, `external`, `persistence`, and `internal`.
|
|
110
|
+
- Keep raw causes, secrets, tokens, stack traces, SQL, payment payloads, and private user data out of public responses.
|
|
111
|
+
5. Preserve specificity inside the system.
|
|
112
|
+
- Use narrow error unions close to the rule when practical.
|
|
113
|
+
- Widen to an application error type near use cases or boundaries.
|
|
114
|
+
- Preserve the underlying cause when useful, but do not make domain logic depend on third-party error classes.
|
|
115
|
+
6. Compose results deliberately.
|
|
116
|
+
- Return, transform with `mapErr`, handle explicitly, or convert to a boundary response.
|
|
117
|
+
- Do not swallow `err` by returning success.
|
|
118
|
+
- Avoid nested results such as `Result<Result<T, A>, B>`; prefer `Result<T, A | B>`.
|
|
119
|
+
- Avoid `Result<Promise<T>, E>`; use `Promise<Result<T, E>>`.
|
|
120
|
+
- Prefer `Result<Option<T>, E>` over `Option<Result<T, E>>`.
|
|
121
|
+
7. Use names that match meaning.
|
|
122
|
+
- Use `find*` when absence is normal.
|
|
123
|
+
- Use `get*` when absence is an error.
|
|
124
|
+
- Use `parse*`, `validate*`, and fallible `create*` functions when invalid input should produce `Result`.
|
|
125
|
+
- Use `is*`, `has*`, and `can*` only when a boolean answer is truly enough and cannot fail.
|
|
126
|
+
8. Map at boundaries.
|
|
127
|
+
- Repositories that can fail and may not find data should return `Result<Option<T>, E>`.
|
|
128
|
+
- Services may convert an `Option` into a domain error when the value is required.
|
|
129
|
+
- Controllers, CLI handlers, queue consumers, and UI boundary code should convert `Result` into protocol responses.
|
|
130
|
+
- Do not serialize internal `Result` or `Option` shapes as public API responses unless that is the explicit public contract.
|
|
131
|
+
9. Log once at the outer boundary.
|
|
132
|
+
- Do not log the same error at every layer.
|
|
133
|
+
- Pure domain functions must not log.
|
|
134
|
+
- Boundary logs may include category, code, safe details, and non-serialized cause according to privacy rules.
|
|
135
|
+
10. Test the branches.
|
|
136
|
+
- Every `Result`-returning function should have tests for success, at least one representative failure, error code, error category, and important details.
|
|
137
|
+
- Every `Option`-returning function should have tests for `some` and `none`.
|
|
138
|
+
- Test stable codes and categories rather than complete free-form messages unless the message is a public contract.
|
|
139
|
+
|
|
140
|
+
<!-- mustflow-section: postconditions -->
|
|
141
|
+
## Postconditions
|
|
142
|
+
|
|
143
|
+
- Expected failures are represented as typed data.
|
|
144
|
+
- Meaningful absence is represented as `Option` or the local equivalent.
|
|
145
|
+
- Normal business failures do not rely on thrown exceptions or rejected promises.
|
|
146
|
+
- Infrastructure and provider errors are converted at boundaries before reaching business logic.
|
|
147
|
+
- Public responses expose stable safe error shapes, not internal `Result`, raw causes, secrets, or stack traces.
|
|
148
|
+
- Tests cover success, failure, and absence branches.
|
|
149
|
+
|
|
150
|
+
<!-- mustflow-section: verification -->
|
|
151
|
+
## Verification
|
|
152
|
+
|
|
153
|
+
Use configured oneshot command intents when available:
|
|
154
|
+
|
|
155
|
+
- `changes_status`
|
|
156
|
+
- `changes_diff_summary`
|
|
157
|
+
- `test_related`
|
|
158
|
+
- `test`
|
|
159
|
+
- `lint`
|
|
160
|
+
- `build`
|
|
161
|
+
- `docs_validate_fast`
|
|
162
|
+
- `test_release`
|
|
163
|
+
- `mustflow_check`
|
|
164
|
+
|
|
165
|
+
Prefer focused tests for the functions whose return shape or error handling changed. Use release or documentation checks when templates, public docs, package metadata, schemas, CLI behavior, or skill routing change.
|
|
166
|
+
|
|
167
|
+
<!-- mustflow-section: failure-handling -->
|
|
168
|
+
## Failure Handling
|
|
169
|
+
|
|
170
|
+
- If local helper shape conflicts with this skill, follow the local convention and report the difference.
|
|
171
|
+
- If replacing exceptions would require a broad public API change, narrow the change to one boundary and report remaining throw paths.
|
|
172
|
+
- If error categories or codes are missing, add the smallest local error union or mapper instead of inventing a global taxonomy too early.
|
|
173
|
+
- If a supposedly impossible condition can happen through user or system behavior, model it as `Result` instead of throwing.
|
|
174
|
+
- If adapter conversion is incomplete, keep third-party error handling in the adapter and report remaining leakage.
|
|
175
|
+
|
|
176
|
+
<!-- mustflow-section: output-format -->
|
|
177
|
+
## Output Format
|
|
178
|
+
|
|
179
|
+
- Failure or absence surface changed
|
|
180
|
+
- Return shape chosen and why
|
|
181
|
+
- Error codes and categories introduced or reused
|
|
182
|
+
- Boundary conversions added
|
|
183
|
+
- Throw paths preserved and why
|
|
184
|
+
- Tests added or updated
|
|
185
|
+
- Command intents run
|
|
186
|
+
- Remaining exception, null, or error-shape risks
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.security-privacy-review
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 4
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: security-privacy-review
|
|
9
|
+
description: Apply this skill when code, configuration, docs, templates, logs, telemetry, credentials, or data flows affect secrets, personal data, authentication, authorization, retention, or external disclosure.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.security-privacy-review
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- docs_validate_fast
|
|
19
|
+
- test_release
|
|
20
|
+
- mustflow_check
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Security and Privacy Review
|
|
24
|
+
|
|
25
|
+
<!-- mustflow-section: purpose -->
|
|
26
|
+
## Purpose
|
|
27
|
+
|
|
28
|
+
Catch security, privacy, and disclosure risks introduced by ordinary code, documentation, template, configuration, logging, or reporting changes.
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: use-when -->
|
|
31
|
+
## Use When
|
|
32
|
+
|
|
33
|
+
- A change touches authentication, authorization, sessions, admin behavior, tenant boundaries, personal data, secrets, tokens, credentials, API keys, or private files.
|
|
34
|
+
- A change adds or modifies logging, telemetry, diagnostics, receipts, reports, caches, generated state, retention, redaction, export, or external transmission.
|
|
35
|
+
- Documentation, templates, examples, tests, or final reports mention sensitive data handling, privacy behavior, secret handling, or user-identifying data.
|
|
36
|
+
- A diff could expose data through filenames, paths, command output, screenshots, generated artifacts, package contents, or public docs.
|
|
37
|
+
- A change constructs, recommends, copies, resolves, or runs commands based on repository-controlled names, configuration, or generated reports.
|
|
38
|
+
- A change reads or writes repository paths, follows filesystem links, packages files, or publishes release artifacts.
|
|
39
|
+
- A workflow gains publish credentials, package registry identity, OIDC permissions, or third-party actions before artifact publication.
|
|
40
|
+
- A code-scanning, Scorecard, CodeQL, zizmor, or dependency-scanning alert reports a security or quality issue that may cross a trust, disclosure, permission, or release boundary.
|
|
41
|
+
|
|
42
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
43
|
+
## Do Not Use When
|
|
44
|
+
|
|
45
|
+
- The task needs a concrete abuse-case regression test; use `security-regression-tests` for that part.
|
|
46
|
+
- The task is only dependency availability, package version freshness, or artifact packaging without sensitive data.
|
|
47
|
+
- The task is a general security checklist with no changed boundary, data flow, or disclosure surface to inspect.
|
|
48
|
+
|
|
49
|
+
<!-- mustflow-section: required-inputs -->
|
|
50
|
+
## Required Inputs
|
|
51
|
+
|
|
52
|
+
- Changed files, diff summary, and the user goal.
|
|
53
|
+
- Sensitive data, actor, trust boundary, storage, logging, retention, export, or external disclosure surfaces involved.
|
|
54
|
+
- Existing project rules for secrets, privacy, generated state, public docs, package contents, and command output.
|
|
55
|
+
- Relevant command-intent contract entries for status, diff, docs, release, or mustflow validation.
|
|
56
|
+
- Any repository-controlled names, paths, symlinks, command strings, environment path entries, workflow actions, or package contents that cross a trust boundary.
|
|
57
|
+
- Scanner name, rule identifier, alert location, severity, data-flow evidence, and whether the alert is fixable in code or requires repository settings.
|
|
58
|
+
|
|
59
|
+
<!-- mustflow-section: preconditions -->
|
|
60
|
+
## Preconditions
|
|
61
|
+
|
|
62
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
63
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
64
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
65
|
+
|
|
66
|
+
<!-- mustflow-section: allowed-edits -->
|
|
67
|
+
## Allowed Edits
|
|
68
|
+
|
|
69
|
+
- Add or tighten redaction, masking, omission, retention, disclosure, or documentation wording when the changed surface justifies it.
|
|
70
|
+
- Remove sensitive-looking sample values from docs, fixtures, templates, logs, reports, and final output when they are not required.
|
|
71
|
+
- Mark unknown privacy or secret-handling behavior as unverified instead of claiming it is safe.
|
|
72
|
+
- Do not invent compliance claims, privacy guarantees, secret scanning results, or audit coverage.
|
|
73
|
+
|
|
74
|
+
<!-- mustflow-section: procedure -->
|
|
75
|
+
## Procedure
|
|
76
|
+
|
|
77
|
+
1. Identify the sensitive surface: secret, personal data, actor, permission, storage location, log, generated artifact, package file, public document, or external recipient.
|
|
78
|
+
2. Decide whether the change creates, stores, reads, transforms, logs, exports, deletes, or reports sensitive information.
|
|
79
|
+
3. Check whether the changed surface is public, packaged, generated, cached, retained, user-visible, or sent outside the repository boundary.
|
|
80
|
+
4. Treat shell commands, copyable command text, executable names, workflow action references, publish identities, package manifests, and environment path entries as disclosure and execution surfaces, not as harmless strings.
|
|
81
|
+
5. For filesystem changes, distinguish lexical containment from the real target. Check symlinks, generated state, package contents, and file APIs that may follow links before claiming a path stays inside the repository.
|
|
82
|
+
6. For code-scanning alerts, group findings by root cause and rule. Fix the underlying pattern, not only the exact flagged line, and separate repository-setting alerts such as branch protection or maintainer activity from code changes.
|
|
83
|
+
7. For workflow scanner alerts, check action pinning, `persist-credentials`, job-level permissions, reusable workflow permissions, artifact upload boundaries, and privileged identity timing before treating the warning as cosmetic.
|
|
84
|
+
8. For pinned action references, distinguish tag objects from the commit that implements the tag. Verify pinned SHAs against the action repository so scanner tooling does not report an imposter or non-member commit.
|
|
85
|
+
9. For dependency scanner alerts, separate production dependency manifests from fixtures, examples, generated test repositories, and intentionally vulnerable samples. Narrow the scan scope before treating fixture-only alerts as product vulnerabilities.
|
|
86
|
+
10. Verify that examples, fixtures, screenshots, command outputs, and final reports do not expose real-looking secrets or unnecessary personal data.
|
|
87
|
+
11. Prefer omission or minimal metadata over masking when the sensitive value is not needed for the user to understand the result.
|
|
88
|
+
12. If the change affects an authorization or abuse boundary, activate `security-regression-tests` for test selection instead of folding test generation into this review.
|
|
89
|
+
13. Run the narrowest configured verification that covers the changed docs, templates, package, or mustflow contract.
|
|
90
|
+
|
|
91
|
+
<!-- mustflow-section: postconditions -->
|
|
92
|
+
## Postconditions
|
|
93
|
+
|
|
94
|
+
- Sensitive data and disclosure surfaces have been identified or explicitly reported as unknown.
|
|
95
|
+
- Public and packaged surfaces do not include unnecessary secrets, personal data, or misleading privacy guarantees.
|
|
96
|
+
- The final report names remaining unverified security or privacy risks without revealing sensitive values.
|
|
97
|
+
|
|
98
|
+
<!-- mustflow-section: verification -->
|
|
99
|
+
## Verification
|
|
100
|
+
|
|
101
|
+
Use configured oneshot command intents when available:
|
|
102
|
+
|
|
103
|
+
- `changes_status`
|
|
104
|
+
- `changes_diff_summary`
|
|
105
|
+
- `docs_validate_fast`
|
|
106
|
+
- `test_release`
|
|
107
|
+
- `mustflow_check`
|
|
108
|
+
|
|
109
|
+
Use a narrower configured test, build, or documentation intent when it better proves the changed sensitive surface.
|
|
110
|
+
|
|
111
|
+
<!-- mustflow-section: failure-handling -->
|
|
112
|
+
## Failure Handling
|
|
113
|
+
|
|
114
|
+
- If a sensitive value appears in command output, stop copying it and summarize the issue without the value.
|
|
115
|
+
- If the project lacks enough context to confirm privacy or secret handling, report the uncertainty and avoid claiming safety.
|
|
116
|
+
- If a copyable command, executable lookup, symlink-following path, or publishing workflow uses repository-controlled input across a trust boundary, treat it as a security issue until quoting, validation, no-follow file handling, or workflow isolation is verified.
|
|
117
|
+
- If a scanner reports many alerts from test fixtures or generated sample repositories, do not hide them by dismissal first. Prefer narrowing scanner inputs to the real release and runtime dependency surfaces, then document any intentionally scanned fixture exceptions.
|
|
118
|
+
- If a package, generated artifact, or public doc includes sensitive data, remove or redact it before continuing unrelated work.
|
|
119
|
+
- If verification requires unavailable scanners or live systems, report the missing check and the remaining risk.
|
|
120
|
+
|
|
121
|
+
<!-- mustflow-section: output-format -->
|
|
122
|
+
## Output Format
|
|
123
|
+
|
|
124
|
+
- Sensitive surfaces reviewed
|
|
125
|
+
- Disclosure or retention paths checked
|
|
126
|
+
- Redaction, omission, or wording changes made
|
|
127
|
+
- Related security-regression test need
|
|
128
|
+
- Command intents run
|
|
129
|
+
- Skipped checks and reasons
|
|
130
|
+
- Remaining security or privacy risk
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.security-regression-tests
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 6
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: security-regression-tests
|
|
9
|
+
description: Apply this skill when security-sensitive code or behavior changes need abuse-case regression tests.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.security-regression-tests
|
|
15
|
+
command_intents:
|
|
16
|
+
- test
|
|
17
|
+
- test_related
|
|
18
|
+
- test_audit
|
|
19
|
+
- lint
|
|
20
|
+
- build
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Security Regression Tests
|
|
24
|
+
|
|
25
|
+
<!-- mustflow-section: purpose -->
|
|
26
|
+
## Purpose
|
|
27
|
+
|
|
28
|
+
Convert security-sensitive behavior changes into safe negative tests that preserve defensive expectations without turning the task into vulnerability scanning, exploit development, or penetration testing.
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: use-when -->
|
|
31
|
+
## Use When
|
|
32
|
+
|
|
33
|
+
- Authentication, authorization, session, CSRF, rate-limit, admin, payment, credit, subscription, personal-data, or tenant-boundary behavior changes.
|
|
34
|
+
- Input validation, output encoding, file upload, path handling, webhook callback, redirect, or external URL handling changes.
|
|
35
|
+
- Command construction, command recommendation, executable resolution, command-contract linting, or copy-to-clipboard command behavior changes.
|
|
36
|
+
- Filesystem containment, symlink handling, package publishing, build pipeline, or release automation behavior changes.
|
|
37
|
+
- A bug fix closes an abuse case and the fix needs a regression test to prevent reintroduction.
|
|
38
|
+
- A review identifies a concrete security-sensitive boundary that can be expressed as a deterministic test.
|
|
39
|
+
- A static analysis alert identifies a concrete data flow, permission boundary, command boundary, artifact boundary, or input-handling bug that can be locked with a local test.
|
|
40
|
+
- A repository health scanner flags missing fuzzing or property-based testing, and the project has a real parser, validator, serializer, path, command, or workflow boundary worth exercising with generated inputs.
|
|
41
|
+
|
|
42
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
43
|
+
## Do Not Use When
|
|
44
|
+
|
|
45
|
+
- The task is only a general security review, dependency audit, static analysis request, or policy discussion.
|
|
46
|
+
- The repository lacks enough application context to identify the real protected resource, actor, trust boundary, or existing test harness.
|
|
47
|
+
- The only available output would be a generic test such as "prevents XSS" without a specific route, component, serializer, or data flow.
|
|
48
|
+
- The test would require real external services, live attack traffic, credential guessing, destructive input, or unsafe payload collection.
|
|
49
|
+
- The user explicitly asks not to add or propose tests.
|
|
50
|
+
|
|
51
|
+
<!-- mustflow-section: required-inputs -->
|
|
52
|
+
## Required Inputs
|
|
53
|
+
|
|
54
|
+
- The changed behavior, diff, route, component, handler, data model, or bug fix that creates the security-sensitive boundary.
|
|
55
|
+
- The relevant actors, ownership rules, trust boundary, allowed and denied state combinations, and expected status or error behavior.
|
|
56
|
+
- Existing test framework, fixtures, factories, mocks, request helpers, and naming conventions.
|
|
57
|
+
- `.mustflow/config/commands.toml` entries for test, audit, lint, and build-related intents.
|
|
58
|
+
- Any project context or public contract that defines privacy, authorization, upload, callback, payment, or tenant rules.
|
|
59
|
+
- The executable, shell, filesystem, package, or workflow boundary that should reject repository-controlled input.
|
|
60
|
+
- Static-analysis rule identifier, flagged location, source-to-sink path, and the intended defensive outcome after the fix.
|
|
61
|
+
- Existing fuzzing or property-based testing libraries, package metadata, lockfiles, and test-runner conventions when generated-input tests are added.
|
|
62
|
+
|
|
63
|
+
<!-- mustflow-section: preconditions -->
|
|
64
|
+
## Preconditions
|
|
65
|
+
|
|
66
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
67
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
68
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
69
|
+
- The test can be written as a defensive expectation without teaching an exploit recipe or contacting unsafe targets.
|
|
70
|
+
|
|
71
|
+
<!-- mustflow-section: allowed-edits -->
|
|
72
|
+
## Allowed Edits
|
|
73
|
+
|
|
74
|
+
- Keep edits within the scope described by this skill, the user request, and the matching route in `.mustflow/skills/INDEX.md`.
|
|
75
|
+
- Prefer existing test files, fixtures, factories, mocks, and helper APIs before adding new test structure.
|
|
76
|
+
- Do not broaden command permission, invent project facts, introduce external scanners, add offensive payload corpora, or change unrelated workflow files.
|
|
77
|
+
|
|
78
|
+
<!-- mustflow-section: procedure -->
|
|
79
|
+
## Procedure
|
|
80
|
+
|
|
81
|
+
1. Identify the protected boundary: actor, resource, operation, trust boundary, and expected defensive outcome.
|
|
82
|
+
2. Classify the abuse case using project-specific facts, not broad labels alone:
|
|
83
|
+
- unauthorized actor or cross-tenant access
|
|
84
|
+
- invalid ownership or privilege escalation
|
|
85
|
+
- unsafe input shape, size, encoding, path, or MIME mismatch
|
|
86
|
+
- unsafe output rendering or serialization
|
|
87
|
+
- unsafe external URL, callback, redirect, or server-side request target
|
|
88
|
+
- unsafe shell command construction, command name interpolation, clipboard command output, or executable lookup
|
|
89
|
+
- filesystem escape through symlinks, path traversal, archive entries, generated state, or package contents
|
|
90
|
+
- mismatch between two validators, linters, dashboards, schemas, or release gates that claim the same policy
|
|
91
|
+
- release or package-publishing pipeline code execution before artifact publication
|
|
92
|
+
- incomplete escaping, quoting, encoding, or sanitization where the safe behavior can be asserted without invoking a real shell or network target
|
|
93
|
+
- stack trace or internal error exposure through a user-visible API, report, dashboard, or command output
|
|
94
|
+
- workflow permission drift, mutable action references, wrong pinned-action object type, dependency scan overreach, or artifact credential leakage that can be checked through repository-local workflow tests or linters
|
|
95
|
+
- payment, credit, coupon, subscription, refund, or entitlement abuse
|
|
96
|
+
- personal-data or admin-only access leakage
|
|
97
|
+
- unsafe direct execution of destructive, bulk, migration, billing, permission, publishing, or external-send operations without a reviewable plan/apply boundary
|
|
98
|
+
- missing capability or scoped permission object where a sensitive operation depends on broad user, role, or global authorization state
|
|
99
|
+
- missing invariant policy where a sensitive state change could violate a non-negotiable rule such as last-owner, entitlement, paid-order, refund, or retention constraints
|
|
100
|
+
- missing idempotency key, action ledger, or outbox/inbox record where repeated execution of a side effect could charge, refund, notify, grant, revoke, publish, or delete more than once
|
|
101
|
+
3. Search for existing tests that already cover the same boundary. Strengthen the existing test when that gives clearer coverage than adding a new one.
|
|
102
|
+
4. Build the smallest safe negative test data: at least one allowed control case when useful, and one denied case that proves the boundary rejects the abuse condition.
|
|
103
|
+
5. For parser, validator, serializer, path, command, or workflow boundaries, consider a bounded property-based or fuzz-style regression when the invariant is clearer than a list of hand-written examples. Keep generators local, deterministic under the test runner, size-limited, and focused on the defensive invariant.
|
|
104
|
+
6. When adding a fuzzing or property-based testing dependency, keep dependency metadata, lockfiles, test selection rules, and package tests synchronized. Prefer an existing project dependency when it can express the invariant cleanly.
|
|
105
|
+
7. Use mocks or local fakes for external requests, uploads, redirects, webhooks, payment providers, file systems, shell commands, package registries, and CI workflows. Do not contact live suspicious endpoints or publish real artifacts.
|
|
106
|
+
8. Name the test after the defensive expectation, such as `cannot_read_other_users_invoice` or `rejects_private_network_callback_url`.
|
|
107
|
+
9. Keep assertions tied to observable behavior: status code, returned error shape, unchanged database state, missing side effect, sanitized output, rejected job, or invariant preserved for all generated cases.
|
|
108
|
+
10. Avoid dumping long exploit strings into the test. Use minimal representative inputs or generated values that prove the validation or boundary rule without becoming an offensive payload corpus.
|
|
109
|
+
11. For command and filesystem boundaries, assert the denied side effect directly: no injected command appears in a runnable recommendation, no repository-local shim is executed, no background shell pattern is counted runnable, no symlink target outside the root is read or written.
|
|
110
|
+
12. For plan/apply, capability, invariant, time, and idempotency boundaries, assert the safety contract directly: planning produces no side effect, commit rejects stale or unauthorized capability, invalid transitions preserve state, injected time controls expiry, and repeated side-effect keys do not repeat the effect.
|
|
111
|
+
13. For workflow scanner fixes, prefer repository-local assertions for durable contracts: action references are pinned to commit SHAs or digest-pinned containers, privileged permissions are job-scoped, deployment or scanner jobs can be manually rerun when useful, and dependency scans exclude fixture-only manifests unless intentionally included.
|
|
112
|
+
14. For scanner-driven fixes, include a regression only when the rule reflects a durable project contract. Do not add brittle tests that merely assert the scanner's current wording, line number, or severity.
|
|
113
|
+
15. If the project lacks enough context to write a deterministic test, output a concrete test proposal instead of inventing fixtures or behavior.
|
|
114
|
+
|
|
115
|
+
<!-- mustflow-section: postconditions -->
|
|
116
|
+
## Postconditions
|
|
117
|
+
|
|
118
|
+
- The expected output can be produced with clear evidence, executed command intents, skipped checks, and remaining risks.
|
|
119
|
+
- Any missing command intent, unknown input, or authority conflict is reported instead of hidden.
|
|
120
|
+
- New tests are justified by a concrete security-sensitive behavior contract, not by a habit of adding tests to every change.
|
|
121
|
+
|
|
122
|
+
<!-- mustflow-section: verification -->
|
|
123
|
+
## Verification
|
|
124
|
+
|
|
125
|
+
Use configured oneshot command intents when available:
|
|
126
|
+
|
|
127
|
+
- `test_related`
|
|
128
|
+
- `test`
|
|
129
|
+
- `test_audit`
|
|
130
|
+
- `lint`
|
|
131
|
+
- `build`
|
|
132
|
+
|
|
133
|
+
Prefer the narrowest configured test intent that covers the changed boundary. Do not infer missing test, lint, scanner, or build commands. If a relevant intent is unknown or manual-only, report that status and the remaining verification risk.
|
|
134
|
+
|
|
135
|
+
<!-- mustflow-section: failure-handling -->
|
|
136
|
+
## Failure Handling
|
|
137
|
+
|
|
138
|
+
- If a generated test fails because the defensive behavior is missing, inspect the nearest production code that owns the boundary before weakening the test.
|
|
139
|
+
- If a generated test fails because fixtures or assumptions are wrong, fix the test setup or report the missing project fact.
|
|
140
|
+
- If the test would require unsafe traffic, real credentials, live external targets, or destructive data, replace it with a local mock-based expectation or a written test proposal.
|
|
141
|
+
- If existing tests already prove the boundary, report the existing coverage rather than adding duplicate cases.
|
|
142
|
+
- If the repository's testing policy requires more evidence before adding tests, report the security-sensitive contract that justifies the test or stop at a proposal.
|
|
143
|
+
|
|
144
|
+
<!-- mustflow-section: output-format -->
|
|
145
|
+
## Output Format
|
|
146
|
+
|
|
147
|
+
- Security-sensitive boundary reviewed
|
|
148
|
+
- Abuse case classification
|
|
149
|
+
- Defensive structure selected, such as plan/apply, capability, invariant policy, adapter, injected time, or action ledger
|
|
150
|
+
- Required test data
|
|
151
|
+
- Tests added or strengthened
|
|
152
|
+
- Property-based or fuzz-style invariant covered, if used
|
|
153
|
+
- Existing coverage reused
|
|
154
|
+
- Suspected code location if the test fails
|
|
155
|
+
- Command intents run
|
|
156
|
+
- Skipped command intents and reasons
|
|
157
|
+
- Remaining security or verification risks
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.skill-authoring
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 5
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: skill-authoring
|
|
9
|
+
description: Apply this skill when creating or maintaining `.mustflow/skills/*/SKILL.md` procedures and `.mustflow/skills/INDEX.md` routes.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.skill-authoring
|
|
15
|
+
command_intents:
|
|
16
|
+
- mustflow_check
|
|
17
|
+
- docs_validate
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Skill Authoring
|
|
21
|
+
|
|
22
|
+
<!-- mustflow-section: purpose -->
|
|
23
|
+
## Purpose
|
|
24
|
+
|
|
25
|
+
Create narrow, repeatable mustflow skill procedures without turning skills into broad advice, project context, or command-permission sources.
|
|
26
|
+
|
|
27
|
+
<!-- mustflow-section: use-when -->
|
|
28
|
+
## Use When
|
|
29
|
+
|
|
30
|
+
- A `.mustflow/skills/<name>/SKILL.md` file is created, renamed, split, removed, or substantially changed.
|
|
31
|
+
- `.mustflow/skills/INDEX.md` needs a new or updated route for a skill.
|
|
32
|
+
- A skill needs clearer use conditions, exclusion conditions, required inputs, command intent references, verification, or failure handling.
|
|
33
|
+
- A broad prompt, checklist, or outside recommendation needs to be adapted into mustflow's skill format.
|
|
34
|
+
|
|
35
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
36
|
+
## Do Not Use When
|
|
37
|
+
|
|
38
|
+
- The task only applies an existing skill to code, docs, tests, context, or assets.
|
|
39
|
+
- The content belongs in `AGENTS.md`, `.mustflow/docs/agent-workflow.md`, `.mustflow/context/PROJECT.md`, or `.mustflow/config/commands.toml`.
|
|
40
|
+
- The proposed skill is broad advice such as "write better code" or "be careful" without a repeatable trigger and procedure.
|
|
41
|
+
- The skill would duplicate project-domain context, authorize commands, install dependencies, or define raw shell commands.
|
|
42
|
+
|
|
43
|
+
<!-- mustflow-section: required-inputs -->
|
|
44
|
+
## Required Inputs
|
|
45
|
+
|
|
46
|
+
- The user request and the repeated task the skill should cover.
|
|
47
|
+
- Existing `.mustflow/skills/INDEX.md` and nearby skill documents.
|
|
48
|
+
- `.mustflow/config/commands.toml` command intent names relevant to verification.
|
|
49
|
+
- Any repository evidence showing that the task is repeatable and not better handled by an existing skill.
|
|
50
|
+
- Localization and template metadata when the skill is part of an installed template.
|
|
51
|
+
|
|
52
|
+
<!-- mustflow-section: preconditions -->
|
|
53
|
+
## Preconditions
|
|
54
|
+
|
|
55
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
56
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
57
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
58
|
+
|
|
59
|
+
<!-- mustflow-section: allowed-edits -->
|
|
60
|
+
## Allowed Edits
|
|
61
|
+
|
|
62
|
+
- Keep edits within the scope described by this skill, the user request, and the matching route in `.mustflow/skills/INDEX.md`.
|
|
63
|
+
- Do not broaden command permission, invent project facts, or change unrelated workflow files.
|
|
64
|
+
|
|
65
|
+
<!-- mustflow-section: procedure -->
|
|
66
|
+
## Procedure
|
|
67
|
+
|
|
68
|
+
1. Define the smallest repeatable task the skill should cover. If the task is too broad, split it or leave it as repository guidance instead of creating a skill.
|
|
69
|
+
2. Search existing skills before adding a new one. Prefer updating a matching skill over creating overlapping procedures.
|
|
70
|
+
3. Use a stable folder name and matching frontmatter `name`. Set `mustflow_doc` to `skill.<name>`, `metadata.mustflow_schema` to `"1"`, `metadata.mustflow_kind` to `procedure`, `metadata.pack_id` to the package namespace, and `metadata.skill_id` to `<pack_id>.<name>`.
|
|
71
|
+
4. Write the standard sections: Purpose, Use When, Do Not Use When, Required Inputs, Preconditions, Allowed Edits, Procedure, Postconditions, Verification, Failure Handling, and Output Format.
|
|
72
|
+
5. Keep the procedure concrete and bounded. Include what to read, what to change, what to avoid, and what evidence to report.
|
|
73
|
+
6. Reference command intent names only. Do not include raw shell command blocks or claim that the skill authorizes command execution.
|
|
74
|
+
7. Update `.mustflow/skills/INDEX.md` with a compact route that includes trigger, required input, edit scope, risk, verification intents, and expected output.
|
|
75
|
+
8. If the skill is installed by a template, update template manifests, localization metadata, installation docs, package tests, and public docs that list installed files.
|
|
76
|
+
|
|
77
|
+
<!-- mustflow-section: postconditions -->
|
|
78
|
+
## Postconditions
|
|
79
|
+
|
|
80
|
+
- The expected output can be produced with clear evidence, executed command intents, skipped checks, and remaining risks.
|
|
81
|
+
- Any missing command intent, unknown input, or authority conflict is reported instead of hidden.
|
|
82
|
+
|
|
83
|
+
<!-- mustflow-section: verification -->
|
|
84
|
+
## Verification
|
|
85
|
+
|
|
86
|
+
Use configured oneshot command intents when available:
|
|
87
|
+
|
|
88
|
+
- `mustflow_check`
|
|
89
|
+
- `docs_validate`
|
|
90
|
+
|
|
91
|
+
If the skill changes tests or behavior-sensitive template output, also use the relevant configured test or build intents.
|
|
92
|
+
|
|
93
|
+
<!-- mustflow-section: failure-handling -->
|
|
94
|
+
## Failure Handling
|
|
95
|
+
|
|
96
|
+
- If `mustflow_check` reports missing sections, metadata drift, unknown command intents, raw shell commands, or command-permission claims, fix the skill contract before changing unrelated files.
|
|
97
|
+
- If two skills overlap, tighten their use and non-use conditions or merge the duplicate procedure.
|
|
98
|
+
- If a needed command intent is missing, record the missing intent instead of inventing a command inside the skill.
|
|
99
|
+
- If translation confidence is low, keep the source skill authoritative and mark translations for review through template metadata.
|
|
100
|
+
|
|
101
|
+
<!-- mustflow-section: output-format -->
|
|
102
|
+
## Output Format
|
|
103
|
+
|
|
104
|
+
- Skill files added, updated, renamed, or removed
|
|
105
|
+
- Skill index routes changed
|
|
106
|
+
- Command intents referenced
|
|
107
|
+
- Template or localization metadata updated
|
|
108
|
+
- Command intents run
|
|
109
|
+
- Skipped command intents and reasons
|
|
110
|
+
- Remaining overlap, translation, or validation risks
|