handoff — session transfer to the next agent
Adapted from mattpocock/skills (skills/productivity/handoff, MIT). Compresses the current conversation into a self-contained document for the next session. Principle: reference durable artifacts, do not duplicate them.
Argument
- If the argument looks like a path (ends with
.md or points to an existing directory) → target path.
- Otherwise → focus of the next session (insert it into the handoff header).
- If both are present, treat the first token as the path and the rest as focus.
- Without an argument, ask the user for the focus in one line and continue with the default path.
Where to write
- Default directory:
handoffs/ at the project root. Create it if missing.
- Default file name:
handoff-<YYYYMMDD-HHMMSS>.md (local time).
- If the user provided a path, use it (overwrite without confirmation).
- Before writing, read the target file through Read. The expected "does not exist" error is fine; this is protection against overwriting an unrelated existing file with the same name.
- If the project has
.gitignore and handoffs/ is not mentioned there, offer to add it (handoffs are session artifacts, not code), but do not add it automatically.
PowerShell conventions (\ in paths, quotes around paths with spaces) — see the powershell-windows skill.
Document structure
# Handoff: <one-line session goal>
**When**: <YYYY-MM-DD HH:MM local>
**Branch / commit**: <branch>, latest commit <short SHA + subject>
**Next session focus**: <argument focus, if provided>
## Current State
1-3 sentences: what was done last, what remains unfinished, what is blocked.
## Open Questions
Bulleted list of real unresolved questions (architectural forks, waiting for the user, unclear contract). If empty, omit the section.
## Files Changed In This Session
- `path/to/file.bsl` — what changed and why.
- `path/to/file.xml` — same.
Only include the current session diff. If nothing changed, omit the section.
## Verification State
Which gates from `verification-gates.md` passed / failed / were skipped. Latest `syntaxcheck` / `check_1c_code` / `review_1c_code` result in brief (error count, key messages).
## Next Steps
1-5 imperative items ("Check movements for `РегистрНакопления.<Имя>`", "Finish `ОбработкаПроведения` for document `<Имя>`").
## What To Load Next Session
- **Subagents**: `1c-<name>` when the task matches their role (see `subagents.md`).
- **On-demand rules**: `<name>.md` based on the task trigger (see `AGENTS.md → Additional rules`).
- **MCP tools**: especially relevant tools (`get_object_dossier` for X, `trace_impact` before refactoring Y, `ssl_search` for topic Z).
- **Slash commands**: `/opsx:apply` when there is an active OpenSpec proposal, `/getconfigfiles` for metadata re-export, etc.
## Links (DO NOT copy content)
- `openspec/changes/<id>/proposal.md`, `design.md`, `tasks.md`
- `memory.md` — relevant sections
- `1c-templates-mcp` notes — `recall` keys: `<term1>`, `<term2>`
- Commits / PR / Issue
- ITS articles, platform documentation pages
What NOT to write in the handoff
- Contents of existing artifacts (PRD, OpenSpec proposal/design/tasks, ADR, ITS page, commit, PR description). Link only.
- Full module code. Only include a short change description and path.
- Secrets, tokens, passwords,
.dev.env contents, infobase connection strings.
- Long MCP output dumps. Include only the result and call parameters so the check can be repeated if needed.
After writing
- Tell the user the absolute path of the created file and its line count.
- If the session produced corrections / facts that may qualify for
memory.md or 1c-templates-mcp (remember) under AGENTS.md → Project memory, list them separately as candidates for long-term memory. Do not save automatically (memory.md is strict, remember is targeted).
Boundaries
- Handoff is a session artifact, not configuration and not code. Do not run
syntaxcheck / check_1c_code / review_1c_code against it.
- Handoff does not replace an OpenSpec proposal. If the task requires a proposal and it does not exist yet, additionally suggest
/opsx:propose and reference the future ID from the handoff.
- Handoff does not duplicate
memory.md and recall notes. Memory and handoff are different channels (see AGENTS.md → Project memory).
- Handoff is written in normal grammar, not caveman style, so the next agent can read it without ambiguity.
1---2name: handoff3description: Compact the current conversation into a self-contained handoff document so a fresh agent (new chat, another machine, another AI client) can continue the work without re-discovering the context. References durable artifacts (`openspec/`, `memory.md`, commits, `1c-templates-mcp` notes) instead of duplicating them. Use when the user says 'handoff', 'compact session', 'save context for continuation', 'brief the next session', 'сделай handoff', 'передай контекст', 'сохрани контекст для продолжения', or invokes `/handoff`.4---56# handoff — session transfer to the next agent78Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills) (`skills/productivity/handoff`, MIT). Compresses the current conversation into a self-contained document for the next session. Principle: **reference durable artifacts, do not duplicate them**.910## Argument1112- If the argument looks like a path (ends with `.md` or points to an existing directory) → **target path**.13- Otherwise → **focus** of the next session (insert it into the handoff header).14- If both are present, treat the first token as the path and the rest as focus.15- Without an argument, ask the user for the focus in one line and continue with the default path.1617## Where to write18191. Default directory: `handoffs/` at the project root. Create it if missing.202. Default file name: `handoff-<YYYYMMDD-HHMMSS>.md` (local time).213. If the user provided a path, use it (overwrite without confirmation).224. **Before writing**, read the target file through Read. The expected "does not exist" error is fine; this is protection against overwriting an unrelated existing file with the same name.235. If the project has `.gitignore` and `handoffs/` is not mentioned there, **offer** to add it (handoffs are session artifacts, not code), but **do not add it automatically**.2425PowerShell conventions (`\` in paths, quotes around paths with spaces) — see the `powershell-windows` skill.2627## Document structure2829```markdown30# Handoff: <one-line session goal>3132**When**: <YYYY-MM-DD HH:MM local>33**Branch / commit**: <branch>, latest commit <short SHA + subject>34**Next session focus**: <argument focus, if provided>3536## Current State371-3 sentences: what was done last, what remains unfinished, what is blocked.3839## Open Questions40Bulleted list of real unresolved questions (architectural forks, waiting for the user, unclear contract). If empty, omit the section.4142## Files Changed In This Session43- `path/to/file.bsl` — what changed and why.44- `path/to/file.xml` — same.45Only include the current session diff. If nothing changed, omit the section.4647## Verification State48Which gates from `verification-gates.md` passed / failed / were skipped. Latest `syntaxcheck` / `check_1c_code` / `review_1c_code` result in brief (error count, key messages).4950## Next Steps511-5 imperative items ("Check movements for `РегистрНакопления.<Имя>`", "Finish `ОбработкаПроведения` for document `<Имя>`").5253## What To Load Next Session54- **Subagents**: `1c-<name>` when the task matches their role (see `subagents.md`).55- **On-demand rules**: `<name>.md` based on the task trigger (see `AGENTS.md → Additional rules`).56- **MCP tools**: especially relevant tools (`get_object_dossier` for X, `trace_impact` before refactoring Y, `ssl_search` for topic Z).57- **Slash commands**: `/opsx:apply` when there is an active OpenSpec proposal, `/getconfigfiles` for metadata re-export, etc.5859## Links (DO NOT copy content)60- `openspec/changes/<id>/proposal.md`, `design.md`, `tasks.md`61- `memory.md` — relevant sections62- `1c-templates-mcp` notes — `recall` keys: `<term1>`, `<term2>`63- Commits / PR / Issue64- ITS articles, platform documentation pages65```6667## What NOT to write in the handoff6869- Contents of existing artifacts (PRD, OpenSpec proposal/design/tasks, ADR, ITS page, commit, PR description). Link only.70- Full module code. Only include a short change description and path.71- Secrets, tokens, passwords, `.dev.env` contents, infobase connection strings.72- Long MCP output dumps. Include only the result and call parameters so the check can be repeated if needed.7374## After writing75761. Tell the user the absolute path of the created file and its line count.772. If the session produced corrections / facts that may qualify for `memory.md` or `1c-templates-mcp` (`remember`) under `AGENTS.md → Project memory`, **list them separately** as candidates for long-term memory. Do not save automatically (`memory.md` is strict, `remember` is targeted).7879## Boundaries8081- Handoff is a session artifact, not configuration and not code. Do not run `syntaxcheck` / `check_1c_code` / `review_1c_code` against it.82- Handoff **does not replace** an OpenSpec proposal. If the task requires a proposal and it does not exist yet, additionally suggest `/opsx:propose` and reference the future ID from the handoff.83- Handoff **does not duplicate** `memory.md` and `recall` notes. Memory and handoff are different channels (see `AGENTS.md → Project memory`).84- Handoff is written in normal grammar, not caveman style, so the next agent can read it without ambiguity.