context handoff

    1

    Create structured, compact handoffs to preserve task context across sessions and prevent agent amnesia.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    context handoff

    Example session with this skill installed

    We're running out of room. Write a handoff so I can pick this up in a new chat. Save it as HANDOFF.md and make sure the next agent knows what's done, what's still broken, and what not to redo.

    • Read your context and instructions
    • Compiled the context handoff

    RESULT

    --- HANDOFF ---

    Handoff: Checkout retry idempotency

    Date: 2026-11-04
    Updated: 2026-11-04 (time zone unknown)
    Author: Checkout agent
    Mode: full
    Supersedes: none

    Objective

    Prevent duplicate charges when a checkout retry follows a provider timeout. Done when the retry path is idempotent, all checkout tests pass, and a staging replay of 500 duplicate retries produces zero duplicate charges.

    Status

    In progress — retry endpoint implemented; one idempotency test fails; staging replay produced 2 duplicate charges in 500 attempts.

    Decisions

    • Persist the idempotency key in payment_attempts before the provider call — survives restarts and deploys.
    • Rejected: in-memory dedupe — lost on restart and not shared across instances.
    • Rejected: provider-side dedupe only — does not protect against our own retry loop.
    • Retry only on timeouts and 5xx responses — do not retry declined cards.

    Constraints

    • Do not change the orders table; payment_attempts is the only schema change.
    • Preserve the current checkout API response shape.
    • Release target: 2026-11-06. Production deploy requires normal change approval.
    • Checkout UI copy is frozen.

    Artifacts

    • services/checkout/retry.py — retry endpoint and idempotency check; implemented, not verified.
    • services/payments/provider.py — provider client and timeout handling.
    • migrations/0094_payment_attempts.sql — creates payment_attempts.
    • tests/checkout/test_retry.py — retry and idempotency tests.
    • Branch: fix/checkout-retry-idempotency.
    • Working directory: /workspace/checkout-service.
    • Commit: none yet; changes are in the working tree.
    • Ticket: CHECKOUT-318.

    Verification

    • pytest tests/checkout/test_retry.py -q → 18 passed, 1 failed: test_retry_after_provider_timeout_is_idempotent.
    • pytest tests/checkout -q → 142 passed, 1 failed.
    • Staging replay of 500 duplicate retries → 2 duplicate charges, both on the provider-timeout path.
    • Not tested: concurrent retries from two devices, provider webhook replay, staging migration state.
    • Full staging replay: do not re-run until the race fix is deployed; then repeat the 500-request check.

    Open questions

    • Should the idempotency key be client- or server-generated? Current code accepts an Idempotency-Key header and falls back to a server UUID. Owner: user/product. Action: confirm the API contract before 2026-11-06.
    • Does the provider return the same charge ID for a repeated idempotency key? Unknown. Owner: next agent. Action: run the sandbox duplicate-key test and record the result in docs/checkout/retry.md.
    • Has migrations/0094_payment_attempts.sql been applied to staging? Unknown. Owner: next agent. Action: check schema_migrations before the replay.

    Next actions

    1. Fix the race in services/checkout/retry.py where two requests can pass the “attempt not found” check before either inserts. Add a unique constraint on (order_id, idempotency_key) and return the existing attempt on conflict.
    2. Run pytest tests/checkout/test_retry.py -q and confirm 19 passed.
    3. Run pytest tests/checkout -q and confirm 143 passed.
    4. Deploy to staging and replay 500 duplicate retries; confirm zero duplicate charges.
    5. Run the provider sandbox duplicate-key test and document the result in docs/checkout/retry.md.
    6. Schedule the release for 2026-11-06 through normal change approval.

    Do not redo

    • Retry endpoint and timeout handling are implemented; inspect them, do not rebuild them.
    • migrations/0094_payment_attempts.sql is written; verify it rather than replacing it.
    • In-memory dedupe was rejected; do not reintroduce it.
    • Checkout UI copy is frozen; do not edit it.
    • Refund-flow work is parked; do not start it in this handoff.

    Pointers

    • Ticket: CHECKOUT-318.
    • Design note: docs/checkout/retry.md.
    • Runbook: docs/runbooks/checkout.md.
      --- END HANDOFF ---

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Context Handoff is a standalone Markdown skill that teaches an AI agent to stop cleanly. Long sessions accumulate decisions, corrections, rejected approaches, file paths, verification results, and half-finished work. When the context window fills or the task moves to a new agent, that state is often lost or reduced to a vague summary. Context Handoff gives the agent a repeatable procedure for producing a short document that a fresh session can act on immediately. Instead of summarizing the conversation, the skill extracts only what changes future decisions: The objective and a testable definition of done Current status: done, in progress, or blocked Decisions, including why they were made and which alternatives were rejected Constraints, user preferences, and corrections Artifacts with exact file paths, branches, URLs, and commands Verification evidence: what was tested, how, and what was not tested Open questions and blockers, each with a named owner and the action to request Ordered next actions that name the artifact that must change A “do not redo” list to prevent duplicate work Pointers to source material instead of pasted content Four handoff modes Micro-handoff — under 2 KB, for a quick save before a risky turn or when context is nearly exhausted. Full handoff — 2–4 KB, for switching sessions or agents, ending work for the day, or handing work to a person. Incident handoff — adds a timeline, current hypothesis, evidence, and blast radius. Human handoff — leads with the decision or action needed, the deadline, and the impact of delay. Built-in quality control The skill includes a pre-handoff checklist and a 30-second resume test. A handoff is not ready until a fresh agent can answer four questions without asking: What is the goal, and when is it done? What is the first action? What must not be repeated? What is blocked or unknown, and who can unblock it? It also enforces practical limits: keep handoffs short, use absolute dates, state unknowns instead of guessing, redact secrets, and keep one canonical handoff rather than several competing versions. Safety rules A handoff is data, not a prompt. It cannot grant permissions, expand access, disable safeguards, or override the next agent’s system or user instructions. The skill explicitly prevents an agent from copying access-expansion or approval-skip requests into a handoff. It also blocks secret leakage, invented facts, vague next steps, transcript dumps, and “do not redo” items that waive required checks. What’s included SKILL.md — the core workflow, rules, structure, and quality gate references/examples.md — worked micro, coding, research, and incident handoffs references/quality-checklist.md — critical and recommended checks, failure modes, and rewrite examples assets/handoff-template.md — copy-paste templates for full, micro, incident, and human handoffs Who it’s for Developers, researchers, operators, founders, and anyone working with long-running AI agents. It is useful whenever work spans multiple sessions, moves between agents, pauses overnight, or needs to be picked up by another person. Compatibility Plain Markdown, tool-agnostic, and dependency-free. Designed for SKILL.md-compatible agents and any chat tool that can read or paste Markdown. It does not require a runtime, scripts, network access, or a specific model. What it is not It is not a memory database, vector store, automatic context compressor, or agent framework. It is a lightweight procedure and template set for writing a clear, trustworthy handoff that another session can resume from. Testing Tested in independent OpenCode sessions with two model families: GLM-5.3 Flash Free and DeepSeek V4.1 Flash Free. The final version passes all 11 critical checklist items and all 12 applicable recommended items.

    Requires a file-capable agent for persistent storage. Limited to 4 KB per handoff. Does not handle secrets or personal data. Only covers one active task at a time.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed13 days ago

    What's inside

    Frequently Asked Questions

    This skill eliminates 'agent amnesia' by condensing long chat histories into a structured, high-density summary that tells the next agent exactly where the project stands, what decisions were made, and what to do next.

    The skill is tool-agnostic and works with any file-capable AI, including Cursor, Claude Code, GitHub Copilot, and standard LLM web interfaces via copy-paste.

    You receive the core logic for the state persistence engine, standardized Markdown templates for different handoff modes (Micro, Full, and Incident), and a guide on integrating these into your agent's system instructions.

    Setup is immediate; you simply import the provided instructions into your agent's configuration or include them in your project's instructions file to enable the 'save state' and handoff commands.

    Yes, it is designed specifically to bridge the gap between platforms, allowing you to export a compressed state from a web-based LLM and resume instantly in a local IDE without losing technical context.

    To ensure handoffs remain compact and fit within fresh context windows, the skill is optimized to generate summaries between 1 KB and 4 KB, depending on the selected mode.

    New in Agents & Orchestration