Skip to content

Enforce brainstorming workflow with hard gates and process flow#462

Merged
obra merged 2 commits intomainfrom
enforce-brainstorming-workflow
Feb 12, 2026
Merged

Enforce brainstorming workflow with hard gates and process flow#462
obra merged 2 commits intomainfrom
enforce-brainstorming-workflow

Conversation

@obra
Copy link
Owner

@obra obra commented Feb 12, 2026

Summary

  • Brainstorming skill now enforces its process instead of merely describing it. Models were skipping design and jumping straight to implementation (e.g., invoking frontend-design or scaffolding code immediately).
  • Using-superpowers skill now intercepts EnterPlanMode attempts and routes them through brainstorming instead.

What changed in brainstorming

  • <HARD-GATE>: no implementation skills, code, or scaffolding until design is presented and approved
  • Explicit checklist (6 items) that must be created as tasks
  • Graphviz process flow with writing-plans as the terminal state — prevents the model from invoking frontend-design or other implementation skills after brainstorming
  • Anti-pattern callout: "This is too simple to need a design" — the exact rationalization models use to skip the process
  • Design section sizing based on section complexity, not project complexity
  • writing-plans is the only valid next skill after brainstorming (explicit, repeated)

What changed in using-superpowers

  • Added EnterPlanMode intercept to workflow graph — checks if brainstorming has happened, invokes it if not, never enters plan mode

Test plan

Tested with claude -p --plugin-dir across three variants:

  • No skill (baseline): model calls EnterPlanMode on turn 2
  • Original skill: model invokes brainstorming but skips to frontend-design after
  • Updated skill: model invokes brainstorming, follows checklist, writes design doc, transitions to writing-plans — never touches frontend-design or EnterPlanMode

Summary by CodeRabbit

  • Documentation

    • Design guidance now scales by complexity; even simple projects require a presented and approved design
    • Expanded process: exploration, clarifying questions, 2–3 approaches with trade-offs, and explicit user approval at each transition
    • Implementation planning must follow a dedicated planning step and pause other tools until plan approval
  • Workflow

    • Brainstorming is prioritized before evaluating other skills
  • Chores

    • Startup hook now runs synchronously (blocking) instead of asynchronously

The brainstorming skill described a process but didn't enforce it. Models
would skip the design phase and jump straight to implementation skills
like frontend-design, or collapse the entire brainstorming process into
a single text block.

Changes to brainstorming skill:
- Add HARD-GATE: no implementation until design is approved
- Add explicit checklist that maps to task items
- Add graphviz process flow with writing-plans as terminal state
- Add anti-pattern callout for "too simple to need a design"
- Scale design sections by section complexity, not project complexity
- Make writing-plans the only valid next skill after brainstorming

Changes to using-superpowers skill:
- Add EnterPlanMode intercept to workflow graph
- Route plan mode attempts through brainstorming skill instead

Tested with claude -p --plugin-dir across three variants (no skill,
original skill, updated skill) to verify behavioral compliance.
@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

Replaces fixed-length design-section guidance with a complexity-scaled approach and enforces a universal HARD-GATE requiring design presentation and user approval before implementation. Adjusts skill orchestration to run brainstorming first when not already performed, before evaluating other skills.

Changes

Cohort / File(s) Summary
Brainstorming Skill
skills/brainstorming/SKILL.md
Replaced rigid 200–300 word section rule with complexity-scaled guidance (few sentences to 200–300 words). Added a HARD-GATE blocking implementation until design is presented and approved. Emphasized exploration, questions, 2–3 approaches with trade-offs, presentation per section with approval, and explicit instruction to invoke the writing-plans skill for implementation planning (other skills prohibited during planning).
Skill Orchestration / Superpowers
skills/using-superpowers/SKILL.md
Inserted three nodes ("About to EnterPlanMode?", "Already brainstormed?", "Invoke brainstorming skill") and four edges to route control flow so brainstorming runs first when not already done, before evaluating applicability of other skills.
Session Hooks
hooks/hooks.json
Changed SessionStart hook execution mode: flipped async for session-start.sh from true to false, making startup command synchronous (blocking).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Orchestrator as Skill Orchestrator
    participant Brainstorm as Brainstorming Skill
    participant Other as Other Skill(s)

    User->>Orchestrator: Request action / trigger
    Orchestrator->>Orchestrator: Check: About to EnterPlanMode?
    Orchestrator->>Orchestrator: Check: Already brainstormed?

    alt Not yet brainstormed
        Orchestrator->>Brainstorm: Invoke brainstorming skill
        Brainstorm->>Brainstorm: Explore problem, ask clarifying questions
        Brainstorm->>Brainstorm: Produce designs (scaled by complexity)
        Brainstorm->>User: Present design section(s) and request approval
        User->>Brainstorm: Approve or request changes
        Brainstorm->>Orchestrator: Return approved design
    end

    Orchestrator->>Orchestrator: Evaluate: Might any skill apply?
    Orchestrator->>Other: Invoke applicable skill(s) (e.g., writing-plans)
    Other->>User: Return results / plan
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰✍️ I hopped through ideas, nibbling at the plan,
Scaled words for the simple, longer for the grand.
A soft HARD‑GATE waits — present, then proceed,
Brainstorm first, then build, with approval guaranteed.
Thump-thump, I celebrate each thoughtful command!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Enforce brainstorming workflow with hard gates and process flow' directly reflects the main objective: establishing enforced guardrails and a structured workflow for the brainstorming skill. It accurately captures the primary changes across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ 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 enforce-brainstorming-workflow

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/using-superpowers/SKILL.md (1)

