AGENT SKILL

revealui-doctor

Health check for RevealFleet Studio workflow across equal adapters (Claude + Grok at minimum). Verifies hook/rules homes, skill preconditions, git integrity, workboard freshness, daemon status, MCP configs, env leaks, toolchain, and disaster-recovery snapshot state.

License 许可
MIT
最近更新
2026-11-11
Stars
★ 2
Forks
0

01 前言 Front Matter

name
revealui-doctor
license
MIT
metadata
{ "author": "RevealUI Studio", "version": "0.4.3", "website": "https://revealui.com" }
description
Health check for RevealFleet Studio workflow across equal adapters (Claude + Grok at minimum). Verifies hook/rules homes, skill preconditions, git integrity, workboard freshness, daemon status, MCP configs, env leaks, toolchain, and disaster-recovery snapshot state.
allowed-tools
Bash, Read, Glob, Grep

03 SKILL.md 正文

Run a health check on Studio-native workflow surfaces for equal adapters. Report pass/fail (or SKIP with reason) per section. Claude is one adapter; Grok is first-class.

Load helpers:

. "$REVEALFLEET_ROOT/revskills/scripts/lib/session-state.sh"

0. Adapter homes present

Report which homes exist:

Adapter Paths to note
Claude ~/.claude/{hooks,rules,commands,settings.json}
Grok ~/.grok/{hooks,rules,skills,config.toml,active_sessions.json}
Cursor ~/.cursor or project .cursor/ (SKIP if absent)
OpenCode tool-specific (SKIP if absent)

If Claude home is missing: do not fail the whole doctor — continue with Grok/other and mark Claude sections SKIP.

1. Hook syntax

Claude: node --check on every ~/.claude/hooks/*.js when the dir exists. List failures. Confirm settings.json registers PreCompact → snapshot-before-compact.js (last-ditch mechanical capture).
Grok: list ~/.grok/hooks/*.json when present; confirm JSON parses (python3 -m json.tool or jq). FAIL on invalid JSON. Required for snapshot-before-compact: pre-compact.json and stop-snapshot.json (or equivalent PreCompact + Stop entries) pointing at snapshot-before-compact.js. WARN if either event is missing — Grok discards UserPromptSubmit stdout, so without these hooks checkpoints lose pre-compact fidelity. Required for the output cap: cap-tool-output.json with a PostToolUse entry pointing at cap-tool-output.js. FAIL if it is missing.

Compact sync: the authored numbers are revealui/packages/harnesses/src/token-budget.ts, materialized to .revealui/adapters/grok/token-budget.json and copied to ~/.local/share/revealui/hooks/token-budget.json. FAIL if ~/.grok/config.toml disagrees with that JSON: each models[] entry's compaction_at_tokens must equal compactionAtTokens, and auto_compact_threshold_percent must equal autoCompactThresholdPercent (derived from tokens / window, not stored as a second constant). FAIL if cap-tool-output.json is missing. A gate still described as 85% minus 25 with a floor of 50 is stale. Do not compare this budget to Claude context-thresholds.json (that file is a pressure score).

2. Rules directories

Verify these exist and contain .md files when the home is present:

  • $REVEALFLEET_ROOT/revealui/.claude/rules/
  • $JV_REPO/.claude/rules/
  • ~/.claude/rules/ (Claude adapter)
  • ~/.grok/rules/ (Grok adapter; pointer files OK)

3. Skills self-test

Prefer SoT + multi-home:

bash "$REVEALFLEET_ROOT/revskills/scripts/lint-all-skills.sh"

Additionally, for each present command/skill root (~/.claude/commands, ~/.grok skill paths from config if readable):

  • Extract referenced script paths under ~/.claude, $REVEALFLEET_ROOT/revskills, node/bash invocations.
  • Assert each referenced script exists. Report missing.
  • Flag any ~/suite/ references as stale (retired 2026-05-07 → $REVEALFLEET_ROOT/).

4. Git integrity (RevealFleet repos)

For each repo in $REVEALFLEET_ROOT/revealui and $JV_REPO:

cd "$repo" && git fsck --full 2>&1 | grep -E '^(error|fatal|missing)'
ss_empty_objects "$repo"

Empty objects = WSL crash damage. Report loudly.

5. Workboard freshness

Parse $WORKBOARD (neutral $JV_REPO/.revealui/workboard.md; if that file is absent, the Claude adapter render $JV_REPO/.claude/workboard.md). In ## Log, flag [CRASHED] entries older than 24h. The adapter file and ~/.claude/rules/ are not the policy home. Write SSOT for board fragments is $JV_REPO/.revealui/workboard.d.

6. Events log size

$REVEALFLEET_ROOT/revealui/.claude/events.jsonl and $JV_REPO/.claude/events.jsonl. Warn if over 100KB.

7. Daemon + Studio surface health

ss_daemon_alive && echo "daemon: up" || echo "daemon: down"
ss_revvault_alive && echo "revvault: up" || echo "revvault: down"

8. MCP servers

Claude: if ~/.claude/config.json exists, extract mcpServers and verify command / cwd / absolute args paths.
Grok: if ~/.grok/config.toml has MCP / server entries (or document SKIP when config shape is opaque), note presence; do not invent a second MCP schema.
Flag any stale ~/projects/RevealUI path.

9. Git-tracked env files

In both RevealFleet repos: git ls-files '*.env*'. SAFE vs REVIEW classification as before (allowlist from repo security gate; do not hardcode).

10. Settings JSON validity

Claude: validate ~/.claude/settings.json and settings.local.json if present.
Grok: validate ~/.grok/config.toml parses if present (toml via python or skip with note).

11. Toolchain

pnpm -v; node -v; biome --version 2>/dev/null || echo "biome via pnpm exec"
cd "$REVEALFLEET_ROOT/revealui" && test -f flake.lock && nix flake metadata --json >/dev/null 2>&1 && echo "flake: ok" || echo "flake: check"
cd "$REVEALFLEET_ROOT/revealui" && direnv status 2>&1 | tail -3

12. Disaster recovery (WSL snapshot)

Per-repo LTS sync is retired. Flag leftover .claude/lts-mode under $REVEALFLEET_ROOT/*/. Snapshot freshness is Windows-side — SKIP with pointer to revkit check-backup-staleness.ps1 when LTS drive unreachable.

13. Session id auto-resolve (GAP-469)

ss_session_id && echo "session-id: ok" || echo "session-id: unresolved (non-fatal outside a harness session)"

Output

Traffic-light summary (PASS/WARN/FAIL/SKIP) per section and per adapter. JSON sidecar at /tmp/revealui-doctor-last.json (prefer this over Claude-only path names).

04 同仓库更多 Skills