ragappv3 Commit and PR Protocol
Use this skill when the user asks to commit, push, publish, ship, open a PR, update a PR, or apply PR review follow-up in this repository.
Repository Facts
- Default branch:
master. - Branch prefix: match your agent runner's convention —
claude/for Claude Code,codex/for Codex — unless the user requests another prefix. - Backend: Python/FastAPI under
backend/. - Frontend: npm/Vite/Vitest under
frontend/. - Default PR state: draft, unless the user explicitly asks for ready review.
- Keep
.Codex/, IDE files, local settings, and generated session artifacts out of commits.
Do not use opencode-swarm or Bun publish rules in this repo. Do not require
release-please files, .swarm evidence cleanup, Bun tier suites, dist/ drift
checks, or an opencode-swarm invariant audit unless those files actually exist
and the current change touches them.
Workflow
Inspect state before changing git history.
- Run
git status -sb,git branch --show-current, andgit remote -v. - Run
gh auth statuswhen a PR or push is requested. - Fetch the target branch with
git fetch origin master.
- Run
Choose the branch strategy.
- If detached with existing work or commits, create
<prefix>/<short-slug>at the currentHEAD. - If starting fresh from
master, create<prefix>/<short-slug>from currentorigin/master. - If already on a feature branch for this work, stay there.
- If the branch has diverged from
origin/master, check mergeability before pushing.
- If detached with existing work or commits, create
Confirm scope from the diff.
- Use
git diff --statand targetedgit diff -- <paths>. - Stage explicit paths only. Do not use
git add -Aunless the whole worktree is known to belong to the task. - Leave
.Codex/untracked unless the user explicitly asks to commit session files.
- Use
Validate according to the change.
- Always run
git diff --check; CRLF normalization warnings are non-blocking. - For backend code, run targeted
python -m pytest ...andpython -m py_compile ...for touched Python files. - For broader backend changes, run the relevant backend pytest module set from
backend/. - For frontend code, run targeted
npm test -- <test files>fromfrontend/. - Before PR publish or after review fixes touching frontend code, run
npm run typecheckandnpm run lint -- --max-warnings 0fromfrontend/. - Run
npm run buildwhen the change touches build configuration, routing, app shell behavior, or release-critical frontend paths. - If a validation command fails because dependencies are missing, install the project dependencies in the correct subdirectory and rerun once.
- Always run
Handle external review findings.
- Use this protocol whenever the user provides external-agent, reviewer, CI, or audit findings for an existing PR.
- Load
review-finding-validatorfor finding bundles before deciding what is true. - Load
config-env-contract-checkwhen findings or changes touch env vars, Docker, Compose, settings, CORS, root paths, or deployment docs. - Load
ci-compatibility-auditwhen findings or changes touch workflows, package manifests, requirements, test commands, lint, build, or dependency installation. - Refresh current state before judging findings: fetch the target branch, inspect the current branch or PR head, and compare against the current diff.
- Treat every finding as a claim until verified against source, diff, config, or focused runtime/test evidence.
- Classify each finding as
confirmed,partially valid,not reproduced,pre-existing, orout of scope, and keep brief evidence for the classification. - Fix confirmed findings. Fix partially valid findings only when the valid portion is in PR scope or explicitly accepted by the user/source agent.
- Do not broaden the PR with adjacent cleanup unless required to resolve a confirmed finding.
- Rerun focused validation for touched behavior before publishing the follow-up.
- In the PR body, summarize
Accepted,Rejected, andDeferred/out of scopefindings with short reasons and validation evidence. Do not write exhaustive prose for low-quality rejected findings.
Commit cleanly.
- Use one conventional commit:
<type>(<scope>): <lowercase description>. - Prefer
feat,fix,test,docs,refactor, orchore. - For PR review follow-up, follow
Handle external review findings; amend the single existing commit when practical. - Keep the PR branch to one meaningful commit before asking for merge.
- Use one conventional commit:
Push safely.
- New branch:
git push -u origin <branch>. - Amended review follow-up:
git push --force-with-lease -u origin <branch>. - Never use plain
--force.
- New branch:
Open or update the PR.
- Base branch:
master. - Default to a draft PR.
- Title must match the conventional commit message when practical.
- Body must include:
## Summary: 1-3 bullets explaining what changed and why.## Test plan: markdown checklist of commands run and results.## Review follow-up: only when addressing review feedback.- Known warnings or intentionally skipped checks, with reasons.
- Base branch:
Final status check.
- Run
gh pr view <number> --json url,isDraft,mergeable,mergeStateStatus,headRefName,baseRefName,commits. - Run
git status -sb. - Confirm only expected untracked local files remain.
- Run
PR Body Template
## Summary
- <summary bullet>
## Test plan
- [x] `<command>` -- <result>
## Review follow-up
- <review follow-up bullet>
Omit ## Review follow-up when there was no review feedback.