opencode-skills-collection 3.1.9 → 3.1.11

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 (66) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +8 -1
  2. package/bundled-skills/browser-testing-with-devtools/SKILL.md +334 -0
  3. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  4. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  5. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  6. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  7. package/bundled-skills/docs/sources/sources.md +4 -0
  8. package/bundled-skills/docs/users/bundles.md +1 -1
  9. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  10. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  11. package/bundled-skills/docs/users/getting-started.md +1 -1
  12. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  13. package/bundled-skills/docs/users/usage.md +4 -4
  14. package/bundled-skills/docs/users/visual-guide.md +4 -4
  15. package/bundled-skills/drizzle-migration-conflict/SKILL.md +179 -0
  16. package/bundled-skills/drizzle-migration-conflict/references/ci-policy.md +87 -0
  17. package/bundled-skills/drizzle-migration-conflict/references/conflict-resolution.md +163 -0
  18. package/bundled-skills/drizzle-migration-conflict/references/report-template.md +69 -0
  19. package/bundled-skills/drizzle-migration-conflict/references/sources.md +51 -0
  20. package/bundled-skills/drizzle-migration-conflict/scripts/check_drizzle_migrations.py +721 -0
  21. package/bundled-skills/frontend-lighthouse/SKILL.md +348 -0
  22. package/bundled-skills/pre-release-review/SKILL.md +198 -0
  23. package/bundled-skills/pre-release-review/references/checklist.md +104 -0
  24. package/bundled-skills/pre-release-review/references/report-template.md +91 -0
  25. package/bundled-skills/re-create/SKILL.md +251 -0
  26. package/bundled-skills/weaviate/SKILL.md +132 -0
  27. package/bundled-skills/weaviate/references/ask.md +36 -0
  28. package/bundled-skills/weaviate/references/create_collection.md +152 -0
  29. package/bundled-skills/weaviate/references/environment_requirements.md +34 -0
  30. package/bundled-skills/weaviate/references/example_data.md +24 -0
  31. package/bundled-skills/weaviate/references/explore_collection.md +50 -0
  32. package/bundled-skills/weaviate/references/fetch_filter.md +88 -0
  33. package/bundled-skills/weaviate/references/get_collection.md +32 -0
  34. package/bundled-skills/weaviate/references/hybrid_search.md +47 -0
  35. package/bundled-skills/weaviate/references/import_data.md +160 -0
  36. package/bundled-skills/weaviate/references/keyword_search.md +38 -0
  37. package/bundled-skills/weaviate/references/list_collections.md +31 -0
  38. package/bundled-skills/weaviate/references/query_search.md +38 -0
  39. package/bundled-skills/weaviate/references/semantic_search.md +46 -0
  40. package/bundled-skills/weaviate/scripts/ask.py +106 -0
  41. package/bundled-skills/weaviate/scripts/create_collection.py +359 -0
  42. package/bundled-skills/weaviate/scripts/example_data.py +945 -0
  43. package/bundled-skills/weaviate/scripts/explore_collection.py +295 -0
  44. package/bundled-skills/weaviate/scripts/fetch_filter.py +261 -0
  45. package/bundled-skills/weaviate/scripts/get_collection.py +122 -0
  46. package/bundled-skills/weaviate/scripts/hybrid_search.py +157 -0
  47. package/bundled-skills/weaviate/scripts/import.py +701 -0
  48. package/bundled-skills/weaviate/scripts/keyword_search.py +142 -0
  49. package/bundled-skills/weaviate/scripts/list_collections.py +77 -0
  50. package/bundled-skills/weaviate/scripts/query_search.py +135 -0
  51. package/bundled-skills/weaviate/scripts/semantic_search.py +139 -0
  52. package/bundled-skills/weaviate/scripts/weaviate_conn.py +231 -0
  53. package/bundled-skills/weaviate-cookbooks/SKILL.md +67 -0
  54. package/bundled-skills/weaviate-cookbooks/references/advanced_rag.md +274 -0
  55. package/bundled-skills/weaviate-cookbooks/references/agentic_rag.md +360 -0
  56. package/bundled-skills/weaviate-cookbooks/references/async_client.md +428 -0
  57. package/bundled-skills/weaviate-cookbooks/references/basic_agent.md +270 -0
  58. package/bundled-skills/weaviate-cookbooks/references/basic_rag.md +219 -0
  59. package/bundled-skills/weaviate-cookbooks/references/data_explorer.md +336 -0
  60. package/bundled-skills/weaviate-cookbooks/references/environment_requirements.md +78 -0
  61. package/bundled-skills/weaviate-cookbooks/references/frontend_interface.md +104 -0
  62. package/bundled-skills/weaviate-cookbooks/references/pdf_multimodal_rag.md +635 -0
  63. package/bundled-skills/weaviate-cookbooks/references/project_setup.md +75 -0
  64. package/bundled-skills/weaviate-cookbooks/references/query_agent_chatbot.md +163 -0
  65. package/package.json +1 -1
  66. package/skills_index.json +156 -0
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: drizzle-migration-conflict
3
+ description: "Diagnose, repair, and prevent Drizzle Kit migration conflicts involving generated SQL, snapshots, journals, merge queues, and team workflows."
4
+ category: databases
5
+ risk: critical
6
+ source: community
7
+ source_repo: chaunsin/agent-skills
8
+ source_type: community
9
+ date_added: "2026-06-29"
10
+ author: chaunsin
11
+ tags: [drizzle, migrations, database, ci, merge-conflicts]
12
+ tools: [git, python, rg]
13
+ license: "Apache-2.0"
14
+ license_source: "https://github.com/chaunsin/agent-skills/blob/master/LICENSE"
15
+ ---
16
+
17
+ # Drizzle Migration Conflict
18
+
19
+ Use this skill to help a user diagnose, repair, and prevent Drizzle Kit migration conflicts in a
20
+ multi-developer repository. Drizzle migrations encode both SQL and migration snapshots, so the safe
21
+ answer depends on the current migration directory shape, the Drizzle Kit version, and the git state.
22
+
23
+ ## When to Use This Skill
24
+
25
+ - Use when Drizzle migration files, `_journal.json`, or `snapshot.json` conflict after a pull, merge, rebase, or PR update.
26
+ - Use when `drizzle-kit check` reports non-commutative migrations or migration folder conflicts.
27
+ - Use when a team wants a safe repair flow for generated Drizzle migrations after schema changes converge.
28
+ - Use when designing CI or merge-queue policy to prevent repeated Drizzle migration conflicts.
29
+
30
+ ## Safety rules
31
+
32
+ - Start in read-only diagnosis mode unless the user explicitly asks to fix files.
33
+ - Do not run `drizzle-kit migrate`, `drizzle-kit push`, database seed scripts, or any command that
34
+ connects to a live database unless the user explicitly requests it and the target is clear.
35
+ - Treat `drizzle-kit check`, project typechecks, and tests as command execution that may load project
36
+ config, environment variables, or scripts. Inspect scripts/config first, and require an explicit
37
+ non-production or disposable target before any DB-backed validation.
38
+ - Do not delete migration files, rewrite `_journal.json`, or run `git checkout --ours`,
39
+ `git checkout --theirs`, `git restore`, or `rm` unless the user has confirmed the exact side and
40
+ files to change.
41
+ - Do not recommend `drizzle-kit push` as the production solution for migration conflicts; it skips
42
+ the auditable migration history that teams need.
43
+ - Treat `--ignore-conflicts` as an exception for a known false positive, not as the normal fix.
44
+ - Preserve schema source code changes unless the user explicitly asks to discard them. Conflict
45
+ repair normally discards generated migrations and regenerates them from the merged schema.
46
+ - If `ours` and `theirs` could mean different branches depending on merge direction, ask the user to
47
+ identify the parent branch before suggesting checkout commands.
48
+
49
+ ## Required references
50
+
51
+ - Read `references/sources.md` when the answer depends on current Drizzle behavior, official
52
+ guidance, or one of the preserved external links.
53
+ - Read `references/conflict-resolution.md` before recommending a repair flow.
54
+ - Read `references/ci-policy.md` before proposing CI, merge queue, or team workflow changes.
55
+ - Read `references/report-template.md` before writing a diagnostic report.
56
+
57
+ ## Source references
58
+
59
+ The full list of official docs, Drizzle GitHub discussions, community scripts, and merge-queue
60
+ references lives in `references/sources.md` with trust levels and caveats. Read that file whenever
61
+ the answer depends on current Drizzle behavior. Re-verify the official docs and the most relevant
62
+ discussion when the project's `drizzle-kit` major version changes, since migration internals
63
+ (snapshot format, journal shape, `drizzle-kit check` semantics) have shifted between releases.
64
+
65
+ ## Mode selection
66
+
67
+ Classify the task first:
68
+
69
+ 1. **Diagnose** - The user has a conflict or failed `drizzle-kit check` and wants to understand it.
70
+ 2. **Repair** - The user explicitly asks to fix or regenerate migration files.
71
+ 3. **CI hardening** - The user wants to prevent future conflicts in PRs or merge queues.
72
+ 4. **Explain** - The user wants a conceptual answer or a team playbook.
73
+
74
+ When the mode is not explicit, choose Diagnose.
75
+
76
+ Each mode unlocks a specific set of actions. Do not cross these boundaries without an explicit upgrade:
77
+
78
+ - **Diagnose** - read-only only. Run `git status`, `git ls-files -u`, the helper script, and file
79
+ inspection. Do not run `drizzle-kit check`, typechecks, tests, or any write command. Report
80
+ findings and the proposed repair path, but do not execute it.
81
+ - **Repair** - adds file writes and `drizzle-kit generate`/`check` execution, each gated by the
82
+ Safety rules and explicit confirmation of the exact files and side (`ours`/`theirs`) to change.
83
+ - **CI hardening** - adds proposing or editing CI/workflow files. Do not run migration commands
84
+ against the user's database to validate the workflow; validate the workflow syntax and logic only.
85
+ - **Explain** - conceptual only. No commands against the repo beyond optional read-only inspection.
86
+
87
+ ## Repository discovery
88
+
89
+ Collect repo facts before giving commands:
90
+
91
+ ```bash
92
+ git status --short
93
+ git rev-parse --show-toplevel
94
+ git rev-parse --abbrev-ref HEAD
95
+ git ls-files -u
96
+ rg --files -g 'drizzle.config.*' -g 'package.json' -g 'pnpm-lock.yaml' -g 'yarn.lock' -g 'package-lock.json'
97
+ ```
98
+
99
+ Then inspect the relevant files:
100
+
101
+ - `drizzle.config.*` for `out`, `schema`, dialect, and config shape.
102
+ - `package.json` scripts for the project-approved `generate`, `check`, and `migrate` commands.
103
+ - `package.json` dependencies or lockfile snippets for `drizzle-kit` and `drizzle-orm` versions.
104
+ - The migration output directory, either from config or common names like `drizzle/`, `migrations/`,
105
+ or `src/db/migrations/`.
106
+
107
+ If this skill's helper script is available, run it in read-only mode:
108
+
109
+ ```bash
110
+ python3 <skill-dir>/scripts/check_drizzle_migrations.py --root .
111
+ ```
112
+
113
+ Resolve `<skill-dir>` to the installed skill directory before running. Check these locations in order
114
+ and use the first that contains `scripts/check_drizzle_migrations.py`:
115
+
116
+ 1. The target repository's vendored copy: `<repo-root>/skills/drizzle-migration-conflict`.
117
+ 2. The Claude Code skills directory: `~/.claude/skills/drizzle-migration-conflict`.
118
+ 3. Any other install location reported by the user's environment.
119
+
120
+ If none of these resolve, fall back to the manual `git`/`rg` inspection commands above and tell the
121
+ user the helper script was not found. Use `--config <file>` and `--migrations-dir <dir>` when the
122
+ project has multiple Drizzle configs or outputs. The script never connects to a database and never
123
+ writes files; it only reads migration directories and reports structural issues.
124
+
125
+ ## Migration structure decision
126
+
127
+ Identify the structure before proposing a fix:
128
+
129
+ - **Legacy structure**: `<out>/meta/_journal.json`, `<out>/meta/*_snapshot.json`, and root-level
130
+ migration SQL files such as `<out>/0003_name.sql`.
131
+ - **Folder-based structure**: each migration is a directory containing `migration.sql` and
132
+ `snapshot.json`.
133
+ - **Unknown or mixed structure**: stop and report ambiguity. Do not guess a destructive repair.
134
+
135
+ ## Recommended repair principles
136
+
137
+ - Resolve schema source conflicts first. The regenerated migration must reflect the merged schema,
138
+ not one side's stale snapshot.
139
+ - Treat the parent or target branch migration history as the source of truth when repairing a feature
140
+ branch after updating from that branch.
141
+ - Prefer discarding and regenerating generated migration artifacts over hand-editing journal or
142
+ snapshot files.
143
+ - After regeneration, validate in tiers: database-free structural checks first; then `drizzle-kit
144
+ check` only after confirming its config/env cannot point at production; then project tests only
145
+ after inspecting the scripts and any database targets.
146
+ - If the user asks to apply changes, state exactly which files will be changed before performing the
147
+ write.
148
+
149
+ ## Output rules
150
+
151
+ - Use the user's language when practical, but keep command snippets and file paths literal.
152
+ - State the detected migration structure and selected mode.
153
+ - Separate confirmed conflicts from assumptions and missing evidence.
154
+ - Give a safe default path first, then optional automation or CI hardening.
155
+ - For destructive steps, label them as "requires confirmation" and explain what will be lost.
156
+ - Never echo secrets. When inspecting `drizzle.config.*`, `.env`, or environment variables, do not
157
+ include database URLs, passwords, tokens, or connection strings in the report. Reference them as
158
+ `<redacted>` or describe only whether they point at a production-like target.
159
+ - Use the conclusion values from `references/report-template.md` for diagnostic reports:
160
+ `NO_CONFLICT_FOUND`, `SAFE_TO_REGENERATE`, `NEEDS_USER_CONFIRMATION`, or `BLOCKED_BY_AMBIGUITY`.
161
+
162
+ ## Limitations
163
+
164
+ - This skill cannot guarantee that a regenerated migration is production-safe without review against the target database state and deployment process.
165
+ - It does not run DB-backed migration commands unless the user explicitly confirms the target and the command.
166
+ - It is focused on Drizzle Kit migration conflicts, not general schema design or application-query optimization.
167
+
168
+ ## Test prompts
169
+
170
+ Use these prompts to validate the skill behavior:
171
+
172
+ - "My Drizzle `_journal.json` and `0003_snapshot.json` conflict during merge. Tell me what to do."
173
+ - "We upgraded to the migration folder layout and `drizzle-kit check` reports a non-commutative conflict."
174
+ - "Design CI so our team stops merging broken Drizzle migrations."
175
+ - "Can I solve this production Drizzle migration conflict with `drizzle-kit push`?"
176
+ - "Use the links in the skill to re-check the current official Drizzle migration conflict guidance."
177
+ - "We're halfway through moving from the legacy flat layout to folder-based migrations. How do we handle a conflict during the transition?"
178
+ - "Our `drizzle.config.ts` sets `out` from `process.env.MIGRATIONS_DIR`, and the helper says no out directory was found. What now?"
179
+ - "`drizzle-kit check` keeps failing on a migration we know commutes. Can we just always pass `--ignore-conflicts`?"
@@ -0,0 +1,87 @@
1
+ # CI and Team Policy
2
+
3
+ Use this reference when the user wants to prevent Drizzle migration conflicts in pull requests,
4
+ protected branches, or GitHub merge queues.
5
+
6
+ ## Recommended layers
7
+
8
+ 1. **Local developer habit**
9
+ - Pull or merge the parent branch before generating a migration.
10
+ - Generate migrations once schema source conflicts are resolved.
11
+ - Run `drizzle-kit check` only after confirming its config/env do not target production.
12
+ 2. **Pull request check**
13
+ - Run the project's normal static checks.
14
+ - Run `drizzle-kit check` or the package script that wraps it with explicit non-production config.
15
+ - Run the read-only helper script to catch legacy journal/snapshot mismatches.
16
+ 3. **Merge queue check**
17
+ - If GitHub merge queue is enabled, run the same check on `merge_group` events.
18
+ - Do not assume a successful PR check means the queued merge result is still conflict-free.
19
+
20
+ ## GitHub Actions skeleton
21
+
22
+ Adapt package manager, config path, migration directory, and script location to the target
23
+ repository. The helper script must be vendored or copied into the repository before CI can run it.
24
+ Never point CI migration checks at production credentials.
25
+
26
+ ```yaml
27
+ name: drizzle-migration-check
28
+
29
+ on:
30
+ pull_request:
31
+ merge_group:
32
+
33
+ jobs:
34
+ drizzle-migration-check:
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - uses: actions/setup-node@v4
39
+ with:
40
+ node-version: 20
41
+ cache: pnpm
42
+ - uses: pnpm/action-setup@v4
43
+ with:
44
+ version: 9
45
+ - run: pnpm install --frozen-lockfile
46
+ # Run only with a non-production or disposable DATABASE_URL if the config requires one.
47
+ - run: pnpm exec drizzle-kit check --config drizzle.config.ts
48
+ # Example assumes the helper was copied to scripts/check_drizzle_migrations.py.
49
+ - run: python3 scripts/check_drizzle_migrations.py --root . --config drizzle.config.ts --migrations-dir drizzle
50
+ ```
51
+
52
+ If the repository does not vendor this skill, copy the helper script into the repo or run an
53
+ equivalent read-only check from the CI tooling repository. In multi-config repositories, pass the
54
+ same config and matching migration directory to both Drizzle Kit and the helper script.
55
+
56
+ The helper script exits with: `0` when all checked directories are clean, `1` when any error or
57
+ warning issue is found, and `2` when no migration directory was discovered at all. A CI step that
58
+ runs the script should fail the job on a non-zero exit, but treat exit `2` as "nothing to check"
59
+ only if the repo is expected to have no Drizzle migrations; otherwise exit `2` usually means
60
+ detection missed the migration directory and the config should be passed explicitly.
61
+
62
+ ## What merge queue does and does not solve
63
+
64
+ Merge queue can serialize the final merge order and test a temporary merge result. It does not
65
+ rewrite Drizzle migrations, re-run `drizzle-kit generate`, or choose which branch's snapshots are
66
+ correct. The check should fail when generated migration history is inconsistent, then the developer
67
+ updates the branch and regenerates migrations.
68
+
69
+ ## Policy recommendations
70
+
71
+ - Require one migration-generation point per PR after schema conflicts are resolved.
72
+ - Treat migration artifacts as generated but reviewable files: do not silently rewrite them in CI.
73
+ - Require `drizzle-kit check` or an equivalent conflict check before merge.
74
+ - In legacy projects, reject duplicate migration numbers and journal/snapshot drift.
75
+ - In folder-based projects, reject incomplete migration directories and failed commutativity checks.
76
+ - Keep production migration execution separate from PR validation.
77
+
78
+ ## When CI should fail
79
+
80
+ Fail the job when any of these are true:
81
+
82
+ - `_journal.json` contains duplicate `idx` or `tag` values.
83
+ - A journal entry references a missing SQL file or snapshot.
84
+ - Root SQL or snapshot files exist but are not referenced by the journal in a legacy output.
85
+ - Migration files contain Git conflict markers.
86
+ - A folder-based migration directory is missing `migration.sql` or `snapshot.json`.
87
+ - `drizzle-kit check` reports a non-commutative migration conflict.
@@ -0,0 +1,163 @@
1
+ # Conflict Resolution Playbook
2
+
3
+ Use this playbook after collecting repo facts. The goal is to preserve schema intent while replacing
4
+ stale generated migration artifacts with a migration generated from the merged schema.
5
+
6
+ ## Decision tree
7
+
8
+ 1. Is the repository currently in a merge or rebase?
9
+ - Check `git status --short` and `git ls-files -u`.
10
+ - If yes, identify whether the user is merging the parent branch into a feature branch, rebasing a
11
+ feature branch, or merging a feature branch into the parent branch.
12
+ 2. Which migration structure is present?
13
+ - Legacy: `meta/_journal.json`, `meta/*_snapshot.json`, root SQL files.
14
+ - Folder-based: migration directories with `migration.sql` and `snapshot.json`.
15
+ - Mixed or unknown: stop and ask for the intended migration output path.
16
+ - Transitioning (legacy artifacts plus a partial move to folder-based): do not repair until the
17
+ user confirms the target structure. Treat the legacy artifacts and the folder-based artifacts
18
+ as one logical history only after the intended end state is clear; otherwise a repair could
19
+ discard the wrong side.
20
+ 3. Are schema source files already resolved?
21
+ - If not, resolve those first or tell the user the migration cannot be regenerated safely yet.
22
+ 4. Is the user asking for diagnosis or repair?
23
+ - Diagnosis stays read-only.
24
+ - Repair can include file changes only after the exact generated files to discard are understood.
25
+
26
+ ## Read-only inspection commands
27
+
28
+ ```bash
29
+ git status --short
30
+ git ls-files -u
31
+ rg --files -g 'drizzle.config.*' -g 'package.json'
32
+ rg -n "drizzle-kit|drizzle-orm|db:generate|db:check|migrate" package.json pnpm-lock.yaml yarn.lock package-lock.json 2>/dev/null
33
+ python3 <skill-dir>/scripts/check_drizzle_migrations.py --root .
34
+ ```
35
+
36
+ If `rg` is not available, use `find` and `grep` equivalents. Resolve `<skill-dir>` to the installed
37
+ skill directory before running the helper. Check in order and use the first match that contains
38
+ `scripts/check_drizzle_migrations.py`: the target repo's vendored
39
+ `skills/drizzle-migration-conflict`, then `~/.claude/skills/drizzle-migration-conflict`, then any
40
+ user-reported install location. If none resolve, fall back to the `git`/`rg` inspection commands
41
+ above and tell the user the helper was not found.
42
+
43
+ ## Legacy structure repair
44
+
45
+ Legacy Drizzle output usually looks like this:
46
+
47
+ ```text
48
+ drizzle/
49
+ 0000_initial.sql
50
+ 0001_add_user.sql
51
+ meta/
52
+ _journal.json
53
+ 0000_snapshot.json
54
+ 0001_snapshot.json
55
+ ```
56
+
57
+ Safe flow for a feature branch updated from the parent branch:
58
+
59
+ 1. Resolve schema source conflicts first.
60
+ 2. Keep the parent branch's migration history as the baseline.
61
+ 3. Discard generated migration files created on the feature branch after it diverged from the parent
62
+ branch.
63
+ 4. Re-run the project-approved `drizzle-kit generate` script from `package.json`.
64
+ 5. Validate the regenerated history.
65
+
66
+ Do not hand-edit `_journal.json` or snapshot JSON unless the user explicitly asks for an emergency
67
+ manual repair and accepts the risk. The next generated migration depends on those snapshots.
68
+
69
+ ### Ours/theirs warning
70
+
71
+ `ours` and `theirs` change meaning with merge direction:
72
+
73
+ | Situation | `ours` usually means | `theirs` usually means | Safe guidance |
74
+ | --- | --- | --- | --- |
75
+ | On feature branch, merging parent branch into it | current feature branch | parent branch being merged in | Parent branch is often `theirs`, but verify before checkout. |
76
+ | On parent branch, merging feature branch into it | current parent branch | feature branch | Parent branch is often `ours`, but verify before checkout. |
77
+ | Rebase | meaning can be unintuitive | meaning can be unintuitive | Avoid shorthand; use explicit branch/path restore if possible. |
78
+
79
+ When in doubt, ask which branch should be the migration-history source of truth. Do not guess.
80
+
81
+ ## Folder-based structure repair
82
+
83
+ Folder-based Drizzle output usually looks like this:
84
+
85
+ ```text
86
+ drizzle/
87
+ 20260618120000_add_user/
88
+ migration.sql
89
+ snapshot.json
90
+ ```
91
+
92
+ Safe flow:
93
+
94
+ 1. Inspect the Drizzle config and env first, then run `drizzle-kit check` or the project script
95
+ wrapping it only with a non-production target.
96
+ 2. If it reports a non-commutative migration conflict, identify the conflicting migration and any
97
+ later migrations based on it.
98
+ 3. Remove or regenerate only the generated migration artifacts that are downstream of the conflict,
99
+ after user confirmation.
100
+ 4. Re-run `drizzle-kit generate` from the merged schema.
101
+ 5. Re-run the helper script, and re-run `drizzle-kit check` only after confirming the config/env
102
+ target is still non-production.
103
+
104
+ Use `--ignore-conflicts` only for a known false positive after reviewing why the migrations commute
105
+ or why the check is wrong. Include that decision in the report.
106
+
107
+ ## Validation after regeneration
108
+
109
+ Run validation in tiers so the agent does not accidentally touch a live database or run arbitrary
110
+ project scripts.
111
+
112
+ ### Database-free checks
113
+
114
+ ```bash
115
+ python3 <skill-dir>/scripts/check_drizzle_migrations.py --root . --migrations-dir <migration-dir>
116
+ ```
117
+
118
+ ### Loads project config or environment
119
+
120
+ Run `drizzle-kit check` only after inspecting `drizzle.config.*`, package scripts, and relevant env
121
+ variables. Confirm that any database URL or credentials point to a non-production or disposable
122
+ target before executing it. Work through this checklist before running the command:
123
+
124
+ 1. Read `drizzle.config.*` and note any `url`, `dbCredentials`, `credentials`, or connection fields.
125
+ Determine whether they are literal, read from `process.env`, or loaded via `dotenv`.
126
+ 2. Identify which env vars feed those fields (common names: `DATABASE_URL`, `DB_URL`,
127
+ `POSTGRES_URL`, `DRIZZLE_DATABASE_URL`). Check `.env`, `.env.local`, and the package script's
128
+ environment for their values without echoing secrets.
129
+ 3. If a value points at a production host (named `prod`/`production`, a managed cluster endpoint,
130
+ or a host the user identifies as live), stop and ask for a disposable target. Do not run the check.
131
+ 4. If `drizzle-kit check` needs a real connection for the configured dialect, prefer overriding the
132
+ URL inline with a disposable/local database, or use a config that disables connection (some
133
+ dialects allow a schema-only check). If neither is possible, fall back to the database-free
134
+ helper script and report that `drizzle-kit check` could not be run safely.
135
+ 5. Only after the target is confirmed non-production, run the project-approved check command.
136
+
137
+ ```bash
138
+ # Project script names vary; inspect package.json first.
139
+ # Override with a disposable DATABASE_URL only if the config requires a connection.
140
+ DATABASE_URL=postgres://localhost/disposable pnpm exec drizzle-kit check --config <drizzle-config>
141
+ ```
142
+
143
+ ### Project tests
144
+
145
+ Run typechecks or tests only after inspecting the script definitions. Tests may run migrations,
146
+ connect to databases, mutate fixtures, or start services.
147
+
148
+ ```bash
149
+ pnpm typecheck
150
+ pnpm test
151
+ ```
152
+
153
+ Avoid live database commands unless the user names a disposable database or explicitly requests a
154
+ migration run.
155
+
156
+ ## Anti-patterns
157
+
158
+ - Running `drizzle-kit push` to bypass migration history in production.
159
+ - Keeping both sides' generated migrations and manually renumbering files without regenerating from
160
+ the merged schema.
161
+ - Resolving `_journal.json` by accepting both sides without verifying SQL and snapshot pairs.
162
+ - Using `git checkout --theirs drizzle/` without understanding merge direction.
163
+ - Ignoring `drizzle-kit check` with `--ignore-conflicts` as the default team workflow.
@@ -0,0 +1,69 @@
1
+ # Report Template
2
+
3
+ Use this template for diagnosis and repair recommendations. Keep reports short and evidence-based.
4
+
5
+ ## Conclusion values
6
+
7
+ - `NO_CONFLICT_FOUND` - No migration conflict or structural inconsistency was found from available
8
+ evidence.
9
+ - `SAFE_TO_REGENERATE` - The conflict is understood, schema source is resolved, and the recommended
10
+ next step is to discard generated artifacts and regenerate migrations.
11
+ - `NEEDS_USER_CONFIRMATION` - A repair path exists, but a destructive step or branch-side decision
12
+ requires confirmation.
13
+ - `BLOCKED_BY_AMBIGUITY` - The migration structure, source-of-truth branch, schema state, or
14
+ migration directory cannot be determined safely.
15
+
16
+ ## Template
17
+
18
+ ````markdown
19
+ # Drizzle Migration Conflict Report
20
+
21
+ Conclusion: <NO_CONFLICT_FOUND | SAFE_TO_REGENERATE | NEEDS_USER_CONFIRMATION | BLOCKED_BY_AMBIGUITY>
22
+ Mode: <diagnose | repair | ci-hardening | explain>
23
+
24
+ ## Detected Structure
25
+ - Migration directory: `<path>`
26
+ - Structure: <legacy | folder-based | mixed | unknown>
27
+ - Drizzle Kit version: <version or unable to verify>
28
+ - Git state: <clean | dirty | active merge | active rebase | unable to verify>
29
+
30
+ ## Conflict State
31
+ - <confirmed conflict or inconsistency with file paths>
32
+ - <journal/snapshot/SQL mismatch, non-commutative check, or conflict marker evidence>
33
+
34
+ ## Recommended Path
35
+ - <safe next step>
36
+ - <why this path preserves schema intent and migration history>
37
+
38
+ ## Commands
39
+ ```bash
40
+ # Read-only commands first.
41
+ <commands>
42
+
43
+ # Destructive commands only if confirmed by the user.
44
+ <commands requiring confirmation>
45
+ ```
46
+
47
+ ## Files At Risk
48
+ - `<path>` - <why it may be discarded or regenerated>
49
+
50
+ ## Validation
51
+ - <drizzle-kit check or project script>
52
+ - <helper script command>
53
+ - <typecheck/test command if relevant>
54
+
55
+ ## Unable To Verify
56
+ - <missing version, unavailable branch, unknown migration path, or external docs not refreshed>
57
+ ````
58
+
59
+ ## Reporting rules
60
+
61
+ - Put destructive commands in a clearly labeled block.
62
+ - Do not output `--ours` or `--theirs` commands unless the merge/rebase direction, source-of-truth
63
+ branch, and exact file paths are confirmed. Otherwise use `BLOCKED_BY_AMBIGUITY`.
64
+ - If the project has multiple Drizzle configs, report each output independently.
65
+ - If no conflict is found but the worktree is dirty, state that uncommitted files were not repaired.
66
+ - Do not include clean checklist categories that are irrelevant to the user's conflict.
67
+ - Redact secrets. Never include database URLs, passwords, tokens, or connection strings in the
68
+ report. When a config or env value matters, describe only whether it points at a production-like
69
+ target and write the value as `<redacted>`.
@@ -0,0 +1,51 @@
1
+ # Source References
2
+
3
+ Last verified: 2026-06-18.
4
+
5
+ Use this file when an answer depends on upstream Drizzle behavior, community scripts, or CI platform
6
+ behavior. Drizzle Kit migration internals can change, so prefer current official docs and the
7
+ project's installed `drizzle-kit` version over memory when resolving a real conflict.
8
+
9
+ ## Official and semi-official Drizzle sources
10
+
11
+ | Source | Link | Use | Trust level |
12
+ | --- | --- | --- | --- |
13
+ | Discussion 1104 | https://github.com/drizzle-team/drizzle-orm/discussions/1104 | Original team-collaboration conflict thread for legacy `_journal.json` and snapshot conflicts. Useful for understanding why parallel generated migrations diverge. | Drizzle GitHub discussion; useful but may include outdated comments. |
14
+ | Discussion 2832 | https://github.com/drizzle-team/drizzle-orm/discussions/2832 | Migration folder structure redesign and reasoning. Use to understand why the old flat structure is git-hostile. | Drizzle GitHub discussion; design context may predate current release behavior. |
15
+ | Discussion 5005 | https://github.com/drizzle-team/drizzle-orm/discussions/5005 | Commutative migration checking, `drizzle-kit check`, and conflict behavior in newer Drizzle Kit versions. | High value for current direction; verify against installed version. |
16
+ | Discussion 5581 | https://github.com/drizzle-team/drizzle-orm/discussions/5581 | Practical parent-branch-as-source-of-truth repair workflow. | Community workflow; good playbook, still verify against repo state. |
17
+ | Generate docs | https://orm.drizzle.team/docs/drizzle-kit-generate | How Drizzle Kit derives migrations from schema and snapshots. | Official docs. |
18
+ | Check docs | https://orm.drizzle.team/docs/drizzle-kit-check | Migration consistency checking for team workflows. | Official docs. |
19
+ | Migration overview | https://orm.drizzle.team/docs/migrations | General migration concepts and current official migration overview. | Official docs. |
20
+
21
+ ## Community scripts
22
+
23
+ These scripts are reference material only. Do not copy their destructive behavior into a generic
24
+ agent workflow without dry-run mode and explicit user confirmation.
25
+
26
+ | Source | Link | Use | Caveat |
27
+ | --- | --- | --- | --- |
28
+ | Legacy undo script | https://gist.github.com/anthonyjoeseph/102c0e3ea8496fe111029a8b8a95cc3a | Shows a merge-time undo workflow for legacy Drizzle migration artifacts. | Assumes legacy structure and uses git/file operations that can discard local generated files. |
29
+ | Legacy repair script | https://gist.github.com/anthonyjoeseph/6b99beb34d494acd1dfc83a192ed9388 | Detects duplicate legacy migration numbers and can repair by removing orphaned generated files. | `FORCE_FIX` is destructive; adapt only the read-only checks unless the user confirms. |
30
+ | Earlier repair variant | https://gist.github.com/gburtini/7e34842c567dd80ee834de74e7b79edd | Useful for historical context and comparing conflict-detection logic. | Earlier variant had caveats fixed by later forks; do not rely on it alone. |
31
+
32
+ ## CI and merge queue sources
33
+
34
+ | Source | Link | Use | Caveat |
35
+ | --- | --- | --- | --- |
36
+ | GitHub merge queue docs | https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue | Explains merge queue behavior and why required checks must also run for `merge_group` events. | Merge queue serializes merging; it does not regenerate Drizzle migrations by itself. |
37
+
38
+ ## Version-sensitive guidance
39
+
40
+ Before giving high-confidence advice for a live repository:
41
+
42
+ 1. Check the local `drizzle-kit` version from `package.json` and the lockfile first.
43
+ 2. Check whether the migration output uses the legacy flat structure or the folder-based structure.
44
+ 3. If command execution is acceptable and dependencies are already installed, use a local-only
45
+ package-manager command. Prefer `pnpm exec drizzle-kit --version`,
46
+ `yarn exec drizzle-kit --version`, or `npm exec --no-install drizzle-kit -- --version`. Do not
47
+ use plain `npx` for version probing because it can download or resolve a different package.
48
+ 4. If online browsing is available and the user asks for current guidance, re-open the official docs
49
+ and the discussion most relevant to the installed version.
50
+ 5. If a local result conflicts with these sources, trust the local repository state and report the
51
+ mismatch explicitly.