Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
PicoRuby application development CLI for ESP32.
Sign in to like and favorite skills
PicoRuby application development CLI for ESP32.
Tech Stack: Ruby 3.4+, Rake, Thor CLI, RuboCop, test-unit, SimpleCov
@import AGENTS.md
使用デバッグジェムでシナリオテストをステップ実行検証ぴょん。
# 1. Install debug gem locally gem install debug # 2. Run test with step execution using ruby -r debug ruby -r debug -Itest test/scenario/new_scenario_test.rb # 3. At the debugger prompt, use: # step - Step to next line # next - Step over method calls # pp var - Print variable # help - Show all commands
Complete step execution guide:
see: .claude/docs/step-execution-guide.md
Key sections:
1. Red Phase └─ bundle exec ruby -Itest test/scenario/your_test.rb (See test failure) 2. Green Phase └─ ruby -r debug -Itest test/scenario/your_test.rb (Step through execution, understand expected behavior) └─ Modify implementation code based on findings 3. RuboCop Phase └─ bundle exec rubocop test/scenario/your_test.rb --autocorrect 4. Refactor Phase └─ ruby -r debug -Itest test/scenario/your_test.rb (Verify refactoring didn't break behavior) 5. Commit Phase └─ git add . && git commit -m "..."
# Run test with step execution ruby -r debug -Itest test/scenario/new_scenario_test.rb # At (rdbg) prompt: (rdbg) step # Move to next line (rdbg) step # Enter test method (rdbg) step # Create tmpdir (rdbg) step # Generate project_id (rdbg) step # Execute ptrk command (rdbg) pp output # See command output (rdbg) pp status.success? # Check exit status (rdbg) continue # Continue to next assertion (rdbg) quit # Exit debugger
# Execute ptrk CLI in specified directory output, status = run_ptrk_command("new my-project", cwd: tmpdir) # Returns: [String output, Process::Status status] # Generate unique project ID for test isolation project_id = generate_project_id # Returns: "20251203_015030_abc123f" (timestamp + hash) # Capture stdout/stderr from block captured = capture_stdout { ... } # Returns: String of captured output
| Command | Purpose |
|---|---|
| Execute next line (step into methods) |
| Execute next line (step over methods) |
| Continue execution to next breakpoint |
| Show all local variables |
| Pretty-print variable value |
| Show variable class |
| Inspect variable details |
| Show current code context |
| Show all debugger commands |
| Exit debugger |
Pattern 1: Check command success
output, status = run_ptrk_command("new #{project_id}", cwd: tmpdir) # Debug: Is command succeeding? (rdbg) pp status.success? (rdbg) pp status.exitstatus (rdbg) pp output # See error message
Pattern 2: Verify file system state
assert Dir.exist?(File.join(project_dir, "storage", "home")) # Debug: What files actually exist? (rdbg) system("find #{tmpdir} -type f") (rdbg) system("ls -la #{project_dir}")
Pattern 3: Check assertion failures
assert_match(/expected_pattern/, output) # Debug: What's in output? (rdbg) pp output.lines # See as array of lines (rdbg) pp output.include?("expected_pattern") # Check if present
Pattern 4: Multi-step workflows
# Multiple ptrk commands in sequence run_ptrk_command("new #{project_id}", cwd: tmpdir) run_ptrk_command("env set --latest", cwd: project_dir) run_ptrk_command("device prepare", cwd: project_dir) # Debug: Check state after each command (rdbg) step # Execute first command (rdbg) system("ls -la #{tmpdir}") # Check what was created (rdbg) continue # Jump to next command (rdbg) pp output # Check second command output
ruby -r debug instead of rdbg command (PATH compatibility)Dir.mktmpdir with generate_project_id() for safetystatus.success? or status.exitstatus after commandsSee also:
SPEC.md — Feature specificationTODO.md — Project status and remaining worktest_helper.rb — Test utility functions