ワンクリックで
debug
Systematic bug diagnosis — reproduce, isolate, hypothesize, verify, fix. Usage: /debug [what's broken]
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Systematic bug diagnosis — reproduce, isolate, hypothesize, verify, fix. Usage: /debug [what's broken]
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Read-only bug audit of the current branch vs a base ref. Dispatches subagents per stack (Go, JS/TS, etc.), consolidates findings, produces a prioritized report. Does not fix. Usage: /find-bugs [base-ref]
Multi-model PR review with parallel fan-out. Three Ollama models (Cloud `:cloud` by default, local fallback) review the full PR diff in parallel; Claude acts as Arbiter, using vote count as a confidence prior to confirm/escalate/dismiss findings, then applies a single consolidated fix commit. Auto-merges (squash) when no fixes were reverted and the PR is mergeable; otherwise leaves it for manual review. Usage: /fix-review [PR-number]
Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.
Self-learning system — log mistakes/wins, run retrospectives, promote patterns to hard rules, and coach on workflow quality. Usage: /self-learn [log|retro|status|init|tips]
session-indexer ship pipeline: issue → implement → review → merge → close. Usage: /ship [--yes|-y] [issue-number | title]
Generates a project-specific /find-bugs skill with stack-specific security and correctness checklists. Run once per project. Usage: /generate-find-bugs
| name | debug |
| description | Systematic bug diagnosis — reproduce, isolate, hypothesize, verify, fix. Usage: /debug [what's broken] |
Bugs have two parts: the symptom (what you observe) and the cause (what's actually wrong). The protocol moves from symptom → cause → fix, one verified step at a time.
Goal: Reliable, minimal reproduction before touching any code.
git log --oneline -20 — when did it last work?If you can't reproduce it: Stop. Gather more information. Unreproducible bugs are unsolvable.
Goal: Narrow the search space to the smallest possible area.
Isolation heuristics:
git bisectState one falsifiable hypothesis before changing any code:
Hypothesis : [what I think is wrong]
Evidence for: [what supports this]
Against : [what doesn't fit]
Test : [one action that confirms or refutes]
One hypothesis at a time. Testing multiple simultaneously makes it impossible to know what fixed it.
fix: [what was broken]
Root cause: [why it happened]
Fix: [what changed and why this is correct]
| Pattern | Symptom | Where to look |
|---|---|---|
| Off-by-one | Wrong last/first element | Loop bounds, slice indices, pagination |
| Nil/null dereference | Crash on access | Unguarded pointer use, missing null checks |
| Race condition | Intermittent, timing-dependent | Shared state, goroutines/threads, async code |
| Wrong input assumptions | Works in tests, breaks in prod | Input validation, edge cases, empty/max values |
| Config/env mismatch | Works locally, breaks in CI/prod | .env files, env var names, defaults |
| Stale state | Shows old data | Caches, memoization, DB transaction isolation |
| Type coercion | Wrong math, unexpected falsy | JS ==, int/float truncation, string/int mixing |
| Dependency version | Broke after upgrade | Changelog, breaking changes, peer dependencies |
// Regression: [short description of what was broken]
// Arrange: exact conditions that triggered the bug
// Act: the action that was broken
// Assert: the correct outcome
The test must reproduce the exact failing scenario, not a simplified analogue.
if is not a fix.git bisect for regressions. Faster than reading the diff.[hypothesis] when communicating status.Stack: Go [inferred — no go.mod yet; project in planning stage as of 2026-06-25]
# Run all
go test ./...
# Run all with race detector (preferred)
go test -race ./...
# Run single package
go test ./internal/mine/...
# Run single test by name
go test ./internal/mine/... -run TestChunkFilter
# Coverage
go test -cover ./...
# Verbose output (shows each test name)
go test -v ./...
No debug env vars in source yet [project pre-implementation]. When adding:
os.Getenv("SESSION_INDEXER_DEBUG") or similar for verbose outputwarn: ollama unavailable, indexed without embeddingserror — check err != nil after every DB callTo manually inspect the SQLite DB:
# Open index
sqlite3 .claude/sessions.db
# Check schema version
SELECT * FROM meta;
# Count chunks and pending embeddings
SELECT COUNT(*) FROM chunks;
SELECT COUNT(*) FROM chunks WHERE id NOT IN (SELECT chunk_id FROM embeddings);
# WAL checkpoint status
PRAGMA wal_checkpoint;
Derived from architecture docs — no git history yet:
| Area | File (planned) | Risk |
|---|---|---|
| JSONL parsing | internal/mine/parse.go | Binary heuristic for tool_result (len>10KB or base64 pattern); tool block 2KB truncation edge cases |
| Noise filter | internal/mine/chunk.go | Strips chunks <30 chars after strip — easy to over-filter multilingual content |
| Dedup logic | internal/mine/mine.go | INSERT OR IGNORE on (session_id, message_index, chunk_index) — if session_id is absent from JSONL, falls back to filename stem; mismatch = duplicates |
| Ollama probe | internal/embed/embed.go | 2s timeout on GET /api/tags; bge-m3:latest model-name match is exact string — version suffix in tag list will fail silently |
| Float32 BLOB | internal/embed/embed.go | encoding/binary LittleEndian; corrupted BLOB = cosine NaN; check len(blob) % 4 == 0 and len(blob) == 4096 |
| Schema version | internal/db/db.go | Hard exit on mismatch — if user has old DB, they must run reindex; no migration path |
| FTS5 sync | internal/db/schema.sql | Triggers keep FTS5 in sync; if trigger fires after content delete without FTS delete → phantom results |
| Search fallback | internal/search/search.go | Cosine over all embeddings loaded into memory — at 10k+ chunks this is ~40MB; no pagination |
Pure Go / no CGO:
modernc.org/sqlite — no system libsqlite3 needed; if build fails with sqlite errors, check go.mod replaces or proxy issues-race) is safe to run — no CGO exclusions neededOllama connectivity:
# Is Ollama running?
curl -s http://localhost:11434/api/tags | jq '.models[].name'
# Is bge-m3 available?
curl -s http://localhost:11434/api/tags | jq '[.models[].name] | map(select(startswith("bge-m3")))'
# Manual embed test
curl -s -X POST http://localhost:11434/api/embed \
-d '{"model":"bge-m3:latest","input":"test"}' | jq '.embeddings[0] | length'
# Expected: 1024
SQLite WAL:
# If reads appear stale after write
PRAGMA wal_checkpoint(FULL);
# Check WAL file size (>10MB = checkpoint not running)
ls -lh .claude/sessions.db-wal
Stop hook timing:
mine must complete within ittime session-indexer mine <jsonl> --db .claude/sessions.db--skip-embed flag if added