Skip to content

self-diagnosis: Maintainer Harness Profiler & Audit

Maintainer-only skill: Run self-diagnosis only inside an Agy-Squad source repository checkout. To review or govern your own external repository, use pr-review, full-review, day-one-review, or swarm-governance.

self-diagnosis audits Agy-Squad itself and its workspace skills for contract accuracy, progressive-disclosure budgets, compiled template sizes, link integrity, and pipeline latency.

Workflow

  1. Pre-flight intake & zero-subagent profiler (Operator): Confirm execution mode (/swarm, invoke_subagent fallback, or Local Profiler Only), topology (Flat vs. Layered, zero default bias), retention (--keep-reports vs. --teardown), and integrity gate (audit-<id> vs. --allow-unaudited). Run the zero-subagent local profiler first:
node .agents/skills/self-diagnosis/scripts/diagnose.mjs --markdown

diagnose.mjs validates SKILL.md line/byte/prose-share budgets, relative and hosted doc links, runtime closure checklists, zensical.toml nav entries, SVG XML sanity, Standard v1.5.0 (11-category ARCH–DEP, SEC) and legacy v1.4.0 review ledgers, compiled brief byte budgets, and canary handoff pipeline timings in isolated temp directories.

  1. Compile diagnostic cohorts: Compile self-diagnosis-manifest.json via diagnose.mjs --print-plan (primary /swarm) or diagnose.mjs --print-dispatch <all_l1|all_specialists|squadId> (invoke_subagent fallback):
  2. Skill & PR-Review Standard Lead (skill_and_pr_review_audit) -> 2 readOnly: true specialists (SKILL, DOC, ARCH, SCRIPT).
  3. Runtime & Contract Diagnostics Lead (runtime_and_contract_diagnosis) -> 2 readOnly: true specialists (MCP, RUN, SVC, SCRIPT, TEST, DEP, SEC).
  4. Token & Execution Optimization Lead (token_and_execution_optimization) -> 2 readOnly: true specialists (RUN, SKILL, SVC, ARCH).
  5. Report, patrol & bundle (Specialists -> Working Leads / Coordinator -> Operator): Specialists write specialist-<N>/report.md and send <= 500 B READY receipts. Leads or coordinator verify claims against source files and npm test, emit Content Verdict: PASS, and pair with flat audit-<id> (Integrity Verdict: CLEAN) before bundling via agy-squad finalize.
  6. Ledger, teardown, remediation & re-verification: Transcribe every P0–P3 item 1-to-1 into docs/reviews/<slug>.md (Sections 1, 8, and 9), run diagnose.mjs --teardown all --ledger docs/reviews/<slug>.md, keep spawned workers alive to re-verify fixes in place, flip closed ledger rows, kill workers (swarm{action: "kill"} / manage_subagents), and pass the four-check runtime closure gate.