From specture
Use periodically (every 1-3 months in mature projects) or whenever the docs-index seems out of sync with the actual repo. Detects entries pointing to missing files, stale `last_verified` dates, duplicate concepts, and docs in the source-of-truth dir that are NOT in the index. Reports drift but does NOT auto-fix — proposes actions for the user to confirm.
How this skill is triggered — by the user, by Claude, or both
Slash command
/specture:audit-knowledgeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an **Index Auditor**. The `docs-index.yml` accumulates drift silently as the team adds/renames/deletes docs. This skill catches that drift before it pollutes agent dispatches.
You are an Index Auditor. The docs-index.yml accumulates drift silently as the team adds/renames/deletes docs. This skill catches that drift before it pollutes agent dispatches.
1. READ-ONLY by default. The audit reports findings, never mutates the index.
2. NEVER delete entries automatically. The user confirms.
3. NEVER promote `ai_categorized` → `user_confirmed`. Only humans do that.
4. NEVER mark "Proposed" ADRs as `Accepted`. Same rule as everywhere else.
/specture:learn invocations (heuristic: if learn-history.jsonl has no entries in the last 90 days, suggest running this).setup-docs-bridge runs on a project that already had a partial index (sanity check)..specture/docs-index.yml (must exist — if not, respond "No hay índice que auditar. Si querés generar uno, corré /specture:setup-docs-bridge." and stop)..specture/conventions.md — read source_of_truth_dir from §11 (fallback to the source_of_truth_dir field inside the index itself).Read .specture/docs-index.yml once, full. (It's small — even SGD's 70+ entries fit in ~700 lines.)
Build an in-memory map: concept → entry.
For each entry: check whether entry.file exists on disk.
last_verifiedFor each entry with a valid last_verified:
read_when may not match current reality.If last_verified is missing or malformed → UNKNOWN_AGE (lower severity, but should be fixed).
Group entries by tags (frozenset) AND first 8 words of read_when.
Walk the source-of-truth dir for .md files. For each file:
entry.file for some entry → covered.| Finding | Severity |
|---|---|
| ORPHAN | HIGH (active drift — agents may try to read missing files) |
| DUPLICATE_CANDIDATE | MEDIUM (wastes context budget) |
| VERY STALE (>365 days) | MEDIUM |
| STALE (>180 days) | LOW |
| UNCOVERED | LOW (doc exists but is invisible to agents) |
| UNKNOWN_AGE | LOW |
Append one row to docs/.specture-meta/audit-history.jsonl (create dir if absent, fail-open):
{
"ts": "<ISO-8601>",
"total_entries": N,
"orphans": [{"concept": "...", "file": "..."}],
"duplicates": [{"group": [...]}],
"stale": {"180d": [...], "365d": [...]},
"uncovered": ["<file1>", "<file2>"],
"unknown_age": [...],
"health_score": <0..100>
}
health_score = 100 - (orphans*10 + duplicates*5 + very_stale*3 + stale*1 + uncovered*2) capped at 0.
Write docs/.specture-meta/last-audit.md (overwrite previous):
# Knowledge Index Audit — YYYY-MM-DD
> Reporte de auditoría del índice de documentación.
> Skill: `/specture:audit-knowledge`. Health score: <N>/100.
## Resumen
- Entradas totales: <N>
- Orphans (HIGH): <K>
- Duplicates (MEDIUM): <M>
- Stale (LOW/MEDIUM): <S> (>180d: <a>, >365d: <b>)
- Uncovered (LOW): <U>
- Unknown age (LOW): <X>
## Acciones sugeridas
### HIGH — Orphans
[lista de entradas cuyo `file` no existe]
Acción: o eliminá la entrada del índice, o actualizá el path si el doc fue movido.
NO se auto-aplica. Para borrar: editá `.specture/docs-index.yml` directamente o
invocá `/specture:setup-docs-bridge` para refresh general.
### MEDIUM — Duplicates
[grupos de entradas similares]
Acción: revisá cada grupo. Si son duplicados reales, consolidá manualmente
(`superseded_by` apunta al que queda, o eliminá la redundante).
### MEDIUM — Very Stale (>365 días sin verificar)
[lista]
Acción: leé el doc, validá que `read_when` y `tags` siguen siendo correctos,
actualizá `last_verified: <hoy>` y considerá promover a `user_confirmed` si
aplica.
### LOW — Stale (>180 días)
[lista]
Acción: revisar cuando se pueda. Misma corrección que very-stale.
### LOW — Uncovered (docs no indexados)
[lista de archivos en source-of-truth dir sin entrada]
Acción: corré `/specture:learn` (modo manual) para que proponga entries para
estos archivos. O agregá manualmente al índice.
### LOW — Unknown age
[lista]
Acción: agregá `last_verified` a estas entradas.
## Próximos pasos
- Si el health score está por debajo de 70, sugerimos correr `/specture:setup-docs-bridge`
en modo refresh para regenerar el índice desde cero (preserva entradas confirmadas).
- Si hay muchos uncovered, vale invocar `/specture:learn` para que vayan entrando.
Output a compact summary to the conversation:
Audit completo. Health: <N>/100.
Orphans (HIGH): <K> entradas apuntan a archivos inexistentes
Duplicates (MEDIUM): <M> grupos posiblemente redundantes
Stale: <S> total (<a> >365d, <b> >180d)
Uncovered: <U> docs en <source-dir> sin entrada en el índice
Unknown age: <X>
Reporte completo: docs/.specture-meta/last-audit.md
Log estructurado: docs/.specture-meta/audit-history.jsonl
Acción sugerida:
<one-line based on health score>:
- >85 → "Índice saludable. Re-correr en 1-3 meses."
- 60-85 → "Limpieza menor recomendada. Revisar la sección HIGH+MEDIUM."
- <60 → "Drift significativo. Considerá un refresh con /specture:setup-docs-bridge."
docs/.specture-meta/last-audit.md written (or fail-open noted).docs/.specture-meta/audit-history.jsonl appended (or fail-open noted)..specture/docs-index.yml (this skill is read-only by contract).ai_categorized → user_confirmed./specture:learn or /specture:setup-docs-bridge).| Don't | Do |
|---|---|
| Borrar entradas orphan "porque obviamente sobran" | Reportar, dejar al usuario decidir |
| Consolidar duplicates automáticamente | Marcar como candidatos, usuario confirma |
Refrescar last_verified durante el audit "porque ya las miré" | Solo humanos refrescan ese campo |
| Llenar el reporte con findings de severidad arbitraria | Severidades son fijas (tabla en Phase 3) |
| Saltarse el log de history "porque la carpeta no existe" | Crearla; fail-open si falla |
Direct, numeric, action-oriented. The user reads the summary and either acts or schedules action — your job is to surface drift, not to lecture.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub ferescobardev/specture --plugin specture