# Rai Story Review

> Reflect on completed stories to extract learnings, identify process improvements, and update the framework with insights gained. Use after implementation is complete to close the development cycle.

- Skill: `stefancgillberg/rai-story-review` (Agent Skill)
- Install (CLI): `npx skillmds@latest add stefancgillberg/rai-story-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/stefancgillberg/rai-story-review/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: stefancgillberg (https://skillmd.com/u/stefancgillberg)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/stefancgillberg/rai-story-review

---


# Story Review

## Purpose

Reflect on the completed story to extract learnings, persist patterns, reinforce behavioral signals, and emit calibration telemetry.

## Mastery Levels (ShuHaRi)

- **Shu**: Follow all steps, answer all checkpoint questions with specific examples
- **Ha**: Adapt depth to story complexity, batch small story reviews
- **Ri**: Custom review patterns, integrate with team retrospectives

## Context

**When to use:** After implementation is complete and tests pass. Before `/rai-story-close`.

**Inputs:** Completed story, progress log, passing test suite.

## Steps

### Step 1: Verify Tests Pass

Determine which test command to run using this priority chain:

1. **Check `.raise/manifest.yaml`** for `project.test_command` — if set, use it directly (configuration over convention)
2. **Detect language** from `project.project_type` in manifest, or scan file extensions of changed files (`git diff --name-only`)
3. **Map language to default** using the table below

```yaml
# .raise/manifest.yaml — example
project:
  test_command: "cargo test --quiet"   # explicit override, highest priority
  project_type: rust
```

| Language | Extensions | Default Test Command |
|----------|-----------|----------------------|
| Python | `.py`, `.pyi` | `uv run pytest --tb=short` |
| TypeScript | `.ts`, `.tsx` | `npx vitest run` or `npm test` |
| JavaScript | `.js`, `.jsx` | `npx vitest run` or `npm test` |
| C# | `.cs` | `dotnet test --verbosity quiet` |
| Go | `.go` | `go test ./...` |
| PHP | `.php` | `vendor/bin/phpunit` |
| Dart | `.dart` | `flutter test` |
| Unknown | — | Ask developer |

The table is a **fallback** — `project.test_command` always wins when present.

| Condition | Action |
|-----------|--------|
| Tests green | Continue |
| Tests failing | Fix first — review requires green tests |

<verification>
Project language detected. Tests passing with appropriate runner.
</verification>

### Step 2: Gather Data & Reflect

Review the story development: actual vs estimated time, blockers, plan deviations.

**Heutagogical checkpoint** — answer with specific examples:
1. What did you learn?
2. What would you change about the process?
3. Are there improvements for the framework?
4. What are you more capable of now?

Identify concrete improvements to skills, guardrails, or templates. Apply small improvements immediately; create issues for complex ones.

<verification>
All four questions answered. Improvements identified (or celebrated that none needed).
</verification>

### Step 3: Persist Patterns & Reinforce

**Add new patterns** worth preserving across sessions:

```bash
rai pattern add "Pattern description" -c "context,keywords" -t process --from S{N}.{M}
```

Types: `process`, `technical`, `architecture`, `codebase`.

**Reinforce existing patterns** — evaluate behavioral patterns loaded at session start:

```bash
rai pattern reinforce {pattern_id} --vote {1|0|-1} --from S{N}.{M}
```

| Vote | Meaning |
|:----:|---------|
| `1` | Implementation followed the pattern |
| `0` | Pattern not relevant to this story (does NOT count toward evaluations) |
| `-1` | Implementation contradicted the pattern |

Only evaluate patterns you consciously considered. `0` is correct for most patterns in any story.

<verification>
New patterns persisted. Behavioral patterns evaluated (or explicitly skipped).
</verification>

### Step 4: Document Retrospective

Create `work/epics/e{N}-{name}/stories/s{N}.{M}-retrospective.md` with:
- Summary (story ID, dates, estimated vs actual time)
- What went well / what to improve
- Heutagogical checkpoint answers
- Improvements applied
- Patterns added/reinforced

<verification>
Retrospective document created.
</verification>

### Step 5: Emit Calibration Telemetry

```bash
rai signal emit-calibration S{N}.{M} --size {XS|S|M|L} --estimated {minutes} --actual {minutes}
```

This feeds the velocity tracking system for future estimation accuracy.

<verification>
Calibration event recorded (or skipped if CLI unavailable).
</verification>

## Output

| Item | Destination |
|------|-------------|
| Retrospective | `work/epics/e{N}-{name}/stories/s{N}.{M}-retrospective.md` |
| Patterns | `.raise/rai/memory/patterns.jsonl` |
| Calibration | Via `rai signal emit-calibration` |
| Next | `/rai-story-close` |

## Quality Checklist

- [ ] Project language detected before running tests
- [ ] Tests pass with language-appropriate runner (gate)
- [ ] Heutagogical checkpoint answered with specific examples
- [ ] New patterns persisted via `rai pattern add`
- [ ] Behavioral patterns reinforced via `rai pattern reinforce`
- [ ] Calibration telemetry emitted
- [ ] Retrospective document created
- [ ] NEVER skip pattern reinforce — scoring system depends on it (RAISE-170)
- [ ] NEVER give vague checkpoint answers — be specific with concrete examples

## References

- Previous: `/rai-story-implement`
- Next: `/rai-story-close`
- Pattern scoring: RAISE-170 (temporal decay + Wilson scorer)

