Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions create-dev-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ls ~/.claude/commands/<slug>-dev-loop.md 2>/dev/null

**If a skill already exists**, ask the user to choose:

- **update** *(default)* — re-derive the skill from the current template and current repo state, producing a fresh skill file. Set `MODE=update`. Steps 2–5 run; Steps 6 (create GitHub repo) and 7 (record in `my-claude-skills`) are skipped because those artifacts already exist.
- **update** *(default)* — re-derive the skill from the current template and current repo state, producing a fresh skill file. Set `MODE=update`. Steps 2–5 run; Steps 6 (create GitHub repo) and 7 (record in the personal catalog) are skipped because those artifacts already exist.
- **overwrite** — re-derive and replace as in fresh generation. Set `MODE=overwrite`. Steps 6–7 still run, idempotently re-asserting the repo and registry entry.
- **cancel** — exit without changes.

Expand All @@ -37,11 +37,13 @@ cd ~/local-skills/<slug>-dev-loop && git status --porcelain
```
If the output is non-empty, stop and ask the user to commit or stash their edits — the update would otherwise overwrite in-progress work.

In **update mode**, after Step 4 completes, show the user a diff between the existing skill file and the freshly generated content *before* overwriting:
In **update mode**, after Step 4 completes, write the freshly generated content to a scratch file using the `Write` tool — not `>` shell redirection, which some harness sandboxes statically block even for files the same session just created (the same constraint the generated template's Phase 3 teaches its own children) — at `~/local-skills/<slug>-dev-loop/<slug>-dev-loop.md.new`. Use that path, inside the directory the generator already owns, rather than `/tmp`: out-of-repo scratch writes can be blocked even when in-repo `Write` calls succeed. **If the scratch write fails, abort the update and report the failure** — do not fall back to overwriting without having shown the diff; the diff is the only confirmation gate protecting the user's existing skill file.

Show the user a diff between the existing skill file and the scratch file *before* overwriting:
```bash
diff -u ~/local-skills/<slug>-dev-loop/<slug>-dev-loop.md /tmp/<slug>-dev-loop.new.md
diff -u ~/local-skills/<slug>-dev-loop/<slug>-dev-loop.md ~/local-skills/<slug>-dev-loop/<slug>-dev-loop.md.new
```
Get explicit confirmation before replacing the file.
Get explicit confirmation before replacing the file. After the file is replaced (or the update is declined), remove the scratch file: `python3 -c "import os; os.remove(path)"` (not `rm`, for the same sandbox reason).

---

Expand Down
Loading