You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugin): cowork-aware handoff with local folder and zip options
In cowork mode, the handoff now adapts based on how the user connected:
- Local folder: artifacts are already in their repo, just tell them to
commit (no question needed)
- Cloned repo: offer push+PR or download as zip for users without push
access
- Full CLI: unchanged (construct or PR options)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: plugin/skills/elaborate/SKILL.md
+71-5Lines changed: 71 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1220,7 +1220,13 @@ Workflow: {workflowName}
1220
1220
Next hat: {next-hat}
1221
1221
```
1222
1222
1223
-
Then ask the user how to proceed using `AskUserQuestion`:
1223
+
Then ask the user how to proceed. **The options depend on whether this is a cowork session.**
1224
+
1225
+
```bash
1226
+
IS_COWORK="${CLAUDE_CODE_IS_COWORK:-}"
1227
+
```
1228
+
1229
+
**If NOT cowork mode** (full CLI):
1224
1230
1225
1231
```json
1226
1232
{
@@ -1236,7 +1242,30 @@ Then ask the user how to proceed using `AskUserQuestion`:
1236
1242
}
1237
1243
```
1238
1244
1239
-
### If Construct:
1245
+
**If cowork mode** (`IS_COWORK=1`):
1246
+
1247
+
The artifacts have already been written to `.ai-dlc/{intent-slug}/` in the working directory. Determine the handoff based on how the user connected to the repo in Phase 0:
1248
+
1249
+
-**If the user pointed to a local folder** — the artifacts are already in their repo. They just need to commit.
1250
+
-**If the repo was cloned to a temp workspace** — the user may not have push access. Offer a zip download.
1251
+
1252
+
```json
1253
+
{
1254
+
"questions": [{
1255
+
"question": "Elaboration is complete! How would you like to deliver the spec?",
1256
+
"header": "Handoff",
1257
+
"options": [
1258
+
{"label": "Push branch + open PR/MR", "description": "Push the spec branch and create a pull/merge request for review (requires git push access)"},
1259
+
{"label": "Download as zip", "description": "Package all spec artifacts into a zip file you can share with your team"}
1260
+
],
1261
+
"multiSelect": false
1262
+
}]
1263
+
}
1264
+
```
1265
+
1266
+
**Note:** If the user connected via **local folder**, skip the question entirely — just tell them the artifacts are written and ready to commit (see "If local folder" below).
1267
+
1268
+
### If Construct (CLI only):
1240
1269
1241
1270
Tell the user:
1242
1271
@@ -1303,9 +1332,46 @@ EOF
1303
1332
```
1304
1333
Spec PR created: {PR_URL}
1305
1334
1306
-
Review the spec with your team. When approved, run:
1335
+
Review the spec with your team. When approved, a developer can run:
1307
1336
/construct
1337
+
```
1308
1338
1309
-
Note: All AI-DLC work happens in the worktree at .ai-dlc/worktrees/{intent-slug}/
1310
-
Your main working directory stays clean on the main branch.
1339
+
### If local folder (cowork — no question needed):
1340
+
1341
+
The artifacts are already written in the user's own repo checkout. Just tell them:
1342
+
1343
+
```
1344
+
Spec artifacts written to .ai-dlc/{intent-slug}/:
1345
+
- intent.md
1346
+
- unit-01-{name}.md
1347
+
- unit-02-{name}.md
1348
+
...
1349
+
1350
+
These are ready to commit. From your project directory, run:
1351
+
git add .ai-dlc/{intent-slug}/
1352
+
git commit -m "elaborate: define intent and units for {intent-slug}"
1353
+
1354
+
Then a developer can run `/construct` in Claude Code to start the build loop.
1355
+
```
1356
+
1357
+
### If Download as zip (cowork):
1358
+
1359
+
Package all spec artifacts into a zip file:
1360
+
1361
+
```bash
1362
+
INTENT_DIR=".ai-dlc/${INTENT_SLUG}"
1363
+
ZIP_PATH="/tmp/ai-dlc-${INTENT_SLUG}-spec.zip"
1364
+
cd"$(git rev-parse --show-toplevel)"
1365
+
zip -r "$ZIP_PATH""$INTENT_DIR"
1366
+
```
1367
+
1368
+
Tell the user:
1369
+
1370
+
```
1371
+
Spec packaged: {ZIP_PATH}
1372
+
1373
+
To use this spec:
1374
+
1. Unzip into the project root (preserves the .ai-dlc/{intent-slug}/ structure)
1375
+
2. Commit the files
1376
+
3. Run /construct in Claude Code to start the build loop
0 commit comments