Extract the per-machine concurrency lock from sync.sh into a sourceable
lib (.claude/scripts/sync-lock.sh) plus a `run <cmd>` wrapper that locks
the current repo (same lock-dir basename, so it mutually excludes with
sync.sh in the ClaudeTools repo and self-scopes in any project repo).
sync.sh now sources it (behavior identical — verified by review). /scc
routes its commit+push through the locked, rebase-safe sync.sh (and drops
the bare YYYY-MM-DD-session.md filename for the per-session-unique one).
/checkpoint now stages+commits atomically under the repo lock so a
concurrent session in a shared worktree can't be swept in. Closes the
remaining commit paths that bypassed the lock shipped in 6b0ce9a.
29 lines
2.2 KiB
Markdown
29 lines
2.2 KiB
Markdown
# /scc - Save, Commit, and Push
|
|
|
|
Quick command to save session log, stage everything, and push to Gitea in one shot.
|
|
|
|
## Steps
|
|
|
|
1. **Save session log** - Create/update session log for today using the /save skill logic:
|
|
- Determine correct location based on work context (project-specific or general `session-logs/`)
|
|
- **Per-session-unique filename (mandatory)** — concurrent sessions share this worktree, so never use the bare `YYYY-MM-DD-session.md`. Use `YYYY-MM-DD-<user>-<topic>.md`; collision-guard + same-session-append rules are in `/save` (`save.md`).
|
|
- Include: summary, credentials (unredacted), infrastructure, commands, files changed, pending tasks
|
|
|
|
2. **Commit + push (locked, rebase-safe)** - Run `bash .claude/scripts/sync.sh`. This is the single serialized git path: it takes the per-machine sync lock (so it can't interleave with another session's sync/commit), reconciles git identity to `identity.json`, stages changes, commits, fetch + rebase, pushes — ClaudeTools then vault.
|
|
- **Do NOT** run raw `git add -A` / `git commit` / `git push origin main` here — that bypasses the lock AND the fetch+rebase (the old flow raced and would reject on a stale push).
|
|
- If `sync.sh` **exits 75**, another sync is in progress: report "sync deferred — your log is saved locally and will sync on the next run"; do not claim pushed.
|
|
- Note: the discrete `scc:`-prefixed message is dropped in favour of one locked git path (commit lands under `sync.sh`'s auto message). If a custom message matters, revisit later (e.g. a `-m` arg on `sync.sh`).
|
|
|
|
3. **Report** - Confirm what was saved, committed, and pushed (or deferred)
|
|
|
|
4. **Reaffirm roles** - After push, briefly restate:
|
|
- You are a COORDINATOR, not an executor
|
|
- Delegate: DB -> Database Agent, code -> Coding Agent, git -> Gitea Agent, tests -> Testing Agent
|
|
- Do yourself: simple responses, reading 1-2 files, planning, decisions
|
|
- >500 tokens of work = delegate. Code or database = ALWAYS delegate.
|
|
- NO EMOJIS. Use ASCII markers: `[OK]`, `[ERROR]`, `[WARNING]`, `[SUCCESS]`, `[INFO]`
|
|
|
|
## Important
|
|
- This is a FAST command - no lengthy analysis, just save and ship
|
|
- Just save, commit, push, reaffirm, report
|