Maintains live project state in Markdown (STATE, DECISIONS, SOURCES) so any AI agent can pick up right where the last one left off. Activates automatically only in projects that already have context/STATE.md or where AGENTS.md references pm-handoff: at session start ("resume", "where did we leave off", "handoff"), when a task is completed or a decision is made, or on "save" / "save state". Starting a new project or migrating an existing one from chats, folders, or cloud storage — only on expl...
0 votes
0 copies
4 views
Added December 5, 2026
researchgoshellbashgit
Works with
claude desktop
terminal
cli
Security analysis
F33/100
criticalModifies startup scripts or system services for persistencein README.en.md
criticalModifies startup scripts or system services for persistencein scripts/install-autopush-mac.sh
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of pm-handoff?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mx-otmakhov-pm-handoff)
---
name: pm-handoff
description: >-
Maintains live project state in Markdown (STATE, DECISIONS, SOURCES) so any AI agent can pick up right where the last one left off. Activates automatically only in projects that already have context/STATE.md or where AGENTS.md references pm-handoff: at session start ("resume", "where did we leave off", "handoff"), when a task is completed or a decision is made, or on "save" / "save state". Starting a new project or migrating an existing one from chats, folders, or cloud storage — only on explicit request ("set up project", "create project", "migrate project"). Trigger phrases work in any language (e.g. "продолжим", "сохрани").
---
# pm-handoff
Version: 1.0.0
Live project state stored right in the project files: what is in progress, what was decided and why, where data comes from, and what was tried and ruled out. Any agent that can see the folder can continue seamlessly.
- `setup.md` — setting up or migrating a project. Read only if the project folder has no `context/STATE.md` (an `AGENTS.md` may already exist).
- `recovery.md` — restoring a previous file version and resolving "diverged from GitHub". Read only when needed.
- `templates/` — project file templates (placed into a project without `.template`; `gitignore.template.txt` becomes `.gitignore`); `scripts/` — autopush, installed via `setup.md`.
If you have no file access (a regular chat with no connected folder) and the user asks to save or set up a project — state that in one line and stop; do not pretend to save. Answer everything else normally.
## Rules
- Never delete, move, rename, or overwrite the user's files without an explicit "yes" on a specific list — except files they explicitly asked to edit. Updating `context/` and writing new outputs into working folders do not require confirmation: that is the skill's job.
- Secrets: read only `../.secrets/<this project>/` and only when needed for the task; never print secret values in chat or write them into files, logs, or commits.
- The user is a manager, not a developer: speak plainly, explain technical terms in parentheses, and keep implementation details to yourself.
- Talk to the user in the language they write in; write project files in the `Language` setting from `../_me/PM-HANDOFF.md` (if absent — the user's language). Keep machine-read keys and values exactly as in the templates, in English, whatever the language: `GitHub:`, `Push:`, `Updated:`, `Language:`, and the other `Key:` lines in `PM-HANDOFF.md`, plus their values (`autopush`, `agent`, `none`). Section headings and all other text are written in the project's language; match `STATE` sections by meaning, not by exact heading. Quoted user-facing phrases in this skill are examples — say them in the user's language (keep log/script markers like `"diverged from GitHub"` in English when matching logs).
## When commands run inside a VM (Claude Desktop; sign — git complains about dubious ownership)
- Run every git command with `git -c safe.directory='*' …`, on every invocation, including subshells inside `$(…)`.
- Before the first commit in a session, request permission to delete in the projects folder: git deletes its own lock files. If a commit fails with "Operation not permitted" or "… .lock" — request permission and retry.
- `push` and `gh` do not work from the VM; with `Push: autopush` they are not needed. If a push is needed (`Push: agent`) or autopush is stuck — give a Terminal command: what it will do, the command itself in a single code block, and what output should appear.
## Session Start
1. Read `AGENTS.md`, then `context/STATE.md`, plus anything `AGENTS.md` tells you to read at startup (for example, shared rules in `../_me/global-rules.md`). No `context/STATE.md` → `setup.md`.
2. Check what changed since the last save: `h=$(git log -1 --format=%H -- context/STATE.md) && [ -n "$h" ] && git log --oneline "$h"..HEAD` and `git status --short -uall`. If there are new commits — account for them and mention in one line. If `Push: autopush` — check the latest log line for this project: `grep " <project> " ../_me/logs/autopush.log 2>/dev/null | tail -1`; if it shows `FAIL`, `FETCH_FAIL`, or `WAIT` — report immediately; "diverged from GitHub" → `recovery.md`. If there are unsaved edits not from this session — ask whether to save them in a separate commit or leave them alone.
3. Do not re-investigate items in "Tried and Ruled Out" without a new reason.
4. Recap in one line where things left off and what is next, then move straight to the task.
5. If `../_me/skills/pm-handoff/` exists and its `SKILL.md` has an older `Version` than this one (compare by SemVer `major.minor.patch`; treat any legacy `YYYY-MM-DD` version as older than `1.0.0`) — offer to update the copy: after "yes", replace its contents cleanly with this skill folder (`rsync -a --delete --exclude='.git' --exclude='README*' --exclude='LICENSE' "<skill folder>/" "../_me/skills/pm-handoff/"` — so no stale files remain). Under the same "yes", if `../_me/bin/autopush.sh` exists and differs from `scripts/autopush.sh` (same for `install-autopush-mac.sh`), copy it over and keep it executable (`cp "<skill folder>/scripts/<file>" "../_me/bin/<file>" && chmod +x "../_me/bin/<file>"`; no reinstall needed — launchd runs the file by path). Commit all changes in `_me/`. Symlinks created by `link-skill.sh` pick up the new version automatically; if copies (`--copy`) were installed — give the Terminal command `bash "<projects folder>/_me/skills/pm-handoff/scripts/link-skill.sh" --copy`.
## When to Save
- Task completed: save in the same response without asking. Decisions made during the task go into the same commit.
- A decision that changes project direction, scope, or method can be saved right away.
- "Save", "that's all for today" — save immediately.
- Not sure whether it's time to save: do not save and do not ask; add one line at the end (in the user's language): "I'll save when we wrap up this task."
- Do not save after every message: a typical session has 1–3 saves.
## How to Save
1. **`context/STATE.md`** — re-read from disk (another session may have edited it) and rewrite in full, ≤ 50 lines, one line per bullet (if it doesn't fit, trim "Recently Done" and "Tried and Ruled Out" first; extra tasks go to `BACKLOG.md`), `Updated: <today>`. Sections:
- **Now** — current factual status, not history;
- **Next** — 3–5 concrete steps ready to start; remaining tasks go in `context/BACKLOG.md` (create when needed; one line per task);
- **Blockers / Open Questions** — including unconfirmed agent proposals;
- **Tried and Ruled Out** — ≤ 7 items, with reason and who decided; older items live in git history, major ones go in `DECISIONS`;
- **Recently Done** — 3–5 items with dates; older ones simply drop off since they stay in git history.
2. **`context/DECISIONS.md`** — append to the end only when the user made a decision that changes project direction, scope, or method (something worth remembering "why" a month later). Format: `## YYYY-MM-DD — <decision>` and a line `Why: … Alternatives: …`. Step ordering and wording tweaks belong in `STATE`, not here. An unconfirmed agent proposal belongs only in `STATE` as an open question. Never edit a reversed decision: add a new entry noting `replaces decision from <date>`.
3. **`context/SOURCES.md`** — append new links, files, artifacts, and data sources.
4. Put deliverables into working folders per `AGENTS.md` (`inputs/`, `inputs/data/` — data exports, ignored in `.gitignore` by default; `discovery/YYYY-MM-DD Topic/`, `delivery/`, `archive/`), not just in chat or an artifact. Edit files in place rather than retyping from tool output (tool output can be truncated). If a new working folder or project rule appears — offer to update `AGENTS.md`.
5. **Check:** no secrets or personal data (tokens, passwords, keys, client phone numbers or emails; secrets belong only in `../.secrets/<project>/`); reference existing files, commits, and artifacts by path or link rather than duplicating content; separate facts from assumptions, never fabricate. Run `git status --short -uall`: verify there are no data exports with personal data and no files > 50 MB (check sizes with `du -h`) — add those to `.gitignore` before committing.
6. **Commit.** Author: if `git config --local user.name` is empty → take it from the latest commit (`git log -1 --format='%an'` / `'%ae'`) and set `--local` silently; if there are no commits yet — ask. Never touch global git config. Then `git add -A` (if there are unrelated edits, stage only this task's files) and `git commit -m "<project>: <what and why>"`; one completed task = one commit. If you edited anything in `../_me/` (`global-rules`, `PM-HANDOFF`, skill copy) — make a separate commit in `_me/` if it is a git repo (same author and `safe.directory` rules).
7. **Push** — follow the `Push:` line in `AGENTS.md`:
- `autopush` — do not push yourself. If no upstream branch is set (`git rev-parse @{u}` fails) — skip the check. Unpushed commits: `git rev-list --count @{u}..HEAD`, oldest — `git log --reverse --format=%cr @{u}..HEAD | head -1`; if sitting unpushed for more than ~15 minutes — tell the user and check `../_me/logs/autopush.log`;
- `agent` — run `git push`; if it fails — say it is saved locally;
- `GitHub: none` or no `Push:` line — commit only (unless `AGENTS.md` specifies otherwise).
## Report
One line: what was updated + commit hash (+ "N unpushed", only if sitting > ~15 minutes; + what was added to `.gitignore`, if anything).