Skip to content

docs(supabase_typegen): say when to regenerate the schema in the package skills - #2115

Merged
spydon merged 4 commits into
mainfrom
docs/skills-regenerate-on-schema-change
Nov 2, 2026
Merged

spydon merged 4 commits into
mainfrom
docs/skills-regenerate-on-schema-change

Conversation

@spydon

@spydon spydon commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The package skills told agents to regenerate lib/supabase_schema.g.dart only "after every database migration". That misses several cases where the generated file goes stale. The generate, idioms and migrate-v3 skills now say to regenerate:

  • after any change to the database schema, including changes made in the dashboard or with SQL against a hosted project, and migrations pulled from another branch,
  • after upgrading supabase_typegen or the Supabase CLI.

The generate and idioms skills also say that with --local, new migrations must be applied to the stack first (supabase migration up or supabase db reset), since the command reads the running database and otherwise produces the old schema without an error. The idioms skill now mentions --linked and --project-id next to --local.

The generated skills/ folders were updated with melos run sync-skills.

Summary by CodeRabbit

  • Documentation
    • Expanded schema-generation guidance to cover changes from migrations, dashboards, hosted SQL, and other branches, plus upgrades to the Supabase CLI or type-generation tools.
    • Clarified that local migrations must be applied before generating types locally, and that generation should target the database containing the schema change. Hosted schemas can be used with a linked project or project reference.
    • Warned that editing an already-applied migration does not reapply it automatically, and requires user approval before a local reset that could discard data.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between a3a3110 and b194fb7.

Files selected for processing: 3
  • packages/supabase/README.md
  • packages/supabase_flutter/README.md
  • packages/supabase_typegen/README.md
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between a80dacf and a3a3110.

Files selected for processing: 2
  • packages/supabase_typegen/skills/supabase-typegen-generate/SKILL.md
  • skills_src/generate/SKILL.md.tmpl

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

Walkthrough

The changes update Supabase skill guidance to cover schema regeneration after broader database changes and tool upgrades. They also describe applying migrations before local generation, using hosted schemas, and reporting regeneration in v3 migration guidance.

Changes: Schema regeneration guidance

Layer / File(s) Summary
Type generation workflow
skills_src/generate/SKILL.md.tmpl, packages/supabase_typegen/skills/supabase-typegen-generate/SKILL.md
The typegen guidance adds schema and tool changes as regeneration triggers. It describes local migration requirements, hosted SQL, and affected schema objects.
Schema generation in idiom skills
skills_src/idioms/SKILL.md.tmpl, packages/supabase/skills/supabase-idioms/SKILL.md, packages/supabase_flutter/skills/supabase-flutter-idioms/SKILL.md
The guidance covers regeneration after schema changes and typegen upgrades. It also describes applying local migrations and using hosted schemas.
V3 migration report reminders
skills_src/migrate-v3/SKILL.md.tmpl, packages/supabase/skills/supabase-migrate-v3/SKILL.md, packages/supabase_flutter/skills/supabase-flutter-migrate-v3/SKILL.md
The report reminders now include schema changes made through migrations or the dashboard, and typegen upgrades.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

Possibly related PRs

Suggested labels: supabase

Merge Risk: Low · previous review a3a31

The README can leave generated types stale after hosted schema or tool changes; update it before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: updating Supabase package skills to explain when to regenerate the schema.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread skills_src/generate/SKILL.md.tmpl Resolved
Comment thread skills_src/generate/SKILL.md.tmpl Resolved
Comment thread skills_src/generate/SKILL.md.tmpl Resolved
Comment thread skills_src/idioms/SKILL.md.tmpl Resolved
Comment thread skills_src/idioms/SKILL.md.tmpl Resolved
Comment thread skills_src/migrate-v3/SKILL.md.tmpl Resolved

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread skills_src/generate/SKILL.md.tmpl Resolved
Comment thread skills_src/generate/SKILL.md.tmpl Resolved

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread skills_src/generate/SKILL.md.tmpl Resolved
@spydon
spydon merged commit 8bf5f10 into main Nov 2, 2026
43 checks passed
@spydon
spydon deleted the docs/skills-regenerate-on-schema-change branch November 2, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant