Files
holocron/plugins/bin/.apm/skills/diagnose
Defame1297 60be7b3232 refactor(skills): mandate metadata.version on every skill's frontmatter
Only 12 of 39 skills carried metadata.version, and adoption tracked
which plugin a skill lived in rather than any stated rule: core,
gitea and lint were consistent adopters, bin and kyberforge were
consistent non-adopters, git was split with one outlier. There was
no documented convention, and skill-author's own bump logic was
already written as if presence were conditional.

metadata.version is now required on every skill. The 19 skills here
that never carried one (bin, kyberforge, gitea-files) are seeded at
1.0.0, not 0.1.0 -- that value stays reserved for a skill's actual
creation point under skill-author's existing convention. The
skill-frontmatter pre-commit hook now fails a SKILL.md missing the
field, the same class of failure as a missing name/description.

Full rationale in the new ADR. The git-plugin skills that also need
this field follow in the next commit, bundled with issue #113's rtk
normalization since both touch the same files.

Refs: #127
ADR: 0022
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeH8SCbcrCAQrtymkNuhKP
2026-09-07 20:36:24 +00:00
..

diagnose

A six-phase discipline for hard bugs and performance regressions: feedback loop → reproduce → hypothesise → instrument → fix with a regression test → clean up.

What it does

Imposes an order of operations on debugging so the agent cannot skip to guessing. The load-bearing phase is the first one: build a fast, deterministic, agent-runnable pass/fail signal for the bug. Everything downstream — bisection, hypothesis testing, instrumentation — just consumes that signal, so the skill refuses to advance to Phase 2 without one, and says so explicitly rather than hypothesising blind.

The remaining phases each carry a constraint worth knowing about: hypotheses are generated 3–5 at a time and must be falsifiable, so the first plausible idea cannot anchor the whole investigation; every debug log is tagged with a unique prefix ([DEBUG-a4f2]) so cleanup is a single grep; the regression test is written before the fix and only at a seam that exercises the real bug pattern; and the run closes by asking what would have prevented the bug, handing off to improve-codebase-architecture when the answer is architectural.

Performance regressions take a branch of their own inside Phase 4 — baseline measurement and bisection, not logs.

Conditional reading

Neither reference file is read on every run; SKILL.md names the condition for each.

  • references/feedback-loops.md is read when Phase 1 has no signal yet, or when the loop you have is slow or intermittent.
  • references/regression-seams.md is read when Phase 5 leaves you unsure whether the available seam is deep enough — or whether one exists at all.

Usage

/diagnose

Describe the bug or the regression. For filing and triaging a reported bug rather than diagnosing it, use triage; for test-first feature work, use tdd.

Files

File Purpose
SKILL.md The six phases and their gates — what must be true before each one ends
references/feedback-loops.md Loaded when Phase 1 has no loop or the loop is too weak: ten ways to construct one ordered by cost, how to sharpen an existing loop, handling intermittent bugs, and what to ask the user for when the bug resists reproduction
references/regression-seams.md Loaded when Phase 5 is unsure about the seam: what makes a seam correct, the four shapes of a too-shallow seam, and what to do when no correct seam exists
assets/hitl-loop.template.sh Copy-and-edit bash template for the last-resort human-in-the-loop feedback loop, cited by references/feedback-loops.md. Provides step and capture helpers and prints captured values as KEY=VALUE for the agent to parse