humansys/raise/rai-bugfix-pir

Claude Code and agent skill by humansys/raise

Trust tier 2
  • community
LLM review pending
Source check pending

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-pir

SKILL.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:

bash
cat work/bugs/{issue_key}/retro.md
cat work/bugs/{issue_key}/analysis.md
cat work/bugs/{issue_key}/scope.md

Extract five signal categories from artifacts + in-context session knowledge:

CategorySourceWhat to capture
ContextualSession memoryTimeline with decision points, what pressures existed, what seemed reasonable at each step
Impactscope.mdUser impact scope, detection latency, resolution path
Systemicanalysis.mdContributing factors (plural), prior near-misses in same area, adaptive capacity consumed
LearningSession memorySurprises, tacit knowledge surfaced during debugging, mental models that were wrong
Metaretro.mdDetection 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:

markdown
---
bug_key: {issue_key}
domain: {affected domain — e.g. oauth, pipeline, storage}
contributing_factors:
-{factor-1-slug}
-{factor-2-slug}
action_categories: [{categories of proposed actions}]
action_issue_keys: [{filled after HITL approval}]
pir_confluence_url: null # local-only on 3.1.6 (no docs publish)
---
# PIR: {issue_key} — {summary}
## Summary
{2-3 sentences: what happened, scope of impact, how it was resolved.}
## Contributing Factors
{For each factor, frame as "How X came to be" — describe conditions, not blame.}
1.**How {condition described}:** {narrative explaining the conditions that led to this}
2.**How {condition described}:** {narrative}
## Surprises
{What was unexpected during investigation or fix. What mental models were wrong.}
## Where We Got Lucky
{Things that could have made the impact worse but didn't. Near-miss signals.}
## Impact
-**Users affected:** {scope}
-**Detection latency:** {how long before noticed}
-**Resolution time:** {total fix duration}
-**Detection mechanism:** {automated alert / manual discovery / user report}
## Proposed Actions
{Table of classified actions — filled in Step 3.}
Step 3: Propose Actions (Lunney Taxonomy)

Classify each proposed action into exactly one category:

CategoryPurposeExample
InvestigateDig deeper into an unknown"Audit all OAuth endpoints for similar blanket restrictions"
MitigateReduce impact if it recurs"Add circuit breaker for redirect validation failures"
RepairFix the immediate defect(Usually already done in bugfix — rarely needed in PIR)
DetectCatch it faster next time"Add parametrized test for all RFC client types"
PreventEliminate 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:

markdown
## Proposed Actions
| # | Category | Action | Priority | Rationale |
|---|----------|--------|----------|-----------|
| 1 | Detect | {verb} {specific action} | P1 | {why this category and priority} |
| 2 | Prevent | {verb} {specific action} | P2 | {rationale} |

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:

## PIR Actions — {issue_key}
Proposed improvement issues (will be linked to {issue_key}):
1. [{Category}/P{N}] {Action description}
2. [{Category}/P{N}] {Action description}
Options:
(a) Approve all — create Jira issues
(e) Edit — modify actions before creating
(s) Skip — publish narrative only, no Jira issues

Wait for developer response. Do NOT create Jira issues without approval.

ResponseAction
ApproveCreate all proposed issues (Step 5)
EditApply developer's changes, re-present
SkipSkip Step 5, continue to Step 6
Step 5: Create Improvement Issues in Jira

For each approved action:

bash
rai backlog create \
--project RAISE \
--type Task \
--labels pir-action \
--summary "[{Category}] {Action description}" \
--description "From PIR of {issue_key}.
**Category:** {Category}
**Priority:** P{N}
**Rationale:** {rationale}
Co-Authored-By: Rai <rai@humansys.ai>"

After creation, link each new issue to the original bug:

bash
rai backlog link {new_issue_key} {issue_key} "Relates"

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:

bash
cat > work/bugs/{issue_key}/pir.md << 'PIRDOC'
{complete PIR document with updated frontmatter}
PIRDOC

Commit:

bash
git add work/bugs/{issue_key}/pir.md
git commit -m "bug({issue_key}): pir — learning narrative and improvement actions
Co-Authored-By: Rai <rai@humansys.ai>"

<verification> PIR narrative committed. Jira issues created and linked (if approved). </verification>

Output

ItemDestination
PIR narrativework/bugs/{issue_key}/pir.md (local)
Improvement issuesJira (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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/humansys/raise/rai-bugfix-pir/badge)](https://verified-skill.com/skills/humansys/raise/rai-bugfix-pir)

Something wrong with this skill or its page? Tell us.