When invoked, do this in order.
A) Documentation and state (must do)
- •
Update
HANDOFF.md:- •Fill/refresh every section.
- •Include concrete evidence: file paths and (if a commit is created) the commit hash.
- •
Update
REPO_MAP.mdonly if needed:- •new important file/dir/entrypoint created
- •important file moved/renamed
- •canonical commands/entrypoints changed
- •focus area ("hot paths") changed
- •
Ensure
.gitignorestays strict for artifacts and secrets.
B) Log rotation (must do)
- •Determine next log filename:
- •
agent_logs/YYYY-MM-DD_agentNN.md, where NN is 00, 01, 02, ... chosen as the next unused number for today.
- •
- •Move
agent_logs/current.md-> that filename. - •Append a one-line entry to
agent_logs/INDEX.md:- •
- YYYY-MM-DD_agentNN.md — <short summary> (optional: commit <hash>)
- •
- •Create a fresh
agent_logs/current.md.
C) Safe handoff commit (must do, unless safety checks fail) Before committing, always show:
- •
git status - •
git diff --stat
Never commit artifacts or secrets (see .gitignore).
Commit message:
- •
agentNN: handoff(<area>): <short description> - •Derive
agentNNfromagent_logs/current.md(fieldid:). If missing, stop and ask the human. - •Choose
<area>from:workflow,docs,engine,viewer,runner,schemas,misc.