Auto-generate a Production Change Validation Log entry for one or more PRs. Researches blast radius, test coverage, deployment risk, and cross-repo impact, then drafts the full 8-section checklist for engineer review. Trigger on: "validate change", "change validation", "production checklist", "deploy checklist".
Auto-generate a Production Change Validation Log entry. Research the change, draft all 8 sections, get engineer approval, save to Notion, and link to the PR.
$ARGUMENTS — One or more of:
Multiple PRs are treated as a single logical change — one checklist entry.
| Item | Value |
|---|---|
| Validation Log data source ID | bdb67447-737b-48c4-acef-97449310640b |
| Validation Log database ID | 9d1b46aa-f9a3-4806-bf45-28f1d14ccfe1 |
| Pending Changes database ID |
32da84ed-4024-80ab-abfd-000b0395b097 |
| Checklist process page | 32da84ed402480d096caf355647afc3a |
| Property | Type | Values |
|---|---|---|
| Change | title | Terse summary |
| Checklist Complete | checkbox | __YES__ / __NO__ |
| Status | select | Pending Review, Peer Approved, EM Approved, Shipped, Held, Rolled Back |
| Risk Level | select | Low, Medium, High, Critical |
| Type | select | PR, Feature Flag, Rake Task, Rollout Change, Config Change, Hotfix |
| Financial Liability | select | None, Possible, Confirmed |
| Merchants Affected | text | Free text |
| PR / Ticket | url | GitHub PR URL |
| Engineer | person | JSON array of user IDs |
| Date | date | ISO-8601 date |
| Peer Reviewer | person | Leave empty |
| EM Sign-off | person | Leave empty |
| Notes | text | Free text |
Use ToolSearch to find mcp__claude_ai_Notion__notion-create-pages. If unavailable, tell the user: "Can't write to Notion. I'll save as ~/Documents/validate-change-{date}.md instead."
If $ARGUMENTS contains a Notion URL:
Query the Validation Log database for entries matching the PR. If found and complete, ask whether to re-validate or skip. If found but incomplete, ask whether to update or create new.
# If PR URL provided
gh pr view {PR_URL} --json title,body,author,headRefName,baseRefName,files,additions,deletions,number,url
gh pr diff {PR_URL}
# If branch name or empty
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
BRANCH=$(git branch --show-current)
gh pr list --head "$BRANCH" --json number,url,title --limit 1
Also get the full diff:
git diff origin/master...HEAD -- ':(exclude)Gemfile.lock' ':(exclude)db/' ':(exclude)*.lock'
| Pattern | Type |
|---|---|
| Standard code change | PR |
| Only flag config changes | Feature Flag |
| Contains rake tasks / data scripts | Rake Task |
| Rollout percentage changes | Rollout Change |
| Config/env/terraform only | Config Change |
| Emergency fix | Hotfix |
Show a brief summary of the change, then ask:
(Validate · Setup) Before I research, is there anything about this change that worries you? Any specific risk?
Provide 2-3 context-aware concern options from the diff plus "No concerns". Store as $ENGINEER_CONCERNS — these become priority investigation targets but do NOT replace standard analysis.
Launch 3 agents in parallel:
Provide the full diff. Agent should:
~/.thanx/ sibling repos if available)$ENGINEER_CONCERNS as priority targetsProvide affected tables, models, endpoints. Agent should:
$ENGINEER_CONCERNS risk chains with production dataProvide diffs and PR metadata. Agent should:
Wait for all 3 agents, consolidate into $RESEARCH.
Assertive, evidence-first, no hedging. Follow the CTO example style:
| Do This | Not This |
|---|---|
"Risk is zero. Draft promotions cannot be redeemed — .redeemable scope filters to active only." | "No financial liability risk." |
| "0 merchants affected at launch. No existing callers send this param." | "The change has low blast radius." |
"$0. Even if a draft were somehow created, .redeemable prevents redemption." | "Worst-case financial exposure is minimal." |
Rules:
For each sub-bullet (Direct Revenue, Direct Liability, Operational Friction, Indirect Impact):
If $ENGINEER_CONCERNS exist, add a callout at the top:
Engineer concern: {concern} — Investigated: {evidence}. Verdict: {SAFE/MITIGATED/AT RISK}.
Code coverage: scenarios, edge cases, side effects checked Risk validation: for each risk from Section 2, what test or verification proves it won't materialize Declared gaps: what was NOT tested and why
N/A for features. For bug fixes: root cause, related bugs, symptom vs root cause.
Display all 8 sections. Ask:
(Validate: {PR title} · Review) Here's the complete validation checklist. Please review — you're signing off on these answers.
Ready to save to Notion, or corrections needed?
Only after explicit approval.
Fetch the enhanced markdown spec first:
ReadMcpResourceTool(server="claude.ai Notion", uri="notion://docs/enhanced-markdown-spec")
Use mcp__claude_ai_Notion__notion-create-pages with:
{"type": "data_source_id", "data_source_id": "bdb67447-737b-48c4-acef-97449310640b"}If updating an existing entry, use mcp__claude_ai_Notion__notion-update-page. If status is already Peer Approved or EM Approved, warn that re-validating resets to Pending Review.
If Notion write fails, save to ~/Documents/validate-change-{repo}-{date}.md.
After creating the Notion page:
BODY_FILE=$(mktemp)
gh pr view {PR_URL} --json body -q '.body' > "$BODY_FILE"
printf "\n\n---\n**Production Change Validation**: [{title}]({notion_url})\n" >> "$BODY_FILE"
gh pr edit {PR_NUMBER} -R {REPO} --body-file "$BODY_FILE"
rm -f "$BODY_FILE"
Tell the engineer:
Validation log saved and linked:
- Notion: {URL}
- PR(s) updated: {list}
Next steps:
1. Peer reviewer validates the checklist
2. EM gives final sign-off
3. No EM approval = does not proceed to production
| Error | Action |
|---|---|
| Keystone unavailable | Proceed without production data. Flag sections as "needs manual verification" |
| No PR found | Ask: "No open PR found. Describe the change manually?" |
| Notion write fails | Save as local markdown file |
| PR edit fails | Show Notion link, tell engineer to add manually |
| Agent timeout | Use partial results, note incomplete analysis |