Skip to content

enable superpowers to use subagents in codex via collab - #450

Merged
arittr merged 7 commits into
devfrom
feat/codex-subagent-skill-leakage
Feb 12, 2026
Merged

arittr merged 7 commits into
devfrom
feat/codex-subagent-skill-leakage

Conversation

@arittr

@arittr arittr commented Feb 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a <SUBAGENT-STOP> gate check to using-superpowers that short-circuits before the 1% rule, telling subagents to ignore the skill catalog and just execute their dispatch prompt
  • Adds a Codex dispatch routing table to using-superpowers mapping CC concepts (Task tool) to Codex equivalents (spawn_agent/wait/close_agent)
  • Adds one-liner scope guidance to all 4 subagent dispatch templates (implementer, spec-reviewer, code-reviewer x2)

Problem

In Codex, subagents inherit filesystem access and can discover superpowers skills via ~/.agents/skills/. The using-superpowers 1% rule ("if there's even a 1% chance a skill applies, USE IT") causes subagents to activate the full skill workflow instead of just executing their assigned task. This burns tokens, adds latency, and confuses subagents that see conflicting instructions.

Approach

CC-first. No skill language was genericized. No scope guard mechanisms. Claude Code users see zero functional difference.

The fix is guidance, not machinery:

  1. Gate check before the 1% rule — subagents short-circuit out of using-superpowers immediately
  2. Routing table for Codex users — translate CC dispatch syntax to Codex collab tools
  3. Belt-and-suspenders one-liners in dispatch templates — subagents are told directly not to invoke skills

What we explicitly did NOT do

  • No scope guards (Codex platform-enforces depth-1, so no grandchild agents)
  • No genericizing CC-specific language in skills
  • No platform detection logic
  • No rewriting dispatch templates to be platform-neutral

Test plan

  • Codex subagent no longer asks for clarification about conflicting skill instructions
  • CC users: verify skills workflow unchanged (gate check is invisible to top-level agents)
  • Codex users: verify subagents execute tasks without invoking skill catalog

Closes PRI-420

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a Visual Brainstorming companion: browser-based mockup display, live interaction capture, and a local helper to send feedback into sessions.
  • Chores
    • Updated guidance to prohibit agents/subagents from independently invoking extra skills; enforce orchestrated task dispatch.
    • Added new ignore patterns and improved hook behavior on Windows.
  • Documentation
    • Added detailed review-loop workflows, dispatching guidance, and updated default plan storage location to docs/superpowers/plans.
  • Tests
    • Added integration and unit tests covering the Visual Brainstorming flow and document review system.

@coderabbitai

coderabbitai Bot commented Feb 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds explicit prohibition against agents/subagents autonomously discovering or invoking "superpowers" skills across multiple prompt and skill docs; introduces a Visual Brainstorming Companion (server, helper, frame, scripts, tests); updates hooks for Windows, numerous path changes from docs/plans → docs/superpowers/plans, and various docs/tests/tooling adjustments.

Changes

