Skip to content
Development
Command

/debug

Investigate bugs and failures with systematic root-cause analysis

From plugin
shipyard
6725 skills20 agents25 commands4 hooks
> /plugin marketplace add lgbarn/shipyard
> /plugin install shipyard@shipyard

Command definition

debug.md
description: "Investigate bugs and failures with systematic root-cause analysis"
disable-model-invocation: true
argument-hint: "<error description or test name>"

/shipyard:debug - Root Cause Analysis

You are executing the Shipyard debugging workflow. This dispatches a dedicated debugger agent for systematic root-cause investigation.

<prerequisites>

Step 1: Parse Arguments

  • If an error description is provided, use it as the problem statement.
  • If no argument is provided, ask the user:

> "What issue are you investigating? Provide the error message, failing test, or describe the unexpected behavior."

Step 2: Gather Context

1. Read `.shipyard/STATE.json` if it exists (for current phase context) 2. Read `.shipyard/config.json` for model routing 3. Follow **Worktree Protocol** (detect if running in a git worktree; if so, use worktree root for paths and record the branch name; see `docs/PROTOCOLS.md`) 4. Follow **Model Routing Protocol** (select the correct model for the debugger role using `model_routing.debugging` from config; see `docs/PROTOCOLS.md`)

</prerequisites>

<execution>

Step 3: Dispatch Debugger

Dispatch a **debugger agent** (subagent_type: "shipyard:debugger") following the **Model Routing Protocol** with:

  • The problem statement (error description, test name, or unexpected behavior)
  • Working directory, current branch, and worktree status
  • Codebase docs per **Codebase Docs Protocol** (resolve configured codebase docs path and load CONVENTIONS.md, STACK.md, ARCHITECTURE.md, etc.; see `docs/PROTOCOLS.md`)
  • `.shipyard/PROJECT.md` if it exists
  • Recent git log (`git log --oneline -20`)
  • Any error output or stack traces the user provided

The debugger agent performs: 1. Root cause investigation (reproduce, trace, gather evidence) 2. Pattern analysis (compare working vs broken code) 3. Hypothesis testing (minimal changes, one variable at a time) 4. Remediation plan (documented steps for the builder)

Step 4: Present Results

Read the debugger's ROOT-CAUSE.md output and present to the user:

  • Root cause summary
  • Evidence chain
  • Remediation plan

</execution>

<output>

Step 5: Route Forward

Offer the user options based on the diagnosis:

  • **Fix now:** "Run `/shipyard:quick {remediation summary}` to implement the fix."
  • **Plan a fix:** "Run `/shipyard:plan` to plan a structured fix if the issue spans multiple files."
  • **Manual fix:** "The remediation plan is in ROOT-CAUSE.md. Fix it yourself and run the verification command to confirm."

If in an active phase build:

  • **Re-dispatch builder:** "This issue was found during Phase {N} build. Re-dispatch the builder with the diagnosis to fix and continue."

</output>

Read more
@lgbarn
Ships withshipyard

A Claude Code plugin for structured project execution. Plan work in phases, build with parallel agents and TDD, review with security audits and quality gates, and ship with confidence.

6725 skills20 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
67
Star history of lgbarn/shipyard on GitHub, a chart by star-history.com

Other commands on shipyard.

audit

audit

Command

On-demand security audit — OWASP, secrets, dependencies, IaC security

@lgbarn@lgbarnInstall Command
brainstorm

brainstorm

Command

Explore requirements through Socratic dialogue and capture project definition

@lgbarn@lgbarnInstall Command
build

build

Command

Execute plans using fresh subagents with review gates

@lgbarn@lgbarnInstall Command
document

document

Command

On-demand documentation generation — API docs, architecture updates, user guides

@lgbarn@lgbarnInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command