Doctor

From brycewang-stanford/Auto-Empirical-Research-Skills · View interactive version

Doctor is an AI agent skill from the GitHub repository brycewang-stanford/Auto-Empirical-Research-Skills. System diagnostics and health checks for Diverga plugin. OpenClaw-style Check-Report-Fix pattern with 5-layer diagnostics. Triggers: /diverga:doctor, diverga doctor, system check, diagnose, 진단

How to use this skill

Skill file

Diverga Doctor

Version: 11.1.0

Trigger: /diverga:doctor

Description

System diagnostics for the Diverga plugin. Checks plugin health, skill sync, hook enforcement, configuration validity, API keys, and project state. Reports issues with actionable fix commands.

Follows OpenClaw Check-Report-Fix pattern: every detected issue includes a fix recommendation.

Instructions

When user invokes /diverga:doctor, execute all 7 diagnostic layers sequentially and display results.

Layer 1: Plugin Health

Check plugin registration:

Check config JSON validity:

Report format:

PLUGIN HEALTH
  Registration:    [PASS - diverga@diverga v11.1.0 | FAIL - not found in installed_plugins.json]
  Config file:     [PASS - valid JSON | FAIL - missing or invalid]
  Config fields:   [PASS - all required fields present | WARN - missing: field1, field2]

Fix if FAIL:

Layer 2: Skill Sync

Check skill counts match between plugin and local cache:

Check for missing skills in local cache:

Report format:

SKILL SYNC
  Plugin skills:   [count] skills in plugin directory
  Local skills:    [count] skills in local cache
  Sync status:     [PASS - all synced | WARN - X skills missing locally]
  Missing:         [list of missing skill names, if any]

Fix if WARN:

Layer 3: Plugin Cache Sync

Check that the plugin cache matches the installed version:

Report format:

PLUGIN CACHE
  Installed version: [11.1.0 | FAIL - plugin.json missing]
  Cached version:    [11.1.0 | WARN - stale cache: 8.0.1 | FAIL - no cache found]
  Cache has hooks:   [PASS - hooks.json present | FAIL - hooks missing from cache]
  Cache has agents:  [PASS - agents/ present | WARN - agents/ missing]

Fix if WARN/FAIL:

```

REPO="/Volumes/External SSD/Projects/Diverga/Diverga-core"

CACHE="$HOME/.claude/plugins/cache/diverga/diverga/11.1.0"

rm -rf "$HOME/.claude/plugins/cache/diverga/diverga/8.0.1"

mkdir -p "$CACHE"

cp -R "$REPO"/{skills,agents,config,hooks,mcp,CLAUDE.md,AGENTS.md,README.md} "$CACHE/"

cp "$REPO/.claude-plugin/plugin.json" "$CACHE/"

```

Layer 4: Hook Enforcement

Check hook configuration:

Report format:

HOOK ENFORCEMENT
  Plugin hooks.json: [PASS - exists with Agent+Skill matchers | FAIL - missing or wrong matchers]
  Global hooks:      [PASS - configured in settings.json | WARN - not in settings.json (relies on plugin)]
  Hook executable:   [PASS - returns valid JSON | FAIL - execution error]
  Matcher check:     [PASS - uses "Agent" | FAIL - uses stale "Task" matcher]

Fix if issues found:

Layer 5: Config Validity

Deep validation of diverga-config.json:

Report format:

CONFIG VALIDITY
  Version field:   [PASS - 11.1.0 | WARN - version mismatch: found X.Y.Z]
  Checkpoints:     [PASS - configured | FAIL - missing or malformed]
  Language:        [PASS - "en" | WARN - unexpected value: "XX"]
  Model routing:   [PASS - configured | SKIP - not set (using defaults)]

Fix if issues found:

Layer 6: API Keys

Check 8 environment variables using Bash tool (echo $VAR_NAME):

| Variable | Purpose | Required? |

|----------|---------|-----------|

| GROQ_API_KEY | LLM screening (recommended) | Recommended |

| ANTHROPIC_API_KEY | Claude API | Recommended |

| OPENAI_API_KEY | OpenAI screening | Optional |

| GEMINI_API_KEY | Gemini visualization | Optional |

| SEMANTIC_SCHOLAR_API_KEY | Paper retrieval | Optional |

| OPENALEX_EMAIL | OpenAlex polite pool | Optional |

| SCOPUS_API_KEY | Scopus access | Optional |

| WOS_API_KEY | Web of Science | Optional |

For each variable, use Bash: echo "${VAR_NAME:+configured}" — if output is "configured", it's set; if empty, it's not set.

Report format:

API STATUS
  Groq:              [configured | NOT SET -> export GROQ_API_KEY=your_key]
  Anthropic:         [configured | NOT SET -> export ANTHROPIC_API_KEY=your_key]
  OpenAI:            [configured | not set (optional)]
  Gemini:            [configured | not set (optional)]
  Semantic Scholar:  [configured | not set (optional)]
  OpenAlex:          [configured | not set (optional)]
  Scopus:            [configured | not set (optional)]
  Web of Science:    [configured | not set (optional)]

Fix if NOT SET (recommended keys):

Layer 7: Project State

Check for active research project:

Report format:

PROJECT STATE
  Active project:  [project name | No active project]
  State file:      [PASS - valid | WARN - invalid YAML | SKIP - no project]
  Research dir:    [PASS - structure intact | WARN - missing subdirs | SKIP - no project]

Fix if issues:

Final Summary

After all 7 layers, display overall status:

══════════════════════════════════════════════
DIVERGA SYSTEM DIAGNOSTICS v11.1.0
══════════════════════════════════════════════

[Layer 1-7 results as shown above]

------------------------------------------
OVERALL: [HEALTHY | X WARNING(S) | X ERROR(S)]

[If issues found, numbered list:]
  1. [Issue description] -> [Fix command]
  2. [Issue description] -> [Fix command]
  ...

[If healthy:]
  All systems operational. Diverga is ready to use.
  Run /diverga:help to see all 24 agents and commands.
══════════════════════════════════════════════

Implementation Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.