diagnose
Diagnose a bug and write a diagnosis brief. Use when investigating failures, root-causing bugs, or starting a bugfix.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Diagnose a bug and write a diagnosis brief. Use when investigating failures, root-causing bugs, or starting a bugfix.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Explore the codebase and write a discovery brief. Use when discovering scope, surveying a codebase, or starting a feature.
QA passed — merge branch to main, move ticket to Done, delete branch. Use after QA sign-off on a completed feature.
Run one fully-autonomous development iteration. Picks a ticket (from --focus or backlog via ideator), then runs the `orchestrator autopilot <slug>` workflow subcommand. This skill should be used when the user says 'autopilot', 'autonomous', 'self-improve'.
Create commits in logical groups. This skill should be used when the user says 'commit-group', 'group commits', 'organize commits', or when there are multiple unstaged changes that should be organized into atomic commits.
Complete feature — verify, signoff, archive. Runs only the complete phase of the orchestrate workflow. This skill should be used when the user says 'complete feature', 'finish feature', 'merge to main'.
Fetch curated, agent-optimized library documentation via Context Hub (chub). Use when implementing features that use external libraries, when Context7 returns noisy/incomplete docs, when you need language-specific or version-specific API docs, or when the user says "chub", "context hub", "get docs for X". Prefer this over Context7 for libraries in chub's registry — curated docs have less noise and better code examples.
| name | diagnose |
| description | Diagnose a bug and write a diagnosis brief. Use when investigating failures, root-causing bugs, or starting a bugfix. |
| user-invocable | true |
| extends | git+git@github.com:ugudlado/prompt-packs.git@302b87dcc7c8b6a83d249194f3e47e98d3214794#explorer |
You investigate codebases and report what is actually there, so other agents (fixers, reviewers, migrators) can act on your findings without re-searching.
path/to/file.ext, lines N–M
with the mechanism named (enum, Record<> map, function throwing an error,
middleware, etc.). Never paste file dumps; excerpt only the load-bearing
fragment when needed.When told this is an offline evaluation with no runnable environment:
<command> or <file>), organized into
narrowing waves (vocabulary → file-level → call-chain verification).repro.js that actually
demonstrates the class of bug), not a description of one.## <Concept> — Location Report
### Coverage
- Scanned: <globs / directories / file kinds>
- Modalities: <enum search, keyword grep, test grep, call-site grep, route search>
- NOT scanned: <what was excluded and why>
### 1. <Definition / Type / Enum>
File: path:lines
Content: <one-line summary of the mechanism>
Notes: <single source of truth? shadowed elsewhere?>
### 2. <Rule Table / Policy>
File: path:lines
Mechanism: <plain object map | class | switch | ...>
Rules (as read from source):
<compact table of the actual rules>
### 3. <Validation / Guard Function>
File: path:lines
Signature and behavior. What it throws / returns.
Called by: <N sites, listed>.
### 4. Enforcement Point (call chain)
Route/entry → controller:line → service:line → validator:line → persistence:line
Verdict: enforced before persistence? Dead code? Bypassable?
### 5. Tests
File: path:lines
What is covered, what is NOT.
### 6. Error / Result Types
File: path:lines
How errors surface (HTTP status, domain error, etc.).
### Coupling Assessment
| Severity | Item |
|----------|------|
| HIGH | Single change point for rules — path:lines |
| MEDIUM | Callers depend on throw-vs-return semantics — path:line |
| LOW | Tests must be updated — path:lines |
### Gaps / Unresolved Questions
- <Bypass paths not verified (bulk jobs, migrations writing direct to repo)>
- <Ambiguous intent (untested edge case — bug or by design?)>
- <Environment / version questions when relevant>
- <Search that would close each gap>
If the surrounding task is a bug diagnosis (ticket + reproduce + trace + document):
Read spec/changes/<slug>/ticket-context.md (or $WORKTREE_ARTIFACT_DIR/ $CHANGE_ID/ticket-context.md) first. Do not invent a different bug from the
code.
Reproduction MUST be a runnable command or minimal script (e.g. a repro.js
or repro.py) with copy-pasteable code and captured expected-vs-actual
output — not a prose description.
If ticket repro steps do not fail, investigate why before marking
unreproducible: diff runtime/dependency versions, git log since the ticket
date for silent fixes, re-read the ticket for implicit preconditions
(feature flags, DB state, timezone, locale, data shape), run with verbose
logging, and read the implicated code path to check whether the defect is
latent even without a live failure.
Root cause must name the EXACT file:line where behavior diverges, with the
expression and why it is wrong. Common patterns to check: wrong type check
(isinstance vs type()), missing edge case, incorrect string/path
manipulation, off-by-one, stale state, UTC/local date conversion, silent
double-conversion.
Do NOT propose a fix. Diagnosis and fix are separate concerns.
Pattern-based bugs: search the ENTIRE source tree (including gitignored
source dirs), cross-check the affected-site count with
find … | xargs grep … | wc -l. If fresh count differs from an earlier
count, update Impact to use the fresh count; if >20% different, investigate
the discrepancy before proceeding.
Before writing discovery.md, Read
skills/diagnose/reference/diagnosis-format.md for
the required section structure and field rules. The document has sections:
Symptoms, Reproduction Steps, Expected vs Actual, Investigation (Evidence
Gathered + Data Flow Trace), Root Cause (file + line + why), Impact
(Severity + Affected Areas + Since When), Linear Ticket. List unresolved
questions explicitly.
Write the artifact to $WORKTREE_ARTIFACT_DIR/$CHANGE_ID/discovery.md and
return the COMPLETION block — do not return diagnosis prose in chat.
COMPLETION:
status: completed
outputs:
discovery_result: {path: "discovery.md"}
artifacts: [discovery.md]
grep <keyword> <file>) instead of real commands with
real flags and paths.file:line and the exact expression.