Learn Stats
Reads workspace/learning/facts/ and workspace/learning/.state/review-log.jsonl to produce a markdown stats report.
Trigger
User wants a snapshot of their learning loop health.
Workflow
Step 1 — Read facts
- Read all
.mdfiles inworkspace/learning/facts/ - Parse frontmatter of each file
- Get today's date (YYYY-MM-DD)
- Compute:
total= count of all fact filesoverdue= count wherenext_review <= todayactive_decks= count of uniquedeckvalues across all factsadded_this_week= count wherecreated >= today - 7 days
If workspace/learning/facts/ does not exist or is empty:
"Nenhum fato encontrado. Use /learn-capture para adicionar fatos primeiro." Stop here.
Step 2 — Read review log
- Read
workspace/learning/.state/review-log.jsonlline by line (each line is a JSON object) - If the file does not exist or is empty:
total_reviews = 0,retention_rate = "N/A" - If it exists:
total_reviews= count of all log entriesgood_easy_count= count wheregrade == "good"ORgrade == "easy"retention_rate=round(good_easy_count / total_reviews * 100)%
Step 3 — Output report
Print in markdown, in pt-BR:
## 📊 Learning Loop — Stats
| Métrica | Valor |
|---------------------|--------------|
| Total de fatos | {total} |
| Vencidos hoje | {overdue} |
| Taxa de retenção | {retention_rate} ({good_easy_count}/{total_reviews} revisões) |
| Decks ativos | {active_decks} |
| Adicionados (7 dias)| {added_this_week} |
**Data:** {today YYYY-MM-DD}
If overdue > 0:
💡 Use
/learn-reviewpara revisar os fatos vencidos.
If total < 10:
💡 Use
/learn-capturepara adicionar mais fatos (meta v0: 20 fatos em 2 semanas).
Step 4 (optional) — List overdue facts
If overdue > 0 and overdue <= 10, list them:
### Fatos vencidos
- `{filename}` (deck: {deck}, venceu: {next_review})
> {Retrieval Q — first 80 chars}
Constraints
- Read-only. Do NOT modify any file.
- Do NOT write to review-log.jsonl.
- If log is missing (user hasn't reviewed yet), show
N/Afor retention — do not error. - Round retention_rate to nearest integer (no decimal places).