一键导入
pr-prep
Use when implementation is complete and the branch is ready to open a PR — runs all quality gates and produces the PR description in one pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementation is complete and the branch is ready to open a PR — runs all quality gates and produces the PR description in one pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pr-prep |
| description | Use when implementation is complete and the branch is ready to open a PR — runs all quality gates and produces the PR description in one pass. |
| allowed-tools | Bash, Read, Grep, Glob |
| model | sonnet |
Verifies a branch is PR-ready and generates the PR description. Do not open the PR until all blocking gates pass.
git log develop..HEAD --oneline
git diff develop..HEAD --stat
git diff develop..HEAD --name-only
Run in parallel:
flutter analyze
flutter test patrol_test
If either fails: stop. Fix first, then resume.
diff <(jq -r '[paths(scalars)|join(".")]|sort|.[]' assets/translations/en.json) \
<(jq -r '[paths(scalars)|join(".")]|sort|.[]' assets/translations/km.json)
Output must be empty. If not: add missing keys to whichever file is behind.
git diff develop..HEAD --name-only | grep '\.dart$' | grep -v '\.g\.dart$' | while read f; do
[ -f "$f" ] && echo "$(wc -l < "$f") $f"
done | awk '$1 > 250 {print}'
Flag anything over 250. Anything over 300 is a blocker.
git diff develop..HEAD | grep -E '(api_key|apiKey|password|secret|token)\s*=\s*["'"'"'][^$]'
Must be empty. API keys must use String.fromEnvironment(...) from config_constants.dart.
flutter analyze — cleanflutter test patrol_test — all passing*.g.dart not manually edited (check via git diff develop..HEAD -- '*.g.dart')## What
- [What changed at the user/product level — 2–3 bullets]
## Why
[Motivation — bug report, spec requirement, performance issue]
## How
- [Key architectural decisions or non-obvious implementation choices]
## Test Plan
- [ ] `flutter analyze` — clean
- [ ] `flutter test patrol_test` — all passing
- [ ] Manually tested: [describe golden path]
- [ ] Edge cases: [list non-obvious edge cases]
## Notes for Reviewer
[Anything needing special attention, or known limitations]
---
🤖 Generated with [Claude Code](https://claude.ai/code)
Fill from git diff + commit history. Be specific — "add SHA-256 signature check to skip unchanged note chunks" not "improve performance".
gh pr create \
--base develop \
--title "type(scope): subject" \
--body "$(cat <<'EOF'
<generated description>
EOF
)"
Return the PR URL.
## PR Prep — <branch>
### Gates
✅ flutter analyze — clean
✅ flutter test patrol_test — N passed
✅ i18n parity — in sync
✅ File sizes — no violations
✅ No secrets found
### Blockers
(none) — ready to open PR
### PR Description
<description>
Use when inserting a new i18n key into Trovara's locale files — adds the key to both en.json and km.json under the correct nested path and verifies parity.
Use when incrementing the Trovara app version before a release — updates the semver and build number in pubspec.yaml following the project's versioning convention.
Use when reviewing a Trovara code change — checks correctness, MVVM layering, security, performance, i18n parity, file-size limits, and test coverage like a senior engineer.
Use when a developer needs orientation to the Trovara codebase — new team member, returning after a gap, or asking "how does X work", "where is Y", or "how do I add a new feature".
Use when a new service, repository, or subsystem needs documentation — CLAUDE.md for new directories, dartdoc for public APIs, or updating existing architecture docs after a structural change.
Use when adding a new screen, modifying existing feature behavior, or wiring new business logic end-to-end in Trovara — creates MVVM scaffold, route, ServiceLocator wiring, and i18n keys.