You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/migration-scripts/SKILL.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
name: migration-scripts
3
-
description: Use when writing or reviewing database/config migration scripts. Enforces that migrations are frozen snapshots with no external imports.
3
+
description: Use when writing or reviewing database/config migration scripts or migration registries. Enforces frozen-snapshot migrations, safe registration, and lean import boundaries.
4
4
metadata:
5
5
author: read-frog
6
-
version: "1.0.0"
6
+
version: "1.1.0"
7
7
---
8
8
9
9
# Migration Scripts
@@ -17,10 +17,28 @@ Migration scripts must NEVER import or reference:
17
17
18
18
**Why:** The codebase evolves. A migration written today references code that may change tomorrow. When that constant changes, the migration silently breaks — it now migrates to the *new* shape, not the shape that existed when the migration was written.
19
19
20
+
## Rule: Migration Registries Must Validate the Chain
21
+
22
+
In this repo, config migration registries should auto-discover migration files from `src/utils/config/migration-scripts/v*-to-v*.ts` (for example via `import.meta.glob`), and the registry must:
23
+
- Parse both `fromVersion` and `toVersion` from the filename
24
+
- Reject invalid steps like `v001-to-v003`
25
+
- Reject duplicate target versions
26
+
- Reject discontinuous chains
27
+
28
+
Do not silently map only the target version and assume filenames are correct.
29
+
30
+
## Rule: Keep Migration Imports Off Hot Paths
31
+
32
+
Do not let generic config read helpers or content-script paths import migration registries unless they really perform migration.
33
+
34
+
Prefer to isolate migration-aware reads/writes into dedicated modules for import/sync/restore flows, so normal runtime paths do not bundle all migration scripts unnecessarily.
35
+
20
36
## Checklist
21
37
22
38
-[ ] All values are hardcoded inline (no imports from `src/`)
23
39
-[ ] Input and output typed as `any`
24
40
-[ ] No calls to factory functions or helpers
25
41
-[ ] Default values are literal objects, not references to constants
0 commit comments