| name | pub-release |
| description | Guides publishing a Flutter/Dart package to pub.dev with a release checklist (CHANGELOG, README, docs), version policy (breaking changes as beta first, bugfixes as stable, promote beta to full after 1 week), and GitHub Issues feedback collection. Use when the user runs /pub-release, or asks to publish to pub.dev, cut a release, promote a beta, ship a bugfix version, or prep package release docs.
|
pub-release
Agent instructions for releasing this Dart/Flutter package to pub.dev.
Follow every phase in order. Do not publish until the user explicitly confirms
the final publish step.
Version policy (non-negotiable)
| Change type | Channel | Version pattern | Notes |
|---|
| Breaking change | Beta first | X.Y.Z-beta.N | Never ship breaking API/SDK/behavior as stable on first cut |
| Feature (non-breaking) | Prefer beta, or patch/minor stable if low risk | X.Y.Z-beta.N or X.Y.0 | Prefer beta for large features |
| Bugfix only | Stable | X.Y.Z (patch) | Ship as full release when no breaking changes |
| Beta → full | Stable after soak | Drop -beta.N → X.Y.Z | Only after ≥ 7 days on pub.dev and feedback review |
SemVer rules for this package:
- Breaking → bump major or keep pre-release under the intended stable (
1.4.5-beta.N → later 1.4.5)
- Feature → minor (or stay on beta track for the next stable)
- Bugfix → patch
- Pre-release identifiers: use
-beta.1, -beta.2, … (pub.dev pre-release ordering)
If the change set includes any breaking item, the whole release is beta.
Release modes
Detect or ask which mode:
- beta — new pre-release (breaking and/or large features)
- stable-bugfix — patch with only fixes
- promote-beta — promote an existing beta to full after 1-week soak
- docs-only — no version bump publish; update docs only (rare)
Phase 0 — Orient
- Read
pubspec.yaml for current name, version, environment, homepage/repository.
- Read top of
CHANGELOG.md for the latest published/unreleased notes.
git status / git log / git diff vs last tag — what actually changed.
- List open GitHub issues/PRs that this release claims to fix (
gh issue list, gh pr list).
- State the chosen mode, from version → to version, and a one-line rationale. Get user confirmation if ambiguous.
Phase 1 — Classify the change set
Build a short table:
| Item | Breaking? | Fix / Feature / Docs | Linked issue |
|---|
Rules:
- API removals/renames, min SDK/Flutter bumps, platform-view strategy changes, default behavior flips → breaking
- Pure crash/layout/leak fixes with public API unchanged → bugfix
- If mixed breaking + fixes → beta (list breaking first in CHANGELOG)
Phase 2 — Documentation checklist (must all pass)
Work through every item. Mark [x] / [ ] in your reply to the user before publish.
2.1 CHANGELOG.md
2.2 README.md
2.3 Other package docs
2.4 Version files stay in sync
Reference: references/checklist.md
Phase 3 — Quality gates (before any publish)
Run from package root (adjust if monorepo):
flutter pub get
dart format --set-exit-if-changed .
flutter analyze
flutter test
If the package has an example:
cd example && flutter pub get && flutter analyze
Optional but recommended for plugins:
cd android && ./gradlew test
Also:
dart pub publish --dry-run
Fix all failures before continuing. Dry-run must report no blockers.
Phase 4 — GitHub Issues feedback loop
When shipping a beta
- Open (or update) a tracking issue titled roughly:
Beta feedback: <package> <version>
- Body must include:
- What changed (summary + link to CHANGELOG section)
- Breaking changes / migration steps
- How to try: dependency override or version pin (
package: X.Y.Z-beta.N)
- Ask for: platform, Flutter version, repro, expected vs actual
- Explicit note: target full release after ≥ 7 days if no critical regressions
- Label appropriately if labels exist (
beta, feedback, release)
- Link related fixed issues in the tracking issue
- Comment on major fixed issues: “Included in
<version> (beta) — please verify”
gh issue create --title "Beta feedback: <name> <version>" --body-file - <<'EOF'
...
EOF
When shipping a stable bugfix
- Comment on fixed issues that the fix is on pub.dev as
<version>
- Close issues only when the fix is confirmed shipped (or per repo convention: close with “fixed in …” and let maintainers close)
When promoting beta → full
- Search issues for beta feedback since beta publish date:
gh issue list --search "beta feedback OR regression OR <version-base>" --state all --limit 50
gh issue list --label "bug" --state open --limit 50
- Summarize to the user:
- Critical regressions? → do not promote; cut
beta.N+1 instead
- Non-blocking issues? → file follow-ups, proceed if user agrees
- Comment on the beta tracking issue that full
X.Y.Z is published; close if resolved
- Thank reporters on useful feedback issues
Phase 5 — Version bump
- Edit
pubspec.yaml version:
- Ensure CHANGELOG top section matches
- Commit only when user asks to commit (do not force git_write)
Suggested commit message style:
release: <version>
or
chore(release): <version>
Tag after publish success (or immediately before, per repo habit — prefer after successful dart pub publish so tags match live versions):
git tag v<version>
git push origin HEAD --tags
Only push/tag when the user approves.
Phase 6 — Publish to pub.dev
Stop and confirm with the user before running publish.
dart pub publish --dry-run
dart pub publish
Notes:
- Requires logged-in publisher (
dart pub token / browser auth as configured)
- Publisher must have permission on the pub.dev package
- Pre-release versions (
-beta.N) are visible on pub.dev but clients need an explicit constraint to take them (good)
- After publish, verify:
https://pub.dev/packages/<name>/versions
Do not re-publish the same version. Versions are immutable.
Phase 7 — Promote beta → full (after 1 week)
Trigger when user asks to promote, or when reviewing an aged beta.
- Confirm beta version exists on pub.dev and published date ≥ 7 days ago
- Run Phase 4 feedback review (blockers → new beta, not promote)
- Set version to stable
X.Y.Z (same numbers as beta base, no -beta.N)
- CHANGELOG:
- Add
## X.Y.Z noting promotion from X.Y.Z-beta.N and any post-beta fixes
- If identical to last beta: “Stable release of X.Y.Z-beta.N after soak period.”
- Re-run Phase 2–3 checklists
- Publish stable, then Phase 4 close-out comments
If post-beta fixes landed:
- Either promote with those fixes listed under
X.Y.Z, or
- Ship another beta and restart the 7-day clock (prefer restart if fixes are risky)
Phase 8 — Post-release
Stable:
dependencies:
<package>: ^X.Y.Z
Beta:
dependencies:
<package>: X.Y.Z-beta.N
Decision shortcuts
Is there a BREAKING change?
YES → beta (never direct stable)
NO → only bugfixes?
YES → stable patch
NO → features?
large / risky → beta
small / safe → minor/patch stable (confirm with user)
Is this a promote-beta request?
beta age < 7 days → refuse promote; report days remaining
open critical regressions → new beta, do not promote
else → stable X.Y.Z
Safety
- Never
dart pub publish without explicit user approval for that exact version
- Never force-push tags or rewrite published CHANGELOG history casually
- Never publish with failing analyze/tests or failed dry-run
- Never skip README/CHANGELOG sync “to do later”
- If publisher credentials missing, stop and instruct the user to auth — do not try to bypass
Communication with the user
At each major gate, report:
- Mode + version transition
- Checklist status (pass/fail list)
- Feedback issue status
- Exact command you want to run next
- Wait for approval on publish / tag / push