debug-cli
Workflow tool for testing and modifying CLI application commands and logic.
Install
mkdir -p .claude/skills/debug-cli && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3452" && unzip -o skill.zip -d .claude/skills/debug-cli && rm skill.zipInstalls to .claude/skills/debug-cli
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when users need to debug, modify, or extend the code-forge application's CLI commands, argument parsing, or CLI behavior. This includes adding new commands, fixing CLI bugs, updating command options, or troubleshooting CLI-related issues.Key capabilities
- →Build the application in debug mode
- →Get latest CLI documentation
- →Test CLI commands with the -p flag
- →Export conversations as JSON or HTML
- →Clone conversations for bug reproduction
- →Verify new command appearance
How it works
This skill provides a workflow for debugging CLI applications by building in debug mode, testing with specific flags, and managing conversations for reproduction.
Inputs & outputs
When to use debug-cli
- →Debug CLI argument parsing
- →Fix CLI command bugs
- →Add new CLI subcommands
- →Verify CLI behavior without committing
About this skill
CLI Debug Skill
This skill provides a systematic workflow for debugging and verifying changes to the forge CLI application.
Core Principles
- Always get latest docs first: Run
--helpto see current commands and options - Use
-pfor testing: Test forge by giving it tasks with the-pflag - Never commit: This is for debugging only - don't commit changes
- Clone conversations: When debugging conversation bugs, clone the source conversation before reproducing
Workflow
1. Build the Application
Always build in debug mode after making changes:
cargo build
Never use cargo build --release for debugging - it's significantly slower and unnecessary for verification.
2. Get Latest Documentation
Always start by checking the latest help to understand current commands and options:
# Main help - do this first
./target/debug/forge --help
# Command-specific help
./target/debug/forge [COMMAND] --help
# Subcommand help
./target/debug/forge [COMMAND] [SUBCOMMAND] --help
3. Test with -p Flag
Use the -p flag to give forge a task to complete without interactive mode:
# Test with a simple prompt
./target/debug/forge -p "create a hello world rust program"
# Test with specific functionality
./target/debug/forge -p "read the README.md file and summarize it"
# Test with complex tasks
./target/debug/forge -p "analyze the code structure and suggest improvements"
4. Debug with Conversation Dumps
When debugging prompts or conversation issues, use conversation dump to export conversations. The command automatically creates a timestamped file:
# Dump conversation as JSON (creates: YYYY-MM-DD_HH-MM-SS-dump.json)
./target/debug/forge conversation dump <conversation-id>
# Export as HTML for human-readable format (creates: YYYY-MM-DD_HH-MM-SS-dump.html)
./target/debug/forge conversation dump --html <conversation-id>
# Use dumped JSON to reproduce issues
./target/debug/forge --conversation 2025-11-23_12-28-52-dump.json
5. Clone Before Reproducing Bugs
Critical: When a user provides a conversation with a bug, always clone it first:
# Clone the conversation
./target/debug/forge conversation clone <source-conversation-id>
# This creates a new conversation ID - use that for testing
./target/debug/forge --conversation-id <new-cloned-id>
# Keep cloning the source until the fix is verified
# Never modify the original conversation
Why clone?
- Preserves original bug evidence
- Allows multiple reproduction attempts
- Enables A/B testing of fixes
- Keeps source conversation clean
Common Testing Patterns
Test New Features
# Build and test new command
cargo build
./target/debug/forge --help # Verify new command appears
./target/debug/forge new-command --help # Check command docs
./target/debug/forge -p "test the new feature"
Reproduce Reported Bugs
# 1. Dump the conversation (creates timestamped JSON file)
./target/debug/forge conversation dump <bug-conversation-id>
# 2. Clone it for testing (preserves original)
./target/debug/forge conversation clone <bug-conversation-id>
# 3. Reproduce with the cloned conversation
./target/debug/forge --conversation-id <cloned-id> -p "reproduce the issue"
# 4. After fix, verify with new clone
./target/debug/forge conversation clone <bug-conversation-id>
./target/debug/forge --conversation-id <new-clone-id> -p "verify fix"
Test Edge Cases
# Test with missing arguments
./target/debug/forge command
# Test with invalid input
./target/debug/forge -p "invalid task with special chars: <>|&"
# Test with boundary values
./target/debug/forge -p "create a file with a very long name..."
Debug Prompt Optimization
# 1. Dump conversation to analyze prompts (creates timestamped JSON)
./target/debug/forge conversation dump <id>
# 2. Review the conversation structure
cat 2025-11-23_12-28-52-dump.json | jq '.messages[] | {role, content}'
# 3. Export as HTML for easier reading
./target/debug/forge conversation dump --html <id>
# 4. Test modified prompts
./target/debug/forge -p "your optimized prompt here"
Integration with Development Workflow
After Code Changes
- Build:
cargo build - Docs:
./target/debug/forge --help(verify documentation) - Test:
./target/debug/forge -p "relevant task" - Verify: Check output matches expectations
Debugging a Bug Report
- Clone:
./target/debug/forge conversation clone <source-id> - Build:
cargo build(with potential fixes) - Test:
./target/debug/forge --conversation-id <cloned-id> -p "reproduce" - Iterate: Repeat until verified
- Never commit during debugging - only after full verification
Quick Reference
# Standard debug workflow
cargo build
./target/debug/forge --help # Always check docs first
./target/debug/forge -p "your test task"
# Dump conversation (creates timestamped file)
./target/debug/forge conversation dump <id>
# Output: 2025-11-23_12-28-52-dump.json
# Export as HTML for review
./target/debug/forge conversation dump --html <id>
# Output: 2025-11-23_12-28-52-dump.html
# Use dumped conversation
./target/debug/forge --conversation 2025-11-23_12-28-52-dump.json
# Clone and test bug
./target/debug/forge conversation clone <source-id>
./target/debug/forge --conversation-id <cloned-id> -p "reproduce bug"
# Debug prompts with jq (use actual filename)
cat 2025-11-23_12-28-52-dump.json | jq '.messages[] | {role, content}'
# Test with verbose output
./target/debug/forge --verbose -p "test task"
Tips
- Always
--helpfirst: Get latest docs before testing - Use
-pfor testing: Don't test interactively, use prompts - Clone conversations: Never modify original bug conversations
- Never commit: This is for debugging only
- Dump creates files:
dumpautomatically creates timestamped files (no>needed) - HTML exports: Use
--htmlflag for human-readable conversation views - Use relative paths: Binary is at
./target/debug/forgefrom project root - Check exit codes: Use
echo $?to verify exit codes - Watch for warnings: Build warnings often indicate issues
When not to use it
- →Committing changes made during debugging
- →Using `cargo build --release` for debugging
- →Modifying original bug conversations
Limitations
- →Changes made during debugging are not committed
- →Original bug conversations must not be modified
- →Testing is for debugging only
How it compares
This workflow systematically isolates and reproduces CLI issues using conversation cloning and non-interactive testing, unlike ad-hoc manual execution.
Compared to similar skills
debug-cli side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| debug-cli (this skill) | 1 | 8mo | Review | Intermediate |
| fix-clippy | 3 | 6mo | No flags | Beginner |
| handling-rust-errors | 4 | 2mo | No flags | Intermediate |
| search-code | 2 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by antinomyhq
View all by antinomyhq →You might also like
fix-clippy
quickwit-oss
Fix all clippy lint warnings in the project
handling-rust-errors
hashintel
HASH error handling patterns using error-stack crate. Use when working with Result types, Report types, defining custom errors, propagating errors with change_context, adding context with attach, implementing Error trait, or documenting error conditions in Rust code.
search-code
JamieMason
Search for code patterns in Syncpack. Use when finding symbols, implementations, or understanding how code is used. Covers ast-grep for Rust and grep/rg for other cases.
m01-ownership
actionbook
CRITICAL: Use for ownership/borrow/lifetime issues. Triggers: E0382, E0597, E0506, E0507, E0515, E0716, E0106, value moved, borrowed value does not live long enough, cannot move out of, use of moved value, ownership, borrow, lifetime, 'a, 'static, move, clone, Copy, 所有权, 借用, 生命周期
m03-mutability
actionbook
CRITICAL: Use for mutability issues. Triggers: E0596, E0499, E0502, cannot borrow as mutable, already borrowed as immutable, mut, &mut, interior mutability, Cell, RefCell, Mutex, RwLock, 可变性, 内部可变性, 借用冲突
bisect-ssa-pass
noir-lang
Workflow for debugging SSA pass semantic preservation using the noir-ssa CLI. Use when a program's behavior changes incorrectly during the SSA pipeline - bisects passes to identify which one breaks semantics. The `pass_vs_prev` fuzzer finds such issues automatically.