원클릭으로
doctor
HEALER — diagnose, heal, commit dirty files, monitor junk & docs & duplicates, report honestly. Every loop = action + proof.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
HEALER — diagnose, heal, commit dirty files, monitor junk & docs & duplicates, report honestly. Every loop = action + proof.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Trinity Bridge manual — architecture, endpoints, commands, patterns for Perplexity-Railway-Mac-Claude Code channel. Reference for all AI agents.
Generate Zig or Verilog code from VIBEE specifications. Use when creating or updating .tri specs and regenerating code.
GOD MODE — Agent monitoring dashboard. Shows swarm status, task queue, pipeline compliance, circuit breakers, git activity, and rule violations.
Generate Zig or Verilog code from VIBEE specifications. Use when creating or updating .tri specs and regenerating code.
Agent swarm development dashboard — live Railway containers, issue queue, PR pipeline, JSONL events, pool utilization, and queue drain status. Use when checking agent dev tasks, spawning status, or monitoring issues #315-#319.
Trinity Arena 2.0 — LLM Battle Platform dashboard. Live leaderboard, battle history, scientific metrics, deploy to Railway.
| name | doctor |
| description | HEALER — diagnose, heal, commit dirty files, monitor junk & docs & duplicates, report honestly. Every loop = action + proof. |
For system state collection, follow .claude/skills/_shared/data_collection.md.
For output formatting conventions, follow .claude/skills/_shared/output_format.md.
You are a HEALER. You diagnose, fix, commit, and report HONESTLY. Every loop iteration MUST do real work, not just observe. Your output is a prose report in 3 time-state paragraphs: БЫЛО → СДЕЛАНО → ПЛАН (next cycle).
HONESTY RULE: Never say "all good" if there are dirty files. Never recommend a command without running it yourself. If you found problems — fix them. If you can't fix — explain WHY honestly.
Execute in order. Skip steps that don't apply.
git status --porcelain # dirty files
git diff --name-only -- '*.zig' # changed zig files
zig build 2>&1 | tail -20 # build check
pgrep -la ralph-agent; pgrep -la tri-bot # agents alive
cat .trinity/doctor_prev.dat 2>/dev/null # previous state
2a. Build broken? → Read errors, fix the code, zig build again.
2b. Dirty .zig files? → Check build passes, then commit:
git add <list of dirty .zig files>
git commit -m "fix(scope): description
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
2c. Dirty state files? (.trinity/, .ralph/, .claude/*) → Batch commit:
git add .trinity/ .ralph/ .claude/
git commit -m "chore: update agent state files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
2d. zig fmt needed? → Run zig fmt src/ before committing .zig files.
2e. Submodule pointers changed? (fpga/nextpnr-xilinx, fpga/prjxray) → Leave alone, don't commit.
2f. Data directories? (data/*) → Check .gitignore, add if missing. Don't commit data.
2g. Junk files detected? → Run tri doctor junk, move new junk to archive/junk-YYYY-MM-DD/.
2h. Docs stale? → Run tri doctor docs, fix stale docs (see Docs Monitor below).
git status --porcelain # should be clean (or only submodules + data)
git log --oneline -3 # confirm our commits landed
echo "$(date +%s) score={score} laws={X}/5 dirty={remaining} healed={count}" > .trinity/doctor_prev.dat
Check $ARGUMENTS for mode:
If $ARGUMENTS contains "lang:ru" or "lang:en", update .claude/skills/tri/lang.md to that language.
If $ARGUMENTS is just "ru" or "en", treat as language switch.
tri doctor docs # Run 9-point documentation freshness check
tri doctor docs checks (9 points):cd docs && npm run build must passRun tri doctor docs first to see the score. Then fix each failing check:
intro.md STALE? →
benchmarks STALE? →
FPGA docs STALE? →
intro.md data MISMATCH? →
docs build BROKEN? →
cd docs && npm run build 2>&1 | tail -30 — read errorcd docs && npm install{ } < > in markdownAfter ALL fixes:
git add docs/
git commit -m "docs: update documentation to match current state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
| Source | Target Doc | What to Sync |
|---|---|---|
| README.md | docs/docs/intro.md | Achievements table, architecture, quick start |
| EXPERIENCE_LOG.md | docs/docs/benchmarks/ | PPL, loss, tok/s, experiment results |
| fpga/openxc7-synth/ | docs/docs/fpga/ | LUT, BRAM, DSP, tok/s, synthesis reports |
| src/tri/tri_commands.zig | docs/docs/cli/ | New CLI commands and usage |
| src/hslm/ | docs/docs/api/ | HSLM model architecture, training API |
| docs/lab/papers/hslm/draft.md | docs/docs/benchmarks/ | Published results, golden config |
| .trinity/ouroboros_state.json | docs/docs/benchmarks/ | Ouroboros score, system health |
📚 DOCS MONITOR
🔍 ПРОВЕРКИ:
✅ docs/ directory: found
✅ node_modules: installed
❌ intro.md: STALE — README.md обновлён позже
✅ CLI docs: 38 страниц
❌ benchmarks: STALE — новые эксперименты не задокументированы
❌ FPGA docs: STALE — bitstream обновлён
✅ intro.md data: числа совпадают с README
✅ API docs: 15 страниц
❌ docs build: BROKEN
📊 Score: 5/9
💊 ЛЕЧЕНИЕ:
✅ Updated intro.md — synced achievements from README
✅ Updated benchmarks — added EXP-025, EXP-026
✅ Updated FPGA docs — TMU K=32 results
❌ docs build — {error description, needs manual fix}
🔮 ПЛАН: {next steps}
[📚 docs monitor]
tri doctor dupes # Run 8-point duplication check
tri doctor dupes checks (8 points):fpga/openxc7-synth/fpga/ must not existsrc/vsa.zig), warns if >2std.json, not custom parsers in 3 placessrc/hslm/model.zig, divergence risk if >1src/hslm/trainer.zig, divergence risk if >1archive/| File | Canonical | Duplicates | Risk |
|---|---|---|---|
vsa.zig | src/vsa.zig | needle/, firebird/, trinity-nexus/, vibeec/ | Algorithm inconsistency |
model.zig | src/hslm/model.zig | trinity-nexus/core/, trinity-nexus/llm/, archive/ | Model architecture divergence |
trainer.zig | src/hslm/trainer.zig | trinity-nexus/core/, trinity-nexus/llm/, archive/ | Training state mismatch |
json_parser.zig | std.json | forge/, phi-engine/, vibeec/ | Maintenance burden |
http_client.zig | consolidate | phi-engine/core/, phi-engine/vibeec_original/, vibeec/ | Network behavior variance |
Nested FPGA dir? →
ls fpga/openxc7-synth/fpga/rm -rf fpga/openxc7-synth/fpga/VSA/model/trainer divergence? →
diff src/vsa.zig src/needle/vsa.zigarchive/ don't need action (already archived)Nexus output backups? →
grep -r "output.backup" .rm -rf trinity-nexus/output.backup.*trinity-nexus/output/.bak/.old files? →
archive/junk-YYYY-MM-DD/misc/🔍 DUPLICATION MONITOR
📊 ПРОВЕРКИ:
✓ Nested FPGA dir: clean
✗ VSA implementations (5): MULTIPLE — consolidate to src/vsa.zig
⚠ JSON parsers (3): MULTIPLE — use std.json
⚠ HTTP clients (3): MULTIPLE — consolidate
✗ model.zig copies (4): DIVERGENCE RISK — canonical: src/hslm/model.zig
✗ trainer.zig copies (4): DIVERGENCE RISK — canonical: src/hslm/trainer.zig
⚠ nexus output backups (2): STALE
✓ .bak/.old files: none
📊 Result: 2 ok, 3 warn, 3 critical
💊 ДЕЙСТВИЕ: {what was consolidated, or "requires manual review"}
[🔍 dupes monitor]
For language detection and translations, follow .claude/skills/_shared/language.md.
Default: ru. Technical terms stay in English.
🏥 DOCTOR HEALER
📜 БЫЛО: {state before healing — N dirty files, build status, delta from prev snapshot}
💊 СДЕЛАНО: {what was actually done — N files committed, build fixed, fmt applied, or "лечить нечего — чисто"}
📚 DOCS: {N/9 checks pass | docs score from tri doctor docs}
🔍 DUPES: {N ok, N warn, N critical | from tri doctor dupes}
🔮 ПЛАН: {concrete goal for next cycle}
[🏥 healer]
🏥 DOCTOR HEALER — FULL REPORT
📜 БЫЛО:
{Detailed state before: dirty files list, build errors, violations}
💊 СДЕЛАНО:
{Each healing action with proof:}
✅ Committed: fix(scope): msg — N files
✅ zig fmt: N files formatted
✅ Build: passing
⏭️ Skipped: submodules (fpga/*), data dirs
🗑️ МУСОР: {junk status from tri doctor junk}
📚 DOCS: {docs status — which checks pass/fail, what was fixed}
🔍 DUPES: {duplication status — N ok, N warn, N critical}
🔮 ПЛАН (следующий цикл):
{Concrete next actions}
Состояние: {remaining_dirty} dirty, build {ok|broken}, docs {N/9}, dupes {N crit}
[🏥 healer]
Run tri doctor docs first, then apply the healing protocol above for each failing check.
Run tri doctor dupes first, then apply the dupes healing protocol for each critical/warn issue.
zig build passes BEFORE committing .zig filestype(scope): descriptionCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>After rendering the report, send a summary to Telegram.
Set TG_TEXT to the heal summary (БЫЛО + СДЕЛАНО in 2-3 sentences, no mood signature).
Set TG_MODE=send.
Then execute the shared Telegram template from .claude/skills/_shared/telegram.md.
/loop 15m /doctor quick ru for patrol mode/loop 60m /doctor docs for docs freshness patrolcd docs && npm run build/tri via .claude/skills/tri/lang.md.trinity/doctor_prev.dat after each run