feat(init): default VS Code chat sessions to Squad - #1485
Conversation
🟡 Impact Analysis — PR #1485Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affecteddocs (2 files)
root (2 files)
squad-cli (3 files)
tests (1 file)
|
🏗️ Architectural Review
Automated architectural review — informational only. |
🔒 Security Review🔒 Security review: 1 info.
Automated security review — informational only. |
🛫 PR Readiness Check
PR Scope: 📦🔧 Mixed (product + infrastructure)
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 2 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | Changeset file found |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | 2 active Copilot thread(s) resolved (1 outdated skipped) |
| ✅ | CI passing | All checks passing |
Files Changed (8 files, +303 −5)
| File | +/− |
|---|---|
.changeset/init-vscode-default.md |
+5 −0 |
docs/src/content/docs/features/vscode.md |
+33 −0 |
docs/src/content/docs/reference/cli.md |
+1 −0 |
package-lock.json |
+2 −2 |
packages/squad-cli/package.json |
+1 −0 |
packages/squad-cli/src/cli-entry.ts |
+5 −3 |
packages/squad-cli/src/cli/core/init.ts |
+51 −0 |
test/init-vscode-settings.test.ts |
+205 −0 |
Total: +303 −5
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
Pull request overview
Adds an opt-outable squad init enhancement that updates VS Code workspace settings to default new chat sessions to Squad mode by writing "chat.newSession.defaultMode": "Squad" into .vscode/settings.json using JSONC-safe edits.
Changes:
- Add JSONC-aware
.vscode/settings.jsonupdate duringrunInit()withincludeVscodeDefault+--no-vscode-defaultopt-out and--globalskip behavior. - Add focused vitest coverage for create/update/idempotency/opt-out/malformed JSON scenarios.
- Document the new behavior and CLI flag; add a changeset and new dependency (
jsonc-parser).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/init-vscode-settings.test.ts | Adds tests for the VS Code settings injection behavior and opt-out semantics. |
| packages/squad-cli/src/cli/core/init.ts | Implements JSONC-safe injection of chat.newSession.defaultMode during init, gated by options. |
| packages/squad-cli/src/cli-entry.ts | Adds --no-vscode-default parsing and help text (currently has a formatting issue). |
| packages/squad-cli/package.json | Adds jsonc-parser dependency (description currently has encoding/mojibake). |
| package-lock.json | Lockfile updates for the new direct dependency. |
| docs/src/content/docs/reference/cli.md | Documents the new --no-vscode-default flag. |
| docs/src/content/docs/features/vscode.md | Documents “Default Chat Session Mode” behavior and opt-out. |
| .changeset/init-vscode-default.md | Changeset for a minor bump describing the new init behavior. |
|
Self-review notes before this can go in — I can't formally request changes on my own PR, but the following three items are still required before merge. Head verified at
I'll come back for another self-review pass once these are pushed. |
|
👋 Friendly nudge — this PR has had no activity for 7 days. What needs attention:
If this PR is abandoned, please close it. If it's blocked on something external, leave a comment so the team knows. |
- Fix mojibake in packages/squad-cli/package.json description - Fix --no-vscode-default help alignment in cli-entry.ts (split into separate console.log call matching surrounding indentation pattern) - Add regression test: isGlobal:true does not create .vscode/settings.json Closes #1486 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a05b5960-2854-438d-976d-2bc01816ee70
|
The three self-review blockers are fixed in e8ddcb0; focused tests pass 9/9 and the full build passes. Fresh CI's Policy Gates failure is branch staleness, not the fix: this branch still has @bradygaster/squad-cli@0.11.0-build.1 while current dev is 0.11.0. Per the approved sequence, hold this PR until #1445 lands, then rebase onto current dev, squash if desired, rerun CI, and request final approval. |
|
#1445 has now merged — the blocker that was holding this PR is gone. @tamirdresher please take the following steps to move this forward:
No code changes are expected from you in this pass — the three self-review items (@tamirdresher comment 2026-07-17, fixed in — Flight 🏗️ (monitor pass, 2026-07-27) |
- Add applyVscodeDefaultMode() to packages/squad-cli/src/cli/core/init.ts using jsonc-parser (modify/applyEdits) for JSONC-safe, comment-preserving edits - Create .vscode/settings.json with chat.newSession.defaultMode: Squad if absent - Add key to existing settings.json; preserve existing value if key already set - Add includeVscodeDefault?: boolean to RunInitOptions interface - Wire --no-vscode-default flag in cli-entry.ts (matches existing --no-<cap> pattern) - Add --no-vscode-default to squad init --help output - Add jsonc-parser ^3.3.1 as direct dependency of @bradygaster/squad-cli - Add test/init-vscode-settings.test.ts with 7 focused test cases - Update docs/features/vscode.md and docs/reference/cli.md - Add .changeset/init-vscode-default.md (minor bump) Note: GitHub issue creation was blocked by Enterprise Managed User (EMU) restriction on the tamirdresher_microsoft account — cannot create issues/PRs on external bradygaster/squad repo via the GitHub API or gh CLI. PR is opened without a linked issue number. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix mojibake in packages/squad-cli/package.json description - Fix --no-vscode-default help alignment in cli-entry.ts (split into separate console.log call matching surrounding indentation pattern) - Add regression test: isGlobal:true does not create .vscode/settings.json Closes #1486 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a05b5960-2854-438d-976d-2bc01816ee70
e8ddcb0 to
d84e369
Compare
|
@bradygaster This is rebased onto latest dev, version cleanup done (@bradygaster/squad-cli restored to 0.11.0), all 3 outstanding review threads resolved (help text split, package description mojibake fixed, global-init regression test added), and all CI checks including Policy Gates are green. Ready for your review/approval whenever you have a chance. |
Summary
Implements the feature that defaults VS Code chat sessions to Squad mode during
squad init,using a JSONC-safe editor (
jsonc-parser) to write"chat.newSession.defaultMode": "Squad"to
.vscode/settings.json.Closes #1486
Behavior
squad initcreates or updates.vscode/settings.jsonwith"chat.newSession.defaultMode": "Squad".vscode/dir if needed)--no-vscode-default: skips.vscode/settings.jsonentirely--global): skipped - no.vscode/context for personal squad configsquad initrun produces no further diffOpt-out flag
Follows the existing
--no-<capability>naming convention (same as--no-workflows).Changed files
packages/squad-cli/src/cli/core/init.ts-applyVscodeDefaultMode()function +includeVscodeDefaultoptionpackages/squad-cli/src/cli-entry.ts---no-vscode-defaultflag parsing + help textpackages/squad-cli/package.json-jsonc-parser ^3.3.1added to dependenciespackage-lock.json- updated for new direct deptest/init-vscode-settings.test.ts- 7 new focused test cases (new file)docs/src/content/docs/features/vscode.md- "Default Chat Session Mode" section addeddocs/src/content/docs/reference/cli.md---no-vscode-defaultrow added.changeset/init-vscode-default.md- minor bump changeset (new file)Validation
@types/react,@types/ws), zero new errorsnpm installis blocked by a corporate proxy 404 on an unrelated transitive package (vite@8.1.4), unrelated to this change. Test filetest/init-vscode-settings.test.tscovers 7 cases (missing file, existing without key, existing key with different value preserved, comments/trailing commas preserved, opt-out flag, idempotent rerun, malformed-file safety) but could not be executed locally; recommend CI run on this PR as the actual test gate.Notes
squad upgradewas intentionally not modified - its scaffolding path is independent.tamirdresheraccount after the Enterprise Managed User (EMU) account (tamirdresher_microsoft) was found to be blocked from creating issues on this external/public repo.