mustflow 2.22.17 → 2.22.47

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 (70) hide show
  1. package/README.md +6 -0
  2. package/dist/cli/commands/api.js +874 -0
  3. package/dist/cli/commands/dashboard.js +51 -4
  4. package/dist/cli/commands/explain.js +3 -2
  5. package/dist/cli/commands/help.js +0 -1
  6. package/dist/cli/commands/run.js +41 -4
  7. package/dist/cli/commands/verify.js +4 -43
  8. package/dist/cli/i18n/en.js +15 -0
  9. package/dist/cli/i18n/es.js +15 -0
  10. package/dist/cli/i18n/fr.js +15 -0
  11. package/dist/cli/i18n/hi.js +15 -0
  12. package/dist/cli/i18n/ko.js +15 -0
  13. package/dist/cli/i18n/zh.js +15 -0
  14. package/dist/cli/index.js +1 -0
  15. package/dist/cli/lib/cli-output.js +1 -1
  16. package/dist/cli/lib/command-registry.js +6 -0
  17. package/dist/cli/lib/dashboard-html/client-script.js +9 -0
  18. package/dist/cli/lib/dashboard-html/styles.js +48 -1
  19. package/dist/cli/lib/doc-review-ledger.js +1 -1
  20. package/dist/cli/lib/local-index/index.js +324 -298
  21. package/dist/cli/lib/repo-map.js +19 -5
  22. package/dist/cli/lib/validation/index.js +6 -2
  23. package/dist/core/active-run-locks.js +36 -8
  24. package/dist/core/atomic-state-write.js +5 -20
  25. package/dist/core/change-verification.js +18 -2
  26. package/dist/core/contract-lint.js +3 -3
  27. package/dist/core/public-json-contracts.js +48 -0
  28. package/dist/core/repeated-failure.js +1 -1
  29. package/dist/core/run-write-drift.js +30 -17
  30. package/dist/core/safe-filesystem.js +54 -5
  31. package/dist/core/skill-route-explanation.js +2 -1
  32. package/dist/core/source-anchors.js +7 -3
  33. package/dist/core/validation-ratchet.js +61 -18
  34. package/dist/core/verification-decision-graph.js +8 -1
  35. package/dist/core/verification-plan-id.js +44 -0
  36. package/package.json +1 -1
  37. package/schemas/README.md +6 -0
  38. package/schemas/command-catalog.schema.json +158 -0
  39. package/schemas/diff-risk.schema.json +74 -0
  40. package/schemas/health.schema.json +45 -0
  41. package/schemas/latest-evidence.schema.json +95 -0
  42. package/schemas/verification-plan.schema.json +245 -0
  43. package/schemas/workspace-summary.schema.json +282 -0
  44. package/templates/default/i18n.toml +139 -1
  45. package/templates/default/locales/en/.mustflow/skills/INDEX.md +24 -1
  46. package/templates/default/locales/en/.mustflow/skills/api-contract-change/SKILL.md +212 -0
  47. package/templates/default/locales/en/.mustflow/skills/astro-code-change/SKILL.md +184 -0
  48. package/templates/default/locales/en/.mustflow/skills/auth-permission-change/SKILL.md +194 -0
  49. package/templates/default/locales/en/.mustflow/skills/config-env-change/SKILL.md +189 -0
  50. package/templates/default/locales/en/.mustflow/skills/css-code-change/SKILL.md +199 -0
  51. package/templates/default/locales/en/.mustflow/skills/dart-code-change/SKILL.md +179 -0
  52. package/templates/default/locales/en/.mustflow/skills/database-migration-change/SKILL.md +178 -0
  53. package/templates/default/locales/en/.mustflow/skills/dependency-upgrade-review/SKILL.md +151 -0
  54. package/templates/default/locales/en/.mustflow/skills/elysia-code-change/SKILL.md +115 -0
  55. package/templates/default/locales/en/.mustflow/skills/file-path-cross-platform-change/SKILL.md +147 -0
  56. package/templates/default/locales/en/.mustflow/skills/flutter-code-change/SKILL.md +116 -0
  57. package/templates/default/locales/en/.mustflow/skills/go-code-change/SKILL.md +156 -0
  58. package/templates/default/locales/en/.mustflow/skills/hono-code-change/SKILL.md +117 -0
  59. package/templates/default/locales/en/.mustflow/skills/html-code-change/SKILL.md +173 -0
  60. package/templates/default/locales/en/.mustflow/skills/javascript-code-change/SKILL.md +149 -0
  61. package/templates/default/locales/en/.mustflow/skills/python-code-change/SKILL.md +154 -0
  62. package/templates/default/locales/en/.mustflow/skills/release-publish-change/SKILL.md +172 -0
  63. package/templates/default/locales/en/.mustflow/skills/routes.toml +138 -0
  64. package/templates/default/locales/en/.mustflow/skills/rust-code-change/SKILL.md +154 -0
  65. package/templates/default/locales/en/.mustflow/skills/svelte-code-change/SKILL.md +186 -0
  66. package/templates/default/locales/en/.mustflow/skills/tailwind-code-change/SKILL.md +164 -0
  67. package/templates/default/locales/en/.mustflow/skills/tauri-code-change/SKILL.md +185 -0
  68. package/templates/default/locales/en/.mustflow/skills/typescript-code-change/SKILL.md +184 -0
  69. package/templates/default/locales/en/.mustflow/skills/unocss-code-change/SKILL.md +186 -0
  70. package/templates/default/manifest.toml +158 -1
