From superpowers-ruby
Packages a failed debugging investigation into a self-contained prompt for a stronger model (GPT-5 Pro, Opus, Gemini). Uses a narrow, project-brief approach with just enough files attached.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-ruby:consulting-an-oracleThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When in-session debugging has stalled, package the failed investigation into a single self-contained markdown file that a stronger one-shot model can answer cold. The oracle has zero project knowledge and no memory of prior runs — the prompt must stand alone.
When in-session debugging has stalled, package the failed investigation into a single self-contained markdown file that a stronger one-shot model can answer cold. The oracle has zero project knowledge and no memory of prior runs — the prompt must stand alone.
Core principle: Just-enough context beats whole-repo dumps. A focused 1500-line prompt outperforms a 30k-line dump every time.
This skill produces a file. It does not call any model. Print the path and suggested invocation; let the user run it. This separation is deliberate: keeping prompt-construction decoupled from model-orchestration keeps the skill model-agnostic (works with any oracle the user picks — Codex, Claude, Gemini, paste-into-chat), keeps the artifact re-runnable later, and avoids coupling the skill to credentials, CLI availability, or cost decisions that belong to the user.
Announce at start: "I'm using the consulting-an-oracle skill to package this investigation."
Don't use when:
superpowers-ruby:systematic-debuggingsuperpowers-ruby:compoundsuperpowers-ruby:handoffLocation: tmp/oracle/<YYYY-MM-DD>-<slug>.md (Rails projects gitignore tmp/ already).
Fallback: /tmp/oracle-<slug>.md if tmp/ isn't writable or this isn't a Rails project.
Slug: short kebab-case description of the failing symptom — zeitwerk-constant-loop, n-plus-one-after-cache-add, turbo-stream-double-render. Not the branch name, not the ticket ID.
After writing, print:
Oracle prompt: tmp/oracle/2026-05-06-<slug>.md
Suggested invocation:
codex --model gpt-5-pro --file tmp/oracle/2026-05-06-<slug>.md
# or paste into chat.openai.com / claude.ai / gemini.google.com
Run these in parallel and capture output:
cat .ruby-version 2>/dev/null || cat .tool-versions 2>/dev/null
ruby --version
bundle --version 2>/dev/null
grep -E "^\s*(rails|sinatra|hanami|roda|rspec|minitest|sidekiq|good_job|solid_queue|sorbet|rbs|standard|rubocop)" Gemfile 2>/dev/null
test -f Gemfile.lock && grep -E "^\s+(rails|rack|puma|pg|mysql2|sqlite3|redis) \(" Gemfile.lock | head
test -f config/application.rb && grep -E "config\.(autoload|eager_load|cache_classes|active_job|active_record)" config/application.rb
ls config/initializers/ 2>/dev/null
test -f bin/rails && echo "rails app"
test -d app/javascript && ls app/javascript 2>/dev/null
test -f config/importmap.rb && echo "importmap"
test -f Procfile.dev && cat Procfile.dev
Extract: Ruby version, Rails (or other framework) version, DB adapter, test framework, background jobs, asset pipeline, type tooling, linter, Hotwire stack.
From recent session context (read recent tool results, do not re-run failing commands unless they're cheap):
Walk recent session history (your own tool calls and edits in this conversation). Produce 3–7 entries, each:
- Hypothesis: <one line>
Action: <what you changed or ran>
Outcome: <what happened, including partial successes>
Include partial successes — "this fixed one of the failing tests but the other still fails" is high-signal for the oracle. Don't pad: if there were only 2 attempts, write 2.
Start from the failing file and walk one hop:
require, constant references, method calls on collaborators)config/initializers/ that touches this areadb/schema.rb excerpt (only the relevant tables) if ActiveRecord-relatedHard cap: ≤8 files, ≤2000 total lines. If you'd exceed it, prefer fewer files with surrounding context over many files with no context.
This step must run before Step 6, not after. Redacting an already-written file is leak recovery, not prevention — once secrets are on disk, they may be in editor swap files, OS-level backups (Time Machine, Dropbox, iCloud, tmp autosync), shell history, or the user's clipboard before you get a chance to scrub them. Redaction operates on the in-memory prompt body and file contents before the Write tool persists anything.
Scan the prompt body and every attached file for:
.env*, master.key, credentials.yml.enc, *.pem, *.key → never include, even if asked(?i)(api[_-]?key|secret|token|password|bearer|authorization)\s*[:=]\s*['"][^'"]+['"]postgres://user:pass@...)Replace with [REDACTED:<reason>] and keep enough surrounding context for the oracle to understand the structure. Note redactions in the safety footer.
Use the structure in template.md. Section order matters — role and desired output go first because oracles weight the opening of long prompts most heavily.
Print the file path, line count, and suggested invocation. Do not call any model. Do not open the file in an editor.
Always include this section in the oracle prompt — these are the implicit-context items that bite Ruby projects and that an oracle cannot infer:
app/, lib/, or an engine? Is lib/ in autoload paths? Eager-load mode in this environment?Thread.current usage in the call stackgit log -p Gemfile.lock for recently bumped gems on the failing pathconfig/initializers/, lib/core_ext/, or app/lib/ that reopens the failing class?present?/blank?/try collisions, delegate chains, with_options blocksconfig/environments/*.rb differences on the relevant flag?db/schema.rb?Include only the items that might be relevant. Don't pad.
.env "with secrets redacted by hand" — use the redaction step, never trust manual redaction of entire filesOracles are one-shot — the model has no memory of prior runs. Write the prompt so that re-running it later (with the same --file argument) reproduces the same context. That means:
| Step | Action |
|---|---|
| 1 | Detect Ruby/Rails project shape |
| 2 | Pull verbatim failure (command, stack trace, expected vs actual) |
| 3 | Reconstruct hypothesis → action → outcome from session |
| 4 | Pick ≤8 files / ≤2000 lines, one hop from failing file |
| 5 | Redact secrets aggressively |
| 6 | Write tmp/oracle/<date>-<slug>.md using template.md |
| 7 | Print path + suggested invocation; do not call any model |
See template.md for the exact section layout.
npx claudepluginhub lucianghinda/superpowers-ruby --plugin superpowers-rubyEnforces a disciplined debugging methodology requiring root cause investigation before any fix, with phases for reproduction, tracing, and verification of technical issues.
Bundles a prompt plus selected files into a single request for a second model review (API or browser) to debug, refactor, validate design, or cross-check results.
Orchestrates persistent, hypothesis-driven debugging sessions across conversations, delegating analysis to subagents and tracking in debug files.