doctor

Diagnose and repair .state/ work memory and ADR structure against current contracts.

4|1|Updated Jul 31, 2025
One-click install
npx skills add https://github.com/alvis/.agents --skill doctor-alvis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doctor
Source: https://github.com/alvis/.agents/tree/main/plugins/essential/skills/doctor
Command: npx skills add https://github.com/alvis/.agents --skill doctor-alvis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vitest, and includes scripts (resource) components.

What problem does it solve? Long-running AI-assisted work accumulates state files and architecture decision records that silently drift from current conventions, leaving stale, contradictory, or corrupted records that mislead future sessions. This Skill detects that drift and repairs it safely without falsifying history. ## Core Features & Use Cases - Structural integrity checks: Runs the read-only state-doctor script over .state/ work streams and docs/architecture/decisions/ ADR trees, reporting defects, format drift, and informational findings with severity levels. - User-approved migration and repair: Proposes per-stream repair or migration plans derived from current contracts, then applies them under a lease only after explicit approval, preserving journal lines, tombstones, and superseded decisions. - ADR lifecycle validation: Verifies ADR filenames, numeric identity uniqueness, supersession headers, index consistency, and placeholder-free content, always offering an explicit repair for every finding. - Use Case: Before resuming a work stream that has been idle for weeks, run the doctor to confirm the stream's state files still match the current contract format, then approve a lazy migration of any retired lifecycle vocabulary. ## Quick Start Ask the agent to run the doctor skill to check the integrity of the .state directory and ADR records, optionally scoped to a single work ID with the --strict flag.

Frequently Asked Questions about doctor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check the integrity of .state work memory files?

Run the doctor skill, which invokes the read-only state-doctor script over the .state directory or a single work stream. It reports findings classified as defects, format drift, or informational items, each with severity and a proposed fix.

How do I migrate old state files to the current contract format?

The doctor proposes a per-stream migration plan derived from the current contracts, never from a version token. Migrations apply only after explicit user approval, run under the stream's lease, and are journaled as sweep events while preserving all recorded history.

Does the doctor modify files during diagnosis?

No, diagnosis is strictly read-only and never mutates anything. Repairs and migrations happen only after explicit user approval, per stream, under that stream's main-agent lease, and unrecognized files are always preserved and reported.

What ADR problems can the state-doctor detect?

It validates ADR filenames, numeric identity uniqueness across current and archived records, supersession headers with portable relative links, index consistency, and unresolved TODO or TBD placeholders. Every ADR finding includes an explicit repair offer requiring user approval.

When should I not use the doctor skill?

Do not use it to implement, review, or resume the actual work; resumption belongs to the takeover skill. It also never rewrites history, renames work IDs, or migrates files merely because conventions changed, since older formats remain valid history.