@@ -0,0 +1,151 @@
1
+ ---
2
+ mustflow_doc: skill.dependency-upgrade-review
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: dependency-upgrade-review
9
+ description: Apply this skill when dependency versions, lockfiles, package manager metadata, security advisory fixes, generated dependency outputs, runtime engine constraints, peer dependency contracts, framework plugins, CI actions, Docker base images, or toolchain versions are upgraded, downgraded, pinned, widened, regenerated, reviewed, or reported.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.dependency-upgrade-review
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - test_release
24
+ - mustflow_check
25
+ ---
26
+
27
+ # Dependency Upgrade Review
28
+
29
+ <!-- mustflow-section: purpose -->
30
+ ## Purpose
31
+
32
+ Review dependency upgrades as runtime, build, security, package, and generated-output contract changes rather than as version-number edits.
33
+
34
+ <!-- mustflow-section: use-when -->
35
+ ## Use When
36
+
37
+ - A dependency version is upgraded, downgraded, pinned, unpinned, widened, narrowed, replaced, or removed.
38
+ - A lockfile, package manager metadata, workspace constraint, runtime engine, peer dependency, optional dependency, feature flag, or generated dependency output changes.
39
+ - A security advisory, vulnerability scanner, Dependabot, Renovate, package audit, language audit, CI action update, Docker base image update, framework plugin update, formatter/linter/bundler update, ORM update, code generator update, protobuf/OpenAPI generator update, or toolchain update is reviewed or applied.
40
+ - A task claims a dependency change is "only patch", "only devDependency", "safe minor", "security-only", "transitive only", "lockfile only", or "no runtime change".
41
+ - A dependency update touches installation, publish output, generated clients, SDKs, native binaries, browser bundles, serverless or edge runtime, ESM/CJS/module format, Python markers, Go module graph, Cargo features, JVM dependency mediation, .NET target frameworks, Ruby/PHP/Swift lockfiles, Docker images, or CI actions.
42
+
43
+ <!-- mustflow-section: do-not-use-when -->
44
+ ## Do Not Use When
45
+
46
+ - A brand-new dependency is proposed without upgrading an existing declaration; use `dependency-reality-check` first.
47
+ - Code imports or invokes an existing dependency but no dependency metadata, lockfile, runtime version, generated output, or package-manager contract changes.
48
+ - The task only updates prose that mentions a dependency and does not assert supported versions, install commands, runtime behavior, security status, or package metadata.
49
+
50
+ <!-- mustflow-section: required-inputs -->
51
+ ## Required Inputs
52
+
53
+ - The dependency or tool being changed, old version or range, new version or range, direct or transitive status, and reason for the change.
54
+ - Ecosystem and package manager: JavaScript or TypeScript, Python, Go, Rust, JVM, .NET, Ruby, PHP, Swift, Docker, CI actions, or another declared system.
55
+ - Package declarations, lockfiles, workspace files, runtime-version files, package-manager config, toolchain files, CI/Docker files, generated outputs, and command contract entries.
56
+ - Release notes, migration notes, changelog, advisory range, fixed range, compatibility notes, or local issue evidence when available from approved context.
57
+ - Impacted runtime paths, build paths, test paths, generated clients, mocks, fixtures, docs examples, deployment images, and package publish output.
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
+ - Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
64
+ - The upgrade is classified before editing as patch, minor, major, pre-1.0, security fix, transitive-only, toolchain-only, generated-output, runtime-engine, CI-image, or broad refresh.
65
+
66
+ <!-- mustflow-section: allowed-edits -->
67
+ ## Allowed Edits
68
+
69
+ - Align dependency declarations, lockfiles, generated outputs, compatibility code, tests, docs, and package metadata that are directly required by the upgrade.
70
+ - Prefer the minimum version change that satisfies the feature or advisory.
71
+ - Keep unrelated modernization, formatting churn, dependency family refreshes, and broad package-manager rewrites out of a narrow upgrade.
72
+ - Do not delete and recreate lockfiles to hide the dependency graph change.
73
+ - Do not weaken tests, scanners, coverage gates, type checks, peer warnings, engine checks, or generated-output assertions to make an upgrade pass.
74
+
75
+ <!-- mustflow-section: procedure -->
76
+ ## Procedure
77
+
78
+ 1. Name the upgrade and classify it: direct or transitive, runtime or development, patch/minor/major/pre-1.0/security/toolchain/generated/CI-image, and narrow or broad.
79
+ 2. Identify the ecosystem and read the matching declaration surfaces.
80
+ - JavaScript and TypeScript: package metadata, lockfile, workspace files, package-manager config, runtime version, TypeScript config, bundler/framework/test config, generated clients, and publish files.
81
+ - Python: project metadata, dependency groups, constraints, lockfiles, requirements files, Python version files, test matrix, build backend, and packaging output.
82
+ - Go: module files, workspace file, checksum file, vendored module metadata, generated code hooks, tool dependencies, and toolchain expectations.
83
+ - Rust: manifest, lockfile, toolchain file, cargo config, features, default features, target-specific dependencies, build scripts, generated bindings, and crate publish surface.
84
+ - JVM, .NET, Ruby, PHP, Swift: manifests, lockfiles, package-manager wrappers, toolchain files, dependency mediation rules, generated artifacts, and publish metadata.
85
+ - Docker and CI: base image tags or digests, action versions, setup-tool versions, cache keys, matrix versions, deployment image metadata, and runtime smoke surfaces.
86
+ 3. Build a dependency ledger before editing: old version, new version, direct or transitive path, source registry or image source, lockfile entry, integrity or checksum, engine or platform requirement, peer or feature changes, optional or platform-specific packages, and generated-output changes.
87
+ 4. For patch upgrades, verify that the patch does not change runtime defaults, parser strictness, security behavior, peer requirements, engine support, native binaries, module format, generated output, or install scripts.
88
+ 5. For minor upgrades, read release notes or migration notes when available. Check new defaults, deprecations, peer and engine changes, plugin compatibility, generated output, bundle size, runtime adapter behavior, and framework integration behavior.
89
+ 6. For major upgrades, treat the change as a migration. Require migration notes, public API change classification, config schema review, CLI flag review, plugin API review, codemod or manual migration notes, full caller review, rollback plan, and broad verification.
90
+ 7. For pre-1.0 or calendar-versioned packages, do not trust SemVer labels. Classify risk by actual contract changes and release notes.
91
+ 8. For security upgrades, keep the patch narrow. Identify advisory id, affected range, fixed range, direct or transitive path, exploit-relevant code path, minimum patched version, scanner recheck, and whether stricter validation, escaping, TLS, redirect, auth, or parser behavior can break callers.
92
+ 9. Review the lockfile as a graph, not a blob. Check direct and transitive replacements, newly introduced packages, removed packages, optional/platform packages, source URLs, integrity or checksum changes, peer resolution, engine requirements, native prebuilds, and postinstall or lifecycle scripts.
93
+ 10. Review runtime boundaries that dependency upgrades commonly break: ESM/CJS and package `type`, `exports` and conditional exports, browser/node/edge conditions, Node engine support, Python dependency markers and extras, Go module path changes, Cargo feature unification, native builds, SSR/client split, WebView/native split, and generated client or SDK types.
94
+ 11. Treat framework, plugin, code generator, formatter, linter, bundler, ORM, protobuf, OpenAPI, GraphQL, database driver, and test-runner upgrades as behavior changes when their output, config schema, plugin API, CLI flags, or generated code can change.
95
+ 12. For new dependencies introduced by the upgrade, invoke the `dependency-reality-check` decision path: license, maintainer risk, provenance, lifecycle scripts, binary downloads, package age, transitive size, supply-chain risk, and replacement path.
96
+ 13. For Docker base images and CI actions, review them as dependencies. Check image/action source, version pinning policy, digest use when required, runtime version changes, security patch reason, cache impact, and deployment smoke coverage.
97
+ 14. Synchronize dependent surfaces: generated code, snapshots, mocks, fixtures, examples, SDK clients, OpenAPI or GraphQL artifacts, README install guidance, migration docs, changelog, Docker/CI docs, and package publish metadata.
98
+ 15. Select verification from the command contract based on risk. Patch and narrow transitive changes can use focused checks when they cover the touched path; major, framework, runtime-engine, generated-output, security-sensitive, Docker, or CI-action updates need broader checks.
99
+ 16. Report skipped checks explicitly. If the command contract lacks a dependency graph or package verification intent, do not invent raw package-manager commands; report the missing configured intent.
100
+
101
+ <!-- mustflow-section: postconditions -->
102
+ ## Postconditions
103
+
104
+ - The final state shows exactly which dependency contract changed and why.
105
+ - The lockfile and declaration files agree.
106
+ - Direct and transitive changes are understood, not hidden behind lockfile volume.
107
+ - Runtime engine, peer dependency, optional/platform package, feature, module-format, generated-output, and publish-surface risks are classified.
108
+ - Security fixes are narrow unless the user explicitly accepted a broader modernization.
109
+ - Tests and scanners were not weakened to pass the upgrade.
110
+
111
+ <!-- mustflow-section: verification -->
112
+ ## Verification
113
+
114
+ Use configured oneshot command intents when available:
115
+
116
+ - `changes_status`
117
+ - `changes_diff_summary`
118
+ - `lint`
119
+ - `build`
120
+ - `test_related`
121
+ - `test`
122
+ - `docs_validate_fast`
123
+ - `test_release`
124
+ - `mustflow_check`
125
+
126
+ Prefer the narrowest configured intent that proves the actual upgraded dependency path. Use broader verification for major upgrades, runtime or framework upgrades, security-sensitive dependencies, generated-output changes, publish-surface changes, Docker image changes, CI action changes, and package-manager behavior changes.
127
+
128
+ <!-- mustflow-section: failure-handling -->
129
+ ## Failure Handling
130
+
131
+ - If release notes, advisory range, fixed range, or migration guidance are missing, mark the upgrade as higher risk instead of calling it safe.
132
+ - If a lockfile diff introduces unrelated dependency churn, split the change or explain why the graph update is necessary.
133
+ - If peer dependency, engine, optional dependency, native build, or platform warnings appear, resolve or report them. Do not dismiss them because the local machine passed.
134
+ - If tests fail after an upgrade, do not delete tests, skip tests, loosen assertions, lower coverage, disable scanners, or widen permissions unless the behavior contract intentionally changed and the report says so.
135
+ - If a security upgrade requires broad modernization, split the minimum patch from the modernization when possible.
136
+ - If generated output changes, regenerate from the official generator path and explain the generated diff. Do not hand-edit generated dependency output.
137
+ - If configured verification is missing, report the missing command intent instead of inferring a package-manager command.
138
+
139
+ <!-- mustflow-section: output-format -->
140
+ ## Output Format
141
+
142
+ - Dependency upgraded and reason
143
+ - Ecosystem and package manager surface inspected
144
+ - Direct and transitive graph changes
145
+ - Compatibility classification: patch, minor, major, pre-1.0, security, toolchain, generated-output, Docker, or CI action
146
+ - Runtime, peer, engine, module, feature, platform, generated-output, and publish-surface risks
147
+ - Security advisory and fixed-range notes when relevant
148
+ - Surfaces synchronized
149
+ - Command intents run
150
+ - Skipped dependency checks and reasons
151
+ - Remaining dependency upgrade risk
@@ -0,0 +1,115 @@
1
+ ---
2
+ mustflow_doc: skill.elysia-code-change
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: elysia-code-change
9
+ description: Apply this skill when Elysia routes, schemas, plugins, decorators, derives, guards, auth, error handling, OpenAPI output, Eden clients, or Bun server behavior are created or changed.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.elysia-code-change
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - mustflow_check
24
+ ---
25
+
26
+ # Elysia Code Change
27
+
28
+ <!-- mustflow-section: purpose -->
29
+ ## Purpose
30
+
31
+ Preserve Elysia schema-first runtime validation, type inference, plugin, auth, error, OpenAPI, Eden, and Bun runtime boundaries.
32
+
33
+ <!-- mustflow-section: use-when -->
34
+ ## Use When
35
+
36
+ - `new Elysia`, route methods, `t.Object`, request or response schemas, `.use`, `.guard`, `.derive`, `.decorate`, `.onError`, auth middleware, OpenAPI, Eden, or Bun server tests change.
37
+ - The task adds API routes, plugins, validators, error envelopes, authentication, or generated client contracts.
38
+
39
+ <!-- mustflow-section: do-not-use-when -->
40
+ ## Do Not Use When
41
+
42
+ - The task only edits framework-free service functions called by Elysia routes; use the relevant language or architecture skill.
43
+ - Another web framework owns the route surface.
44
+
45
+ <!-- mustflow-section: required-inputs -->
46
+ ## Required Inputs
47
+
48
+ - Package metadata, Bun lockfile if present, TypeScript config, server entrypoint, route modules, plugin modules, schema/model files, auth/session files, error handling, OpenAPI config, Eden client exports, and tests.
49
+ - Existing response envelope, status-code contract, and strict TypeScript policy.
50
+
51
+ <!-- mustflow-section: preconditions -->
52
+ ## Preconditions
53
+
54
+ - Identify whether schema is the source of truth for runtime validation and type inference.
55
+ - Inventory method, path, params, query, headers, cookies, body, response statuses, auth, and plugin/decorator dependencies.
56
+
57
+ <!-- mustflow-section: allowed-edits -->
58
+ ## Allowed Edits
59
+
60
+ - Define request and response schemas with the route.
61
+ - Keep framework context at the route boundary and move only framework-free business logic into services.
62
+ - Preserve plugin, decorator, derive, and store inference through Elysia chaining.
63
+ - Keep OpenAPI and Eden clients aligned with route schemas when present.
64
+
65
+ <!-- mustflow-section: procedure -->
66
+ ## Procedure
67
+
68
+ 1. Read server entry, routes, plugins, schemas, auth, error handling, OpenAPI, Eden exports, and tests.
69
+ 2. Build a route inventory for the changed surface.
70
+ 3. Add or update schemas for every external input and meaningful response status.
71
+ 4. Do not annotate handlers with broad `any`, duplicated manual interfaces, or imported `Context` types that erase inference.
72
+ 5. Keep request-specific state out of module-level mutable globals.
73
+ 6. Centralize expected error envelope and auth failure behavior.
74
+ 7. If OpenAPI or Eden is used, confirm the generated contract follows the schema change.
75
+ 8. Choose configured verification intents that cover types, server boot, route happy path, validation failure, auth failure, OpenAPI, and Eden inference when available.
76
+
77
+ <!-- mustflow-section: postconditions -->
78
+ ## Postconditions
79
+
80
+ - Schemas, runtime validation, and inferred types remain one contract.
81
+ - Error and auth responses are consistent.
82
+ - OpenAPI and Eden impact is known.
83
+ - No route relies on unvalidated input or erased context types.
84
+
85
+ <!-- mustflow-section: verification -->
86
+ ## Verification
87
+
88
+ Use configured oneshot command intents when available:
89
+
90
+ - `lint`
91
+ - `build`
92
+ - `test_related`
93
+ - `test`
94
+ - `docs_validate_fast`
95
+ - `mustflow_check`
96
+
97
+ Report missing route, OpenAPI, or Eden verification intents when relevant.
98
+
99
+ <!-- mustflow-section: failure-handling -->
100
+ ## Failure Handling
101
+
102
+ - If schema and manual types diverge, make schema the source of truth or report the competing contract.
103
+ - If plugin inference breaks after extraction, return context-sensitive code to the Elysia chain or narrow the extraction.
104
+ - If auth behavior is unclear, stop the route change and inspect or request the auth contract.
105
+
106
+ <!-- mustflow-section: output-format -->
107
+ ## Output Format
108
+
109
+ - Boundary checked
110
+ - Schema and type inference notes
111
+ - Auth, error, OpenAPI, or Eden impact
112
+ - Files changed
113
+ - Command intents run
114
+ - Skipped checks and reasons
115
+ - Remaining Elysia risk
@@ -0,0 +1,147 @@
1
+ ---
2
+ mustflow_doc: skill.file-path-cross-platform-change
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: file-path-cross-platform-change
9
+ description: Apply this skill when file path handling, cross-platform path behavior, path helpers, safe filesystem wrappers, temp or cache paths, atomic writes, locks, archive extraction, uploads, downloads, scanners, CLI/API/schema path contracts, snapshots, generated outputs, or package artifact paths are created, changed, reviewed, or reported.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.file-path-cross-platform-change
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - test_release
24
+ - mustflow_check
25
+ ---
26
+
27
+ # File Path Cross-Platform Change
28
+
29
+ <!-- mustflow-section: purpose -->
30
+ ## Purpose
31
+
32
+ Treat file paths as security boundaries and operating-system contracts, not as ordinary strings.
33
+
34
+ <!-- mustflow-section: use-when -->
35
+ ## Use When
36
+
37
+ - Code accepts, stores, serializes, validates, normalizes, joins, resolves, compares, scans, extracts, uploads, downloads, writes, deletes, locks, packages, or reports paths.
38
+ - Path behavior appears in CLI arguments, API request or response schemas, config files, snapshots, fixtures, generated output, package artifacts, logs, manifests, caches, temp directories, upload or download flows, archive extraction, or scanner output.
39
+ - A change claims path traversal safety, base-directory containment, symlink safety, junction or reparse-point safety, archive extraction safety, atomic write behavior, durable write behavior, lock ownership, cleanup safety, deterministic scanning, or Windows/macOS/Linux compatibility.
40
+ - A test or docs example includes paths that must behave consistently across Windows, macOS, Linux, CI, containers, archives, package artifacts, or user machines.
41
+
42
+ <!-- mustflow-section: do-not-use-when -->
43
+ ## Do Not Use When
44
+
45
+ - The task only changes in-memory labels and no path is interpreted by an OS, runtime, CLI, API, archive, scanner, package manager, or filesystem helper.
46
+ - The task only changes Git line-ending policy; use `line-ending-hygiene`.
47
+ - A generated artifact is only referenced or packaged and no path validation, path generation, or artifact path contract changes; use `artifact-integrity-check`.
48
+ - The task is only a narrow low-level filesystem helper change with no public path contract; `cross-platform-filesystem-safety` can be used as the narrower adjunct.
49
+
50
+ <!-- mustflow-section: required-inputs -->
51
+ ## Required Inputs
52
+
53
+ - Every path input and output, including user input, CLI args, API fields, config fields, archive entries, generated files, temp files, cache paths, lock files, uploaded filenames, download filenames, scanner roots, package artifact paths, and logs.
54
+ - The path owner and trust class: user-controlled, repository-owned, generated, temp, cache, archive-contained, package artifact, external file, or unknown.
55
+ - The base directory or allowed root, expected relative/absolute policy, symlink and reparse-point policy, case-sensitivity policy, invalid-name policy, atomic-write policy, lock policy, archive extraction policy, scanner bounds, cleanup policy, and platform expectations.
56
+ - Current path helpers, safe filesystem wrappers, temp/cache helpers, archive helpers, upload/download helpers, scanners, schema validators, snapshots, and tests.
57
+ - Relevant command-intent entries for build, tests, docs, release, and mustflow validation.
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
+ - Existing path helpers and safe filesystem wrappers have been inspected before adding a new helper.
64
+ - Security and privacy review is applied first when paths can expose secrets, personal data, uploaded files, downloaded files, or files outside an owned root.
65
+ - The path contract is classified before editing: internal helper, public CLI, public API, schema, generated output, snapshot, package artifact, archive, upload/download, scanner, temp/cache, lock, or cleanup.
66
+
67
+ <!-- mustflow-section: allowed-edits -->
68
+ ## Allowed Edits
69
+
70
+ - Update path validators, path helpers, safe filesystem wrappers, schemas, CLI parsing, API contracts, snapshots, fixtures, docs, tests, package metadata, generated-output paths, archive extraction, scanner bounds, temp/cache handling, locks, and cleanup code that are directly needed for safe path behavior.
71
+ - Prefer existing repository path helpers and one shared path contract over ad hoc string manipulation.
72
+ - Keep path display format stable for users and automation. Prefer repository-relative paths in output unless absolute paths are required for local diagnosis.
73
+ - Do not broaden filesystem access, cleanup roots, scanner roots, archive extraction roots, package artifact globs, or upload/download destinations to make a path bug disappear.
74
+
75
+ <!-- mustflow-section: procedure -->
76
+ ## Procedure
77
+
78
+ 1. Build a path ledger. List every path field, argument, helper, schema, snapshot, generated output, package artifact, archive entry, upload/download filename, scanner root, temp/cache path, lock file, and cleanup target touched by the change.
79
+ 2. Classify each path by trust and owner: trusted repository path, user input, generated state, template path, package artifact, temporary file, cache file, archive-contained path, external path, uploaded name, downloaded name, scanner root, or unknown.
80
+ 3. Define the allowed root and representation. Decide whether the contract accepts relative paths, absolute paths, URLs, file URLs, archive entry names, package-relative paths, repository-relative paths, or display-only paths.
81
+ 4. Reject dangerous path text before filesystem access: null bytes, empty names where not allowed, absolute paths where relative paths are required, dot segments where not allowed, Windows device names, drive-relative paths, UNC roots, namespace prefixes, alternate data streams, trailing dots or spaces, reserved characters, and mixed separator bypasses.
82
+ 5. Treat Windows drive-relative paths such as `C:tmp.txt` as relative to a drive current directory, not as `C:\tmp.txt`.
83
+ 6. Treat Windows reserved names as reserved even with extensions. Names such as `CON`, `PRN`, `AUX`, `NUL`, `COM1`, and `LPT1` must not become ordinary user filenames.
84
+ 7. Treat macOS and Windows case-insensitive defaults as compatibility risks. Decide whether to reject case-only collisions, preserve spelling, normalize display only, or rely on the host filesystem.
85
+ 8. Do not solve containment with string prefixes. Establish the base real path, resolve or canonicalize the candidate parent when possible, then use path-aware relative containment with a separator boundary.
86
+ 9. For new files whose final path does not exist yet, canonicalize the existing parent directory and verify that parent remains inside the allowed root.
87
+ 10. Recheck symlink, junction, reparse-point, and final-target behavior at the operation boundary where the runtime allows it. Do not claim race-free behavior from normalize-then-open code alone.
88
+ 11. For uploads and downloads, separate displayed filename from storage key. Validate extension, size, content type, magic bytes when relevant, path separators, Unicode aliasing, reserved names, collision policy, overwrite policy, and tenant or user ownership.
89
+ 12. For archive extraction, validate every entry before extraction. Reject absolute entries, parent traversal, empty names, platform-reserved names, symlink entries unless explicitly supported, hard links unless explicitly supported, duplicate or case-colliding entries, oversized entries, zip bombs, and extraction outside the target root.
90
+ 13. Do not call extract-all behavior on untrusted archives unless the helper performs per-entry validation and bounded extraction.
91
+ 14. For atomic writes, create the temporary file in the target directory on the same filesystem, use an unpredictable temp name, write, flush, close, replace or rename, and flush the parent directory when the platform and helper support it.
92
+ 15. Scope atomicity claims. Cross-filesystem moves, network filesystems, Windows sharing violations, antivirus/indexer locks, and missing directory fsync support can downgrade a claim to best effort.
93
+ 16. For Windows replace or rename failures caused by sharing violations, use bounded retry or report the platform limitation. Do not turn every transient lock into silent data loss.
94
+ 17. For locks and mutexes, define owner token, stale lock policy, crash recovery, deletion race handling, PID reuse handling, and whether the lock works on local filesystems only. Do not treat a PID file alone as proof of ownership.
95
+ 18. For scanners, set max depth, max file count, max file size, binary-file handling, ignored directories, hidden-file policy, permission-error behavior, symlink traversal policy, loop detection, deterministic ordering, and output path format.
96
+ 19. For temp and cache paths, keep them under an owned root, avoid global temp rename into a target location, include cleanup bounds, and avoid leaking user data through predictable names.
97
+ 20. For CLI, API, schema, snapshot, docs, and package artifact path changes, update every contract surface together. Path spelling, separators, slash policy, absolute/relative policy, escaping, sorting, and error messages are part of the contract.
98
+ 21. Add focused tests for the riskiest path shapes: traversal, absolute input, drive-relative input, UNC-like input, reserved names, trailing dots or spaces, case collision, symlink escape, archive traversal, duplicate archive entries, scanner loop, large file cap, and cleanup boundary.
99
+ 22. Select verification from the command contract based on risk. Public CLI/API/schema/package artifact changes need broader checks than internal helper-only changes.
100
+
101
+ <!-- mustflow-section: postconditions -->
102
+ ## Postconditions
103
+
104
+ - Path trust classes, accepted path representation, invalid-name policy, case policy, root boundary, symlink and reparse-point policy, archive policy, upload/download policy, scanner policy, atomic-write policy, lock policy, temp/cache policy, and cleanup policy are explicit.
105
+ - Path contracts are synchronized across helpers, schemas, CLI/API docs, snapshots, fixtures, generated outputs, package artifacts, tests, and reports.
106
+ - Any race-safety, atomicity, durability, lock, or cross-platform claim is scoped to what the current runtime and helpers can actually guarantee.
107
+ - Platform behavior that was not tested is reported as remaining risk.
108
+
109
+ <!-- mustflow-section: verification -->
110
+ ## Verification
111
+
112
+ Use configured oneshot command intents when available:
113
+
114
+ - `changes_status`
115
+ - `changes_diff_summary`
116
+ - `lint`
117
+ - `build`
118
+ - `test_related`
119
+ - `test`
120
+ - `docs_validate_fast`
121
+ - `test_release`
122
+ - `mustflow_check`
123
+
124
+ Prefer focused tests for helper-only path changes. Use release or package checks when CLI output, schemas, snapshots, generated outputs, package artifacts, template paths, or installed workflow files change.
125
+
126
+ <!-- mustflow-section: failure-handling -->
127
+ ## Failure Handling
128
+
129
+ - If root containment is unclear, stop before writing, deleting, extracting, scanning, or opening and report the ambiguous path owner.
130
+ - If the platform cannot prove symlink-safe behavior, fail closed or report the exact remaining gap.
131
+ - If archive entries cannot be validated before extraction, do not extract the archive.
132
+ - If atomic replace, file fsync, parent directory fsync, no-follow open, lock ownership, or final-target verification is unavailable, downgrade the claim and keep the operation bounded.
133
+ - If Windows, macOS, Linux, container, CI, or network-filesystem behavior differs and cannot be tested, state the untested platform boundary.
134
+ - If cleanup might remove user data or files outside generated state, do not proceed without a tighter owned root.
135
+
136
+ <!-- mustflow-section: output-format -->
137
+ ## Output Format
138
+
139
+ - Path contract changed
140
+ - Path ledger and trust classes
141
+ - Accepted representation and base-root policy
142
+ - Windows, macOS, Linux, archive, upload/download, scanner, lock, temp/cache, atomic-write, and cleanup decisions
143
+ - CLI/API/schema/snapshot/generated-output/package artifact surfaces synchronized
144
+ - Tests or fixtures added or reused
145
+ - Command intents run
146
+ - Skipped platform checks and reasons
147
+ - Remaining file path cross-platform risk
@@ -0,0 +1,116 @@
1
+ ---
2
+ mustflow_doc: skill.flutter-code-change
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: flutter-code-change
9
+ description: Apply this skill when Flutter widgets, screens, routing, state management, async UI, platform channels, assets, responsive layout, accessibility, or Flutter tests are created or changed.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.flutter-code-change
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - mustflow_check
24
+ ---
25
+
26
+ # Flutter Code Change
27
+
28
+ <!-- mustflow-section: purpose -->
29
+ ## Purpose
30
+
31
+ Preserve Flutter widget, state owner, build purity, async lifecycle, navigation, platform channel, asset, responsive layout, and accessibility boundaries.
32
+
33
+ <!-- mustflow-section: use-when -->
34
+ ## Use When
35
+
36
+ - Flutter `lib/**.dart`, widgets, screens, routing, state management, platform channels, assets, tests, integration tests, or platform project files change.
37
+ - The task touches `StatefulWidget`, `StatelessWidget`, `setState`, `BuildContext`, navigation, `FutureBuilder`, `StreamBuilder`, controllers, subscriptions, `MethodChannel`, `pubspec.yaml` assets, or responsive layout.
38
+
39
+ <!-- mustflow-section: do-not-use-when -->
40
+ ## Do Not Use When
41
+
42
+ - The change is pure Dart package or CLI logic with no Flutter UI/lifecycle surface; use `dart-code-change`.
43
+ - The task only reads Flutter code for orientation.
44
+
45
+ <!-- mustflow-section: required-inputs -->
46
+ ## Required Inputs
47
+
48
+ - `pubspec.yaml`, analyzer config, app root, route config, state management setup, target screen, parent widgets, assets, platform channel files, and tests.
49
+ - Existing state management, navigation, accessibility, theming, and responsive layout conventions.
50
+ - Configured verification intents.
51
+
52
+ <!-- mustflow-section: preconditions -->
53
+ ## Preconditions
54
+
55
+ - Identify widget tree owner, state owner, route owner, async source, platform boundary, asset declaration, and verification surface.
56
+ - Keep `build` as UI description, not a side-effect runner.
57
+
58
+ <!-- mustflow-section: allowed-edits -->
59
+ ## Allowed Edits
60
+
61
+ - Put network calls, subscriptions, controllers, timers, analytics, navigation side effects, and snackbars in the proper lifecycle or event boundary.
62
+ - Use the project's existing state management and routing style.
63
+ - Use constraints and layout information rather than device-name assumptions.
64
+ - Dispose controllers, streams, timers, animations, and subscriptions.
65
+
66
+ <!-- mustflow-section: procedure -->
67
+ ## Procedure
68
+
69
+ 1. Read app root, route config, parent widgets, state owner, target widget, platform files, assets, and tests.
70
+ 2. Classify the change: widget layout, state, async lifecycle, navigation, platform channel, asset, accessibility, or test-only.
71
+ 3. Do not create futures, streams, controllers, listeners, or side effects inside `build`.
72
+ 4. Keep `setState` narrow and synchronous; do not put awaited work inside the `setState` callback.
73
+ 5. After async gaps, ensure the widget is still mounted before using context or state, and prefer disposing owners so dead widgets are not touched.
74
+ 6. Keep navigation consistent with the project's router.
75
+ 7. If platform channel or native permission changes, verify Dart interface, native implementation, serialization shape, and error shape together.
76
+ 8. Check small width, wide width, long text, text scaling, keyboard/open input states, and screen-reader semantics when relevant.
77
+
78
+ <!-- mustflow-section: postconditions -->
79
+ ## Postconditions
80
+
81
+ - Widget build remains pure.
82
+ - State owner and async lifecycle are clear.
83
+ - Layout responds to constraints and text scaling.
84
+ - Platform, asset, and accessibility risks are checked or reported.
85
+
86
+ <!-- mustflow-section: verification -->
87
+ ## Verification
88
+
89
+ Use configured oneshot command intents when available:
90
+
91
+ - `lint`
92
+ - `build`
93
+ - `test_related`
94
+ - `test`
95
+ - `docs_validate_fast`
96
+ - `mustflow_check`
97
+
98
+ Report missing widget, integration, golden, or platform verification intents when relevant.
99
+
100
+ <!-- mustflow-section: failure-handling -->
101
+ ## Failure Handling
102
+
103
+ - If a lifecycle fix requires repeated mounted checks, inspect ownership and disposal before adding more guards.
104
+ - If layout only works for one viewport, redesign with constraints before finishing.
105
+ - If platform permissions or channels are unclear, stop that part and inspect native config.
106
+
107
+ <!-- mustflow-section: output-format -->
108
+ ## Output Format
109
+
110
+ - Boundary checked
111
+ - State, lifecycle, layout, and accessibility notes
112
+ - Platform or asset impact
113
+ - Files changed
114
+ - Command intents run
115
+ - Skipped checks and reasons
116
+ - Remaining Flutter risk