Intelligently analyze RSpec test failures and provide actionable debugging guidance.
Analyzes RSpec failures to identify patterns and provide specific debugging steps, code fixes, and test quality improvements. Activates when tests fail or you ask about debugging Ruby test issues.
/plugin marketplace add jwplatta/prompt-library/plugin install rubyist@jwplatta-claude-toolsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/README.mdscripts/analyze_failures.shscripts/run_tests.shIntelligently analyze RSpec test failures and provide actionable debugging guidance.
This skill activates when:
Automatically identify common failure patterns:
NoMethodError Patterns:
Expectation Failures:
Database/State Issues:
For each failure, suggest:
Immediate Checks:
Investigation Steps:
puts or binding.pry at strategic pointsLikely Fixes:
Evaluate test quality:
Good Signs:
Warning Signs:
Identify untested scenarios:
Failure Detected:
Failure/Error: expect(user.full_name).to eq("John Doe")
expected: "John Doe"
got: "John"
Analysis Response:
Failure: User#full_name incomplete
Immediate Cause:
The full_name method is only returning the first name.
Investigation Steps:
Check the implementation at lib/user.rb:15
# Current implementation (likely):
def full_name
first_name
end
Verify test data:
# Check that your factory/test setup has both names
user = User.new(first_name: "John", last_name: "Doe")
Suggested Fix:
# lib/user.rb:15
def full_name
[first_name, last_name].compact.join(' ')
end
Additional Considerations:
compact)Suggested Additional Tests:
context 'when last_name is missing' do
it 'returns only first_name' do
user = User.new(first_name: "John", last_name: nil)
expect(user.full_name).to eq("John")
end
end
When tests are slow:
Identify Bottlenecks:
bundle exec rspec --profileOptimization Suggestions:
Database-Heavy Tests:
build_stubbed instead of createlet instead of let! where possibleExternal Services:
Factory Optimization:
build instead of createOffer to:
binding.pry at failure pointSuggest tests for:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.