.config/claude/skills/bug-hunt/SKILL.md
Statically investigate latent bugs in existing code. Use on "bug hunt", "latent bugs", "code audit".
npx skillsauth add kokatsu/dotfiles bug-huntInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A skill for discovering hidden bugs in existing code through code reading and pattern matching. Proactively searches for undiscovered latent bugs.
Respond to the user in the same language they use.
$ARGUMENTS: Investigation target (optional)
/bug-hunt src/controllers/users_controller.rb/bug-hunt src//bug-hunt payment processingWhen the argument is a file/directory:
Run the analyze script, then read the files. Multiple paths are supported:
bash ${CLAUDE_SKILL_DIR}/analyze <path1> [path2] [path3] ...
When the argument is a feature name:
analyze on the identified filesWhen the argument is omitted:
Run both scripts to identify targets and prioritize:
bash ${CLAUDE_SKILL_DIR}/analyze --diff
bash ${CLAUDE_SKILL_DIR}/hotspots
The analyze --diff auto-detects the main branch and gathers diff file stats.
The hotspots output highlights high-churn files worth investigating.
Lock files, build output, tests, and i18n files are excluded by default.
If analyze reports 0 files, select investigation targets from hotspots using the criteria below.
Skip auto-generated files — check CLAUDE.md for project-specific auto-generated file patterns. These should not be investigation targets
Prioritize business logic — workers, models, services, controllers over views/config
Select parallel implementations as a set — if one platform-specific module is a hotspot (e.g., storage_backend), also include its siblings. Cross-implementation comparison catches pattern inconsistencies
Aim for 3,000–10,000 total lines — enough depth for meaningful findings without overwhelming agents
Run analyze on the selected files to get the correct strategy:
bash ${CLAUDE_SKILL_DIR}/analyze file1.rb file2.rs file3.ts ...
Use the strategy field from analyze output:
| strategy value | Action |
|------------------|--------|
| direct | Investigate directly (no sub-agents). Cover all perspectives (A+B+C) yourself |
| 3-agent | Launch 3 Explore agents in parallel, one per perspective |
Launch 3 agents (subagent_type: Explore) in parallel. Pass each agent the list of target file paths and its investigation perspective. Each agent reports only its assigned perspective (ignore findings from other perspectives).
Read ${CLAUDE_SKILL_DIR}/perspectives.md for the common instructions and the 3 investigation perspectives (A: Data Safety, B: Control Flow, C: Security).
Include the common instructions and the assigned perspective in each agent's prompt.
Do not adopt agent reports as-is. Verify all findings, prioritizing Critical / High:
Exclude findings whose evidence cannot be confirmed.
Before writing the report, check the output directory for existing bug-hunt reports:
bug-hunt-*.md in the output directorySave reports to .kokatsu/bug-hunt/ under the Git repository root.
Determine the root with git rev-parse --show-toplevel and create the directory if needed:
mkdir -p "$(git rev-parse --show-toplevel)/.kokatsu/bug-hunt"
Use the absolute path for the report file as well.
bug-hunt-YYYY-MM-DD-HHmm.mdbug-hunt-YYYY-MM-DD-HHmm-payment-workers.mdbug-hunt-YYYY-MM-DD-HHmm-auth-module.mdSee ${CLAUDE_SKILL_DIR}/REPORT_TEMPLATE.md for the output format and severity criteria.
development
Apply UX psychology principles when building UI components, forms, pricing pages, onboarding flows, checkout experiences, modals, or any user-facing interface. Use when designing CTAs, implementing progress indicators, creating loading states, improving user engagement, or reviewing UI for psychological effectiveness.
development
Guide TDD workflow with Red-Green-Refactor cycle. Use when the user asks to "write tests first", "TDD", "test-driven", "テスト駆動", "TDDで実装", "テストファースト".
development
Deep-read a codebase area and write findings to research.md. Use for thorough investigation before planning.
development
Create a detailed implementation plan in plan.md. Never implements code. Use after /research or when planning a feature.