Repository navigation
Closed
Description
Summary
Change squad init so it sets the repository's VS Code workspace default chat mode to Squad by default, via .vscode/settings.json:
{
"chat.newSession.defaultMode": "Squad"
}Behavior / Acceptance Criteria
- Plain
squad initenables this behavior by default. - If
.vscode/settings.jsondoes not exist, create it (and.vscode/if needed) with"chat.newSession.defaultMode": "Squad". - If
.vscode/settings.jsonexists andchat.newSession.defaultModeis absent, add that property while preserving all existing settings. - If
chat.newSession.defaultModealready exists with any value, preserve it exactly and do not overwrite it (treat as user ownership, regardless of casing/value). - Provide an explicit CLI opt-out following the repo
's established--no-flag convention (e.g.--no-vscode-default). Document the exact flag insquad init --help` and relevant init documentation. - With the opt-out flag, do not create or modify
.vscode/settings.jsonfor this behavior at all. - Editing must be JSONC-aware: preserve comments, trailing commas, existing keys, and reasonable formatting. Reuse an existing helper/dependency where possible rather than hand-rolling a parser; do not replace the whole file or strip comments.
- If an existing settings file cannot be safely parsed/edited, do not corrupt or replace it - surface a warning consistent with existing CLI patterns and continue init (unless repo conventions require a hard failure).
- The operation must be idempotent: rerunning
squad initcauses no further diff. - Scope is limited to
squad init; this behavior should not be added tosquad upgradeunless architecture makes init/upgrade inseparable (if so, that must be documented and justified).
Testing
Add/update focused tests covering:
- Missing settings file
- Existing settings file without the key
- Existing key present with a different value (must be preserved)
- Comments / trailing commas preserved after edit
- Opt-out flag behavior
- Idempotent rerun (no diff on second run)
- Malformed/unparseable existing file (safety - no corruption)
Docs
Update user-facing docs/help directly related to the new flag and default behavior.
Non-goals
- Do not modify unrelated files or pre-existing user work.
- Do not touch
squad upgradebehavior unless justified per above.
Requested by Tamir Dresher.
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix: address self-review blockers from PR #1485
fix: address self-review blockers from PR #1485