New to Claude Skills? Learn how to install them →

Ctailcallhq on GitHub

CLI Debug Skill

Free

Streamline debugging for the forge CLI application.

Get this skill

Free · Opens the source repo

What CLI Debug Skill does

The CLI Debug Skill is designed specifically for developers working with the forge CLI application. It provides a comprehensive workflow that aids in debugging, modifying, and extending CLI commands, argument parsing, and overall CLI behavior. This skill is particularly useful when you need to add new commands, fix bugs, or troubleshoot issues related to the command-line interface. By following the structured approach outlined in the skill, users can ensure they are efficiently addressing problems without compromising the integrity of the original codebase.

The skill emphasizes a systematic debugging process that begins with building the application in debug mode. Users are instructed to always check the latest documentation using the --help command, ensuring they are aware of the current commands and options available. Testing is facilitated through the -p flag, allowing users to run tasks without the need for interactive input. This method not only speeds up the testing process but also helps in identifying issues more rapidly.

A unique aspect of this skill is its focus on conversation dumps, which are essential for debugging prompts or conversation-related issues. Users can export conversations to JSON or HTML formats, preserving the original context while allowing for multiple reproduction attempts. This is critical when verifying fixes, as it ensures that the original conversation remains untouched, providing a reliable reference for future debugging sessions.

Overall, the CLI Debug Skill is an invaluable tool for developers who need to maintain and enhance the functionality of the forge CLI application. Its structured approach to debugging and testing promotes best practices, ensuring that modifications are made safely and effectively.

When to use it

Use this skill when you need to debug, modify, or extend the forge CLI application, especially when adding new commands or fixing bugs.

When not to use it

This skill is not suitable for production environments or when you need to commit changes; it is strictly for debugging purposes.

What you can build with it

Debugging a New Command

When adding a new command to the forge CLI, use the skill to build the application, verify documentation, and test the command with the `-p` flag.

Reproducing Reported Bugs

Utilize the conversation dump feature to clone a reported bug conversation, allowing for safe testing and verification of fixes.

Testing Edge Cases

Employ the CLI Debug Skill to test edge cases by running commands with missing arguments or invalid inputs to ensure robust error handling.

How to install CLI Debug Skill

View source

1. Install with the skills CLI

npx skills add tailcallhq/forgecode/debug-cli --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by tailcallhq

CLI Debug Skill

This skill provides a systematic workflow for debugging and verifying changes to the forge CLI application.

Core Principles

  1. Always get latest docs first: Run --help to see current commands and options
  2. Use -p for testing: Test forge by giving it tasks with the -p flag
  3. Never commit: This is for debugging only - don't commit changes
  4. 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

  1. Build: cargo build
  2. Docs: ./target/debug/forge --help (verify documentation)
  3. Test: ./target/debug/forge -p "relevant task"
  4. Verify: Check output matches expectations

Debugging a Bug Report

  1. Clone: ./target/debug/forge conversation clone <source-id>
  2. Build: cargo build (with potential fixes)
  3. Test: ./target/debug/forge --conversation-id <cloned-id> -p "reproduce"
  4. Iterate: Repeat until verified
  5. 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 --help first: Get latest docs before testing
  • Use -p for testing: Don't test interactively, use prompts
  • Clone conversations: Never modify original bug conversations
  • Never commit: This is for debugging only
  • Dump creates files: dump automatically creates timestamped files (no > needed)
  • HTML exports: Use --html flag for human-readable conversation views
  • Use relative paths: Binary is at ./target/debug/forge from project root
  • Check exit codes: Use echo $? to verify exit codes
  • Watch for warnings: Build warnings often indicate issues

Frequently asked questions about CLI Debug Skill

Similar skills