# Orca Eval

> Quét N session Claude Code gần nhất, distill best practices thành report md + đề xuất action cải tiến quy trình

- Skill: `rheinmir/orca-eval` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add rheinmir/orca-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rheinmir/orca-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: rheinmir (https://skillmd.com/u/rheinmir)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rheinmir/orca-eval

---


# Skill: orca-eval

## Purpose

Vòng tự cải thiện quy trình: đọc lại session logs → rút best practice / anti-pattern → report md → đề xuất hành động (promote thành skill, sửa CLAUDE.md, thêm hook…). Report là **đề xuất** — mọi action phải qua `propose` → gate, không tự thực hiện.

## Triggers

- `/orca-eval [N]` — N = số session gần nhất cần quét (vd 5/10/15)
- Không có N → chỉ quét session hiện tại
- User nói "đánh giá session", "rút best practice", "tối ưu quy trình từ lịch sử"

## Input

| Tham số | Ý nghĩa | Default |
|---------|---------|---------|
| `N` | Số session gần nhất (theo mtime của `*.jsonl`) | session hiện tại |

Session logs nằm tại `~/.claude/projects/<project-slug>/*.jsonl` — slug là cwd với `/` thay bằng `-` (vd `-Users-giatran-orca-workspaces-setup-evaluation`).

## Steps

1. **Scan** — chạy `skills/orca-eval/assets/orca-eval-scan.sh [N]` từ repo root. Script trả về digest gọn (user prompts, tool errors, lệnh Bash lặp lại). KHÔNG nạp nguyên transcript — 1 session có thể hàng trăm KB.
2. **Distill** — từ digest, tìm 4 loại tín hiệu:
   - **Correction**: user sửa lời agent ("không, dùng X", "sai rồi", "actually…") → quy tắc ứng xử mới
   - **Repetition**: chuỗi lệnh/thao tác lặp ≥ 3 lần qua các session → ứng viên skill-hóa
   - **Friction**: tool error lặp lại, permission prompt nhiều lần, retry loop → ứng viên hook/permission/config
   - **Win**: workflow user approve nhanh, không phải sửa → ghi nhận best practice giữ nguyên
3. **Report** — ghi `llmwiki/wiki/draft/orca/DDMMYY-eval-report.md` theo template dưới. Cập nhật `wiki/index.md` + `wiki/log.md`.
4. **Action proposal** — mỗi finding gắn đúng 1 action: `promote-to-skill` / `update-CLAUDE.md` / `add-hook` / `keep` / `ignore`. Hiển thị bảng action cho user. **DỪNG** — action chỉ thực hiện sau khi user duyệt (qua `propose` nếu là thay đổi code/skill).

## Report template

```markdown
# DDMMYY-eval-report
**Type:** draft
**Status:** proposed
**Tags:** orca-eval, eval-report
**Proposed:** YYYY-MM-DD
**Scope:** <N session / session hiện tại> — <danh sách file jsonl đã quét>

## Best practices
| # | Tín hiệu | Loại | Bằng chứng (session, trích dẫn ngắn) |
|---|----------|------|--------------------------------------|

## Đề xuất action
| # | Finding | Action | Lý do |
|---|---------|--------|-------|

## Origin
- **Sessions:** <paths đã quét>
- **Generated by:** /orca-eval
```

## Giới hạn

- Read-only với session logs — không sửa/xóa `*.jsonl`.
- Format JSONL của Claude Code không có spec công khai — scanner fail thì fallback session hiện tại và báo rõ, không sinh report rỗng.
- Auto-trigger mỗi 30 session: **Phase 2** (cần Stop-hook + counter), chưa nằm trong skill này.

## References (community — claimed 2026-06-11)

| Repo | Áp dụng được gì |
|------|-----------------|
| [BayramAnnakov/claude-reflect](https://github.com/BayramAnnakov/claude-reflect) | Regex bắt correction ("no, use X", "remember:"), queue → review 2 giai đoạn, routing global vs project CLAUDE.md, `/reflect-skills` tìm pattern lặp để skill-hóa |
| [haddock-development/claude-reflect-system](https://github.com/haddock-development/claude-reflect-system) | Stop-hook auto-run cuối session (mẫu cho Phase 2 auto-trigger 30 session), cross-skill best-practice extraction |
| [netresearch/claude-coach-plugin](https://github.com/netresearch/claude-coach-plugin) | Friction detection — đếm permission prompts / retry loops làm tín hiệu cải tiến |
| [robonuggets/skills — calibrate](https://github.com/robonuggets/skills) | In-session self-improvement: review conversation hiện tại, đề xuất sửa skill/memory có chủ đích |
| [a-c-m reflection.md gist](https://gist.github.com/a-c-m/f4cead5ca125d2eaad073dfd71efbcfc) | Bản tối giản 1 file — giữ skill này gọn, không over-engineer |

## Origin
- **Raw:** `llmwiki/raw/evalution-engineering.md`
- **Draft:** `wiki/draft/orca/110626-orca-eval-skill.md`

