humansys/raise/rai-bugfix-pir
Claude Code and agent skill by humansys/raise
- community
Checking that the SKILL.md file is still in the repository.
Post-Incident Review — learning narrative and improvement actions. Phase 8.5 of bugfix pipeline.
Install
npx vskill@latest install humansys/raise/rai-bugfix-pirSKILL.md
Bugfix PIR (Post-Incident Review)
Purpose
Convert in-context session learning into a team-readable narrative and trackable improvement actions. Bugs are process sensors — the PIR extracts the signal before it decays.
Grounded in: Google SRE postmortem framework (Lunney 2017), Etsy Debriefing Guide (Allspaw), Howie Post-Incident Guide (Maguire/Jones), Cook's "How Complex Systems Fail."
Mastery Levels (ShuHaRi)
- Shu: Follow all steps, present full narrative, ask for approval on every action
- Ha: Compact narrative for trivial bugs; batch-present actions
- Ri: Cross-bug pattern analysis from prior PIR artifacts; systemic action proposals
Context
When to use: After /rai-bugfix-review has produced retro.md. The PIR consumes review artifacts and the agent's in-context session knowledge to produce learning outputs.
When to skip: Only when the developer explicitly skips at the HITL gate (pipeline mandatory: false). Even trivial bugs benefit from a brief narrative — the cost is 2 minutes, the value compounds.
Inputs: Bug ID, work/bugs/{issue_key}/retro.md, work/bugs/{issue_key}/analysis.md, in-context session knowledge from the bugfix session.
Expected state: On bug branch. Review phase complete. retro.md committed.
Steps
Step 1: Gather Signals
Read prior artifacts to ground the narrative in evidence:
Extract five signal categories from artifacts + in-context session knowledge:
| Category | Source | What to capture | |
|---|---|---|---|
| Contextual | Session memory | Timeline with decision points, what pressures existed, what seemed reasonable at each step | |
| Impact | scope.md | User impact scope, detection latency, resolution path | |
| Systemic | analysis.md | Contributing factors (plural), prior near-misses in same area, adaptive capacity consumed | |
| Learning | Session memory | Surprises, tacit knowledge surfaced during debugging, mental models that were wrong | |
| Meta | retro.md | Detection mechanism (automated vs manual), response effectiveness, what patterns were added |
Step 2: Draft PIR Narrative
Write the narrative using HOW-not-WHY framing. "How" elicits conditions; "why" elicits blame.
Document structure:
Step 3: Propose Actions (Lunney Taxonomy)
Classify each proposed action into exactly one category:
| Category | Purpose | Example | |
|---|---|---|---|
| Investigate | Dig deeper into an unknown | "Audit all OAuth endpoints for similar blanket restrictions" | |
| Mitigate | Reduce impact if it recurs | "Add circuit breaker for redirect validation failures" | |
| Repair | Fix the immediate defect | (Usually already done in bugfix — rarely needed in PIR) | |
| Detect | Catch it faster next time | "Add parametrized test for all RFC client types" | |
| Prevent | Eliminate the class of bug | "Spec-review checklist for security endpoints" |
Quality bar per action (Lunney):
- Actionable — starts with a verb
- Specific — scoped narrowly enough to be a single Jira issue
- Bounded — clear done-criteria
Assign priority:
- P1 — high recurrence risk or wide blast radius
- P2 — moderate risk, improvement opportunity
- P3 — nice-to-have, low urgency
Add the actions table to the PIR narrative:
For trivial bugs with no systemic learning, it is valid to propose zero actions. State explicitly: "No systemic actions warranted — single-instance defect with no pattern signal."
Step 4: HITL Gate — Action Approval
Present proposed actions to the developer for review:
Wait for developer response. Do NOT create Jira issues without approval.
| Response | Action | |
|---|---|---|
| Approve | Create all proposed issues (Step 5) | |
| Edit | Apply developer's changes, re-present | |
| Skip | Skip Step 5, continue to Step 6 |
Step 5: Create Improvement Issues in Jira
For each approved action:
After creation, link each new issue to the original bug:
Collect all created issue keys for the frontmatter.
Step 6: Publish PIR
Update the frontmatter with actual action_issue_keys (from Step 5) or empty list (if skipped).
Write pir.md locally:
Commit:
<verification> PIR narrative committed. Jira issues created and linked (if approved). </verification>
Output
| Item | Destination | |
|---|---|---|
| PIR narrative | work/bugs/{issue_key}/pir.md (local) | |
| Improvement issues | Jira (linked to original bug) |
STOP HERE. Return your summary to the orchestrator. Do NOT invoke any further skill.
Quality Checklist
- [ ] Contributing factors use HOW framing (never "X failed because Y")
- [ ] Actions classified per Lunney taxonomy (Investigate/Mitigate/Repair/Detect/Prevent)
- [ ] Each action meets Actionable + Specific + Bounded quality bar
- [ ] HITL gate respected — never create Jira issues without developer approval
- [ ] Zero actions is valid for trivial bugs — stated explicitly
- [ ] Frontmatter is valid YAML with all semantic fields populated
- [ ] NEVER modify retro.md, analysis.md, or any prior artifact
References
- Research:
work/research/pir-sota/pir-sota-report.md - Previous:
/rai-bugfix-review - Next:
/rai-bugfix-close - Lunney taxonomy: Investigate, Mitigate, Repair, Detect, Prevent (USENIX ;login: 2017)
- Howie guide: howie-guide.pagerduty.com
- Cook: how.complexsystems.fail
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/raise-cli/src/raise_cli/skills_base/rai-bugfix-pir/SKILL.md
Popularity
- Repository stars
- 71
- Repository forks
- 8
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/humansys/raise/rai-bugfix-pir)