本文へ移動
cccskills
無料GitHub で公開

diagnose

Diagnostic method for any bug, failure, regression, flake, or slowdown. Use before proposing a fix: something is broken, throwing, not saving, not showing, or 'worked yesterday'; on 'debug this' or 'find the root cause'; and immediately after a fix attempt did not work.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md9.4 KB
  • evals.md15.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<!-- SYNCED COPY — do not edit here. Canonical: common-docs/skills/diagnose/SKILL.md This file is distributed to every consuming repo by common-docs/meta/scripts/sync_skills.py. Edit the canonical, run the sync, and commit each repo. Edits made here are overwritten and lost. -->

diagnose — no fix without a proven cause

Fix the class (law 3, the laws); this skill is how you get the root cause. The usual AI failure: read code, form one plausible story, patch it, see the symptom move, ship with the real cause still in place. If you cannot name the command that shows this bug red, you are guessing. Read the owning repo's CLAUDE.md and the area's FEATURE.md first. Credential values never enter output.

Siblings: scheduled queue patrol → persistence-repair-patrol (aidream, matrx-frontend, common-docs); wiring capture for an error class → error-capture (aidream, matrx-frontend); test quality → forcing-function-tests.

0. Start from what the platform already captured

Reports, ledgers, and other agents' findings are leads — reproduce them against current state (defect-ownership § Evidence and closure).

Symptom lives inEvidence lane
Any recorded errorAI Dream MCP errors tool, action='surfaces' first (system_error, write_failure, app_log, stuck_rows, shape/tool-UI incidents)
A provider/LLM callthe failed request's cx_request_snapshot.request_payload — the exact wire payload; replay it (aidream error-capture)
A tool callaidream inspect-call · AI Dream MCP debug_traces tool (cx_tool_trace)
A browser surfacethe admin Error Inspector (captureError), AdminIndicator "Copy Full Context", console + network via browser tools
Rows stuck / never landedMCP persistence_watchdog
Fleet, deploy, containersmatrx-ship fleet-incident
"Is my fix live?"https://server.app.matrxserver.com/health/version, never the repo

Read the first error in a run, not the last — later errors cascade from it. Read the whole traceback. Check what changed: git log on the touched paths (many writers share the checkout), deployed SHA vs HEAD, env/config, and the live definition of any DB object — the migration file is not enough (verify-live-state).

A failure a user saw that no lane captured is a second defect in the same bug. The fix includes structured capture at that boundary (aidream / matrx-frontend error-capture).

1. Build a red-capable loop (the core of the skill)

One command, already run with its output shown, that:

  • drives the real code path and asserts the reported symptom ("didn't crash" or a nearby failure does not count);
  • gives the same verdict every run (a flake: a pinned, high reproduction rate);
  • runs in seconds, unattended.

Ways to build it, roughly in order: a failing test at a seam that reaches the bug · a script or curl against a running server (dev-login / pre-authorized test accounts) · replay a captured payload or trace · a browser tool driving the real surface and asserting DOM/console/network · a differential run (last-good vs first-bad SHA, two configs, two users/orgs) · git bisect run when a good state exists · the trigger looped 100× under load for races.

Then tighten it: faster, sharper assertion, deterministic (pin time, seed RNG, isolate state). No loop after real effort? Recover a captured artifact, add local instrumentation, or drive a local canary, and record what you tried. A normal developer task does not deploy capture or wait for production verification. If the assignment explicitly requires production-only evidence, prepare the instrumentation and record the release-owner handoff through the existing durable channel. A theory without a reproduction loop is not a diagnosis.

The loop is scaffolding, not proof. Stubs, fixtures, and throwaway harnesses are fine here and get deleted; they never count as closure.

2. Reproduce, then minimise

Watch the loop go red and confirm it is the user's failure, not a neighbouring one. Cut inputs, callers, config, data, and steps one at a time, re-running after each. Stop when removing any remaining element turns the loop green. The minimal repro shrinks the hypothesis space and becomes the guard.

3. Localize the boundary before theorizing

Failures cross boundaries: React → Supabase/RLS → Postgres · client → router → service → provider → stream → kind renderer · extension/desktop → server · package source → published artifact → consumer. Instrument each boundary once (what enters, what exits, which identity, org, env, and version are in effect), run the loop, find the first boundary where good data goes bad. Work only there. Trace backward from it — what produced the bad value, what called that — to the origin, and fix at the origin, never where it surfaced.

Diff against a working sibling — the canonical component, the other route, the other org, the last-good SHA. List every difference, however small; dismiss none as "can't matter". Working siblings reveal the cause; broken siblings define the class (the census the fix needs).

Tag temporary instrumentation uniquely ([DBG-a4f2]) so cleanup is one grep. Never commit it.

4. Hypothesize: several, falsifiable, one variable at a time

