AGENT SKILL

baton-handoff

Write a complete handoff document at session end so the next agent (Claude Code, Codex, Cursor, Antigravity, Kiro, or local LLM) resumes exactly where this one stopped. Use whenever a session is approaching its limit, the user types /checkpoint, or the agent recognizes natural completion of a task. Surgical honesty - no context loss across tool boundaries.

License 许可
MIT
所属仓库
MILTONADINA/DevOPs
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
baton-handoff
description
Write a complete handoff document at session end so the next agent (Claude Code, Codex, Cursor, Antigravity, Kiro, or local LLM) resumes exactly where this one stopped. Use whenever a session is approaching its limit, the user types /checkpoint, or the agent recognizes natural completion of a task. Surgical honesty - no context loss across tool boundaries.

02 资源文件 1

03 SKILL.md 正文

Baton Handoff

Implements Principle 6 of the DevOPs Constitution. Sessions are short. Projects are long. The baton bridges the gap.

Tradeoff: ~500 bytes of structured state per session-end. Worth it: zero context loss across tool boundaries.


When to invoke

  1. User types /checkpoint — explicit handoff request.
  2. Session limit approaching — proactively, when 80%+ of session budget is used.
  3. Natural task boundary — completed unit of work, no obvious next move.
  4. Before tool switch — user mentions opening another agent.

What goes in the baton

.workflow/state/baton.md holds the fields below. Where the host tool wires hooks/universal/session-end/write-baton.sh, that hook rewrites the file at session end, filling its ## Next action and ## Open questions for the user sections from .workflow/state/next-action.txt and .workflow/state/open-questions.txt, so put them there; where it is not wired, write the baton yourself. It contains:

  • last_updated timestamp
  • session_id and originating tool
  • Active lifecycle_phase and active_mode
  • Git state (branch, HEAD, dirty file count)
  • Count of verified claims this session
  • List of open blockers
  • ## Next action section — the literal next instruction for the next agent
  • Open questions for the user
  • Files modified this session
  • Recently completed claim refs

How to write the Next action well

The single most important section. Be specific. Keep one ## Next action heading and replace its text each session, rather than adding a second one or a next_action: field: the Stratum session-start recall (runtime/scripts/session-start-context.ts), where it runs, reads its query only from the first ## Next action section, up to the next ## heading.

Bad (forces the next agent to re-explore):

Continue working on auth.

Good (the next agent knows exactly what to do):

Resume task T-014 (refresh-token rotation). The spec is at specs/auth/tokens.md#ac-3. AC-3, AC-4, AC-5 are implemented and verified (see .workflow/proofs/claim-2026-05-22-018.yml through -020.yml). AC-6 (clock-skew tolerance) is next.

First action: read AC-6, write the failing test in src/auth/clock-skew.test.ts, then implement. Use the existing addClockSkew helper from src/auth/util.ts line 47.


How to write open_questions

Anything the agent couldn't resolve alone. The user reads this when starting the next session, answers, and the answers go into specs/ or decisions.md.

1. Should refresh tokens be invalidated on password change? (Currently they
   are NOT. AC-7 implies yes but doesn't say explicitly. Spec ambiguous.)

2. Rate limit on /refresh? Current setting: 30/min/IP. The compliance doc
   suggests 5/min/IP for OAuth-style refresh. Confirm which applies.

Where the baton lives

  • File: .workflow/state/baton.md
  • Committed to git where the project tracks .workflow/state/. Where .gitignore excludes it (as the DevOPs repository itself does), the baton stays a local file; leave it untracked.
  • Checked by: hooks/universal/session-start/load-baton.sh on every session start. It reports whether the baton exists and how old it is; it does not read the contents for the agent.
  • Max age before "stale": 24 hours (configurable). After that it's informational only.

What NOT to put in the baton

  • Code (the next agent has the repo)
  • Lengthy reasoning (link to a doc instead)
  • Anything secret (PII, keys) — not in the baton even where it stays untracked, and never in committed files
  • Past completed work in detail (link to proofs)

Reading the baton

On session start, load-baton.sh already prints status. The agent must still explicitly:

  1. Open .workflow/state/baton.md
  2. Read its ## Next action section and the open questions
  3. Address blockers first
  4. Then resume

This skill is working when: the user can type continue in any tool and the agent picks up correctly. Target: resume success > 0.95. The intended record is governance/telemetry/resume-success.jsonl. Nothing writes it yet, so check by hand.

04 同仓库更多 Skills

MILTONADINA
MILTONADINA/DevOPs

karpathy-guidelines

Behavioral guidelines that reduce common LLM coding mistakes. Apply whenever writing, modifying, or reviewing code. Don't assume requirements, don't overcomplicate, don't refactor unrelated code, and define success criteria before implementing. Use this skill on every non-trivial coding task to avoid bloat, silent assumptions, and completion-bias.

★ 0
MILTONADINA
MILTONADINA/DevOPs

unsigned-missing-sig-fixture

Test fixture (F.09) — SKILL.md without an accompanying .sig file. Default install rejects with exit 2; --allow-unsigned --rationale="..." proceeds.

★ 0
MILTONADINA
MILTONADINA/DevOPs

unsigned-mismatched-sig-fixture

Test fixture (F.09) — SKILL.md whose accompanying .sig signs different content. NFR-F3 hash check catches this even with --allow-unsigned.

★ 0
MILTONADINA
MILTONADINA/DevOPs

karpathy-guidelines

Behavioral guidelines that reduce common LLM coding mistakes. Apply whenever writing, modifying, or reviewing code. Don't assume requirements, don't overcomplicate, don't refactor unrelated code, and define success criteria before implementing. Use this skill on every non-trivial coding task to avoid bloat, silent assumptions, and completion-bias.

★ 0
MILTONADINA
MILTONADINA/DevOPs

webhook-idempotency

Defend against double-processing of webhook events across every provider (Stripe, GitHub, Slack, Twilio, SendGrid). Idempotency-key pattern + replay-window enforcement + dedupe-storage strategy. Triggers on any webhook handler authoring (route matching /webhook(s)?/, Stripe-Signature / X-Hub-Signature-256 header references). Defense against OWASP ASI02 (Tool Misuse) -- a replayed webhook that re-triggers a destructive tool is the canonical control-flow-level replay attack. Universal across providers; stack-specific signature verification lives in stack-specific skills.

★ 0
MILTONADINA
MILTONADINA/DevOPs

semgrep-scan

Run Semgrep static analysis to detect insecure code patterns - SQL injection, XSS, path traversal, weak crypto, broken auth, OWASP Top 10 issues. Use on every file change touching security-sensitive code and as part of the tiered security gate. Complements gitleaks (which catches secrets) by catching insecure logic.

★ 0