Skip to content
← Public packages

@hypercubed/handoff

Agent handoff queue via storage — any agent to any agent, use your own harness name

FollowFork

Files

SKILL.md

33 lines · 2.1 KB · Markdown

Pickup

Continue work that another agent handed off through Kody @hypercubed/handoff. Approval comes first: read and show the task, and only claim it after the user says go.

Steps

  1. Read, do not claim. Call getTask({ taskId }) with the id from the user's message. If the task is missing or its status is not pending, stop and tell the user (include the status and claimedBy if it is already claimed).
  2. Show it and wait. Present the title, createdBy, forAgent, priority, tags, and the full prompt. Then stop. Do nothing else until the user approves.
  3. Claim by id. After approval, call claimTask({ taskId, agentId }) where agentId is your own harness name. Keep the sessionName it returns and send it on later calls.
  4. Orient before acting. Open the references the prompt lists. Check the stated repo, branch, and commit against what you actually have. If the working state differs from what the prompt describes, tell the user before changing anything. Load any suggested skills.
  5. Do the work described in the prompt. Stay within its stated scope.
  6. Close it. Call completeTask({ taskId, result }) with a short result: what you did, what changed, and where to find it. If you could not finish, use status: "failed" and put the reason in result.

Calling it

Run through Kody execute:

import getTask from 'kody:@hypercubed/handoff/getTask'
import claimTask from 'kody:@hypercubed/handoff/claimTask'
import completeTask from 'kody:@hypercubed/handoff/completeTask'

export default async function main(params: { taskId: string; harnessName: string; step: 'read' | 'claim' | 'complete'; result?: string; failed?: boolean }) {
	if (params.step === 'read') return getTask({ taskId: params.taskId })
	if (params.step === 'claim') return claimTask({ taskId: params.taskId, agentId: params.harnessName })
	return completeTask({ taskId: params.taskId, result: params.result, status: params.failed ? 'failed' : 'completed' })
}