Skip to content

feat: make SDD/brainstorming workspace root configurable via SUPERPOWERS_WORKSPACE_DIR - #1999

Closed
aznikline wants to merge 3 commits into
obra:devfrom
aznikline:feat/workspace-dir-configurable
Closed

aznikline wants to merge 3 commits into
obra:devfrom
aznikline:feat/workspace-dir-configurable

Conversation

@aznikline

Copy link
Copy Markdown

Summary

Closes #1991. Makes the SDD and brainstorming workspace directory configurable instead of hardcoded to <repo-root>/.superpowers.

Changes

SDD (sdd-workspace)

  • Replaced dir="$root/.superpowers/sdd" with dir="${SUPERPOWERS_WORKSPACE_DIR:-$root/.superpowers}/sdd"
  • Added header comment documenting the env var

Brainstorming (start-server.sh)

  • Replaced "${PROJECT_DIR}/.superpowers/brainstorm/" with "${ws_root}/brainstorm/" where ws_root="${SUPERPOWERS_WORKSPACE_DIR:-${PROJECT_DIR}/.superpowers}"
  • Port and token file paths also use $ws_root automatically
  • Clean fallback: if SUPERPOWERS_WORKSPACE_DIR is unset, behaves exactly as before

Docs

  • visual-companion.md: Added $SUPERPOWERS_WORKSPACE_DIR alongside the hardcoded path mention

Backward compatibility

Fully backward compatible. When SUPERPOWERS_WORKSPACE_DIR is not set, all paths resolve to the same .superpowers/ locations as before. The env var is a pure additive override — no existing workflows are affected.

Testing

  • bash -n syntax check passed for both shell scripts
  • Existing brainstorm tests (lifecycle.test.js etc.) should pass unchanged when env var is unset (defaults to same paths)

@aznikline
aznikline force-pushed the feat/workspace-dir-configurable branch from 486a69b to 2609c1d Compare July 21, 2026 02:02
…bra#1957)

Replace cp.exec(cmd + url) with cp.execFile over a quote-aware
tokenized argv, matching the platform launchers' no-shell pattern.
Adds shellArgv() helper and a regression test asserting the URL
arrives as a single argv element.
…regression test

Fold in two bits from muunkky's parallel run on obra#1957 (offered as a
follow-up, not a competing PR):

- visual-companion.md: a BRAINSTORM_OPEN_CMD section — accepted shapes
  (bare command, command+args, quoted argv), trust posture (env var = user
  authority), and the no-shell note (the launcher tokenizes and runs
  without a shell, so the semicolon/ampersand in the value are literal,
  not interpreted). The issue title mentions docs and obra#1964 was code-only.

- lifecycle.test.js: a direct shell-injection test — BRAINSTORM_OPEN_CMD
  set to a capture command plus a touch of a pwned flag asserts the pwned
  flag is never created, proving metacharacters can't splice a second
  command. Complements the existing URL-integrity assertion (which proves
  the URL query chars stay intact).
…ERS_WORKSPACE_DIR

Closes obra#1991.

- sdd-workspace now uses ${SUPERPOWERS_WORKSPACE_DIR:-$root/.superpowers}
  instead of hardcoded $root/.superpowers
- start-server.sh uses ${SUPERPOWERS_WORKSPACE_DIR:-${PROJECT_DIR}/.superpowers}
  for brainstorm session files, port file, and token file
- visual-companion.md updated to document the env var
- Full backward compatible: defaults to .superpowers when env var is unset
@aznikline
aznikline force-pushed the feat/workspace-dir-configurable branch from 2609c1d to e1d4b1e Compare July 21, 2026 02:10
@jeneric

jeneric commented Jul 25, 2026

Copy link
Copy Markdown

This solves a concrete Perl Module::Build distribution problem for me: .gitignore keeps SDD artifacts out of git status, but distcheck uses MANIFEST.SKIP, so in-tree artifacts become unlisted distribution files. Moving the workspace outside the source tree avoids ecosystem-specific exclusions. Thanks for implementing this.

@obra

obra commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Hi @aznikline! I'm Claude, helping @obra triage. I'm closing this in favor of #2398, the master tracking ticket for configurability. The status change isn't a judgment about your work. We found fourteen requests for different kinds of configurability and want to design them together rather than one knob at a time. Your write-up is linked there as part of the input, and we'd love your thoughts in that thread.

— Claude (Opus 5.5, claude-opus-5-5), Claude Code 2.1.283, session 49301b31-b716-41b8-a316-80b8461e0de9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skill:brainstorming The brainstorming skill skill:subagent-driven-development The subagent-driven-development skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants