$npx -y skills add Soul-Brews-Studio/arra-oracle-skills-cli --skill rrrCreate session retrospective with AI diary and lessons learned. Use when user says "rrr", "retrospective", "wrap up session", "session summary", or at end of work session.
| 1 | # /rrr |
| 2 | |
| 3 | > "Reflect to grow, document to remember." |
| 4 | |
| 5 | ``` |
| 6 | /rrr # Retro + 1 background dig subagent (parallel, fast) |
| 7 | /rrr --quick # No dig, no subagent — memory only (fastest) |
| 8 | /rrr --detail # Full template + background dig |
| 9 | /rrr --deep # 5 parallel subagents |
| 10 | /rrr --deep --teammate # 3 coordinated team agents (requires AGENT_TEAMS) |
| 11 | ``` |
| 12 | |
| 13 | **Default mode**: main agent starts writing the retro immediately from conversation memory. |
| 14 | One background subagent runs dig + .jsonl timestamp extraction in parallel. |
| 15 | When the subagent returns, main agent merges real timestamps into the Timeline section. |
| 16 | **No speed penalty** — dig runs while you write. |
| 17 | |
| 18 | `--quick` skips dig entirely — memory only, zero subagents. |
| 19 | |
| 20 | **Subagent rules**: default /rrr spawns exactly 1 background Agent (dig miner). `--deep` spawns 5. `--quick` spawns 0. |
| 21 | **NEVER use the Task tool.** Only `--deep` and `--deep --teammate` use TeamCreate. |
| 22 | |
| 23 | --- |
| 24 | |
| 25 | ## Oracle Root Detection (REQUIRED — run before any ψ/ write) |
| 26 | |
| 27 | **Every skill that writes to ψ/ MUST detect the oracle root first.** Do not assume `pwd` is the oracle repo. |
| 28 | |
| 29 | ```bash |
| 30 | # Step 1: Find git root |
| 31 | ORACLE_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) |
| 32 | |
| 33 | # Step 2: Cross-check — oracle repo has CLAUDE.md + ψ/ |
| 34 | if [ -n "$ORACLE_ROOT" ] && [ -f "$ORACLE_ROOT/CLAUDE.md" ] && { [ -d "$ORACLE_ROOT/ψ" ] || [ -L "$ORACLE_ROOT/ψ" ]; }; then |
| 35 | PSI="$ORACLE_ROOT/ψ" |
| 36 | elif [ -f "$(pwd)/CLAUDE.md" ] && { [ -d "$(pwd)/ψ" ] || [ -L "$(pwd)/ψ" ]; }; then |
| 37 | # Fallback: pwd has oracle markers |
| 38 | ORACLE_ROOT="$(pwd)" |
| 39 | PSI="$ORACLE_ROOT/ψ" |
| 40 | else |
| 41 | # Last resort: warn and use pwd |
| 42 | echo "⚠️ Not in oracle repo (no CLAUDE.md + ψ/ at git root). Writing to pwd." |
| 43 | ORACLE_ROOT="$(pwd)" |
| 44 | PSI="$ORACLE_ROOT/ψ" |
| 45 | fi |
| 46 | ``` |
| 47 | |
| 48 | **Why**: prevents retros writing to `~/ψ/` (home) or incubated repo's `ψ/` instead of the oracle's own vault. |
| 49 | |
| 50 | All paths below use `$PSI/` instead of bare `ψ/`. |
| 51 | |
| 52 | --- |
| 53 | |
| 54 | ## /rrr (Default — background dig + parallel write) |
| 55 | |
| 56 | ### 1. Gather git context (main agent) |
| 57 | |
| 58 | ```bash |
| 59 | date "+%H:%M %Z (%A %d %B %Y)" |
| 60 | git log --oneline -10 && git diff --stat HEAD~5 |
| 61 | ``` |
| 62 | |
| 63 | Detect session ID: |
| 64 | |
| 65 | ```bash |
| 66 | ENCODED_PWD=$(echo "$ORACLE_ROOT" | sed 's|^/|-|; s|[/.]|-|g') |
| 67 | PROJECT_BASE=$(ls -d "$HOME/.claude/projects/${ENCODED_PWD}" 2>/dev/null | head -1) |
| 68 | LATEST_JSONL=$(ls -t "$PROJECT_BASE"/*.jsonl 2>/dev/null | head -1) |
| 69 | [ -n "$LATEST_JSONL" ] && SESSION_ID=$(basename "$LATEST_JSONL" .jsonl) && echo "SESSION: ${SESSION_ID:0:8}" |
| 70 | ``` |
| 71 | |
| 72 | ### 1.5. Spawn timestamp miner (background subagent) |
| 73 | |
| 74 | Spawn ONE background Agent to extract real timestamps from the session .jsonl: |
| 75 | |
| 76 | ``` |
| 77 | Agent({ |
| 78 | name: "timestamp-miner", |
| 79 | description: "Extract session timestamps for /rrr", |
| 80 | run_in_background: true, |
| 81 | prompt: `Extract real user message timestamps from a Claude Code session file. |
| 82 | Read-only — do NOT write files. |
| 83 | |
| 84 | Run this single command: |
| 85 | |
| 86 | ENCODED_PWD=$(echo "[ORACLE_ROOT]" | sed 's|^/|-|; s|[/.]|-|g') |
| 87 | PROJECT_BASE=$(ls -d "$HOME/.claude/projects/${ENCODED_PWD}" 2>/dev/null | head -1) |
| 88 | LATEST_JSONL=$(ls -t "$PROJECT_BASE"/*.jsonl 2>/dev/null | head -1) |
| 89 | echo "SESSION_FILE: $LATEST_JSONL" |
| 90 | python3 -c " |
| 91 | import json, os, sys |
| 92 | sys.stdout.reconfigure(encoding='utf-8') # Windows Thai locale: stdout defaults to cp874 -> Thai snippets mojibake; force UTF-8 output |
| 93 | from datetime import datetime, timezone, timedelta |
| 94 | tz = timezone(timedelta(hours=7)) |
| 95 | jsonl = '$LATEST_JSONL' |
| 96 | if not jsonl or not os.path.exists(jsonl): exit(0) |
| 97 | with open(jsonl, encoding='utf-8') as f: |
| 98 | for line in f: |
| 99 | try: |
| 100 | m = json.loads(line) |
| 101 | if m.get('type') != 'user' or 'message' not in m: continue |
| 102 | content = m['message'].get('content', '') |
| 103 | if isinstance(content, list): |
| 104 | for c in content: |
| 105 | if isinstance(c, dict) and c.get('type') == 'text': |
| 106 | content = c.get('text', ''); break |
| 107 | if not isinstance(content, str): continue |
| 108 | ts = m.get('timestamp', '') |
| 109 | if not ts or '<command-name>' in content[:200]: continue |
| 110 | dt = datetime.fromisoformat(ts.replace('Z', '+00:00')).astimezone(tz) |
| 111 | snippet = content[:80].replace(chr(10), ' ') |
| 112 | print(f'{dt.strftime(\"%Y-%m-%d %H:%M\")} | {snippet}') |
| 113 | except: pass |
| 114 | " |
| 115 | |
| 116 | Return ALL output lines. The main agent will use them for the Timeline.` |
| 117 | }) |
| 118 | ``` |
| 119 | |
| 120 | **Why only .jsonl, not dig.py**: the subagent has no conversation context — it can't interpret dig session summaries. The .jsonl timestamps are objective data (real ISO timestamps from every user message). That's all we need for the Timeline. |
| 121 | |
| 122 | ### 2. Write Retrospective (main agent — start immediately, don't wait for dig) |
| 123 | |
| 124 | **Path**: `$PSI/memory/retrospectives/YYYY-MM/DD/ |