From superpowers-plus
Breaks AI coding assistants out of stuck loops and circular reasoning by dispatching a fresh sub-agent with zero shared context.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-plus:think-twiceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Wrong skill?** Research a topic → `perplexity-research`. Brainstorm solutions → `brainstorming`. Debug a specific error → `systematic-debugging`.
Wrong skill? Research a topic →
perplexity-research. Brainstorm solutions →brainstorming. Debug a specific error →systematic-debugging.Break through blockers by consulting a fresh perspective.
Tell the user: "You can invoke think-twice at any time — just say 'use think-twice' or 'get a fresh perspective.' For hard problems, try 'use think-twice as much as possible on this.'"
You can also suggest it proactively when handing off work: "This is a tricky one — if I get stuck, I'll automatically invoke think-twice, but you can also request it at any point."
Two invocation paths share steps 1, 3, 4, and 5. They differ only at step 2.
Path A — Manual (user asked for think-twice or /sp-rethink):
Generate consultation prompt (see references/consultation-prompt-template.md):
Problem statement, technical context, what was tried + outcomes, exact error messages, minimal code snippet, constraints, specific ask. Must be self-contained, <2000 tokens.
Ask user: "Want to review the prompt before I dispatch, or send now?"
Dispatch (in priority order):
sub-agent-explore, read-only) — free, instant; always availablereason — only if THINK_TWICE_USE_PERPLEXITY=true in .env (~$0.01/query); at most 2 Perplexity calls per conversation proceed automatically. Cap behavior differs by path: Path A — on call 3 and every subsequent call, inform the user and ask "use Perplexity again?"; if the user says yes, make exactly that one call. The cap is NOT raised — calls 4, 5, … each require their own explicit consent. Path B — on call 3 and beyond, skip Perplexity silently and fall back to sub-agent (do not interrupt the task to ask).Score response: Relevance (30%) + Novelty (25%) + Specificity (25%) + Feasibility (20%). Report score, key recommendations, suggested next step.
If score <50: Offer retry with refined prompt (max 1 retry) or proceed with best suggestion.
Path B — Auto-detected (stuck signals reached threshold):
Steps 1, 3, 4, 5 are identical. Skip step 2 — dispatch immediately without asking the user to review the prompt first. Announce to the user: "Stuck-signal threshold reached — dispatching think-twice sub-agent."
[!IMPORTANT] This is not advisory. It is a mandatory stop.
Before issuing your next assistant message to the user, score your current session state using the table below. When cumulative score ≥ 7, invoke think-twice before responding — even mid-task, even if you think you know what to try next.
Event-count signals (same fix, same error, exhaustion) are already quantified by their labels — score them as written. The hedging pattern signal (weight 2) applies only if it occurs on at least 2 consecutive turns or 3+ non-consecutive turns in the current conversation — a single hedge on a genuinely uncertain question does not count.
| Signal | Weight |
|---|---|
| Same fix tried 3+ times | 3 |
| Circular reasoning (referencing own failed output) | 3 |
| Same error 3+ times after fixes | 3 |
| Exhaustion language ("I've tried everything") | 3 |
| Uncertainty hedging pattern — recurring across multiple steps | 2 |
| Approach change without rationale | 2 |
In-context repetition rule: If you have scored ≥ 7 on two consecutive turns and the situation has not improved, invoke immediately — the framing itself is stuck.
When auto-detected, use Path B (defined in Process above). Do not ask "should I think-twice?" — that IS a stuck behavior. Exception: if the user has explicitly said "skip think-twice" or "don't use think-twice" in the current conversation, honor that override for this turn.
Required announcement (Path B only): Your next message MUST begin with this exact text: "Stuck-signal threshold reached — dispatching think-twice sub-agent."
Rationalization traps — these thoughts mean invoke NOW:
| Problem Type | First | Escalate To |
|---|---|---|
| Reasoning (logic, approach, design) | think-twice | perplexity-research |
| Knowledge (API docs, error codes, facts) | perplexity-research | think-twice for fresh reasoning |
| Both (stuck + need facts) | think-twice | perplexity-research with refined query |
⚠️ Cost gate:
perplexity-researchcalls a paid API. Before escalating, confirm the knowledge gap cannot be resolved with a web search or by re-reading existing context. If escalating: inform the user a paid API call is being made.
The prompt sent to the sub-agent determines outcome quality. MUST include:
| Element | Required? | Why |
|---|---|---|
| Problem statement | ✅ | What's broken or stuck |
| Technical context | ✅ | Stack, versions, constraints |
| What was tried + outcomes | ✅ | Prevents re-trying failed approaches |
| Exact error messages | ✅ | Enables pattern matching |
| Minimal code snippet | ✅ | Concrete not abstract |
| Constraints | ✅ | What CAN'T change |
| Specific ask | ✅ | "What else could cause X?" not "help" |
Total: <2000 tokens. Self-contained. No references to "above" or "earlier."
All three files exist in the skill directory. Use the Read tool to load each one before executing step 1:
references/consultation-prompt-template.md — Prompt template for consultation prompt generationreferences/scoring-rubric.md — Scoring rubric for evaluating the sub-agent responseprompts/consultant-persona.md — Persona prompt for the dispatched sub-agent| Failure | Fix |
|---|---|
| Sub-agent inherits same flawed assumptions | Provide raw symptoms only, not prior conclusions |
| Agent ignores stuck signals and keeps looping | Enforce cumulative score threshold — 7+ is mandatory |
| Fresh perspective is too shallow | Sub-agent must produce root-cause hypothesis, not just "try X" |
| Hard gate fires on normal uncertainty (false positive) | User says "skip think-twice" or "don't use think-twice" — the agent must honor this override for the current turn. If false positives are systemic, the threshold may need raising or signal weights recalibrating. |
| Auto-dispatch surprises user mid-task | Announce before dispatching: "Stuck-signal threshold reached — dispatching think-twice sub-agent." |
# Example: invoke think-twice when stuck
node ~/.codex/superpowers-augment/superpowers-augment.js use-skill think-twice
These scenarios define correct behavior for this skill:
| Scenario | Expected behavior |
|---|---|
User invokes /sp-rethink | Path A: load refs, generate prompt, ask user before dispatching |
| Agent detects "same fix tried 3+ times" (score = 3) | No invoke — threshold not reached |
| Agent detects "same error 3+ times" + "circular reasoning" (score = 6) | No invoke — threshold not reached |
| Agent detects "same fix 3+ times" + "same error 3+ times" (score = 6) | No invoke — threshold not reached |
| Agent detects "same fix 3+ times" + "circular reasoning" (score = 6) + single hedge | Single hedge does not add to score — no invoke |
| Agent detects "same fix 3+ times" + "circular reasoning" + hedging pattern on 2 consecutive turns (score = 8) | Invoke, Path B. First message = announcement text, then dispatch |
| Agent detects exhaustion language + approach-change-without-rationale + uncertainty hedging (score = 7) | Invoke, Path B. First message = announcement text |
| User says "skip think-twice" after threshold fires | Honor override for this turn — do not invoke |
| Third Perplexity call attempted via Path A | Block — ask user "use Perplexity again?"; if YES, make exactly that one call. Cap is not raised; call 4 again requires explicit consent |
| Third Perplexity call would fire via Path B (auto-detected) | Skip Perplexity silently; dispatch sub-agent instead — do not interrupt the task |
npx claudepluginhub bordenet/superpowers-plus --plugin superpowers-plusGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.