dev-loop-research
Standalone invocable research agent. Scans two parallel tracks — code health
and vault health — cross-references findings, and outputs a prioritized
work-item recommendation list.
When This Skill Activates
- User runs
/dev-loop-research or /dev-loop-research high
- User wants a one-shot research scan of repo and vault health
- User schedules recurring background scans:
/loop 1h dev-loop-research
- Dev-loop idle path delegates here (same logic, different trigger)
Intensity
Parse arguments for high (case-insensitive). If present,
intensity = high; otherwise intensity = normal.
- normal: Output top-3 items. Suppress recurring findings that haven't
changed since last pass. Respect priority gates.
- high: Output top-5 items. Never suppress recurring findings. Every
finding is actionable regardless of priority tier. P4+ items are
first-class.
Prerequisites
- Project config — load
./.claude/dev-loop.config.md. Required
fields: slug. Optional: vault, cli_src, cli_test,
skills_glob. If missing, prompt user to bootstrap via dev-loop.
- Resolve BACKEND_CAPS from
knowledge_layer config field (default:
skillwiki if vault exists, none otherwise).
- Resolve VAULT_TYPES from
{vault}/SCHEMA.md ## Layers section —
extract backtick-wrapped directory names ending in /, exclude raw
and project. Store for Track B.
- Read
CLAUDE.md and user MEMORY.md fresh.
Single-Pass Cycle
┌───────────────────────────────────────────────────────────┐
│ 0. REFRESH │
│ Load project config + read CLAUDE.md/MEMORY.md fresh │
├─────────────────────────┬─────────────────────────────────┤
│ TRACK A: CODE HEALTH │ TRACK B: VAULT HEALTH │
│ │ │
│ A1. CLI COVERAGE GAPS │ B1. RAW-TO-PAGE COVERAGE │
│ A2. SKILLS AUDIT │ B2. CROSS-LINK DENSITY │
│ A3. SPEC DRIFT │ B3. PAGE QUALITY │
│ A4. UNPUSHED COMMITS │ B4. TYPE COVERAGE │
├─────────────────────────┴─────────────────────────────────┤
│ 1. VAULT RETROS (cross-cutting) │
│ 2. SYNTHESIZE — merge + score (P0–P3, +P4 in high) │
│ 3. SAVE & EXIT │
└───────────────────────────────────────────────────────────┘
Skip Track B entirely when query_vault not in BACKEND_CAPS or vault
is empty. Skip Track A when cli_src is empty.
Track A: Code Health
A1. CLI Coverage Gaps
- List
{cli_src}/*.ts. For each: test file in {cli_test}/? --human
flag? Stable exit codes? TODO/FIXME/HACK markers?
- Compare counts against CLAUDE.md documented counts. Flag drift.
A2. Skills Audit
- List SKILL.md files from
skills_glob. Check: CLI subcommand
references exist? Description matches current behavior? Skill maps
list all skills correctly?
A3. Spec Drift
- If canonical spec is declared, verify scope fields against current
code. New commands not in spec? Changed counts? New schema changes?
A4. Unpushed Commits
git log origin/$RELEASE_BRANCH..HEAD --oneline. Priority:
≥10→P1, 5-9→P2, 1-4→P4+.
Track B: Vault Health
B1. Raw-to-Page Coverage
- Run
skillwiki lint for wikilink_citation warnings.
- Count raw files vs typed pages vs cited sources. Flag:
normal: uncited >50%→P1; high: uncited >20%→P1.
- Single-source pages: normal→P2, high→P2 always.
B2. Cross-Link Density
- Count outbound
[[wikilink]] in body region per page.
- normal: <2 links→P2; high: <3 links→P2.
- Orphan and overlap detection via
skillwiki orphans/overlap.
B3. Page Quality
- Count non-blank body lines (exclude headings and
---).
- normal: <40 lines→thin; high: <60 lines→thin.
- Flag missing Overview or Related sections.
B4. Type Coverage
- Page counts per type directory. Flag: entities <3, empty comparisons,
empty queries when >30 pages exist, empty meta when 2+ projects active.
- High: flag any empty type dir.
Vault Retros (Track 1)
Scan {vault}/log.md for recent Improve: and Generalize?: yes entries.
Check {vault}/projects/{slug}/compound/ for pending distillation work.
A retro's Improve: field that names a concrete action is a direct
work-item candidate.
Synthesize (Track 2)
Score each finding:
| Score |
Impact |
Effort |
| P0 |
Spec violation or regression |
Any |
| P1 |
High — untested command, raw-to-page gap >50%, isolated pages |
S/M |
| P2 |
Medium — thin pages, skill map drift, single-source, empty type dirs |
S/M |
| P3 |
Low — code quality, cross-link improvement, section completeness |
Any |
| P4+ |
Speculative — proactive improvements, future-proofing, polish |
Any |
normal: top-3, P0–P3 only, suppress unchanged recurring.
high: top-5, P0–P4+, never suppress recurring.
Output format per item:
### #N: [title] (Px)
**Source**: [track source]
**What**: One-paragraph spec.
**Acceptance**: Bullet list of verifiable outcomes.
**Files**: Likely files to touch (omit for vault-only items).
Save & Exit (Track 3)
- Append research observation to
{vault}/log.md:## [YYYY-MM-DD HH:MM] research | dev-loop-research cycle [normal|high]
- Findings: [N] new, [N] recurring
- Vault health: raw=[N] pages=[N] cited=[N]% isolated=[N] thin=[N]
- Top-N: [titles]
- If ranked list changed since last cycle, update user MEMORY.md with
research-backlog entry.
- Exit with one-line summary.
Idle Fast-Path
Pre-idle gate (mandatory): Before declaring idle, collect actual vault
health metrics from B1–B4. If any metric exceeds thresholds below, do NOT
report idle:
| Metric |
normal |
high |
| Uncited raw |
>50% |
>20% |
| Isolated pages |
any |
any (<3 links) |
| Thin pages |
any (<40L) |
any (<60L) |
| Empty type dirs |
any (entities, comparisons) |
any |
Three exit states:
- Truly idle — zero new findings, all metrics healthy. Exit:
"Research idle — no new findings."
- Steady backlog — no new findings, but known gaps persist. Exit:
"Research steady — [N] recurring: [titles]"
- High mode never idle — always produce recommendations. If standard
checks find nothing, generate proactive suggestions.
NEVER report idle when vault health metrics show actionable gaps.
1---2name: dev-loop-research3description: Standalone research agent — scans repo health and vault health, outputs prioritized work-item recommendations. Pass "high" for aggressive mode.4---56# dev-loop-research78Standalone invocable research agent. Scans two parallel tracks — code health9and vault health — cross-references findings, and outputs a prioritized10work-item recommendation list.1112## When This Skill Activates1314- User runs `/dev-loop-research` or `/dev-loop-research high`15- User wants a one-shot research scan of repo and vault health16- User schedules recurring background scans: `/loop 1h dev-loop-research`17- Dev-loop idle path delegates here (same logic, different trigger)1819## Intensity2021Parse arguments for `high` (case-insensitive). If present,22**intensity = high**; otherwise **intensity = normal**.2324- **normal**: Output top-3 items. Suppress recurring findings that haven't25 changed since last pass. Respect priority gates.26- **high**: Output top-5 items. Never suppress recurring findings. Every27 finding is actionable regardless of priority tier. P4+ items are28 first-class.2930## Prerequisites31321. **Project config** — load `./.claude/dev-loop.config.md`. Required33 fields: `slug`. Optional: `vault`, `cli_src`, `cli_test`,34 `skills_glob`. If missing, prompt user to bootstrap via dev-loop.352. **Resolve BACKEND_CAPS** from `knowledge_layer` config field (default:36 `skillwiki` if vault exists, `none` otherwise).373. **Resolve VAULT_TYPES** from `{vault}/SCHEMA.md` `## Layers` section —38 extract backtick-wrapped directory names ending in `/`, exclude `raw`39 and `project`. Store for Track B.404. Read `CLAUDE.md` and user `MEMORY.md` fresh.4142## Single-Pass Cycle4344```45┌───────────────────────────────────────────────────────────┐46│ 0. REFRESH │47│ Load project config + read CLAUDE.md/MEMORY.md fresh │48├─────────────────────────┬─────────────────────────────────┤49│ TRACK A: CODE HEALTH │ TRACK B: VAULT HEALTH │50│ │ │51│ A1. CLI COVERAGE GAPS │ B1. RAW-TO-PAGE COVERAGE │52│ A2. SKILLS AUDIT │ B2. CROSS-LINK DENSITY │53│ A3. SPEC DRIFT │ B3. PAGE QUALITY │54│ A4. UNPUSHED COMMITS │ B4. TYPE COVERAGE │55├─────────────────────────┴─────────────────────────────────┤56│ 1. VAULT RETROS (cross-cutting) │57│ 2. SYNTHESIZE — merge + score (P0–P3, +P4 in high) │58│ 3. SAVE & EXIT │59└───────────────────────────────────────────────────────────┘60```6162Skip Track B entirely when `query_vault` not in BACKEND_CAPS or vault63is empty. Skip Track A when `cli_src` is empty.6465## Track A: Code Health6667### A1. CLI Coverage Gaps68- List `{cli_src}/*.ts`. For each: test file in `{cli_test}/`? `--human`69 flag? Stable exit codes? `TODO/FIXME/HACK` markers?70- Compare counts against CLAUDE.md documented counts. Flag drift.7172### A2. Skills Audit73- List SKILL.md files from `skills_glob`. Check: CLI subcommand74 references exist? Description matches current behavior? Skill maps75 list all skills correctly?7677### A3. Spec Drift78- If canonical spec is declared, verify scope fields against current79 code. New commands not in spec? Changed counts? New schema changes?8081### A4. Unpushed Commits82- `git log origin/$RELEASE_BRANCH..HEAD --oneline`. Priority:83 ≥10→P1, 5-9→P2, 1-4→P4+.8485## Track B: Vault Health8687### B1. Raw-to-Page Coverage88- Run `skillwiki lint` for `wikilink_citation` warnings.89- Count raw files vs typed pages vs cited sources. Flag:90 normal: uncited >50%→P1; high: uncited >20%→P1.91- Single-source pages: normal→P2, high→P2 always.9293### B2. Cross-Link Density94- Count outbound `[[wikilink]]` in body region per page.95- normal: <2 links→P2; high: <3 links→P2.96- Orphan and overlap detection via `skillwiki orphans`/`overlap`.9798### B3. Page Quality99- Count non-blank body lines (exclude headings and `---`).100- normal: <40 lines→thin; high: <60 lines→thin.101- Flag missing Overview or Related sections.102103### B4. Type Coverage104- Page counts per type directory. Flag: entities <3, empty comparisons,105 empty queries when >30 pages exist, empty meta when 2+ projects active.106- High: flag any empty type dir.107108## Vault Retros (Track 1)109110Scan `{vault}/log.md` for recent `Improve:` and `Generalize?: yes` entries.111Check `{vault}/projects/{slug}/compound/` for pending distillation work.112A retro's `Improve:` field that names a concrete action is a direct113work-item candidate.114115## Synthesize (Track 2)116117Score each finding:118119| Score | Impact | Effort |120|-------|--------|--------|121| P0 | Spec violation or regression | Any |122| P1 | High — untested command, raw-to-page gap >50%, isolated pages | S/M |123| P2 | Medium — thin pages, skill map drift, single-source, empty type dirs | S/M |124| P3 | Low — code quality, cross-link improvement, section completeness | Any |125| P4+ | Speculative — proactive improvements, future-proofing, polish | Any |126127**normal**: top-3, P0–P3 only, suppress unchanged recurring.128**high**: top-5, P0–P4+, never suppress recurring.129130Output format per item:131132```markdown133### #N: [title] (Px)134135**Source**: [track source]136**What**: One-paragraph spec.137**Acceptance**: Bullet list of verifiable outcomes.138**Files**: Likely files to touch (omit for vault-only items).139```140141## Save & Exit (Track 3)1421431. Append research observation to `{vault}/log.md`:144 ```145 ## [YYYY-MM-DD HH:MM] research | dev-loop-research cycle [normal|high]146 - Findings: [N] new, [N] recurring147 - Vault health: raw=[N] pages=[N] cited=[N]% isolated=[N] thin=[N]148 - Top-N: [titles]149 ```1502. If ranked list changed since last cycle, update user MEMORY.md with151 research-backlog entry.1523. Exit with one-line summary.153154## Idle Fast-Path155156**Pre-idle gate (mandatory):** Before declaring idle, collect actual vault157health metrics from B1–B4. If any metric exceeds thresholds below, do NOT158report idle:159160| Metric | normal | high |161|--------|--------|------|162| Uncited raw | >50% | >20% |163| Isolated pages | any | any (<3 links) |164| Thin pages | any (<40L) | any (<60L) |165| Empty type dirs | any (entities, comparisons) | any |166167Three exit states:1681. **Truly idle** — zero new findings, all metrics healthy. Exit:169 `"Research idle — no new findings."`1702. **Steady backlog** — no new findings, but known gaps persist. Exit:171 `"Research steady — [N] recurring: [titles]"`1723. **High mode never idle** — always produce recommendations. If standard173 checks find nothing, generate proactive suggestions.174175**NEVER report idle when vault health metrics show actionable gaps.**