29-45: ⚠️ Potential issue | 🟠 Major

EnterPlanMode gate is unreachable in the flow graph. The new branch has no incoming edge, so the graph still routes directly from “User message received” to “Might any skill apply?”. Add an edge to the gate (and then route to “Might any skill apply?” for the “no” path) so the new logic actually executes.

💡 Proposed flow fix
-    "User message received" -> "Might any skill apply?";
+    "User message received" -> "About to EnterPlanMode?";
+    "About to EnterPlanMode?" -> "Might any skill apply?" [label="no"];
🤖 Fix all issues with AI agents
In `@skills/using-superpowers/SKILL.md`:
- Around line 29-33: The node labeled "About to EnterPlanMode?" is a
decision/question but is rendered as a terminal (doublecircle); change its shape
to a decision by replacing [shape=doublecircle] with [shape=diamond] for the
"About to EnterPlanMode?" node so it matches the semantics (i.e., update the
line containing "About to EnterPlanMode?" to use [shape=diamond]).

Comment on lines +29 to 33
"About to EnterPlanMode?" [shape=doublecircle];
"Already brainstormed?" [shape=diamond];
"Invoke brainstorming skill" [shape=box];
"Might any skill apply?" [shape=diamond];
"Invoke Skill tool" [shape=box];
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use a decision shape for “About to EnterPlanMode?”. It’s a question node but is drawn as a terminal (doublecircle), which conflicts with the diagram semantics.

🔧 Suggested tweak
-    "About to EnterPlanMode?" [shape=doublecircle];
+    "About to EnterPlanMode?" [shape=diamond];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"About to EnterPlanMode?" [shape=doublecircle];
"Already brainstormed?" [shape=diamond];
"Invoke brainstorming skill" [shape=box];
"Might any skill apply?" [shape=diamond];
"Invoke Skill tool" [shape=box];
"About to EnterPlanMode?" [shape=diamond];
"Already brainstormed?" [shape=diamond];
"Invoke brainstorming skill" [shape=box];
"Might any skill apply?" [shape=diamond];
"Invoke Skill tool" [shape=box];
🤖 Prompt for AI Agents
In `@skills/using-superpowers/SKILL.md` around lines 29 - 33, The node labeled
"About to EnterPlanMode?" is a decision/question but is rendered as a terminal
(doublecircle); change its shape to a decision by replacing [shape=doublecircle]
with [shape=diamond] for the "About to EnterPlanMode?" node so it matches the
semantics (i.e., update the line containing "About to EnterPlanMode?" to use
[shape=diamond]).

…first turn

When async is true, the hook may not complete before the model starts
responding, meaning the using-superpowers skill instructions aren't
in context for the first message.
Copy link

@coderabbitai coderabbitai bot left a comment

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 `@hooks/hooks.json`:
- Line 9: The command value using ${CLAUDE_PLUGIN_ROOT} will break on paths with
spaces; update the "command" string so the expanded path is wrapped in single
quotes (e.g., put single quotes around
${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh) to prevent shell word-splitting
when the variable expands.

@@ -7,7 +7,7 @@
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Quote ${CLAUDE_PLUGIN_ROOT} to avoid path breakage on spaces.
Without single quotes, paths containing spaces will be split by the shell, breaking the hook execution.

🛠️ Suggested fix
-            "command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh",
+            "command": "'${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh'",
Based on learnings: In the superpowers plugin for Claude Code, when using `${CLAUDE_PLUGIN_ROOT}` in hook commands (hooks/hooks.json), single quotes around the variable are necessary because Claude Code expands variables before passing the command to the shell. The quotes protect against word splitting when the expanded path contains spaces (e.g., 'C:\Users\Name With Spaces\...').
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh",
"command": "'${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh'",
🤖 Prompt for AI Agents
In `@hooks/hooks.json` at line 9, The command value using ${CLAUDE_PLUGIN_ROOT}
will break on paths with spaces; update the "command" string so the expanded
path is wrapped in single quotes (e.g., put single quotes around
${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh) to prevent shell word-splitting
when the variable expands.

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.

1 participant