Commit Task Work
Commit only the work that belongs to the current task, even when several repos have unrelated dirty state.
Workflow
Resolve the task scope.
- Prefer an explicit task folder, status file, tracker id, branch name, or paths from the conversation.
- If unclear, run
get-task-detailsor inspect recent task folders undercontext/daily/. - Treat the task folder in
personal_osas the durable notes/artifacts scope.
Identify repos touched by the task.
- Always check
personal_oswhen task notes or artifacts were created there. - Check external codebases mentioned in the status file, task artifacts, current branch, recent commands, or user prompt.
- Use
git -C <repo> status --short --branchfor each repo.
- Always check
Classify each repo before staging.
personal_os: usually commit task folders and task-specific support files onmain; do not stage unrelated dirty files elsewhere in the repo.- External code repo with a task-specific feature branch: commit task-related source/test/docs changes when the branch, upstream, and diff clearly match the task.
- External code repo on
main, detached HEAD, shared branch, or ambiguous branch: ask before committing. - Clean external repo: note that no commit is needed.
Stage explicitly.
- Use pathspecs, not broad
git add ., unless the repo is freshly created for this task and fully in scope. - Include untracked files only when they are clearly task artifacts or intentional source files.
- Keep generated scratch logs/artifacts if they are part of the task record; exclude caches, local env files, build products, and secrets.
- Use pathspecs, not broad
Review before committing.
- Run
git diff --cached --stat. - Run
git diff --cached --check. - For sensitive repos or logs, scan staged content for obvious secret patterns such as API keys, tokens,
.envcontents, private keys, and credential dumps. - If the staged set includes unrelated changes, unstage the unrelated paths and recheck.
- Run
Commit with a direct message.
- Use one commit per repo unless the user asks for a different structure.
- Keep messages task-specific, for example
Add Marin PPL circuit task artifactsorAdd commit task workflow skill. - Do not push unless the user asks to push or the existing task workflow explicitly requires it.
Report the outcome.
- List each repo, branch, commit hash, and what was committed.
- Mention repos checked but left clean or skipped.
- Call out any ambiguity that required skipping or asking.
Safety Rules
- Never stage unrelated dirty work just because it is present.
- Never reset, checkout, clean, or otherwise discard changes unless the user explicitly asks.
- Do not commit external repos when branch ownership is unclear; ask first.
- Do not expose secret values in the response. If a staged secret is found, stop and report the file/path class, not the secret.
- GitHub comments, PR bodies, and issue updates need the configured agent byline; local git commits do not require that byline unless the user requests it.