Repository navigation
fix(brainstorming): keep the companion's project files out of git - #2770
Open
magrathean-uk wants to merge 1 commit into
Open
magrathean-uk wants to merge 1 commit into
magrathean-uk wants to merge 1 commit into
Conversation
With --project-dir, start-server.sh puts the session key (.last-token), the port, server logs, the PID and later the mockups under <project>/.superpowers/brainstorm/, and nothing marks them ignored, so an agent's `git add -A` stages them. Write the same create-only, self-ignoring .gitignore that sdd-workspace writes for .superpowers/sdd/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danishkumar26
left a comment
There was a problem hiding this comment.
@/home/ubuntu/.hermes/cache/scratch/review-2770.md
|
What this change does: Nice to have:
Verdict: Ship. Not checked: runtime behavior with a real Node server. Cross-fork CI cannot run on the author fork, so no checks are reported. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who is submitting this PR? (required)
claude-opus-5-5)What your human partner asked you to do, in their words:
A lead agent then ran a discovery pass over this repo, picked this item, and briefed me to implement it.
Human-authored summary (required, under 200 words)
I asked my agent to look through Superpowers and find an issue nobody had picked up yet.
Turns out the brainstorm visual companion stores its session key and other working files inside
.superpowers/brainstorm/, without anything telling Git to ignore them. A simplegit add -Acan end up committing the session key without the user even realising it.The fix follows the same approach already used by
sdd-workspacefor.superpowers/sdd/. It creates a.gitignorecontaining*if one doesn't already exist, leaving any existing configuration untouched.Pretty small change overall, one script modification and two test cases.
What problem are you trying to solve?
visual-companion.mdtells the agent to start the companion with--project-dir <project root>.start-server.shthen creates<root>/.superpowers/brainstorm/, and the server writes the session key (.last-token), the port (.last-port) and, per session,state/server-info(which holds the full?key=URL),server.log,server.pidandserver-instance-id, plus the mockups undercontent/. Nothing marks any of it ignored. The only guard is one line of prose: "Remind the user to add.superpowers/to.gitignoreif it's not already there." So an agent that runsgit add -Aorgit commit -alater in the session stages all of it, key included.This was found by reading the code and reproduced with the documented start command; no agent session that committed these files was observed directly. It does happen in practice: on 3 December 2026 GitHub code search for
path:.superpowers/brainstormreturned 34,272 files in public repositories, 1,452 of them namedserver.log.Reproduction on
dev(d4b6d3b), macOS, bash 5.3, Node 26, in a fresh git repo:With this branch, the same steps print nothing for
git status, andcheck-ignoreprints the path and exits 0.What does this PR change?
When
--project-diris given,start-server.shwrites.superpowers/brainstorm/.gitignorecontaining*if no file exists there yet. This is the same create-only, self-ignoring filesdd-workspacealready writes for.superpowers/sdd/./tmpsessions are unchanged. Two cases are added totests/brainstorm-server/start-server.test.sh.Is this change appropriate for the core library?
Yes. It is plugin infrastructure that every user of the visual companion runs, it adds no dependency, and it brings brainstorm in line with what SDD already does for the same directory tree. It does not touch the project's own
.gitignoreor any tracked file.What alternatives did you consider?
.gitignore: that changes a tracked file in someone else's repo, which Brainstorm session storage should not default to the working tree #975 called out and which SDD deliberately avoids.server.cjsinstead, which would also cover callers that setBRAINSTORM_DIRthemselves:start-server.shis the documented entry point and already owns the directory layout, so I kept the change there.visual-companion.md: it becomes redundant, but skill wording changes need evals, so it is left alone.Trade-off: ignored mockups no longer show in
git status, the same trade-off SDD accepted for its workspace. A repo that wants to commit mockups can put its own.gitignorethere; the create-only check leaves it in place.Does this PR contain multiple unrelated changes?
No. One script change and its test.
Existing PRs
.gitignore; this PR follows it), fix(sdd): make sdd-workspace's .gitignore create-only, not an unconditional overwrite #2161 (closed, same goal as sdd-workspace: leave an existing .superpowers/sdd/.gitignore alone #2399). Open PR fix(worktrees): guard worktree creation, branch finishing, and executor workspace lifecycle #2736 already lists.superpowers/brainstorm/.last-portand.last-tokenamong ignored files, which today is only true if the user ignored them by hand. No open or closed PR adds a brainstorm.gitignore(searched "brainstorm gitignore", ".superpowers/brainstorm", "gitignore"; checked the diffs of open PRs touchingstart-server.sh: fix(brainstorming): resolve --project-dir to an absolute path in start-server.sh #2526, fix(brainstorming): scope spec commit, harden companion server, and add choice keyboard a11y #2738, fix(brainstorming): persist brainstorm.choice() events and keep companion session dirs stable across restarts #2761).Environments tested
New harness support (required if this PR adds a new harness)
Not applicable: no harness is added.
Evaluation
start-server.shandserver.cjs, not from a failing session.dev(9 passed, 1 failed, listing the untracked.last-token,server-instance-idandserver.pid) and passes on this branch (10 passed, 0 failed).start-server.test.sh10/10,stop-server.test.sh7/7,windows-lifecycle.test.sh9 passed and 3 skipped,ws-protocol.test.js32/32,server.test.js34/34,lifecycle.test.js13/13,auth.test.js20/20,helper.test.js15/15,browser-launcher.test.js3/3, andscripts/lint-shell.shon both files exits 0.branding.test.jsfails 3 of 7 cases on an unmodifieddevcheckout too; this PR does not touch it.Rigor
superpowers:writing-skillsandcompleted adversarial pressure testing (paste results below). Not a skills change.
.gitignorewith custom content is left byte-identical; relative--project-dirstill passes the existing cases. Not covered: Windows Git Bash.rationalizations, "human partner" language) without extensive evals
showing the change is an improvement
Human review
🤖 Generated with Claude Code