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.
Files changed (415) hide show
  1. package/LICENSE +16 -0
  2. package/README.md +422 -0
  3. package/dist/cli/commands/check.js +73 -0
  4. package/dist/cli/commands/classify.js +104 -0
  5. package/dist/cli/commands/context.js +95 -0
  6. package/dist/cli/commands/contract-lint.js +74 -0
  7. package/dist/cli/commands/dashboard.js +654 -0
  8. package/dist/cli/commands/docs.js +382 -0
  9. package/dist/cli/commands/doctor.js +232 -0
  10. package/dist/cli/commands/explain.js +293 -0
  11. package/dist/cli/commands/help.js +148 -0
  12. package/dist/cli/commands/impact.js +120 -0
  13. package/dist/cli/commands/index.js +70 -0
  14. package/dist/cli/commands/init.js +986 -0
  15. package/dist/cli/commands/line-endings.js +102 -0
  16. package/dist/cli/commands/map.js +95 -0
  17. package/dist/cli/commands/run.js +442 -0
  18. package/dist/cli/commands/search.js +166 -0
  19. package/dist/cli/commands/status.js +65 -0
  20. package/dist/cli/commands/update.js +443 -0
  21. package/dist/cli/commands/verify.js +448 -0
  22. package/dist/cli/commands/version-sources.js +79 -0
  23. package/dist/cli/commands/version.js +57 -0
  24. package/dist/cli/i18n/en.js +702 -0
  25. package/dist/cli/i18n/es.js +702 -0
  26. package/dist/cli/i18n/fr.js +702 -0
  27. package/dist/cli/i18n/hi.js +702 -0
  28. package/dist/cli/i18n/ko.js +702 -0
  29. package/dist/cli/i18n/zh.js +702 -0
  30. package/dist/cli/index.js +218 -0
  31. package/dist/cli/lib/agent-context.js +342 -0
  32. package/dist/cli/lib/browser-open.js +58 -0
  33. package/dist/cli/lib/cli-output.js +36 -0
  34. package/dist/cli/lib/command-contract.js +1 -0
  35. package/dist/cli/lib/command-registry.js +107 -0
  36. package/dist/cli/lib/dashboard-html.js +1866 -0
  37. package/dist/cli/lib/dashboard-locale.js +309 -0
  38. package/dist/cli/lib/dashboard-preferences.js +405 -0
  39. package/dist/cli/lib/doc-review-ledger.js +226 -0
  40. package/dist/cli/lib/filesystem.js +125 -0
  41. package/dist/cli/lib/git-changes.js +13 -0
  42. package/dist/cli/lib/i18n.js +55 -0
  43. package/dist/cli/lib/local-index.js +1014 -0
  44. package/dist/cli/lib/locale-tags.js +4 -0
  45. package/dist/cli/lib/manifest-lock.js +131 -0
  46. package/dist/cli/lib/npm-version-check.js +97 -0
  47. package/dist/cli/lib/package-info.js +13 -0
  48. package/dist/cli/lib/preferences-options.js +8 -0
  49. package/dist/cli/lib/project-root.js +23 -0
  50. package/dist/cli/lib/repo-map.js +635 -0
  51. package/dist/cli/lib/reporter.js +8 -0
  52. package/dist/cli/lib/run-receipt.js +1 -0
  53. package/dist/cli/lib/template-i18n.js +265 -0
  54. package/dist/cli/lib/templates.js +188 -0
  55. package/dist/cli/lib/toml.js +1 -0
  56. package/dist/cli/lib/validation.js +1639 -0
  57. package/dist/cli/lib/version-sources.js +1 -0
  58. package/dist/core/authority-resolution.js +155 -0
  59. package/dist/core/change-classification.js +122 -0
  60. package/dist/core/change-verification.js +80 -0
  61. package/dist/core/check-issues.js +67 -0
  62. package/dist/core/command-classification.js +22 -0
  63. package/dist/core/command-contract-rules.js +27 -0
  64. package/dist/core/command-contract-validation.js +197 -0
  65. package/dist/core/command-cwd.js +12 -0
  66. package/dist/core/command-effects.js +182 -0
  67. package/dist/core/command-explanation.js +135 -0
  68. package/dist/core/command-intent-eligibility.js +76 -0
  69. package/dist/core/config-loading.js +54 -0
  70. package/dist/core/contract-lint.js +110 -0
  71. package/dist/core/contract-models.js +53 -0
  72. package/dist/core/dashboard-verification.js +132 -0
  73. package/dist/core/doc-review-triage.js +92 -0
  74. package/dist/core/line-endings.js +144 -0
  75. package/dist/core/public-json-contracts.js +112 -0
  76. package/dist/core/public-surface-explanation.js +49 -0
  77. package/dist/core/release-version-validation.js +53 -0
  78. package/dist/core/retention-explanation.js +74 -0
  79. package/dist/core/retention-policy.js +57 -0
  80. package/dist/core/run-receipt.js +77 -0
  81. package/dist/core/skill-route-alignment.js +100 -0
  82. package/dist/core/skill-route-explanation.js +117 -0
  83. package/dist/core/source-anchor-explanation.js +33 -0
  84. package/dist/core/source-anchor-status.js +269 -0
  85. package/dist/core/source-anchor-symbols.js +181 -0
  86. package/dist/core/source-anchor-validation.js +158 -0
  87. package/dist/core/source-anchors.js +194 -0
  88. package/dist/core/surface-decision-model.js +18 -0
  89. package/dist/core/toml.js +11 -0
  90. package/dist/core/verification-plan.js +41 -0
  91. package/dist/core/verification-scheduler.js +92 -0
  92. package/dist/core/version-impact.js +54 -0
  93. package/dist/core/version-sources.js +235 -0
  94. package/dist/core/version-sync-policy.js +85 -0
  95. package/examples/README.md +13 -0
  96. package/examples/docs-only/README.md +72 -0
  97. package/examples/host-instruction-conflicts/README.md +47 -0
  98. package/examples/minimal-js/README.md +98 -0
  99. package/examples/missing-command-contracts/README.md +70 -0
  100. package/examples/nested-repos/README.md +62 -0
  101. package/package.json +80 -0
  102. package/schemas/README.md +32 -0
  103. package/schemas/change-verification-report.schema.json +319 -0
  104. package/schemas/classify-report.schema.json +113 -0
  105. package/schemas/commands.schema.json +116 -0
  106. package/schemas/context-report.schema.json +341 -0
  107. package/schemas/contract-lint-report.schema.json +61 -0
  108. package/schemas/docs-review-list.schema.json +72 -0
  109. package/schemas/doctor-report.schema.json +175 -0
  110. package/schemas/explain-report.schema.json +471 -0
  111. package/schemas/impact-report.schema.json +121 -0
  112. package/schemas/line-endings-report.schema.json +63 -0
  113. package/schemas/run-receipt.schema.json +75 -0
  114. package/schemas/verify-report.schema.json +67 -0
  115. package/schemas/version-sources-report.schema.json +42 -0
  116. package/templates/default/common/.mustflow/config/commands.toml +251 -0
  117. package/templates/default/common/.mustflow/config/mustflow.toml +424 -0
  118. package/templates/default/common/.mustflow/config/preferences.toml +125 -0
  119. package/templates/default/common/gitignore.mustflow +9 -0
  120. package/templates/default/i18n.toml +483 -0
  121. package/templates/default/locales/en/.mustflow/context/INDEX.md +39 -0
  122. package/templates/default/locales/en/.mustflow/context/PROJECT.md +66 -0
  123. package/templates/default/locales/en/.mustflow/docs/agent-workflow.md +345 -0
  124. package/templates/default/locales/en/.mustflow/skills/INDEX.md +78 -0
  125. package/templates/default/locales/en/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
  126. package/templates/default/locales/en/.mustflow/skills/artifact-integrity-check/SKILL.md +121 -0
  127. package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
  128. package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +115 -0
  129. package/templates/default/locales/en/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
  130. package/templates/default/locales/en/.mustflow/skills/command-pattern/SKILL.md +247 -0
  131. package/templates/default/locales/en/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
  132. package/templates/default/locales/en/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
  133. package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +116 -0
  134. package/templates/default/locales/en/.mustflow/skills/dependency-injection/SKILL.md +161 -0
  135. package/templates/default/locales/en/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
  136. package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +143 -0
  137. package/templates/default/locales/en/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
  138. package/templates/default/locales/en/.mustflow/skills/docs-update/SKILL.md +100 -0
  139. package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +124 -0
  140. package/templates/default/locales/en/.mustflow/skills/facade-pattern/SKILL.md +210 -0
  141. package/templates/default/locales/en/.mustflow/skills/failure-triage/SKILL.md +97 -0
  142. package/templates/default/locales/en/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
  143. package/templates/default/locales/en/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
  144. package/templates/default/locales/en/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
  145. package/templates/default/locales/en/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
  146. package/templates/default/locales/en/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
  147. package/templates/default/locales/en/.mustflow/skills/pattern-scout/SKILL.md +110 -0
  148. package/templates/default/locales/en/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
  149. package/templates/default/locales/en/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
  150. package/templates/default/locales/en/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
  151. package/templates/default/locales/en/.mustflow/skills/readme-authoring/SKILL.md +115 -0
  152. package/templates/default/locales/en/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
  153. package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
  154. package/templates/default/locales/en/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
  155. package/templates/default/locales/en/.mustflow/skills/result-option/SKILL.md +186 -0
  156. package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +130 -0
  157. package/templates/default/locales/en/.mustflow/skills/security-regression-tests/SKILL.md +157 -0
  158. package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +110 -0
  159. package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
  160. package/templates/default/locales/en/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
  161. package/templates/default/locales/en/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
  162. package/templates/default/locales/en/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
  163. package/templates/default/locales/en/.mustflow/skills/test-maintenance/SKILL.md +122 -0
  164. package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +119 -0
  165. package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
  166. package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
  167. package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
  168. package/templates/default/locales/en/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
  169. package/templates/default/locales/en/AGENTS.md +114 -0
  170. package/templates/default/locales/es/.mustflow/context/INDEX.md +39 -0
  171. package/templates/default/locales/es/.mustflow/context/PROJECT.md +63 -0
  172. package/templates/default/locales/es/.mustflow/docs/agent-workflow.md +365 -0
  173. package/templates/default/locales/es/.mustflow/skills/INDEX.md +78 -0
  174. package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
  175. package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
  176. package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
  177. package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +115 -0
  178. package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
  179. package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +247 -0
  180. package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
  181. package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
  182. package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +116 -0
  183. package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +161 -0
  184. package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
  185. package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
  186. package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
  187. package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +97 -0
  188. package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
  189. package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +210 -0
  190. package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +97 -0
  191. package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
  192. package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
  193. package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
  194. package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
  195. package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
  196. package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +110 -0
  197. package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
  198. package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
  199. package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
  200. package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +115 -0
  201. package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
  202. package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
  203. package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
  204. package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +186 -0
  205. package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
  206. package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
  207. package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +110 -0
  208. package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
  209. package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
  210. package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
  211. package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
  212. package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +122 -0
  213. package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
  214. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
  215. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
  216. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
  217. package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
  218. package/templates/default/locales/es/AGENTS.md +83 -0
  219. package/templates/default/locales/fr/.mustflow/context/INDEX.md +39 -0
  220. package/templates/default/locales/fr/.mustflow/context/PROJECT.md +63 -0
  221. package/templates/default/locales/fr/.mustflow/docs/agent-workflow.md +368 -0
  222. package/templates/default/locales/fr/.mustflow/skills/INDEX.md +78 -0
  223. package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
  224. package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
  225. package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
  226. package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +115 -0
  227. package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
  228. package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +247 -0
  229. package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
  230. package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
  231. package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +116 -0
  232. package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +161 -0
  233. package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
  234. package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
  235. package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
  236. package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +97 -0
  237. package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
  238. package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +210 -0
  239. package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +97 -0
  240. package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
  241. package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
  242. package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
  243. package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
  244. package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
  245. package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +110 -0
  246. package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
  247. package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
  248. package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
  249. package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +115 -0
  250. package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
  251. package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
  252. package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
  253. package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +186 -0
  254. package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
  255. package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
  256. package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +110 -0
  257. package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
  258. package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
  259. package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
  260. package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
  261. package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +122 -0
  262. package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
  263. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
  264. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
  265. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
  266. package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
  267. package/templates/default/locales/fr/AGENTS.md +84 -0
  268. package/templates/default/locales/hi/.mustflow/context/INDEX.md +39 -0
  269. package/templates/default/locales/hi/.mustflow/context/PROJECT.md +65 -0
  270. package/templates/default/locales/hi/.mustflow/docs/agent-workflow.md +359 -0
  271. package/templates/default/locales/hi/.mustflow/skills/INDEX.md +78 -0
  272. package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
  273. package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
  274. package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
  275. package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +115 -0
  276. package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
  277. package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +247 -0
  278. package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
  279. package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
  280. package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +116 -0
  281. package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +161 -0
  282. package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
  283. package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
  284. package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
  285. package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +97 -0
  286. package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
  287. package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +210 -0
  288. package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +97 -0
  289. package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
  290. package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
  291. package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
  292. package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
  293. package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
  294. package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +110 -0
  295. package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
  296. package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
  297. package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
  298. package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +115 -0
  299. package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
  300. package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
  301. package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
  302. package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +186 -0
  303. package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
  304. package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
  305. package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +110 -0
  306. package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
  307. package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
  308. package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
  309. package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
  310. package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +122 -0
  311. package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
  312. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
  313. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
  314. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
  315. package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
  316. package/templates/default/locales/hi/AGENTS.md +83 -0
  317. package/templates/default/locales/ko/.mustflow/context/INDEX.md +39 -0
  318. package/templates/default/locales/ko/.mustflow/context/PROJECT.md +66 -0
  319. package/templates/default/locales/ko/.mustflow/docs/agent-workflow.md +506 -0
  320. package/templates/default/locales/ko/.mustflow/skills/INDEX.md +78 -0
  321. package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
  322. package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
  323. package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
  324. package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +118 -0
  325. package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
  326. package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +247 -0
  327. package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
  328. package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
  329. package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +116 -0
  330. package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +161 -0
  331. package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
  332. package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
  333. package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
  334. package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +107 -0
  335. package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
  336. package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +210 -0
  337. package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +119 -0
  338. package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
  339. package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
  340. package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
  341. package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +259 -0
  342. package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
  343. package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +110 -0
  344. package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
  345. package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
  346. package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
  347. package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +115 -0
  348. package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
  349. package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
  350. package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
  351. package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +186 -0
  352. package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
  353. package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
  354. package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +110 -0
  355. package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
  356. package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
  357. package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
  358. package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
  359. package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +130 -0
  360. package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
  361. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
  362. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
  363. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
  364. package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
  365. package/templates/default/locales/ko/AGENTS.md +85 -0
  366. package/templates/default/locales/zh/.mustflow/context/INDEX.md +39 -0
  367. package/templates/default/locales/zh/.mustflow/context/PROJECT.md +64 -0
  368. package/templates/default/locales/zh/.mustflow/docs/agent-workflow.md +310 -0
  369. package/templates/default/locales/zh/.mustflow/skills/INDEX.md +78 -0
  370. package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
  371. package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
  372. package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
  373. package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +115 -0
  374. package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
  375. package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +247 -0
  376. package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
  377. package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
  378. package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +116 -0
  379. package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +161 -0
  380. package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
  381. package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
  382. package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
  383. package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +97 -0
  384. package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
  385. package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +210 -0
  386. package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +96 -0
  387. package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
  388. package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
  389. package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
  390. package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
  391. package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
  392. package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +110 -0
  393. package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
  394. package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
  395. package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
  396. package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +115 -0
  397. package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
  398. package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
  399. package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
  400. package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +186 -0
  401. package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
  402. package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
  403. package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +110 -0
  404. package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
  405. package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
  406. package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
  407. package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
  408. package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +122 -0
  409. package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
  410. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
  411. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
  412. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
  413. package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
  414. package/templates/default/locales/zh/AGENTS.md +86 -0
  415. package/templates/default/manifest.toml +339 -0
@@ -0,0 +1,110 @@
1
+ import { COMMAND_LIFECYCLES, COMMAND_RUN_POLICIES, LONG_RUNNING_LIFECYCLES, isRecord, readPositiveInteger, readString, } from './config-loading.js';
2
+ import { evaluateCommandIntentEligibility } from './command-intent-eligibility.js';
3
+ import { commandIntentHasBlockedShellBackgroundPattern, commandIntentHasCommandSource, commandIntentNameIsSafe, } from './command-contract-rules.js';
4
+ const CONTRACT_LINT_SOURCE_FILES = ['.mustflow/config/commands.toml', '.mustflow/docs/agent-workflow.md', 'AGENTS.md'];
5
+ function readBoolean(intent, key) {
6
+ const value = intent[key];
7
+ return typeof value === 'boolean' ? value : null;
8
+ }
9
+ function successExitCodesAreValid(intent) {
10
+ const value = intent.success_exit_codes;
11
+ return value === undefined || (Array.isArray(value) && value.every((entry) => Number.isInteger(entry)));
12
+ }
13
+ function writesAreValid(intent) {
14
+ const value = intent.writes;
15
+ return value === undefined || (Array.isArray(value) && value.every((entry) => typeof entry === 'string'));
16
+ }
17
+ function pushIssue(issues, severity, code, intent, message) {
18
+ issues.push({ severity, code, intent, message });
19
+ }
20
+ function configuredIntentIsRunnable(intent) {
21
+ return evaluateCommandIntentEligibility('summary', intent).ok;
22
+ }
23
+ function lintIntent(name, value, issues) {
24
+ if (!commandIntentNameIsSafe(name)) {
25
+ pushIssue(issues, 'error', 'unsafe_intent_name', name, `Intent ${name} name must contain only letters, numbers, underscores, and hyphens.`);
26
+ }
27
+ if (!isRecord(value)) {
28
+ pushIssue(issues, 'error', 'intent_not_table', name, `Intent ${name} must be a TOML table.`);
29
+ return null;
30
+ }
31
+ const status = readString(value, 'status');
32
+ if (!status || !['configured', 'manual_only', 'unknown'].includes(status)) {
33
+ pushIssue(issues, 'error', 'invalid_status', name, `Intent ${name} must set status to configured, manual_only, or unknown.`);
34
+ return value;
35
+ }
36
+ if (status === 'unknown') {
37
+ pushIssue(issues, 'warning', 'intent_unknown', name, `Intent ${name} is declared but has no configured command yet.`);
38
+ }
39
+ if (status === 'manual_only') {
40
+ pushIssue(issues, 'warning', 'intent_manual_only', name, `Intent ${name} requires explicit manual handling.`);
41
+ }
42
+ if (status !== 'configured') {
43
+ return value;
44
+ }
45
+ const lifecycle = readString(value, 'lifecycle');
46
+ const runPolicy = readString(value, 'run_policy');
47
+ if (!lifecycle || !COMMAND_LIFECYCLES.has(lifecycle)) {
48
+ pushIssue(issues, 'error', 'invalid_lifecycle', name, `Configured intent ${name} must define a valid lifecycle.`);
49
+ }
50
+ if (!runPolicy || !COMMAND_RUN_POLICIES.has(runPolicy)) {
51
+ pushIssue(issues, 'error', 'invalid_run_policy', name, `Configured intent ${name} must define a valid run_policy.`);
52
+ }
53
+ if (lifecycle === 'oneshot' && readPositiveInteger(value, 'timeout_seconds') === undefined) {
54
+ pushIssue(issues, 'error', 'oneshot_missing_timeout', name, `Oneshot intent ${name} must define timeout_seconds.`);
55
+ }
56
+ if (lifecycle === 'oneshot' && readString(value, 'stdin') !== 'closed') {
57
+ pushIssue(issues, 'error', 'oneshot_stdin_not_closed', name, `Oneshot intent ${name} must set stdin to closed.`);
58
+ }
59
+ if (lifecycle && LONG_RUNNING_LIFECYCLES.has(lifecycle) && runPolicy === 'agent_allowed') {
60
+ pushIssue(issues, 'error', 'long_running_agent_allowed', name, `Long-running intent ${name} must not be agent_allowed.`);
61
+ }
62
+ if (!commandIntentHasCommandSource(value)) {
63
+ pushIssue(issues, 'error', 'executable_source_missing', name, `Configured intent ${name} must define argv or shell cmd.`);
64
+ }
65
+ if (commandIntentHasBlockedShellBackgroundPattern(value)) {
66
+ pushIssue(issues, 'error', 'shell_background_pattern', name, `Shell intent ${name} contains a blocked long-running or background pattern.`);
67
+ }
68
+ if (!successExitCodesAreValid(value)) {
69
+ pushIssue(issues, 'error', 'invalid_success_exit_codes', name, `Intent ${name} success_exit_codes must be an integer array.`);
70
+ }
71
+ if (!writesAreValid(value)) {
72
+ pushIssue(issues, 'error', 'invalid_writes', name, `Intent ${name} writes must be a string array.`);
73
+ }
74
+ if (readBoolean(value, 'network') === null && Object.hasOwn(value, 'network')) {
75
+ pushIssue(issues, 'error', 'invalid_network', name, `Intent ${name} network must be a boolean.`);
76
+ }
77
+ if (readBoolean(value, 'destructive') === null && Object.hasOwn(value, 'destructive')) {
78
+ pushIssue(issues, 'error', 'invalid_destructive', name, `Intent ${name} destructive must be a boolean.`);
79
+ }
80
+ return value;
81
+ }
82
+ function getStatus(errors, warnings) {
83
+ if (errors > 0) {
84
+ return 'failed';
85
+ }
86
+ return warnings > 0 ? 'warning' : 'passed';
87
+ }
88
+ export function lintCommandContract(contract) {
89
+ const issues = [];
90
+ const intentEntries = Object.entries(contract.intents);
91
+ const intentTables = intentEntries
92
+ .map(([name, value]) => lintIntent(name, value, issues))
93
+ .filter((intent) => intent !== null);
94
+ const errors = issues.filter((issue) => issue.severity === 'error').length;
95
+ const warnings = issues.length - errors;
96
+ return {
97
+ status: getStatus(errors, warnings),
98
+ summary: {
99
+ totalIntents: intentEntries.length,
100
+ configured: intentTables.filter((intent) => readString(intent, 'status') === 'configured').length,
101
+ runnable: intentTables.filter(configuredIntentIsRunnable).length,
102
+ manualOnly: intentTables.filter((intent) => readString(intent, 'status') === 'manual_only').length,
103
+ unknown: intentTables.filter((intent) => readString(intent, 'status') === 'unknown').length,
104
+ errors,
105
+ warnings,
106
+ },
107
+ issues,
108
+ sourceFiles: CONTRACT_LINT_SOURCE_FILES,
109
+ };
110
+ }
@@ -0,0 +1,53 @@
1
+ export const CONTRACT_MODEL_DEFINITIONS = [
2
+ {
3
+ id: 'changes',
4
+ filePath: '.mustflow/config/changes.toml',
5
+ status: 'candidate',
6
+ installByDefault: false,
7
+ purpose: 'Describe changed-file classes that can feed verification and surface planning.',
8
+ authority: 'planning',
9
+ },
10
+ {
11
+ id: 'validations',
12
+ filePath: '.mustflow/config/validations.toml',
13
+ status: 'candidate',
14
+ installByDefault: false,
15
+ purpose: 'Describe validation reasons and their relationship to configured command intents.',
16
+ authority: 'planning',
17
+ },
18
+ {
19
+ id: 'surfaces',
20
+ filePath: '.mustflow/config/surfaces.toml',
21
+ status: 'candidate',
22
+ installByDefault: false,
23
+ purpose: 'Describe public and installed surfaces that may need drift checks after changes.',
24
+ authority: 'planning',
25
+ },
26
+ {
27
+ id: 'artifacts',
28
+ filePath: '.mustflow/config/artifacts.toml',
29
+ status: 'candidate',
30
+ installByDefault: false,
31
+ purpose: 'Describe generated or packaged artifacts that need inclusion and freshness checks.',
32
+ authority: 'planning',
33
+ },
34
+ {
35
+ id: 'policy',
36
+ filePath: '.mustflow/config/policy.toml',
37
+ status: 'deferred',
38
+ installByDefault: false,
39
+ purpose: 'Reserved for future cross-cutting policy once smaller contract files have settled.',
40
+ authority: 'policy',
41
+ },
42
+ ];
43
+ export function getContractModelDefinitions() {
44
+ return CONTRACT_MODEL_DEFINITIONS;
45
+ }
46
+ export function getCandidateContractModelDefinitions() {
47
+ return CONTRACT_MODEL_DEFINITIONS.filter((model) => model.status === 'candidate');
48
+ }
49
+ export function getNonInstalledContractConfigPaths() {
50
+ return CONTRACT_MODEL_DEFINITIONS
51
+ .filter((model) => !model.installByDefault)
52
+ .map((model) => model.filePath);
53
+ }
@@ -0,0 +1,132 @@
1
+ import { createChangeClassificationReport } from './change-classification.js';
2
+ import { createChangeVerificationReport, } from './change-verification.js';
3
+ export const DASHBOARD_VERIFICATION_MAX_FILE_MATCHES = 8;
4
+ function toPosixChangedFiles(changedFiles, manifestChangedFiles, manifestMissingFiles) {
5
+ return [
6
+ ...new Set([...changedFiles, ...manifestChangedFiles, ...manifestMissingFiles].map((filePath) => filePath.replaceAll('\\', '/'))),
7
+ ].sort((left, right) => left.localeCompare(right));
8
+ }
9
+ function uniqueLimitedFiles(left, right) {
10
+ return [...new Set([...left, ...right])].slice(0, DASHBOARD_VERIFICATION_MAX_FILE_MATCHES);
11
+ }
12
+ function verificationReasonKey(requirement) {
13
+ if (requirement.reason === 'mustflow_config_change' || requirement.reason === 'mustflow_docs_change') {
14
+ return 'dashboard.verification.reason.mustflow';
15
+ }
16
+ if (requirement.reason === 'docs_change' || requirement.reason === 'copy_change' || requirement.reason === 'i18n_change') {
17
+ return 'dashboard.verification.reason.docs';
18
+ }
19
+ if (requirement.reason === 'package_metadata_change' ||
20
+ requirement.reason === 'template_version_change' ||
21
+ requirement.reason === 'packaging_change' ||
22
+ requirement.reason === 'release_risk') {
23
+ return 'dashboard.verification.reason.release';
24
+ }
25
+ if (requirement.reason === 'code_change' ||
26
+ requirement.reason === 'test_change' ||
27
+ requirement.reason === 'public_api_change') {
28
+ return 'dashboard.verification.reason.code';
29
+ }
30
+ return 'dashboard.verification.reason.fallback';
31
+ }
32
+ function requirementFiles(requirement, allChangedFiles) {
33
+ return (requirement.files.length > 0 ? requirement.files : allChangedFiles).slice(0, DASHBOARD_VERIFICATION_MAX_FILE_MATCHES);
34
+ }
35
+ function addDashboardRecommendation(recommendations, commandByName, intent, reasonKey, files) {
36
+ const existingIndex = recommendations.findIndex((item) => item.intent === intent);
37
+ if (existingIndex >= 0) {
38
+ const existing = recommendations[existingIndex];
39
+ recommendations[existingIndex] = {
40
+ ...existing,
41
+ files: uniqueLimitedFiles(existing.files, files),
42
+ };
43
+ return;
44
+ }
45
+ const command = commandByName.get(intent);
46
+ recommendations.push({
47
+ intent,
48
+ command: `mf run ${intent}`,
49
+ reason_key: reasonKey,
50
+ files: files.slice(0, DASHBOARD_VERIFICATION_MAX_FILE_MATCHES),
51
+ runnable: command?.runnable ?? false,
52
+ });
53
+ }
54
+ function addSkippedCandidate(skipped, candidate) {
55
+ if (!candidate.intent || skipped.some((item) => item.intent === candidate.intent)) {
56
+ return;
57
+ }
58
+ skipped.push({
59
+ intent: candidate.intent,
60
+ reason_key: 'dashboard.verification.skip.notRunnable',
61
+ });
62
+ }
63
+ function createEmptyDashboardVerificationSnapshot(changedFiles) {
64
+ return {
65
+ changed_files: changedFiles,
66
+ surfaces: [],
67
+ recommendations: [],
68
+ skipped: [],
69
+ schedule: {
70
+ runner: 'serial_mf_run_receipts',
71
+ batches: [],
72
+ entries: [],
73
+ notes: [],
74
+ },
75
+ };
76
+ }
77
+ export function createDashboardVerificationSnapshot(projectRoot, rawCommandContract, commandIntents, changedFiles, manifestChangedFiles, manifestMissingFiles) {
78
+ const allChangedFiles = toPosixChangedFiles(changedFiles, manifestChangedFiles, manifestMissingFiles);
79
+ if (!rawCommandContract || allChangedFiles.length === 0) {
80
+ return createEmptyDashboardVerificationSnapshot(allChangedFiles);
81
+ }
82
+ const classificationReport = createChangeClassificationReport('changed', allChangedFiles);
83
+ const verificationReport = createChangeVerificationReport(classificationReport, rawCommandContract, projectRoot);
84
+ const commandByName = new Map(commandIntents.map((intent) => [intent.name, intent]));
85
+ const recommendations = [];
86
+ const skipped = [];
87
+ const requirementByReason = new Map(verificationReport.requirements.map((requirement) => [requirement.reason, requirement]));
88
+ for (const candidate of verificationReport.candidates) {
89
+ const requirement = requirementByReason.get(candidate.reason);
90
+ if (!requirement) {
91
+ continue;
92
+ }
93
+ if (candidate.status === 'runnable' && candidate.intent) {
94
+ addDashboardRecommendation(recommendations, commandByName, candidate.intent, verificationReasonKey(requirement), requirementFiles(requirement, allChangedFiles));
95
+ continue;
96
+ }
97
+ addSkippedCandidate(skipped, candidate);
98
+ }
99
+ return {
100
+ changed_files: verificationReport.files,
101
+ surfaces: [...new Set(verificationReport.requirements.flatMap((requirement) => requirement.surfaces))].sort((left, right) => left.localeCompare(right)),
102
+ recommendations,
103
+ skipped,
104
+ schedule: {
105
+ runner: verificationReport.schedule.runner,
106
+ batches: verificationReport.schedule.batches.map((batch) => ({
107
+ index: batch.index,
108
+ intents: batch.intents,
109
+ commands: batch.intents.map((intent) => `mf run ${intent}`),
110
+ locks: batch.locks,
111
+ })),
112
+ entries: verificationReport.schedule.entries.map((entry) => ({
113
+ intent: entry.intent,
114
+ command: `mf run ${entry.intent}`,
115
+ locks: entry.locks,
116
+ effects: entry.effects.map((effect) => ({
117
+ access: effect.access,
118
+ mode: effect.mode,
119
+ path: effect.path,
120
+ lock: effect.lock,
121
+ concurrency: effect.concurrency,
122
+ })),
123
+ conflicts: entry.conflicts.map((conflict) => ({
124
+ intent: conflict.conflictsWith,
125
+ lock: conflict.lock,
126
+ detail: conflict.detail,
127
+ })),
128
+ })),
129
+ notes: verificationReport.schedule.notes,
130
+ },
131
+ };
132
+ }
@@ -0,0 +1,92 @@
1
+ const P0_EXACT_PATHS = new Set([
2
+ 'README.md',
3
+ 'CHANGELOG.md',
4
+ 'AGENTS.md',
5
+ '.mustflow/docs/agent-workflow.md',
6
+ '.mustflow/skills/INDEX.md',
7
+ ]);
8
+ const AUTHORITY_OR_SECURITY_SKILLS = new Set([
9
+ 'contract-sync-check',
10
+ 'external-prompt-injection-defense',
11
+ 'instruction-conflict-scope-check',
12
+ 'migration-safety-check',
13
+ 'multi-agent-work-coordination',
14
+ 'requirement-regression-guard',
15
+ 'security-privacy-review',
16
+ 'security-regression-tests',
17
+ 'test-maintenance',
18
+ ]);
19
+ function normalizePath(value) {
20
+ return value.replace(/\\/g, '/').replace(/^\.\//u, '');
21
+ }
22
+ function isDefaultTemplateEnglishSource(path) {
23
+ return path.startsWith('templates/default/locales/en/') || path.startsWith('templates/default/common/');
24
+ }
25
+ function isEnglishCommandDoc(path) {
26
+ return /^docs-site\/src\/content\/docs\/en\/commands\/[^/]+\.md$/u.test(path);
27
+ }
28
+ function isAuthorityOrSecuritySkill(path) {
29
+ const match = /^\.mustflow\/skills\/([^/]+)\/SKILL\.md$/u.exec(path);
30
+ return Boolean(match && AUTHORITY_OR_SECURITY_SKILLS.has(match[1]));
31
+ }
32
+ function isTranslationReviewDebt(input, path) {
33
+ if (/^docs-site\/src\/content\/docs\/(?!en\/)[^/]+\//u.test(path) ||
34
+ /^templates\/default\/locales\/(?!en\/)[^/]+\//u.test(path)) {
35
+ return true;
36
+ }
37
+ const text = `${input.origin ?? ''} ${input.reason ?? ''}`.toLowerCase();
38
+ return text.includes('translation') || text.includes('stale') || text.includes('needs_review');
39
+ }
40
+ function isTestFixture(path) {
41
+ return path.startsWith('tests/fixtures/') || path.includes('/fixtures/') || path.includes('/__fixtures__/');
42
+ }
43
+ export function triageDocReview(input) {
44
+ const path = normalizePath(input.path);
45
+ if (P0_EXACT_PATHS.has(path)) {
46
+ return {
47
+ review_priority: 'P0',
48
+ release_blocking: input.status !== 'approved',
49
+ triage_reason: 'release_contract',
50
+ };
51
+ }
52
+ if (isAuthorityOrSecuritySkill(path)) {
53
+ return {
54
+ review_priority: 'P0',
55
+ release_blocking: input.status !== 'approved',
56
+ triage_reason: 'authority_or_security_skill',
57
+ };
58
+ }
59
+ if (isDefaultTemplateEnglishSource(path)) {
60
+ return {
61
+ review_priority: 'P0',
62
+ release_blocking: input.status !== 'approved',
63
+ triage_reason: 'default_template_source',
64
+ };
65
+ }
66
+ if (isEnglishCommandDoc(path)) {
67
+ return {
68
+ review_priority: 'P0',
69
+ release_blocking: input.status !== 'approved',
70
+ triage_reason: 'english_command_doc',
71
+ };
72
+ }
73
+ if (isTestFixture(path)) {
74
+ return {
75
+ review_priority: 'P2',
76
+ release_blocking: false,
77
+ triage_reason: 'test_fixture',
78
+ };
79
+ }
80
+ if (isTranslationReviewDebt(input, path)) {
81
+ return {
82
+ review_priority: 'P2',
83
+ release_blocking: false,
84
+ triage_reason: 'translation_review_debt',
85
+ };
86
+ }
87
+ return {
88
+ review_priority: 'P1',
89
+ release_blocking: false,
90
+ triage_reason: 'user_visible_doc',
91
+ };
92
+ }
@@ -0,0 +1,144 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ const GITATTRIBUTES_PATH = '.gitattributes';
5
+ function toPosixPath(value) {
6
+ return value.split(path.sep).join('/');
7
+ }
8
+ function hasLfPolicy(projectRoot) {
9
+ const attributesPath = path.join(projectRoot, GITATTRIBUTES_PATH);
10
+ if (!existsSync(attributesPath)) {
11
+ return false;
12
+ }
13
+ const content = readFileSync(attributesPath, 'utf8');
14
+ return /^\*\s+.*(?:^|\s)eol=lf(?:\s|$)/imu.test(content);
15
+ }
16
+ function gitList(projectRoot, args) {
17
+ const result = spawnSync('git', [...args, '-z'], {
18
+ cwd: projectRoot,
19
+ encoding: 'buffer',
20
+ stdio: ['ignore', 'pipe', 'pipe'],
21
+ windowsHide: true,
22
+ });
23
+ if (result.status !== 0) {
24
+ return null;
25
+ }
26
+ return result.stdout
27
+ .toString('utf8')
28
+ .split('\0')
29
+ .map((entry) => entry.trim())
30
+ .filter((entry) => entry.length > 0)
31
+ .sort((left, right) => left.localeCompare(right));
32
+ }
33
+ function listGitTrackedFiles(projectRoot) {
34
+ return gitList(projectRoot, ['ls-files']);
35
+ }
36
+ function listGitChangedFiles(projectRoot) {
37
+ const changedLists = [
38
+ gitList(projectRoot, ['diff', '--name-only', '--diff-filter=ACMR']),
39
+ gitList(projectRoot, ['diff', '--cached', '--name-only', '--diff-filter=ACMR']),
40
+ gitList(projectRoot, ['ls-files', '--others', '--exclude-standard']),
41
+ ];
42
+ if (changedLists.some((list) => list === null)) {
43
+ return null;
44
+ }
45
+ return [...new Set(changedLists.flatMap((list) => list ?? []))].sort((left, right) => left.localeCompare(right));
46
+ }
47
+ function detectLineEnding(buffer) {
48
+ if (buffer.includes(0)) {
49
+ return 'binary';
50
+ }
51
+ let lfCount = 0;
52
+ let crlfCount = 0;
53
+ for (let index = 0; index < buffer.length; index += 1) {
54
+ if (buffer[index] !== 0x0a) {
55
+ continue;
56
+ }
57
+ lfCount += 1;
58
+ if (index > 0 && buffer[index - 1] === 0x0d) {
59
+ crlfCount += 1;
60
+ }
61
+ }
62
+ if (lfCount === 0) {
63
+ return 'none';
64
+ }
65
+ if (crlfCount === 0) {
66
+ return 'lf';
67
+ }
68
+ return crlfCount === lfCount ? 'crlf' : 'mixed';
69
+ }
70
+ function normalizeLf(buffer) {
71
+ const bytes = [];
72
+ for (let index = 0; index < buffer.length; index += 1) {
73
+ const byte = buffer[index];
74
+ if (byte === 0x0d) {
75
+ bytes.push(0x0a);
76
+ if (buffer[index + 1] === 0x0a) {
77
+ index += 1;
78
+ }
79
+ continue;
80
+ }
81
+ bytes.push(byte);
82
+ }
83
+ return Buffer.from(bytes);
84
+ }
85
+ export function inspectLineEndings(projectRoot, mode, options = {}) {
86
+ const root = path.resolve(projectRoot);
87
+ const policy = hasLfPolicy(root) ? 'lf' : 'unknown';
88
+ const policyPath = policy === 'lf' ? GITATTRIBUTES_PATH : null;
89
+ const scope = options.scope ?? 'changed';
90
+ const candidateFiles = scope === 'tracked' ? listGitTrackedFiles(root) : listGitChangedFiles(root);
91
+ const issues = [];
92
+ const nonCompliantFiles = [];
93
+ const changedFiles = [];
94
+ const apply = options.apply === true;
95
+ if (!candidateFiles) {
96
+ issues.push('Git tracked files could not be listed. Run this command inside a Git working tree.');
97
+ }
98
+ if (policy !== 'lf') {
99
+ issues.push('No repository LF policy was detected in .gitattributes.');
100
+ }
101
+ if (mode === 'normalize' && apply && policy !== 'lf') {
102
+ issues.push('Refused to normalize without an explicit .gitattributes LF policy.');
103
+ }
104
+ const canApply = mode === 'normalize' && apply && policy === 'lf' && candidateFiles !== null;
105
+ for (const relativePath of candidateFiles ?? []) {
106
+ const absolutePath = path.join(root, ...relativePath.split('/'));
107
+ if (!existsSync(absolutePath)) {
108
+ continue;
109
+ }
110
+ const buffer = readFileSync(absolutePath);
111
+ const lineEnding = detectLineEnding(buffer);
112
+ const wouldChange = policy === 'lf' && (lineEnding === 'crlf' || lineEnding === 'mixed');
113
+ if (!wouldChange) {
114
+ continue;
115
+ }
116
+ if (canApply) {
117
+ writeFileSync(absolutePath, normalizeLf(buffer));
118
+ changedFiles.push(toPosixPath(relativePath));
119
+ }
120
+ nonCompliantFiles.push({
121
+ path: toPosixPath(relativePath),
122
+ lineEnding,
123
+ wouldChange,
124
+ changed: canApply,
125
+ });
126
+ }
127
+ return {
128
+ schema_version: '1',
129
+ command: 'line-endings',
130
+ mode,
131
+ scope,
132
+ ok: issues.length === 0 && (canApply || nonCompliantFiles.length === 0),
133
+ mustflow_root: root,
134
+ policy,
135
+ policy_path: policyPath,
136
+ git_tracked: candidateFiles !== null,
137
+ checked_files: candidateFiles?.length ?? 0,
138
+ non_compliant_files: nonCompliantFiles,
139
+ changed_files: changedFiles,
140
+ dry_run: mode === 'normalize' && !apply,
141
+ wrote_files: changedFiles.length > 0,
142
+ issues,
143
+ };
144
+ }
@@ -0,0 +1,112 @@
1
+ const PUBLIC_JSON_SCHEMA_CONTRACTS = [
2
+ {
3
+ id: 'doctor-report',
4
+ schemaFile: 'doctor-report.schema.json',
5
+ producer: 'mf doctor --json',
6
+ packaged: true,
7
+ documented: true,
8
+ installedCommand: ['mf', 'doctor', '--json'],
9
+ },
10
+ {
11
+ id: 'context-report',
12
+ schemaFile: 'context-report.schema.json',
13
+ producer: 'mf context --json',
14
+ packaged: true,
15
+ documented: true,
16
+ installedCommand: ['mf', 'context', '--json'],
17
+ },
18
+ {
19
+ id: 'run-receipt',
20
+ schemaFile: 'run-receipt.schema.json',
21
+ producer: 'mf run <intent> --json',
22
+ packaged: true,
23
+ documented: true,
24
+ installedCommand: ['mf', 'run', 'mustflow_check', '--json'],
25
+ },
26
+ {
27
+ id: 'commands',
28
+ schemaFile: 'commands.schema.json',
29
+ producer: 'parsed .mustflow/config/commands.toml',
30
+ packaged: true,
31
+ documented: true,
32
+ },
33
+ {
34
+ id: 'contract-lint-report',
35
+ schemaFile: 'contract-lint-report.schema.json',
36
+ producer: 'mf contract-lint --json',
37
+ packaged: true,
38
+ documented: true,
39
+ installedCommand: ['mf', 'contract-lint', '--json'],
40
+ },
41
+ {
42
+ id: 'classify-report',
43
+ schemaFile: 'classify-report.schema.json',
44
+ producer: 'mf classify <path...> --json',
45
+ packaged: true,
46
+ documented: true,
47
+ installedCommand: ['mf', 'classify', 'README.md', '--json'],
48
+ },
49
+ {
50
+ id: 'impact-report',
51
+ schemaFile: 'impact-report.schema.json',
52
+ producer: 'mf impact <path...> --json',
53
+ packaged: true,
54
+ documented: true,
55
+ installedCommand: ['mf', 'impact', 'package.json', '--json'],
56
+ },
57
+ {
58
+ id: 'line-endings-report',
59
+ schemaFile: 'line-endings-report.schema.json',
60
+ producer: 'mf line-endings check --json',
61
+ packaged: true,
62
+ documented: true,
63
+ installedCommand: ['mf', 'line-endings', 'check', '--json'],
64
+ expectedExitCodes: [0, 1],
65
+ },
66
+ {
67
+ id: 'version-sources-report',
68
+ schemaFile: 'version-sources-report.schema.json',
69
+ producer: 'mf version-sources --json',
70
+ packaged: true,
71
+ documented: true,
72
+ installedCommand: ['mf', 'version-sources', '--json'],
73
+ },
74
+ {
75
+ id: 'docs-review-list',
76
+ schemaFile: 'docs-review-list.schema.json',
77
+ producer: 'mf docs review list --json',
78
+ packaged: true,
79
+ documented: true,
80
+ installedCommand: ['mf', 'docs', 'review', 'list', '--json'],
81
+ },
82
+ {
83
+ id: 'explain-report',
84
+ schemaFile: 'explain-report.schema.json',
85
+ producer: 'mf explain <topic> --json',
86
+ packaged: true,
87
+ documented: true,
88
+ installedCommand: ['mf', 'explain', 'authority', 'AGENTS.md', '--json'],
89
+ },
90
+ {
91
+ id: 'verify-report',
92
+ schemaFile: 'verify-report.schema.json',
93
+ producer: 'mf verify --reason <event> --json',
94
+ packaged: true,
95
+ documented: true,
96
+ installedCommand: ['mf', 'verify', '--reason', 'schema_verify', '--json'],
97
+ },
98
+ {
99
+ id: 'change-verification-report',
100
+ schemaFile: 'change-verification-report.schema.json',
101
+ producer: 'mf verify --reason <event> --plan-only --json',
102
+ packaged: true,
103
+ documented: true,
104
+ installedCommand: ['mf', 'verify', '--reason', 'schema_verify', '--plan-only', '--json'],
105
+ },
106
+ ];
107
+ export function getPublicJsonSchemaContracts() {
108
+ return PUBLIC_JSON_SCHEMA_CONTRACTS;
109
+ }
110
+ export function getPublicJsonSchemaFiles() {
111
+ return PUBLIC_JSON_SCHEMA_CONTRACTS.map((contract) => contract.schemaFile);
112
+ }