Commit, PR, and Merge
Stage changes, walk the pre-commit checklist, commit with a descriptive message, create a PR, and merge to main.
Step 0: Pre-commit checklist
There is no numeric score and no automated gate in this repo — no quality_score.py, no
.githooks/pre-commit (Python is not installed on this machine). This step is the review. Walk it
and report each line.
Skip the whole step when no file under R/ or _targets.R changed — a docs-only commit needs
only the session-log line.
Rscript -e "targets::tar_validate()"
grep -rnE "['\"][A-Za-z]:[/\\\\]|['\"]~/" R/ _targets.R # absolute paths
grep -rnE "(^|[^A-Za-z._])[TF]([^A-Za-z0-9._]|$)" R/ # T / F literals
grep -rn "library(\|require(" R/ # library() in R/
[ ] tar_validate() exits clean BLOCKING
[ ] No absolute paths in R/ or _targets.R BLOCKING
[ ] Invariants INV-1 … INV-9 hold for what changed BLOCKING
[ ] format = "file" targets still return the paths they wrote BLOCKING
[ ] No T / F literals; explicit na.rm=; no == on doubles warn
[ ] Output schema unchanged, or CLAUDE.md updated to match BLOCKING
[ ] Domain constants unchanged, or the change was approved BLOCKING
[ ] Session log for today exists in quality_reports/session_logs/ warn
For a change of any substance, spawn the verifier agent (Task, subagent_type=verifier) to
run these checks in a fresh context and report PASS / FAIL / NOT VERIFIED per line.
On a BLOCKING failure: halt and report. The user may override in words ("commit anyway", "skip the checklist") with a reason — record the reason in the commit body.
Never run tar_make() as part of this skill. If a check needs a pipeline run, report it as
NOT VERIFIED and let the user decide.
Step 0b: Documentation parity
If the change touched selecionar_colunas(), schema_cnefe, the folder-naming logic, or any
domain constant, confirm CLAUDE.md was updated in the same commit (INV-1). Apply
summary-parity.md to any summary paragraph you edit — re-read
the body, don't patch the flagged phrase.
Step 1: Check current state
git status
git diff --stat
git log --oneline -5
Step 2: Create a branch
git checkout -b <short-descriptive-branch-name>
Always a new branch — never commit directly to main.
Step 3: Stage files
Add specific files. Never git add -A, and never git add -f.
git add <file1> <file2> ...
Do not stage .claude/settings.local.json, anything under data/ (address microdata — see
confidential-data.md), or any file containing secrets.
Step 4: Commit
If $ARGUMENTS is provided, use it verbatim. Otherwise write a message that explains why, not
just what. Commit messages in this repo are written in Portuguese, matching the existing log.
git commit -m "$(cat <<'EOF'
<commit message here>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: <session url>
EOF
)"
Step 5: Push and create PR
git push -u origin <branch-name>
gh pr create --title "<short title>" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>
## Test plan
<what was verified, and what was NOT>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<session url>
EOF
)"
Step 6: Merge and clean up
gh pr merge <pr-number> --merge --delete-branch
git checkout main
git pull
Step 7: Report
Report the PR URL, what was merged, and — explicitly — what the checklist could not verify.
Important
- Never skip Step 0. If the user overrides, record the reason in the commit body.
- Never force-push; never
--no-verify. - Use
--mergeunless asked otherwise. - This is a public repository (
ipeaGIT/padronizacao_cnefe). Nothing underdata/and no address microdata may ever be staged.