Cohort / File(s) Summary
Agent & Code-review Prompts
agents/code-reviewer.md, skills/requesting-code-review/code-reviewer.md
Appended explicit directive: "Do not independently discover or use superpowers skills." (overrides previous autonomy guidance).
Subagent-driven prompts & implementer
skills/subagent-driven-development/implementer-prompt.md, skills/subagent-driven-development/spec-reviewer-prompt.md, skills/subagent-driven-development/SKILL.md
Added prohibition plus new sections: code organization, escalation rules/statuses, report format, and model/implementer status guidance.
Using-Superpowers guidance
skills/using-superpowers/SKILL.md
Added <SUBAGENT-STOP> directive, instruction priority, dispatching tasks mapping, and mandate to invoke relevant skills before action.
Visual Brainstorming feature
lib/brainstorm-server/index.js, lib/brainstorm-server/helper.js, lib/brainstorm-server/frame-template.html, lib/brainstorm-server/package.json, lib/brainstorm-server/*.sh, tests/brainstorm-server/*
New Express/WebSocket server, browser helper, frame template, start/stop/wait scripts, package config, and tests implementing a visual companion with live-reload and event relay.
Documentation & guides
docs/README.codex.md, docs/superpowers/*, skills/brainstorming/*, skills/brainstorming/visual-companion.md
New/expanded docs for Codex collab, visual companion, spec/plan review loops, and release notes additions describing workflow changes.
Hooks / Windows support
hooks/hooks.json, hooks/run-hook.cmd
Switched SessionStart hook to Windows runner and added a bash-detection Windows-focused run-hook.cmd with fallback behaviors and exec semantics.
Path updates across tests & prompts
tests/**, skills/requesting-code-review/SKILL.md, tests/explicit-skill-requests/prompts/*
Bulk replacement of plan paths from docs/plans/* → docs/superpowers/plans/* in tests and prompt examples.
Misc repo hygiene
.gitignore, .gitattributes, RELEASE-NOTES.md
Added ignore patterns, LF enforcement for a hook, and extensive unreleased release notes documenting many workflow/feature changes.

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Browser (helper.js)
  participant Server as Brainstorm Server
  participant Claude as Claude / Orchestrator
  Browser->>Server: open WebSocket / queue events
  Server-->>Browser: reload / inject helper (on file change)
  Browser->>Server: send user event (click/submit/input)
  Server->>Claude: write event JSON to stdout / log
  Claude->>Server: push updated screen file into SCREEN_DIR
  Server->>Browser: notify clients to reload
  Browser->>Server: sendToClaude (feedback) -> server logs "send-to-claude"
  Server->>Claude: wait-for-feedback.sh reads log and returns JSON line
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Poem

🐇 I nibble lines and tidy strings of prose,

"No wild skills!" the careful orchestrator knows.
I hop, I send, I frame the browser's cheer,
Relay the clicks till Claude's next screen appears.
A rabbit claps for orderly gears.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'enable superpowers to use subagents in codex via collab' directly describes the main objective of the PR: adding support for Codex subagents to use superpowers skills via the collab mechanism.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/codex-subagent-skill-leakage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arittr arittr changed the title Prevent Codex subagent skill leakage enable superpowers to use subagents in codex via collab Feb 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@skills/using-superpowers/SKILL.md`:
- Around line 24-33: The Codex mappings in the routing table (entries
referencing spawn_agent, wait, close_agent and the `[features] collab = true`
syntax) are unverified and should be removed or explicitly marked as unverified;
update the SKILL.md table in the "Dispatching Tasks" section to either delete
the Codex column or replace those cells with officially documented Codex/App
Server/SDK equivalents (e.g., reference JSON-RPC methods like initialize,
thread/start, turn/start or SDK methods startThread() and resumeThread()) and
add a short note that any alternative names are speculative/unverified.
🧹 Nitpick comments (1)
skills/using-superpowers/SKILL.md (1)

26-26: Consider adding guidance on error handling for dispatch operations.

The Dispatching Tasks section provides a translation table but doesn't mention how to handle dispatch failures or errors. For production robustness, consider adding a note about error handling when spawning agents or waiting for results, especially since subagent failures could cascade.

💡 Suggested addition for dispatch error handling

Consider adding a row or note to the table:

 | End subagent | Task completes automatically | `close_agent` |
+
+**Error handling:** If a spawn or wait operation fails, the dispatching skill should handle the error gracefully and may need to report back to the orchestrator.

Comment thread skills/using-superpowers/SKILL.md Resolved
arittr and others added 3 commits February 11, 2026 10:47
…ing table

Codex subagents inherit filesystem access and can discover superpowers skills
via native discovery. Without guidance, they activate the 1% rule and invoke
full skill workflows instead of executing their assigned task.

- Add SUBAGENT-STOP gate check above the 1% rule in using-superpowers
- Add Codex dispatch routing table (spawn_agent/wait/close_agent)
- Add scope directives to all 4 subagent dispatch templates

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace verbose scope explanations with a direct override statement
that explicitly claims priority over prior guidance (i.e. the
using-superpowers 1% rule injected by Codex's skill discovery).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@arittr
arittr force-pushed the feat/codex-subagent-skill-leakage branch from 5306d48 to a171953 Compare February 11, 2026 18:49
@arittr
arittr changed the base branch from main to dev February 11, 2026 18:50
Comment thread skills/using-superpowers/SKILL.md Resolved
Comment thread skills/using-superpowers/SKILL.md Resolved
arittr and others added 4 commits February 11, 2026 12:45
Addresses Jesse's review feedback on PR #450:
- Move inline routing table from using-superpowers to references/codex-tools.md,
  leveraging Codex's native progressive disclosure for companion files
- Narrow SUBAGENT-STOP from "Do not invoke skills" to "Do not invoke
  superpowers skills" so subagents can still use non-superpowers skills

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Let the SUBAGENT-STOP gate in using-superpowers handle skill leakage
instead of per-template directives. This avoids blocking non-superpowers
skills that users may want subagents to use.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Drop 'top-level sessions only' which may cause the model to treat
using-superpowers as a first-turn-only skill, breaking skill chaining
on follow-up turns.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@arittr
arittr merged commit d1e3945 into dev Feb 12, 2026
arittr added a commit that referenced this pull request Feb 12, 2026
Addresses Jesse's review feedback on PR #450:
- Move inline routing table from using-superpowers to references/codex-tools.md,
  leveraging Codex's native progressive disclosure for companion files
- Narrow SUBAGENT-STOP from "Do not invoke skills" to "Do not invoke
  superpowers skills" so subagents can still use non-superpowers skills

Co-Authored-By: Claude Opus 4.6 <[email protected]>
obra pushed a commit that referenced this pull request Feb 12, 2026
Addresses Jesse's review feedback on PR #450:
- Move inline routing table from using-superpowers to references/codex-tools.md,
  leveraging Codex's native progressive disclosure for companion files
- Narrow SUBAGENT-STOP from "Do not invoke skills" to "Do not invoke
  superpowers skills" so subagents can still use non-superpowers skills

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Gamarsoft pushed a commit to Gamarsoft/superpowers that referenced this pull request Feb 24, 2026
Addresses Jesse's review feedback on PR obra#450:
- Move inline routing table from using-superpowers to references/codex-tools.md,
  leveraging Codex's native progressive disclosure for companion files
- Narrow SUBAGENT-STOP from "Do not invoke skills" to "Do not invoke
  superpowers skills" so subagents can still use non-superpowers skills

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants