brainstorming
Structured design dialogue that validates ideas before implementation begins.
fix-rubocop
Fixes RuboCop offenses systematically and safely. Use when the user wants to reduce RuboCop warnings, clean up .rubocop_todo.yml, fix linting errors, or improve code style compliance.
Full skill instructions
Assists with systematically reducing RuboCop offenses while preserving behavior and keeping changes focused.
IMPORTANT: When using this skill, announce to the user: "Using fix-rubocop skill to fix RuboCop violations systematically."
.rubocop.yml: Never hand-edit .rubocop_todo.yml# rubocop:disable comments# Full lint check
rake rubocop
# Lint specific file or directory
bundle exec rubocop path/to/file.rb
# Safe autocorrect (recommended first step)
bundle exec rubocop -a path/to/file.rb
# Unsafe autocorrect for specific cop (use with caution)
bundle exec rubocop -A --only Cop/Name path/to/file.rb
# Run tests to verify no behavior changes
rake spec
# Regenerate .rubocop_todo.yml after fixes
bundle exec docquet regenerate-todo
# Run full lint to see all offenses
rake rubocop
# Note the failing cops and affected files
# Example output:
# lib/foxtail/formatter.rb:15:3: C: Style/StringLiterals: ...
Identify the scope:
Start with the safest approach - automatic fixes that preserve behavior:
# Target specific files to reduce blast radius
bundle exec rubocop -a lib/foxtail/specific_file.rb
# Or target a directory
bundle exec rubocop -a lib/foxtail/
# Verify no new failures
rake rubocop
# CRITICAL: Verify tests still pass
rake spec
If tests fail after autocorrect:
git checkout lib/foxtail/specific_file.rbFor remaining offenses, fix specific cops one at a time:
# For stylistic issues
bundle exec rubocop -A --only Style/StringLiterals lib/foxtail/
# For performance issues (manual review recommended)
bundle exec rubocop --only Performance/MapCompact lib/foxtail/
# Review and fix manually based on suggestions
# Verify after each cop
rake rubocop
rake spec
Important: For logic-sensitive cops (Performance, Lint), prefer manual fixes with test verification.
If a cop is disabled in .rubocop_todo.yml, you must temporarily enable it:
# 1. Check if cop is in TODO file
grep -A 5 "Cop/Name" .rubocop_todo.yml
# 2. Temporarily comment out that cop's block in .rubocop_todo.yml
# (RuboCop respects TODO disables even with --only)
# 3. Run targeted fix
bundle exec rubocop --only Cop/Name path/to/file.rb
# or with autocorrect:
bundle exec rubocop -A --only Cop/Name path/to/file.rb
# 4. Validate changes
rake rubocop
rake spec
# 5. Regenerate TODO file (removes fixed cops automatically)
bundle exec docquet regenerate-todo
# 6. Commit code changes AND regenerated .rubocop_todo.yml together
CRITICAL: Always use docquet regenerate-todo to update the TODO file. Never edit it manually.
If a rule conflicts with project style:
# Edit .rubocop.yml to adjust the rule
# Add clear comment explaining the rationale
Example in .rubocop.yml:
# We prefer double quotes for consistency with string interpolation
Style/StringLiterals:
EnforcedStyle: double_quotes
After configuration changes:
# Regenerate TODO to reflect new config
bundle exec docquet regenerate-todo
# Verify
rake rubocop
FORBIDDEN:
# ❌ NEVER do this
def some_method
# rubocop:disable Style/SomeCop
code_here
# rubocop:enable Style/SomeCop
end
If a finding cannot be safely fixed:
.rubocop.yml# Ensure everything is clean
rake
# Should show:
# - All tests passing
# - No RuboCop offenses (or reduced offenses)
Commit message format:
cat > /tmp/commit_msg.txt <<'EOF'
:police_officer: Fix Style/StringLiterals violations in lib/foxtail
Convert single quotes to double quotes for consistency.
EOF
git commit -F /tmp/commit_msg.txt
rm /tmp/commit_msg.txt
Commit message patterns:
:police_officer: - All RuboCop fixes (style, lint, performance):wrench: - Update RuboCop configuration# 1. Check current state
cat .rubocop_todo.yml
# Note: List of disabled cops and offense counts
# 2. Pick one cop to fix (start with lowest count)
# Example: Style/CommentedKeyword (1 offense)
# 3. Find affected files
bundle exec rubocop --only Style/CommentedKeyword
# 4. Apply fix
bundle exec rubocop -A --only Style/CommentedKeyword lib/foxtail/
# 5. Verify
rake spec
rake rubocop
# 6. Regenerate TODO
bundle exec docquet regenerate-todo
# The fixed cop should be removed automatically
# 7. Commit
git add .
git commit -m ":police_officer: Fix Style/CommentedKeyword violations"
# 1. Target specific file
bundle exec rubocop lib/foxtail/date_time_format.rb
# 2. Safe autocorrect first
bundle exec rubocop -a lib/foxtail/date_time_format.rb
# 3. Check remaining offenses
bundle exec rubocop lib/foxtail/date_time_format.rb
# 4. Fix remaining manually or with targeted cops
bundle exec rubocop -A --only Naming/VariableNumber lib/foxtail/date_time_format.rb
# 5. Verify
rake spec
# 6. If cop was in TODO, regenerate
bundle exec docquet regenerate-todo
# 7. Commit
git commit -m ":police_officer: Fix all RuboCop violations in date_time_format.rb"
# 1. Check scope
bundle exec rubocop --only Style/StringLiterals
# Shows all files and offense counts
# 2. Start with smallest files or directories
bundle exec rubocop -A --only Style/StringLiterals lib/foxtail/helpers/
# 3. Verify incrementally
rake spec
git add lib/foxtail/helpers/
git commit -m ":police_officer: Fix Style/StringLiterals in helpers"
# 4. Continue with other directories
bundle exec rubocop -A --only Style/StringLiterals lib/foxtail/models/
rake spec
git commit -m ":police_officer: Fix Style/StringLiterals in models"
# 5. Final regenerate
bundle exec docquet regenerate-todo
git commit -m ":wrench: Regenerate RuboCop TODO after fixes"
# String literals
bundle exec rubocop -A --only Style/StringLiterals lib/
# Hash syntax
bundle exec rubocop -A --only Style/HashSyntax lib/
# Frozen string literals
bundle exec rubocop -A --only Style/FrozenStringLiteralComment lib/
# Variable naming
bundle exec rubocop -A --only Naming/VariableNumber lib/foxtail/file.rb
# Method naming (often requires manual decision)
bundle exec rubocop --only Naming/PredicateMethod lib/foxtail/file.rb
# Review output and fix manually:
# - Either rename method to end with ?
# - Or document why it shouldn't be a predicate
# Unused variables (manual fix recommended)
bundle exec rubocop --only Lint/UnusedMethodArgument lib/
# Review each and either use or prefix with _
# Verify with tests
rake spec
# Performance improvements (review before applying)
bundle exec rubocop --only Performance/MapCompact lib/
# Apply manually to ensure behavior preservation
# ALWAYS run full test suite
rake spec
-A on small scopes onlyrake spec after fixesdocquet regenerate-todo# rubocop:disable commentsProblem: Cop is disabled in TODO file
Solution:
# Temporarily comment out the cop in .rubocop_todo.yml
# Then run:
bundle exec rubocop --only Cop/Name
# After fixing, regenerate TODO
bundle exec docquet regenerate-todo
Problem: Unsafe autocorrect changed behavior
Solution:
# Revert changes
git checkout path/to/file.rb
# Fix manually or use safer approach
bundle exec rubocop --only Cop/Name path/to/file.rb
# Review suggestions and fix by hand
# Verify each change
rake spec
Problem: Command not found or gem not installed
Solution:
# Ensure bundler is up to date
bundle install
# Check if docquet is installed
bundle exec docquet --version
# If not, check Gemfile and install dependencies
Problem: Overwhelming number of violations
Solution:
Keep changes small and single-purpose:
Include context in PR body:
## Summary
Fix Style/StringLiterals violations in formatter classes
## Changes
- Convert single quotes to double quotes in 5 files
- Applied safe autocorrect (-a flag)
## Verification
- All tests pass (rake spec)
- RuboCop clean for these files
- Regenerated .rubocop_todo.yml
Link rule changes to rationale:
If updating .rubocop.yml, explain why in PR description.
-a before -Arake spec frequently.rubocop.ymlStructured design dialogue that validates ideas before implementation begins.
Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Introduction to the obra skills system with mandatory skill invocation rules and best practices.
Execute a written implementation plan with critical review and task checkpoints.
Delegate independent tasks to specialized agents working concurrently with isolated context.
Isolated git worktrees with smart directory selection and safety verification.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Plan searchable and shareable content that drives traffic, builds authority, and generates leads.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.
Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.
The world's fastest calendar for remote work
Capture, organize, and utilize your knowledge effortlessly.
Instant Summaries of Audio & Video Interviews with AnySummary
Transform PDFs into engaging mind maps.
Chat with any PDF instantly
Create an optimal daily plan using your voice
A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.
AskYourPDF Pricing Plans: Tailored to Your Needs