Skip to content

Commit 4a55b6e

Browse files
aaronbrezelclaude
andcommitted
docs: add git worktrees guidance and fix .clasp.json constraint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4e2e684 commit 4a55b6e

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ The Gemini API key must be set as a Script Property (`GEMINI_API_KEY`) in Apps S
250250
- `appsscript.json` must be in `dist/` for clasp push (the build script copies it)
251251
- Drive Advanced Service must be enabled in the Apps Script editor AND declared in `appsscript.json`
252252
- `PropertiesService.getScriptProperties()` is available in custom functions once the add-on has been authorized by the user (opening the menu triggers authorization)
253-
- `.clasp.json` is committed to the repo and points to the single add-on script project
253+
- `.clasp.json` is gitignored and must be present locally for clasp commands to work — it is not committed to the repo
254254

255255
## Security
256256

@@ -264,6 +264,35 @@ Changes that always warrant a threat model review before submitting a PR:
264264
- **New npm dependencies** — affects T10 (build dependency compromise); flag in the PR security checklist
265265
- **New or changed GCP integrations** — any new Google Cloud service, new Gemini endpoint, new data types sent, or changes to the Files API upload path; review T2, T3, T11, and T14 as a starting point
266266

267+
## Git Worktrees
268+
269+
Worktrees live in `.claude/worktrees/` (already gitignored). The `EnterWorktree` native tool handles creation. Each worktree must be on a **unique branch** — git enforces this; two worktrees cannot share the same branch simultaneously.
270+
271+
### Setting up a new worktree
272+
273+
After creating the worktree, run these steps before starting work:
274+
275+
1. **Install dependencies**`node_modules/` is gitignored and absent in fresh worktrees:
276+
```bash
277+
npm install
278+
```
279+
280+
2. **Symlink `.clasp.json`** — only needed if you plan to deploy and test against the dev sheet. `.clasp.json` is gitignored so it won't be present. Symlink from the main workspace so all worktrees share the same target script project:
281+
```bash
282+
ln -s /path/to/gas-ssi-toolkit/.clasp.json .clasp.json
283+
```
284+
Skip this step for work that doesn't require a live deployment test (e.g. pure logic changes covered by tests).
285+
286+
3. **Deploy from only one worktree at a time** — all worktrees share the same Apps Script project. Running `deploy:watch` from two worktrees simultaneously produces a mixed build. Consciously choose which worktree is "active" for live testing.
287+
288+
### Finishing a worktree
289+
290+
When the feature is ready, open a PR against `develop` (see [Branch Naming](#branch-naming) and [Creating PRs](#creating-prs) below). Once the PR is merged, delete the worktree:
291+
292+
```bash
293+
git worktree remove .claude/worktrees/AI-{n}-feature-name
294+
```
295+
267296
## GitHub
268297

269298
### Docker Sandbox authentication

0 commit comments

Comments
 (0)