mayurpise/draft/bughunt

Claude Code and agent skill by mayurpise/draft

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Performs an exhaustive 14-dimension bug hunt across the codebase using Draft context (architecture, tech-stack, product) for false-positive elimination. Generates a severity-ranked report with code evidence, data flow traces, and suggested fixes. Optionally writes regression tests. Use when the user asks to find bugs, audit code for defects, scan for vulnerabilities, or says 'hunt bugs', 'find bugs', or 'code audit'.

Install

npx vskill@latest install mayurpise/draft/bughunt

SKILL.md

The same SKILL.md was published earlier as mayurpise/draft/bughunt.

Bug Hunt

Conduct an exhaustive bug hunt on this Git repository, enhanced by Draft context when available.

Primary Deliverable

The bug report is the primary deliverable. Every verified bug MUST appear in the final report regardless of whether a regression test can be written. Regression tests are a supplementary output — helpful when possible, but never a filter for bug inclusion.

Relationship to Built-in Bug Hunt Agents

Some AI tools (e.g., Claude Code) provide a built-in bughunt agent that auto-discovers project structure and runs parallel sweeps. /draft:bughunt is complementary, not competing:

/draft:bughuntBuilt-in bughunt agent
ApproachContext-driven methodology with 14 analysis dimensions and verification protocolAuto-discovery with parallel sweep subagents
Draft contextUses architecture, tech-stack, product, guardrails for false-positive eliminationNo Draft context awareness
OutputSeverity-ranked report with evidenceInline fixes + regression tests
Modifies codeNo (report + regression tests only)Yes (finds AND fixes)

When to use which: Use /draft:bughunt when you need context-aware analysis with structured evidence and false-positive elimination. Use the built-in agent when you want fast parallel sweeps with auto-fix capability. For maximum coverage, run both — /draft:bughunt catches context-specific bugs the built-in misses, and vice versa.

