Skip to content

Commit 18f44e4

Browse files
jwaldripclaude
andcommitted
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>
1 parent 37887ff commit 18f44e4

File tree

1 file changed

+71
-5
lines changed

1 file changed

+71
-5
lines changed

plugin/skills/elaborate/SKILL.md

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,13 @@ Workflow: {workflowName}
12201220
Next hat: {next-hat}
12211221
```
12221222

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):
12241230

12251231
```json
12261232
{
@@ -1236,7 +1242,30 @@ Then ask the user how to proceed using `AskUserQuestion`:
12361242
}
12371243
```
12381244

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):
12401269

12411270
Tell the user:
12421271

@@ -1303,9 +1332,46 @@ EOF
13031332
```
13041333
Spec PR created: {PR_URL}
13051334
1306-
Review the spec with your team. When approved, run:
1335+
Review the spec with your team. When approved, a developer can run:
13071336
/construct
1337+
```
13081338

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
13111377
```

0 commit comments

Comments
 (0)