/ruby-rails:brakemanfrom ruby-rails
Scans Ruby on Rails source code for security vulnerabilities (SQL injection, XSS, command injection) via static analysis. Use for security audits, CI/CD integration, or configuring Brakeman.
Ships in ruby-rails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Brakeman is a static analysis tool that checks Ruby on Rails applications for security vulnerabilities without requiring a running application. It analyzes source code to detect common security issues including SQL injection, cross-site scripting (XSS), command injection, mass assignment, and many other vulnerability types.
Verify Brakeman is installed before running scans. If not present, install using one of these methods:
# Using RubyGems (recommended)
gem install brakeman
# Using Bundler (add to Gemfile)
group :development do
gem 'brakeman', require: false
end
# Using Docker
docker pull presidentbeef/brakeman
Brakeman requires Ruby 3.0.0+ to run, but can analyze code written with Ruby 2.0+ syntax. It works with Rails 2.3.x through 8.x.
Run a basic security scan from the Rails application root:
brakeman
From outside the Rails root:
brakeman /path/to/rails/application
Generate reports in various formats:
# HTML report
brakeman -o report.html
# JSON report (useful for comparison and automation)
brakeman -o report.json
# Multiple output formats simultaneously
brakeman -o report.html -o report.json
# Output to console with color and file
brakeman --color -o /dev/stdout -o report.json
# Quiet mode (suppress informational messages)
brakeman -q
Available output formats: text, html, tabs, json, junit, markdown, csv, codeclimate, sonar
Is Brakeman already installed?
├─ No → Install using gem, bundler, or docker
└─ Yes → Continue
What is the goal?
├─ Initial security assessment → Run basic scan: `brakeman`
├─ Generate report for review → Choose format: `brakeman -o report.html`
├─ CI/CD integration → Use JSON output: `brakeman -o report.json`
├─ Too many warnings → Adjust confidence level or filter checks
├─ False positives → Use interactive ignore tool: `brakeman -I`
├─ Compare with previous scan → Use --compare flag
└─ Configuration needed → Create config/brakeman.yml
Brakeman assigns confidence levels to each warning:
Filter warnings by confidence level:
# Only high confidence warnings
brakeman -w3
# High and medium confidence warnings
brakeman -w2
# All warnings (default)
brakeman -w1
Run only specific checks:
# Run only SQL and XSS checks
brakeman -t SQL,CrossSiteScripting
# Skip specific checks
brakeman -x DefaultRoutes,Redirect
# Skip multiple checks
brakeman -x DefaultRoutes,Redirect,SQL
Use brakeman --checks to list all available check names (case-sensitive).
Manage false positives interactively:
brakeman -I
This launches an interactive tool that:
config/brakeman.ignoreOptions during interactive review:
i - Add warning to ignore listn - Add warning to ignore list with note (recommended)s - Skip this warningu - Remove from ignore lista - Ignore remaining warningsk - Skip remaining warningsq - Quit without savingAlways add notes when ignoring warnings to document why they're false positives.
Temporarily view ignored warnings without affecting exit code:
brakeman --show-ignored
Track security improvements or regressions by comparing scans:
# Generate baseline report
brakeman -o baseline.json
# Run new scan and compare
brakeman --compare baseline.json
Output shows:
Store Brakeman options in YAML configuration files. Default locations (checked in order):
./config/brakeman.yml~/.brakeman/config.yml/etc/brakeman/config.ymlSpecify a custom configuration file:
brakeman -c custom_config.yml
Output current options to create a configuration file:
brakeman -C --skip-files plugins/ > config/brakeman.yml
Command-line options override configuration file settings.
---
:skip_files:
- vendor/
- lib/legacy/
:confidence_level: 2
:output_files:
- reports/brakeman.html
- reports/brakeman.json
:quiet: true
Speed up scans with faster mode (skips some features):
brakeman --faster
Equivalent to: --skip-libs --no-branching
Warning: May miss some vulnerabilities. Use only when scan speed is critical.
Skip problematic files or directories:
brakeman --skip-files file1.rb,vendor/,legacy/
Mark custom sanitizing methods as safe to reduce false positives:
brakeman --safe-methods sanitize_input,clean_html
Control exit code behavior:
# Don't exit with error on warnings
brakeman --no-exit-on-warn
# Don't exit with error on scanning errors
brakeman --no-exit-on-error
# Both
brakeman --no-exit-on-warn --no-exit-on-error
Default behavior: Non-zero exit code if warnings found or errors encountered.
Enable verbose debugging output:
brakeman -d
Several Brakeman actions available on GitHub Marketplace. Search for "brakeman" in GitHub Actions.
Brakeman plugin available for Jenkins/Hudson integration. See documentation at brakemanscanner.org/docs/jenkins/
For continuous testing during development:
gem install guard-brakeman
#!/bin/bash
# Example CI script
# Run Brakeman and save results
brakeman -o brakeman-report.json -o brakeman-report.html --no-exit-on-warn
# Check if there are any high confidence warnings
if brakeman -w3 --quiet; then
echo "No high confidence security warnings found"
exit 0
else
echo "High confidence security warnings detected!"
exit 1
fi
Brakeman detects 30+ vulnerability types. For detailed descriptions and remediation guidance, see references/warning_types.md.
Common warning types include:
For comprehensive option reference including less common flags and detailed explanations, see references/command_options.md.
-w3 initially to focus on critical issues--compare to track security posture over time--show-ignored# 1. Run comprehensive scan
brakeman -o initial-audit.html -o initial-audit.json
# 2. Review high confidence warnings first
brakeman -w3 -o high-confidence.html
# 3. Interactively manage false positives
brakeman -I
# 4. Save configuration for future scans
brakeman -C > config/brakeman.yml
# Fail build only on high confidence warnings
brakeman -w3 --no-exit-on-error
# Baseline scan
brakeman -o baseline.json
# After fixes, compare
brakeman --compare baseline.json -o improvements.json
# Focus on specific vulnerability types
brakeman -t SQL,CrossSiteScripting,CommandInjection -w2
# Or exclude noisy checks
brakeman -x DefaultRoutes,Redirect -w2
Problem: Too many weak confidence warnings
Solution: Use -w2 or -w3 to filter by confidence level
Problem: Scanning is very slow
Solution: Use --faster flag or --skip-files to exclude large directories
Problem: False positives for custom sanitization
Solution: Use --safe-methods to mark methods as safe
Problem: Warnings about database values
Solution: Consider if database values truly safe; if yes, adjust with --interprocedural or configuration
Problem: Can't parse certain files
Solution: Use --skip-files to exclude problematic files
Comprehensive descriptions of all 30+ vulnerability types Brakeman can detect, including examples and remediation guidance.
Complete command-line reference with detailed explanations of all available options and flags.
Strategies and techniques for minimizing false positives while maintaining security coverage.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub el-feo/ai-context --plugin ruby-rails13 skills in this plugin
/cucumber-gherkinBDD testing with Cucumber and Gherkin for Ruby and Rails applications. Use when writing feature files (.feature), step definitions, hooks, or implementing Behaviour-Driven Development in Ruby/Rails projects. Covers Gherkin keywords (Feature, Scenario, Given/When/Then, Background, Scenario Outline, Rule), Ruby step definition patterns, Cucumber Expressions, hooks (Before/After/BeforeAll/AfterAll), tags, data tables, doc strings, World modules, and Capybara integration. Triggers on cucumber, gherkin, BDD, feature files, step definitions, acceptance testing, executable specifications./design-patterns-rubyComprehensive Ruby implementations of Gang of Four (GoF) design patterns. Use when implementing object-oriented design solutions, refactoring to reduce coupling, solving architecture problems, or when user mentions specific patterns (Factory, Singleton, Observer, Strategy, etc.) in Ruby context./postgresql-rails-analyzerComprehensive PostgreSQL configuration and usage analysis for Rails applications. Use when Claude Code needs to analyze a Rails codebase for database performance issues, optimization opportunities, or best practice violations. Detects N+1 queries, missing indexes, suboptimal database configurations, anti-patterns, and provides actionable recommendations. Ideal for performance audits, optimization tasks, or when users ask to "analyze the database", "check for N+1 queries", "optimize PostgreSQL", "review database performance", or "suggest database improvements"./railsComprehensive Ruby on Rails v8.1 development guide with detailed documentation for Active Record, controllers, views, routing, testing, jobs, mailers, and more. Use when working on Rails applications, building Rails features, debugging Rails code, writing migrations, setting up associations, configuring Rails apps, or answering questions about Rails best practices and patterns./rails-generatorsCreate expert-level Ruby on Rails generators for models, services, controllers, and full-stack features, plus application templates for whole-app setup. Use when building custom generators, scaffolds, code generation tools, or Rails application templates (rails new -m, app:template, starter-app automation, multi-tenant setup), or when the user mentions Rails generators, Thor DSL, or automated code generation./review-ruby-codeComprehensive Ruby and Rails code review using Sandi Metz rules and SOLID principles. Analyzes changed files in current branch vs base branch, runs rubycritic and simplecov, identifies OOP violations, Rails anti-patterns, security issues, code smells, and test coverage gaps. Outputs REVIEW.md with VSCode-compatible file links. Use when reviewing Ruby/Rails code, conducting code reviews, checking for design issues, pull request review, code quality analysis, or when user mentions Sandi Metz, POODR, 99 Bottles, SOLID, Law of Demeter, or "Tell Don't Ask".3 plugins ship this exact skill · first indexed Jun 21, 2026
Other plugins' skills for the same job