Write 3–5 ranked hypotheses before testing any — a single hypothesis locks onto the first plausible story. A hypothesis without a prediction that can FAIL is a suspect, not a hypothesis, and does not count. Write them as this table; a row with an empty middle column is sharpened or dropped, never tested:

#If the cause is …… then this one change turns the loop greenOne-variable test

Test one variable per run (debugger/REPL or targeted boundary logs), never "log everything and grep". A result that contradicts every hypothesis sends you back to §3, not to a guess. (Observed 2026-09-10: six of six reps — with the skill and without — ranked four or five plausible causes and predicted nothing; one quoted this rule back and then listed five bare suspects.)

Performance: logs mislead. Baseline measurement (same machine, known noise), then bisect; show the regression reproduces before hunting it in the tree.

5. Fix the class, guard at the correct seam

With the cause confirmed: census siblings (grep the pattern, not the instance) and fix at the origin or the shared layer. Turn the minimal repro into a guard at a seam that reproduces the real bug pattern. If the only seam is too shallow (one caller where the bug needs the chain, a stub that owns the logic under test), a test there is false confidence — the missing seam is itself a finding: fix it or record it. Watch the guard fail, fix, watch it pass, then re-run the original un-minimised loop. Test quality: forcing-function-tests.

A retry, longer timeout, sleep, catch-and-default, or fallback without a proven cause is a symptom patch. When the investigation proves an external or timing cause, the handling announces itself (capture + remedy), its limits are knobs, and the investigation is recorded.

6. When fixes keep failing

Revert each failed attempt and return to §3 with the new evidence; never stack a second fix on a first that did not work. Three failed fixes: stop patching — that pattern points at the design (each fix exposes coupling somewhere new). The owner dispatches a fresh-context adversarial reviewer on the hypotheses and evidence and asks whether the design is sound. Arman gets a ruling only for a consequential design choice, packaged with evidence and a recommendation — never "stuck".

Red flags — stop, go back to §1

  • "Let me just try…" or "it's probably X" before a red loop exists
  • A list of suspects, guesses, or "theories to test" with no prediction — ranking is not falsifying
  • Reading code to build a story before the loop exists
  • More than one change per run
  • A sleep, retry, or wider timeout as the fix
  • "Tests pass" offered as closure
  • A diagnosis or ledger entry offered as the deliverable (finding it makes it yours)

Done

  • Original loop green; guard failed then passed at a correct seam, or the missing seam is recorded
  • Siblings censused, each fixed or tracked
  • A previously silent failure is now captured structurally
  • Every [DBG-…] line and throwaway harness removed (grep)
  • Commit message states the confirmed cause and the hypotheses ruled out
  • Every touched type boundary is checked without suppressing introduced errors; meaningful behavior tests prove the repaired path; introduced regressions are fixed
  • Changed UI is exercised in an actual localhost browser against the changed code
  • Independent review is obtained when the change's risk or scope requires it

Deployment and production/live-surface verification belong to the release owner unless the assignment explicitly includes them. They never keep a completed local repair open.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Admin debug system wiring for the floating AdminIndicator's live debug data and Copy Full Context. Use when adding debug visibility to a route or feature, wiring useDebugContext or the debug panel, capturing console errors, or enabling the copy-context workflow for a page.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Compact two-icon Copy / Copy-for-AI controls (components/agent-copy). Use when adding copy buttons to a row, card, list, or record; merging duplicate Copy/JSON/AI controls; continuing the copy rollout; or writing a Copy-for-AI payload. NOT for markdown content actions (use rich-document-actions).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Disclosing a surface's existing fixed AI jobs in the shell's top Agents menu. Use when a page, panel, overlay, or window already runs a mandate behind a button, assist, automatic action, or mode; when the agent-disclosure guard names a file; or during a surface check.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

The watch-fix-rerun method for making an existing platform agent or automated process efficient and correct: baseline its ledger, run one unit yourself, fix the class behind every wasted call, rerun, record. Use when asked to improve, optimize, watch, or 'make efficient' an agent, a sandbox session, a sync job, or any recurring automated process.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Redux state for agent execution and firing agent shortcuts. Use when editing features/agents/redux/, building agent UI, creating a conversation, touching assembleRequest or NDJSON stream state, wiring agent-state selectors, adding a per-conversation capability, or triggering a shortcut from a button, menu, or code (useShortcutTrigger, launchAgentExecution).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

The provision for a call site: the exhaustive menu of values that place in the code can realistically produce. Use before creating or fixing a mandate or agent that reasons about more than its own input, when deciding whether an agent can answer at all with what it is sent, or when its output 'looks right' but nobody checked it could be. NOT for building the agent (use create-agent).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

armanisadeghi のスキルをすべて見る

このスキルの問題を報告する