Red Flags - STOP if you're

  • Hunting for bugs without reading Draft context first (architecture.md, tech-stack.md, product.md)
  • Reporting a finding without reproducing or tracing the code path
  • Fixing production code instead of reporting bugs (bughunt reports bugs and writes regression tests — it doesn't fix source code)
  • Assuming a pattern is buggy without checking if it's used successfully elsewhere
  • Skipping the verification protocol (every bug needs evidence)
  • Making up file locations or line numbers without reading the actual code
  • Reporting framework-handled concerns as bugs without checking the docs
  • Skipping bugs because you can't write a test for them — mark as N/A and still report

Verify before you report. Evidence over assumptions.


Pre-Check

0. Capture Git Context

Before starting analysis, capture the current git state:

bash
git branch --show-current # Current branch name
git rev-parse --short HEAD # Current commit hash

Store this for the report header. All bugs found are relative to this specific branch/commit.

1. Load Draft Context (if available)

Read and follow the base procedure in core/shared/draft-context-loading.md.

Bug-hunt-specific context application:

  • Flag violations of intended architecture as bugs (coupling, boundary violations)
  • Apply framework-specific checks from tech-stack (React anti-patterns, Node gotchas, etc.)
  • Catch bugs that violate product requirements or user flows
  • Prioritize areas relevant to active tracks
  • Leverage Critical Invariants — Check for invariant violations across data safety, security, concurrency, ordering, idempotency categories
  • Leverage Concurrency Model — Use thread/async model info for race condition and deadlock analysis
  • Leverage Error Handling — Use failure modes and retry policies for reliability bug detection
  • Leverage Data State Machines — Check for invalid state transitions, missing guard clauses, states with no exit path
  • Leverage Storage Topology — Identify data loss risks at each tier (cache eviction without writeback, event log gaps, missing archive)
  • Leverage Consistency Boundaries — Find bugs at eventual consistency seams (stale reads, lost events, missing reconciliation)
  • Leverage Failure Recovery Matrix — Verify idempotency claims, check for partial failure states without recovery paths
  • Leverage Graph Data (if draft/graph/ exists) — First resolve the bundled helpers:

``bash # Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT} # is not exported into skill Bash). See core/shared/tool-resolver.md. DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools" [ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)" [ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)" [ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools" ``

Query "$DRAFT_TOOLS/graph-arch.sh" --repo . for dependency awareness. Flag dependencies on unexpected modules. Flag code in modules involved in dependency cycles as higher risk. Run "$DRAFT_TOOLS/hotspot-rank.sh" --repo . to prioritize analysis of high-complexity, high-fanIn files. See core/shared/graph-query.md.

  • Leverage Learned Anti-Patterns — If draft/guardrails.md exists, read the ## Learned Anti-Patterns section. During the bug sweep, when a bug matches a learned anti-pattern, prefix the report entry with [KNOWN-ANTI-PATTERN: {pattern name}]. This distinguishes recurring documented patterns from newly discovered bugs, and signals that a systemic fix may be needed rather than a one-off patch.
2. Confirm Scope

When invoked programmatically by /draft:review with with-bughunt, skip scope confirmation and inherit the scope from the calling command.

Otherwise, ask user to confirm scope:

  • Entire repo - Full codebase analysis
  • Specific paths - Target directories or files
  • Track-level (specify <track-id>) - Focus on files relevant to a specific track
3. Load Track Context (if track-level)

If running for a specific track, also load:

  • [ ] draft/tracks/<id>/spec.md - Requirements, acceptance criteria, edge cases
  • [ ] draft/tracks/<id>/plan.md - Implementation tasks, phases, dependencies

Use track context to:

  • Verify implemented features match spec requirements
  • Check edge cases listed in spec are handled
  • Identify bugs in areas touched by the track's plan
  • Focus analysis on files modified/created by the track

If no Draft context exists, proceed with code-only analysis.

Multi-Directory Mode (monorepo)

/draft:bughunt can sweep multiple sub-projects in one run — useful at a monorepo root. Trigger it with an explicit directory list (bughunt <dir1> <dir2> ...) or no list (auto-discover).

  1. Resolve targets:
  • Explicit list → use the given directories; verify each exists; skip (with a warning) any that lack a draft/ directory.
  • Auto-discover → immediate child directories containing a draft/ folder, excluding node_modules/, vendor/, .git/, draft/, and dotfiles.
  1. Run sequentially (not in parallel — avoids context conflicts): for each target, run the full single-target bug hunt below scoped to that directory. Each writes its own <dir>/draft/bughunt-report-latest.md.
  2. Aggregate into draft/bughunt-summary.md at the invocation root: a table of dir | Critical | High | Medium | Low | Total | report link, a grand total, and a "directories with Critical issues" callout.
  3. Report skipped directories (no draft/) and suggest running /draft:init in them first.

For a single target (the common case), skip this section and proceed.

Dimension Applicability Check

Before analyzing all 14 dimensions, determine which apply to this codebase:

  • Skip explicitly rather than forcing analysis of N/A dimensions
  • Mark skipped dimensions with reason in report summary

Examples of skipping:

  • "N/A - no backend code" (skip dimensions 2, 8, 10 for frontend-only repo)
  • "N/A - no UI components" (skip dimensions 5, 9, 14 for CLI tool)
  • "N/A - no database" (skip dimension 2 for in-memory app)
  • "N/A - no external integrations" (skip dimension 8)
  • "N/A - no external dependencies" (skip dimension 12 for zero-dependency project)
  • "N/A - no user-facing strings" (skip dimension 14 for libraries/APIs)

Analysis Dimensions

Analyze systematically across all applicable dimensions. Skip N/A dimensions explicitly (see Dimension Applicability Check above).

1. Correctness
  • Logical errors, invalid assumptions, edge cases
  • Incorrect state transitions, stale or inconsistent UI state
  • Error handling gaps, silent failures
  • Off-by-one errors, boundary conditions
2. Reliability & Resilience
  • Crash paths, unhandled exceptions
  • Reload/refresh behavior, retry logic
  • UI behavior on partial backend failure
  • Broken recovery after errors, navigation
3. Security
  • XSS, injection vectors, unsafe rendering
  • Client-side trust assumptions
  • Secrets, tokens, auth data exposure
  • CSRF, insecure deserialization
  • Path traversal, command injection
  • Taint tracking (end-to-end data flow analysis):
  • Identify all entry points: HTTP params, form data, file uploads, env vars, CLI args, message queue payloads, webhook bodies
  • Trace user input to dangerous sinks: SQL queries, shell exec, eval, innerHTML, file path construction, URL construction, deserialization, template rendering
  • For each sink, verify sanitization/validation exists on every path from source to sink
  • Flag paths where unsanitized input reaches a sink without passing through a validator, encoder, or sanitizer
  • Reference: OWASP Top 10, Meta Infer taint analysis methodology
4. Performance (Backend + UI)
  • Inefficient algorithms and data fetching
  • Blocking work on main/UI thread
  • Excessive re-renders, unnecessary state updates
  • Unbounded memory growth (listeners, caches, stores)
5. UI Responsiveness & Perceived Performance
  • Long tasks blocking input
  • Jank during scrolling, typing, resizing
  • Layout thrashing, forced reflows
  • Expensive animations or transitions
  • Poor loading states, flicker, content shifts
6. Concurrency & Ordering
  • Race conditions between async calls
  • Stale responses overwriting newer state
  • Incorrect cancellation or debouncing
  • Event ordering assumptions
  • Deadlocks, livelocks
7. State Management
  • Source-of-truth violations
  • Derived state bugs (computed from stale data)
  • Global state misuse
  • Memory leaks from subscriptions or observers
  • Inconsistent state across components
8. API & Contracts
  • UI assumptions not guaranteed by backend
  • Schema drift, weak typing, missing validation
  • Backward compatibility risks
  • Undocumented API behavior dependencies
9. Accessibility & UX Correctness
  • Keyboard navigation gaps
  • Focus management bugs
  • ARIA misuse or absence
  • Broken tab order or unreadable states
  • UI behavior that contradicts user intent
  • Color contrast, screen reader compatibility
10. Configuration & Build
  • Fragile environment assumptions
  • Build-time vs runtime config leaks
  • Dev-only code shipping to prod
  • Missing environment variable validation
  • CI gaps affecting builds or tests
11. Tests

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
39
Repository forks
5
7-day trend score
18

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mayurpise/draft/bughunt/badge)](https://verified-skill.com/skills/mayurpise/draft/bughunt)

Something wrong with this skill or its page? Tell us.