mustflow 2.22.16 → 2.22.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/dashboard.js +51 -4
- package/dist/cli/commands/explain.js +3 -2
- package/dist/cli/commands/help.js +0 -1
- package/dist/cli/commands/run.js +51 -4
- package/dist/cli/commands/verify.js +2 -1
- package/dist/cli/i18n/en.js +5 -0
- package/dist/cli/i18n/es.js +5 -0
- package/dist/cli/i18n/fr.js +5 -0
- package/dist/cli/i18n/hi.js +5 -0
- package/dist/cli/i18n/ko.js +5 -0
- package/dist/cli/i18n/zh.js +5 -0
- package/dist/cli/lib/cli-output.js +1 -1
- package/dist/cli/lib/dashboard-html/client-script.js +9 -0
- package/dist/cli/lib/dashboard-html/styles.js +48 -1
- package/dist/cli/lib/doc-review-ledger.js +1 -1
- package/dist/cli/lib/git-changes.js +2 -0
- package/dist/cli/lib/local-index/index.js +324 -298
- package/dist/cli/lib/repo-map.js +19 -5
- package/dist/cli/lib/run-plan.js +20 -7
- package/dist/cli/lib/run-root-trust.js +33 -2
- package/dist/cli/lib/validation/index.js +6 -2
- package/dist/cli/lib/validation/test-selection.js +11 -1
- package/dist/core/active-run-locks.js +36 -8
- package/dist/core/atomic-state-write.js +5 -20
- package/dist/core/change-verification.js +18 -2
- package/dist/core/command-intent-eligibility.js +7 -0
- package/dist/core/contract-lint.js +3 -3
- package/dist/core/line-endings.js +2 -0
- package/dist/core/repeated-failure.js +1 -1
- package/dist/core/run-write-drift.js +42 -26
- package/dist/core/safe-filesystem.js +54 -5
- package/dist/core/skill-route-explanation.js +2 -1
- package/dist/core/source-anchors.js +7 -3
- package/dist/core/test-selection.js +13 -2
- package/dist/core/test-target-paths.js +17 -0
- package/dist/core/validation-ratchet.js +62 -17
- package/dist/core/verification-decision-graph.js +8 -1
- package/package.json +1 -1
- package/templates/default/i18n.toml +141 -3
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +24 -1
- package/templates/default/locales/en/.mustflow/skills/api-contract-change/SKILL.md +212 -0
- package/templates/default/locales/en/.mustflow/skills/astro-code-change/SKILL.md +184 -0
- package/templates/default/locales/en/.mustflow/skills/auth-permission-change/SKILL.md +194 -0
- package/templates/default/locales/en/.mustflow/skills/config-env-change/SKILL.md +189 -0
- package/templates/default/locales/en/.mustflow/skills/css-code-change/SKILL.md +199 -0
- package/templates/default/locales/en/.mustflow/skills/dart-code-change/SKILL.md +179 -0
- package/templates/default/locales/en/.mustflow/skills/database-migration-change/SKILL.md +178 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-upgrade-review/SKILL.md +151 -0
- package/templates/default/locales/en/.mustflow/skills/elysia-code-change/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/file-path-cross-platform-change/SKILL.md +147 -0
- package/templates/default/locales/en/.mustflow/skills/flutter-code-change/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/go-code-change/SKILL.md +156 -0
- package/templates/default/locales/en/.mustflow/skills/hono-code-change/SKILL.md +117 -0
- package/templates/default/locales/en/.mustflow/skills/html-code-change/SKILL.md +173 -0
- package/templates/default/locales/en/.mustflow/skills/javascript-code-change/SKILL.md +149 -0
- package/templates/default/locales/en/.mustflow/skills/python-code-change/SKILL.md +154 -0
- package/templates/default/locales/en/.mustflow/skills/release-publish-change/SKILL.md +172 -0
- package/templates/default/locales/en/.mustflow/skills/routes.toml +138 -0
- package/templates/default/locales/en/.mustflow/skills/rust-code-change/SKILL.md +154 -0
- package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +22 -7
- package/templates/default/locales/en/.mustflow/skills/security-regression-tests/SKILL.md +31 -20
- package/templates/default/locales/en/.mustflow/skills/svelte-code-change/SKILL.md +186 -0
- package/templates/default/locales/en/.mustflow/skills/tailwind-code-change/SKILL.md +164 -0
- package/templates/default/locales/en/.mustflow/skills/tauri-code-change/SKILL.md +185 -0
- package/templates/default/locales/en/.mustflow/skills/typescript-code-change/SKILL.md +184 -0
- package/templates/default/locales/en/.mustflow/skills/unocss-code-change/SKILL.md +186 -0
- package/templates/default/manifest.toml +158 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.dart-code-change
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 2
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: dart-code-change
|
|
9
|
+
description: Apply this skill when Dart source, pub package metadata, null safety, async Futures or Streams, isolates, analyzer lints, tests, CLI entry points, or public package APIs are created or changed.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.dart-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
|
+
# Dart Code Change
|
|
27
|
+
|
|
28
|
+
<!-- mustflow-section: purpose -->
|
|
29
|
+
## Purpose
|
|
30
|
+
|
|
31
|
+
Preserve Dart null-safety, async, stream, isolate, package API, analyzer, and test boundaries. Treat `!`, `late`, `dynamic`, broad casts, `.cast<T>()`, `.asBroadcastStream()`, and `unawaited()` as risk markers, not fixes.
|
|
32
|
+
|
|
33
|
+
<!-- mustflow-section: use-when -->
|
|
34
|
+
## Use When
|
|
35
|
+
|
|
36
|
+
- `.dart`, `pubspec.yaml`, `analysis_options.yaml`, lockfiles, `lib`, `bin`, `test`, `example`, or public exports change.
|
|
37
|
+
- The task touches nullable types, `!`, `late`, `dynamic`, casts, raw generics, `Future`, `Stream`, `StreamController`, `StreamSubscription`, isolates, analyzer lints, pub package layout, package exports, `bin` entrypoints, README examples, or package versioning.
|
|
38
|
+
|
|
39
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
40
|
+
## Do Not Use When
|
|
41
|
+
|
|
42
|
+
- The change is Flutter widget or platform UI behavior; use `flutter-code-change` and this skill only as an adjunct for shared Dart package/API risk.
|
|
43
|
+
- Dart files are read only for orientation.
|
|
44
|
+
|
|
45
|
+
<!-- mustflow-section: required-inputs -->
|
|
46
|
+
## Required Inputs
|
|
47
|
+
|
|
48
|
+
- `pubspec.yaml`, analyzer config, package layout, public export files, `lib/src` exports, examples, README snippets, CLI entrypoints, tests, and lockfile policy.
|
|
49
|
+
- Existing null-safety, async, exception, and package API conventions.
|
|
50
|
+
- SDK constraints, dependency constraints, executables, public dependency types, and versioning policy when package API changes.
|
|
51
|
+
- Configured verification intents.
|
|
52
|
+
|
|
53
|
+
<!-- mustflow-section: preconditions -->
|
|
54
|
+
## Preconditions
|
|
55
|
+
|
|
56
|
+
- Identify whether the change affects public exports, `lib/src` exposure, internal implementation, CLI behavior, async lifecycle, package metadata, or tests.
|
|
57
|
+
- Treat nullable values, decoded data, map lookups, user input, streams, subscriptions, ports, and isolate messages as boundaries that need explicit ownership and validation.
|
|
58
|
+
- Classify any public nullability, callback, `Future<T>`, `Stream<T>`, generic bound, or default-value change before editing.
|
|
59
|
+
|
|
60
|
+
<!-- mustflow-section: allowed-edits -->
|
|
61
|
+
## Allowed Edits
|
|
62
|
+
|
|
63
|
+
- Narrow nullable values at boundaries and keep core logic non-null where truthful.
|
|
64
|
+
- Use `unawaited` only when detached behavior is intentional, documented, and has local error handling.
|
|
65
|
+
- Cancel subscriptions, close controllers, and document isolate message shape where relevant.
|
|
66
|
+
- Keep public API changes synchronized with examples and docs.
|
|
67
|
+
- Strengthen analyzer boundaries when the project already uses strict linting; do not weaken analyzer or lint rules to pass the current patch.
|
|
68
|
+
|
|
69
|
+
<!-- mustflow-section: procedure -->
|
|
70
|
+
## Procedure
|
|
71
|
+
|
|
72
|
+
1. Read package metadata, analyzer config, public exports, nearby implementation, tests, and examples.
|
|
73
|
+
2. Classify the touched boundary: nullability, public API, package layout, async `Future`, `Stream`, isolate, exception mapping, or test-only.
|
|
74
|
+
3. Identify every nullable boundary: JSON decode, HTTP response, DB row, environment variable, CLI args, platform channel, isolate message, external callback, cache miss, map lookup, and dependency lookup.
|
|
75
|
+
4. Accept external or decoded data as `Object?` at the boundary, validate it in a parser or codec layer, and let only typed domain objects leave that boundary. Do not let `dynamic` flow into internal code.
|
|
76
|
+
5. Distinguish missing optional data from invalid required data. Optional business facts may stay nullable; required facts should be validated once and remain non-nullable afterward.
|
|
77
|
+
6. Do not use `!`, `dynamic`, `late`, broad `as` casts, raw generic types, or `.cast<T>()` as shortcuts around design uncertainty.
|
|
78
|
+
7. Allow `!` only when the same local block has a visible guard proving non-null and flow analysis cannot express it. Prefer early return, throw, or local-variable promotion.
|
|
79
|
+
8. Avoid `late` fields for initialization-order problems. Prefer constructor injection, async factory construction, explicit state objects, or stored `Future<T>` initialization. `late final` still needs read-after-initialize evidence when public behavior depends on it.
|
|
80
|
+
9. Replace broad JSON and collection casts with checked parsers that report the failing field path when feasible.
|
|
81
|
+
10. Ensure every `Future` is awaited, returned, stored for later awaiting or cancellation, or intentionally detached with documented `unawaited` plus local error handling.
|
|
82
|
+
11. Use `Future<void>` for public async APIs that complete later or can fail but do not produce a value. Avoid public `void async` except where a framework callback type requires it.
|
|
83
|
+
12. Ensure every stream subscription, controller, sink, timer, socket, file watcher, receive port, or isolate has an owner and explicit shutdown path. Await cleanup futures when the API exposes them.
|
|
84
|
+
13. Do not use `.asBroadcastStream()` to hide accidental multiple listens. Determine whether the source is truly broadcast, or create an explicit fan-out owner.
|
|
85
|
+
14. For `StreamController`, connect external resource creation and pause/resume/cancel behavior to the controller lifecycle when buffering or resource usage matters.
|
|
86
|
+
15. For `async*` functions wrapping external resources or upstream subscriptions, release resources in a `finally` path.
|
|
87
|
+
16. For long-lived isolates, define startup, request and response message shapes, error propagation, shutdown messages, receive-port closing, and isolate termination.
|
|
88
|
+
17. Do not import another package's `src` implementation. Treat symbols exported from this package's public libraries as public API even when their files live under `lib/src`.
|
|
89
|
+
18. If public exports change, update examples, README snippets, CLI smoke surfaces, and tests that represent consumer behavior when present.
|
|
90
|
+
19. Choose configured verification intents that cover analyzer, formatting, tests, package build, dependency bounds, publish dry-run, examples, CLI behavior, and public API risk when available.
|
|
91
|
+
|
|
92
|
+
<!-- mustflow-section: null-safety-policy -->
|
|
93
|
+
## Null-Safety Policy
|
|
94
|
+
|
|
95
|
+
- `!`, `late`, `dynamic`, broad `as`, raw generic types, `.cast<T>()`, and nullable-to-non-nullable casts are risk markers.
|
|
96
|
+
- Nullable values should be narrowed at the boundary. Core domain objects should be non-nullable when the value is required.
|
|
97
|
+
- `Object?` is preferred over `dynamic` for raw external input because it forces validation before use.
|
|
98
|
+
- Required fields that are missing should fail at the parser or constructor boundary. Do not make required domain fields nullable only to avoid validation.
|
|
99
|
+
- `late` should not hide initialization order. Use it only when local construction or framework lifecycle makes the initialization proof clear and the risk is reported.
|
|
100
|
+
- Public API nullability changes require compatibility classification before version changes.
|
|
101
|
+
|
|
102
|
+
<!-- mustflow-section: async-resource-policy -->
|
|
103
|
+
## Async And Resource Policy
|
|
104
|
+
|
|
105
|
+
- Every future expression must be awaited, returned, stored for later awaiting or cancellation, or intentionally detached with documented `unawaited` and local error handling.
|
|
106
|
+
- `unawaited` must not be used only to silence analyzer warnings. Detached work needs an error sink and a reason.
|
|
107
|
+
- `Future` error handling should be attached before the future completes; prefer straightforward `await` with try/catch where local recovery is needed.
|
|
108
|
+
- Every `StreamSubscription` needs an owner and a lifecycle method that cancels it.
|
|
109
|
+
- Every `StreamController`, sink, timer, socket, watcher, port, or isolate needs an explicit close, cancel, kill, or shutdown path.
|
|
110
|
+
- Long-lived isolates must define message contracts, errors, shutdown, port ownership, and termination behavior.
|
|
111
|
+
|
|
112
|
+
<!-- mustflow-section: public-api-policy -->
|
|
113
|
+
## Package Public API Policy
|
|
114
|
+
|
|
115
|
+
Public surface includes importable files under `lib`, exports from the main library, exported `lib/src` symbols, public classes, functions, typedefs, extensions, enums, constructors, fields, getters, setters, generic bounds, callback signatures, future and stream element types, documented errors, and `bin` executables.
|
|
116
|
+
|
|
117
|
+
- Do not treat `lib/src` as public unless a public library exports it.
|
|
118
|
+
- Do not import another package's `lib/src`.
|
|
119
|
+
- Nullability, required named parameters, default values, generic bounds, callback signatures, `Future<T>` and `Stream<T>` element types, dependency types in public signatures, CLI args, stdout/stderr shape, and exit codes are compatibility-sensitive.
|
|
120
|
+
- If a public API exposes a dependency type, dependency constraints become part of the public contract. Check lower-bound and upper-range compatibility when configured verification exists.
|
|
121
|
+
- README and `example` code are consumer smoke surfaces. Keep them aligned with public API changes.
|
|
122
|
+
- CLI entries under `bin` are public behavior. Command names, args, exit codes, and output formats need compatibility review.
|
|
123
|
+
|
|
124
|
+
<!-- mustflow-section: rejection-criteria -->
|
|
125
|
+
## Review Rejection Criteria
|
|
126
|
+
|
|
127
|
+
Reject or revise the patch when any of these appear without explicit evidence and risk reporting:
|
|
128
|
+
|
|
129
|
+
- New `!`, `late`, `dynamic`, raw generic types, broad `as`, `.cast<T>()`, nullable-to-non-nullable casts, or analyzer ignores used only to make errors disappear.
|
|
130
|
+
- Decoded JSON, platform messages, isolate messages, CLI args, environment values, map lookups, or external callbacks trusted without boundary parsing.
|
|
131
|
+
- Required domain values made nullable instead of validating the boundary.
|
|
132
|
+
- A future expression is neither awaited, returned, stored, nor intentionally detached with error handling.
|
|
133
|
+
- Public `void async` is added where `Future<void>` would preserve completion and error signaling.
|
|
134
|
+
- Stream subscriptions, controllers, ports, timers, sockets, watchers, or isolates are created without cleanup ownership.
|
|
135
|
+
- `.asBroadcastStream()` is used to hide a design problem around multiple listeners.
|
|
136
|
+
- Public nullability, generic bound, callback, `Future<T>`, `Stream<T>`, export, CLI, SDK constraint, dependency constraint, or executable behavior changes without compatibility classification.
|
|
137
|
+
|
|
138
|
+
<!-- mustflow-section: postconditions -->
|
|
139
|
+
## Postconditions
|
|
140
|
+
|
|
141
|
+
- Nullability and async ownership are explicit.
|
|
142
|
+
- Public package API impact is known.
|
|
143
|
+
- Analyzer and tests were preserved or skipped with reason.
|
|
144
|
+
- No safety boundary was hidden behind `!`, `dynamic`, `late`, casts, `unawaited`, or analyzer ignores without a risk note.
|
|
145
|
+
- Examples, README snippets, CLI entrypoints, and package metadata are synchronized when public behavior changes.
|
|
146
|
+
|
|
147
|
+
<!-- mustflow-section: verification -->
|
|
148
|
+
## Verification
|
|
149
|
+
|
|
150
|
+
Use configured oneshot command intents when available:
|
|
151
|
+
|
|
152
|
+
- `lint`
|
|
153
|
+
- `build`
|
|
154
|
+
- `test_related`
|
|
155
|
+
- `test`
|
|
156
|
+
- `docs_validate_fast`
|
|
157
|
+
- `mustflow_check`
|
|
158
|
+
|
|
159
|
+
Report missing package publish or analyzer verification intents rather than inventing tool commands.
|
|
160
|
+
|
|
161
|
+
When the repository exposes configured intents for these surfaces, cover strict analyzer checks, tests, package dry-run, dependency lower and upper bound checks, example or README analysis, CLI smoke behavior, and consumer-style public-import checks.
|
|
162
|
+
|
|
163
|
+
<!-- mustflow-section: failure-handling -->
|
|
164
|
+
## Failure Handling
|
|
165
|
+
|
|
166
|
+
- If nullable data cannot be narrowed safely, report the missing validation boundary.
|
|
167
|
+
- If stream or isolate lifetime is unclear, avoid adding more asynchronous ownership until the owner is identified.
|
|
168
|
+
- If public API compatibility is unclear, report the consumer risk and the changed public symbols or executables.
|
|
169
|
+
- If analyzer/lint rules block the patch, fix the code or report the real boundary issue instead of weakening analysis.
|
|
170
|
+
|
|
171
|
+
<!-- mustflow-section: output-format -->
|
|
172
|
+
## Output Format
|
|
173
|
+
|
|
174
|
+
- Boundary checked
|
|
175
|
+
- Nullability, async, stream, or API notes
|
|
176
|
+
- Files changed
|
|
177
|
+
- Command intents run
|
|
178
|
+
- Skipped checks and reasons
|
|
179
|
+
- Remaining Dart risk
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.database-migration-change
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: database-migration-change
|
|
9
|
+
description: Apply this skill when database migration files, schema migration history, ORM schema migrations, generated clients, schema dumps, SQL snapshots, backfills, rolling deploy compatibility, expand-and-contract changes, destructive database changes, migration rollback claims, or production database migration procedures 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.database-migration-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
|
+
# Database Migration Change
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Keep database migrations safe for running systems by checking deploy compatibility, data preservation, backfill behavior, generated artifacts, ORM contracts, and rollback reality.
|
|
33
|
+
|
|
34
|
+
Do not treat migration authoring as "make a file that applies locally." Treat it as "old code and new code must survive the same database during rollout."
|
|
35
|
+
|
|
36
|
+
<!-- mustflow-section: use-when -->
|
|
37
|
+
## Use When
|
|
38
|
+
|
|
39
|
+
- A database migration file, migration history entry, schema dump, ORM schema, SQL snapshot, generated client, seed, fixture, schema validator, or migration documentation is created or changed.
|
|
40
|
+
- A change adds, removes, renames, splits, merges, backfills, rewrites, validates, constrains, indexes, foreign-keys, type-changes, defaults, nullable rules, enum values, tables, columns, generated columns, triggers, views, functions, row-level policies, or data migrations.
|
|
41
|
+
- A task mentions rolling deploy, expand-and-contract, online migration, backfill, production schema change, rollback, down migration, migration lock, DDL transaction, generated ORM client, migration drift, schema drift, or database migration safety.
|
|
42
|
+
- Prisma, Drizzle, TypeORM, Rails Active Record, Django migrations, Alembic, Diesel, Ecto, Flyway, Liquibase, Knex, Sequelize, SQLx, or another migration tool changes schema, generated output, migration metadata, or deployment behavior.
|
|
43
|
+
- A final report claims a database migration is safe, reversible, applied, validated, production-ready, no-downtime, rollback-safe, or tested from an old schema.
|
|
44
|
+
|
|
45
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
46
|
+
## Do Not Use When
|
|
47
|
+
|
|
48
|
+
- The change only edits query logic or persisted data model code without a migration, generated schema artifact, or migration claim; use `database-change-safety`.
|
|
49
|
+
- The migration is not database-backed, such as file layout, template, cache, content, URL, export, import, or platform migration; use `migration-safety-check`.
|
|
50
|
+
- The task only discusses database design without changing or reporting migration behavior.
|
|
51
|
+
|
|
52
|
+
<!-- mustflow-section: required-inputs -->
|
|
53
|
+
## Required Inputs
|
|
54
|
+
|
|
55
|
+
- Source schema, target schema, migration files, migration history table or metadata, generated clients, schema dumps, SQL snapshots, seeds, fixtures, and affected queries.
|
|
56
|
+
- Migration tool and ecosystem: Prisma, Drizzle, TypeORM, Rails, Django, Alembic, Diesel, Ecto, Flyway, Liquibase, Knex, Sequelize, SQLx, raw SQL, or another declared tool.
|
|
57
|
+
- Deployment shape: single-step deploy, rolling deploy, blue-green, multiple app versions, background workers, read replicas, multiple services, serverless functions, mobile clients, or external integrations.
|
|
58
|
+
- Database engine and operational surface: PostgreSQL, MySQL, SQLite, SQL Server, managed database, migration lock behavior, DDL transaction behavior, online DDL options, table size, expected lock time, statement timeout, lock timeout, and restore capability when known.
|
|
59
|
+
- Data preservation needs, compatibility window, backfill size, batch strategy, restart marker, validation query, rollback type, and whether old code can run after the new schema lands.
|
|
60
|
+
- Relevant command-intent entries for build, generated-output checks, tests, docs, release, and mustflow validation.
|
|
61
|
+
|
|
62
|
+
<!-- mustflow-section: preconditions -->
|
|
63
|
+
## Preconditions
|
|
64
|
+
|
|
65
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
66
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
67
|
+
- The migration is classified before editing as expand, backfill, switch, contract, destructive, data-only, schema-only, generated-output-only, ORM metadata-only, or rollback documentation.
|
|
68
|
+
- If personal data, tenant isolation, authorization, audit, retention, or secrets are involved, also use `security-privacy-review`.
|
|
69
|
+
- If public API response shape changes because of the migration, also use `api-contract-change`.
|
|
70
|
+
- If file paths or storage keys change with the database migration, also use `file-path-cross-platform-change`.
|
|
71
|
+
|
|
72
|
+
<!-- mustflow-section: allowed-edits -->
|
|
73
|
+
## Allowed Edits
|
|
74
|
+
|
|
75
|
+
- Update migration files, ORM schema files, generated client expectations, schema dumps, SQL snapshots, seeds, fixtures, compatibility code, backfill code, validation checks, docs, and tests directly required by the migration.
|
|
76
|
+
- Prefer expand-and-contract for live systems: add compatible shape, backfill safely, switch reads and writes, then contract only after compatibility is proven.
|
|
77
|
+
- Keep destructive cleanup separate from expansion unless the repository explicitly proves a single-step deployment is safe.
|
|
78
|
+
- Do not weaken tests, delete migration history, hand-edit generated client output, suppress migration drift, or claim rollback safety for lossy changes.
|
|
79
|
+
|
|
80
|
+
<!-- mustflow-section: procedure -->
|
|
81
|
+
## Procedure
|
|
82
|
+
|
|
83
|
+
1. Classify the migration surface: schema DDL, data migration, backfill, generated client, schema dump, ORM metadata, seed, fixture, migration docs, or deploy procedure.
|
|
84
|
+
2. Read the tool-specific source of truth before editing.
|
|
85
|
+
- Prisma: schema file, migrations directory, generated client use, migration history expectations, production deploy flow, and drift behavior.
|
|
86
|
+
- Drizzle: schema exports, generated SQL, snapshot or meta files, migration journal, generated client or query types, and runtime schema imports.
|
|
87
|
+
- TypeORM: entity metadata, migration files, data-source config, production synchronization setting, generated SQL, and runtime entity loading.
|
|
88
|
+
- Rails: migration files, schema dump, model validations, historical migration model usage, seeds, fixtures, callbacks, and deploy order.
|
|
89
|
+
- Django: migration files, state operations, historical models, schema editor behavior, generated SQL when relevant, and data migration functions.
|
|
90
|
+
- Alembic or SQLAlchemy: migration revisions, autogenerate output, branch heads, model metadata, downgrade functions, naming conventions, and generated SQL.
|
|
91
|
+
- Diesel, Ecto, Flyway, Liquibase, Knex, Sequelize, SQLx, and raw SQL: migration history, checked-in SQL, generated metadata, compile-time query checks, rollback files, and schema dumps.
|
|
92
|
+
3. Build a migration ledger: old shape, new shape, rows affected, old code behavior, new code behavior, rollback expectation, generated artifact changes, dependent callers, and validation query.
|
|
93
|
+
4. Classify compatibility.
|
|
94
|
+
- Old code on old schema.
|
|
95
|
+
- Old code on expanded schema.
|
|
96
|
+
- New code on expanded schema.
|
|
97
|
+
- New code after backfill.
|
|
98
|
+
- New code after contract.
|
|
99
|
+
If any required state fails, the migration is not rolling-deploy safe.
|
|
100
|
+
5. For column add, decide nullability, default behavior, backfill strategy, write path, read fallback, index need, and when a future `NOT NULL` or constraint can be enforced.
|
|
101
|
+
6. For column drop, first prove all reads, writes, generated clients, old app versions, jobs, analytics, exports, seeds, fixtures, docs, and external consumers stopped using the column. Treat drop as a contract phase, not as the first migration.
|
|
102
|
+
7. For rename, do not implement rename as drop plus add unless data loss is explicitly intended and approved. Prefer add new column, dual-write or copy, backfill, switch reads, validate, then drop old column later.
|
|
103
|
+
8. For type changes, check whether the database rewrites the table, whether old values can fail conversion, whether indexes or constraints rebuild, whether application serializers change, and whether API or generated client types change.
|
|
104
|
+
9. For nullable and default changes, distinguish schema default from application default. Avoid assuming existing rows are backfilled by a new default.
|
|
105
|
+
10. For constraints and foreign keys, use staged validation when the database supports it. Add the constraint without validating existing rows when appropriate, backfill or repair data, then validate in a separate phase.
|
|
106
|
+
11. For indexes, check table size, write load, lock behavior, concurrent or online index support, uniqueness validation, existing duplicates, and whether generated ORM queries will use the index.
|
|
107
|
+
12. For enum changes, check old code behavior, generated client unions, database enum migration limits, default values, serialization, API compatibility, and whether removing or renaming values requires a data migration first.
|
|
108
|
+
13. For table split, table merge, or relationship rewrite, preserve stable identifiers, foreign keys, audit references, external IDs, permissions, search documents, exports, and old-to-new mapping until all callers switch.
|
|
109
|
+
14. For backfills, make them bounded, restartable, observable, and validated. Define batch size, ordering key, checkpoint, retry behavior, idempotency, timeout, lock expectation, dead-letter or manual review behavior, and validation queries.
|
|
110
|
+
15. Do not run or recommend full-table updates on production-sized data without measured volume, lock expectation, batch plan, timeout policy, and recovery plan.
|
|
111
|
+
16. Keep external side effects out of database migrations unless the repository has an explicit recovery model. Sending emails, calling payment APIs, deleting files, or mutating external providers from a migration usually breaks rollback.
|
|
112
|
+
17. Check generated surfaces after schema changes: ORM clients, types, SQL snapshots, schema dumps, OpenAPI or GraphQL projections, API mocks, fixtures, seeds, admin screens, analytics, ETL, BI queries, and docs examples.
|
|
113
|
+
18. Review ORM-specific traps.
|
|
114
|
+
- Prisma generated client and migration history must match the migration files that production applies.
|
|
115
|
+
- Drizzle schema exports and generated SQL or snapshots must not drift.
|
|
116
|
+
- TypeORM production `synchronize` must not be used as a migration strategy.
|
|
117
|
+
- Django rename detection and autogeneration must be reviewed so rename does not become delete and create.
|
|
118
|
+
- Alembic autogenerate output is a candidate, not a reviewed migration.
|
|
119
|
+
- Rails migrations should not depend on current model callbacks or validations when historical data can outlive current model code.
|
|
120
|
+
19. Decide rollback honestly.
|
|
121
|
+
- Reversible: schema-only and data-preserving.
|
|
122
|
+
- Forward-fix preferred: partial live migration can be corrected without restoring.
|
|
123
|
+
- Restore required: deletes, table merges, generated IDs, hashing, encryption, irreversible type conversions, external side effects, or lossy transforms.
|
|
124
|
+
Do not promise rollback for changes that cannot reconstruct old values.
|
|
125
|
+
20. Rehearse from the previous production-like schema when possible. A migration that only applies to a freshly generated schema is not enough.
|
|
126
|
+
21. Check dependent surfaces: application code, background jobs, cron tasks, workers, ETL, reports, admin tools, data exports, imports, mobile or older clients, webhooks, API clients, generated SDKs, test fixtures, seeds, docs, and monitoring.
|
|
127
|
+
22. Select verification from the command contract. Major schema changes, generated client changes, rollback-sensitive changes, security-sensitive migrations, and production deployment changes need broader verification than local schema-only edits.
|
|
128
|
+
|
|
129
|
+
<!-- mustflow-section: postconditions -->
|
|
130
|
+
## Postconditions
|
|
131
|
+
|
|
132
|
+
- Source schema, target schema, migration files, generated artifacts, schema dumps, seeds, fixtures, and dependent code agree.
|
|
133
|
+
- Expand, backfill, switch, and contract phases are separated or explicitly proven unnecessary.
|
|
134
|
+
- Old-code/new-schema and new-code/expanded-schema compatibility is classified.
|
|
135
|
+
- Backfill and validation behavior is bounded, restartable, and checkable where relevant.
|
|
136
|
+
- Rollback claims distinguish schema rollback, data rollback, app rollback, forward-fix, and restore-required cases.
|
|
137
|
+
- Destructive changes and production lock risks are either deferred, measured, or reported as remaining risk.
|
|
138
|
+
|
|
139
|
+
<!-- mustflow-section: verification -->
|
|
140
|
+
## Verification
|
|
141
|
+
|
|
142
|
+
Use configured oneshot command intents when available:
|
|
143
|
+
|
|
144
|
+
- `changes_status`
|
|
145
|
+
- `changes_diff_summary`
|
|
146
|
+
- `lint`
|
|
147
|
+
- `build`
|
|
148
|
+
- `test_related`
|
|
149
|
+
- `test`
|
|
150
|
+
- `docs_validate_fast`
|
|
151
|
+
- `test_release`
|
|
152
|
+
- `mustflow_check`
|
|
153
|
+
|
|
154
|
+
Prefer configured migration dry-run, generated-output, schema-diff, or database test intents when the command contract exposes them. Do not invent raw migration commands inside the skill.
|
|
155
|
+
|
|
156
|
+
<!-- mustflow-section: failure-handling -->
|
|
157
|
+
## Failure Handling
|
|
158
|
+
|
|
159
|
+
- If old/new application compatibility is unknown, do not call the migration rolling-deploy safe.
|
|
160
|
+
- If production table size, lock behavior, or validation cost is unknown, report the operation as production-risky.
|
|
161
|
+
- If an autogenerator proposes drop/create for a rename, stop and rewrite the migration plan.
|
|
162
|
+
- If a migration is lossy, do not claim rollback beyond restore or forward corrective migration.
|
|
163
|
+
- If generated clients or schema dumps drift, fix the source of truth and regenerated surfaces together.
|
|
164
|
+
- If configured verification is missing, report the missing command intent instead of inferring package-manager, ORM, or migration-tool commands.
|
|
165
|
+
|
|
166
|
+
<!-- mustflow-section: output-format -->
|
|
167
|
+
## Output Format
|
|
168
|
+
|
|
169
|
+
- Database migration changed
|
|
170
|
+
- Tool and database engine surface inspected
|
|
171
|
+
- Source schema, target schema, and migration phase
|
|
172
|
+
- Old-code/new-schema and new-code/expanded-schema compatibility
|
|
173
|
+
- Backfill, validation, lock, timeout, and rollback classification
|
|
174
|
+
- ORM/generated client/schema dump/snapshot surfaces synchronized
|
|
175
|
+
- Dependent surfaces checked
|
|
176
|
+
- Command intents run
|
|
177
|
+
- Skipped migration checks and reasons
|
|
178
|
+
- Remaining database migration risk
|
|
@@ -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
|