PR Open Skill
End-to-end workflow for committing work and opening a merge-ready PR in bklit-ui.
Read this skill when the user wants to add, commit, validate, push, and open a PR — or references
.
Before you start
-
Confirm branch context
- If the user merged an earlier PR on this branch and there are new changes, branch from latest instead of stacking on a stale feature branch:
bash
git fetch origin main
git checkout -b <new-branch-name> origin/main
- Re-apply or cherry-pick only the intended changes; do not commit unrelated noise (e.g. reformatted
packages/ui/registry/examples/*
unless those edits are intentional).
-
Never commit secrets — skip
, credentials, API keys, etc. Warn the user if they ask to commit them.
-
Git safety (required)
- Do not update git config.
- Do not run destructive commands (, ) unless the user explicitly asks.
- Do not skip hooks () unless the user explicitly asks.
- Do not unless all amend rules in the user's git rules are satisfied (HEAD commit is yours, not pushed, or user requested amend).
- If a commit fails due to a hook, fix the issue and create a new commit — do not amend a failed commit.
- Use HEREDOC for commit messages (see below).
- Do not push unless the user asked to push or open a PR.
Step 1 — Inspect changes
Run in parallel from the repo root:
bash
git status
git diff
git diff --staged
git log -5 --oneline
If opening a PR, also check divergence from base:
bash
git fetch origin main
git log origin/main..HEAD --oneline
git diff origin/main...HEAD --stat
Draft a commit message that explains
why, not just what. Match recent repo style (e.g.
,
).
Step 2 — Stage and commit (pre-commit loop)
Stage
bash
git add <paths> # prefer explicit paths over blind git add -A
Commit
bash
git commit -m "$(cat <<'EOF'
<subject line>
<optional body — 1–2 sentences on why>
EOF
)"
Husky
pre-commit runs
(see
).
If pre-commit fails or leaves unstaged fixes
- Read the hook output and fix every reported issue (lint correctness, nested ternaries, only when justified, etc.).
- Re-stage affected files:
- Commit again with a new commit (or amend only if amend rules allow and the previous commit succeeded but the hook auto-modified files).
Repeat until
succeeds
and is clean (no leftover hook formatting).
Step 3 — Ultracite from repo root
After commits are clean, run the root pnpm scripts (not
directly unless fixing a one-off):
bash
pnpm lint # ultracite check
If check fails:
bash
pnpm lint:fix # ultracite fix (same as pnpm format)
Then:
- Review for unexpected changes.
- If files changed: →
git commit -m "$(cat <<'EOF' Fix lint issues from ultracite EOF )"
- Re-run until it passes with no fixes pending.
Do not open a PR while
fails or while lint fixes are unstaged.
Step 4 — Test build
Run a production build to catch type and compile errors before the PR.
Default (whole monorepo):
Web app only (faster when changes are confined to
):
bash
cd apps/web && pnpm build
If the web build OOMs in dev/CI-like environments, retry with more heap:
bash
cd apps/web && NODE_OPTIONS='--max-old-space-size=8192' pnpm build
Optional but recommended when touching TypeScript:
If build fails
- Fix the root cause (types, imports, missing registry files, etc.).
- Re-run the failing command until it passes.
- Commit fixes with a clear message, then re-run Step 3 () if source files changed.
Step 5 — Push
Only when the user asked to push or open a PR:
If the branch was already pushed and you added commits,
is enough.
Step 6 — Open the PR
Use GitHub CLI from the repo root:
bash
gh pr create --title "<PR title>" --body "$(cat <<'EOF'
## Summary
- <bullet: what changed and why>
- <bullet: user-facing impact>
- <bullet: follow-ups or deploy notes if any>
## Test plan
- [ ] `pnpm lint` passes at repo root
- [ ] `pnpm build` (or `apps/web` build for web-only changes)
- [ ] <manual verification step 1>
- [ ] <manual verification step 2>
EOF
)"
Return the PR URL to the user.
PR title guidelines
- Short, imperative, scoped (e.g.
Add @bklit/chart-animation registry item
)
- Match the primary commit subject when possible
PR body template (copy structure every time)
markdown
## Summary
- <1–3 bullets: what and why>
## Test plan
- [ ] `pnpm lint` passes at repo root
- [ ] Production build succeeds (`pnpm build` or scoped web build)
- [ ] <feature-specific check>
- [ ] <regression check if applicable>
Add extra sections only when useful:
- Context — link to a merged PR or issue (e.g. "Follow-up to #70")
- Deploy notes — e.g. registry JSON must be live on for Open in v0
Repo-specific PR notes
- Registry changes: run from root (or ) before commit; include outputs in the commit.
- Do not commit incidental reformats from on
packages/ui/registry/examples/*
unless intentional.
- Chart/docs work: mention manual checks for docs pages, Studio, or Open in v0 when relevant.
Full checklist (quick reference)
| Step | Command / action | Must pass before next step |
|---|
| 1 | / / | Understand scope |
| 2 | → | Pre-commit hook clean; working tree clean |
| 3 | → if needed → re-commit | exits 0 |
| 4 | (and if TS changed) | Build exits 0 |
| 5 | | Only if user requested push/PR |
| 6 | with Summary + Test plan | PR URL returned |
Common failures
| Failure | Fix |
|---|
| Pre-commit biome errors | Fix code; add only with a one-line justification |
| Hook fixed files but commit already succeeded | + new commit (or amend if allowed) |
| fails after commit | , review diff, commit, re-run |
Can't resolve './animation'
in registry consumers | Add missing registry deps; run |
| Web build OOM | NODE_OPTIONS='--max-old-space-size=8192'
for build |
| PR branch already merged | New branch from , re-apply only new changes |
Example flow
User: "commit this and open a PR"
- + +
git add apps/web packages/ui
→ (fix pre-commit until clean)
- → if needed → commit →
- (fix until green) → commit if needed
- with Summary + Test plan template
- Reply with PR link and one-line summary of what was validated