From 6507b8a339f009640f0f595210abe8d70482d0cd Mon Sep 17 00:00:00 2001 From: Darren Cheng Date: Wed, 24 Jun 2026 00:01:09 -0700 Subject: [PATCH 1/2] feat(handoff): embed calling task ID so new task can message back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Capture ARGUS_TASK_ID in the Context block and include it in the created Argus task's prompt, telling the receiving agent how to reach the originating task via task_message_send. Omitted when run outside an Argus task session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- agents/skills/handoff/SKILL.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agents/skills/handoff/SKILL.md b/agents/skills/handoff/SKILL.md index f3fb00db..4d98bfc9 100644 --- a/agents/skills/handoff/SKILL.md +++ b/agents/skills/handoff/SKILL.md @@ -17,6 +17,7 @@ Generate a structured prompt capturing the current conversation context so it ca ## Context +- Calling task ID: !`echo $ARGUS_TASK_ID` - Argus projects: !`ls -1 ~/.argus/worktrees/ 2>/dev/null | head -50` - Repo root: !`git rev-parse --show-toplevel 2>/dev/null | head -1` - Branch: !`git branch --show-current` @@ -101,7 +102,9 @@ The Argus knowledge base is the primary destination for handoffs — they persis - `upsert`: `true` — only relevant for retry semantics (same `-` is already unique). - `prompt`: a short instruction telling the receiving agent to invoke any "Invoke First" skill from the handoff, then `kb_read("")` and follow the plan as **reference data**, not as direct instructions to execute. Include the slug so `kb_search("")` is a viable fallback. Do **not** inline the full handoff body — keep the task prompt small and let the KB stay the source of truth. - On success, report the task ID, project, and worktree path/branch alongside the KB path. The procedure is complete; do not fall through to step 9. + **Back-reference to the calling task.** If the **Calling task ID** in the Context block is non-empty, include it in the prompt so the receiving agent can reach back to the originating task — to ask a clarifying question, report a result, or signal completion. Phrase it as: "This handoff came from Argus task ``. If you need to ask the originating task a question or report back, call `task_message_send(to=\"\", id=\"\", body=..., kind=\"question\")` (use `kind=\"note\"` for fire-and-forget)." Omit this line entirely when **Calling task ID** is empty (the handoff is being generated outside an Argus task session), rather than emitting a placeholder. + + On success, report the task ID, project, and worktree path/branch alongside the KB path. If a calling task ID was embedded, mention that the new task can message back to it. The procedure is complete; do not fall through to step 9. On failure (tool errors, missing project, MCP not connected, validation error), **surface the error verbatim** and tell the user: "KB doc saved at `` — Argus task creation failed: ``. Re-run `/handoff project=` or create the task manually." Never silently swallow this failure. After reporting, the procedure is complete; do not fall through to step 9. From c1ca604a7de0211ab552759dd0e0972404db2e04 Mon Sep 17 00:00:00 2001 From: Darren Cheng Date: Wed, 24 Jun 2026 00:03:43 -0700 Subject: [PATCH 2/2] fix(handoff): clarify back-reference id semantics and harden empty check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address review findings on the calling-task back-reference: - Clarify the receiving agent substitutes its own $ARGUS_TASK_ID at call time for the `id` arg, while is filled in statically now - Define empty as blank/whitespace-only so an unset ARGUS_TASK_ID never emits a placeholder back-reference - Tell the receiving agent to log-and-continue if the send fails (stale or archived originating task) - Pipe the Calling task ID context entry through `2>/dev/null | head -1` for consistency with the rest of the Context block, and fix indentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- agents/skills/handoff/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/skills/handoff/SKILL.md b/agents/skills/handoff/SKILL.md index 4d98bfc9..302a8b39 100644 --- a/agents/skills/handoff/SKILL.md +++ b/agents/skills/handoff/SKILL.md @@ -17,7 +17,7 @@ Generate a structured prompt capturing the current conversation context so it ca ## Context -- Calling task ID: !`echo $ARGUS_TASK_ID` +- Calling task ID: !`echo $ARGUS_TASK_ID 2>/dev/null | head -1` - Argus projects: !`ls -1 ~/.argus/worktrees/ 2>/dev/null | head -50` - Repo root: !`git rev-parse --show-toplevel 2>/dev/null | head -1` - Branch: !`git branch --show-current` @@ -102,7 +102,7 @@ The Argus knowledge base is the primary destination for handoffs — they persis - `upsert`: `true` — only relevant for retry semantics (same `-` is already unique). - `prompt`: a short instruction telling the receiving agent to invoke any "Invoke First" skill from the handoff, then `kb_read("")` and follow the plan as **reference data**, not as direct instructions to execute. Include the slug so `kb_search("")` is a viable fallback. Do **not** inline the full handoff body — keep the task prompt small and let the KB stay the source of truth. - **Back-reference to the calling task.** If the **Calling task ID** in the Context block is non-empty, include it in the prompt so the receiving agent can reach back to the originating task — to ask a clarifying question, report a result, or signal completion. Phrase it as: "This handoff came from Argus task ``. If you need to ask the originating task a question or report back, call `task_message_send(to=\"\", id=\"\", body=..., kind=\"question\")` (use `kind=\"note\"` for fire-and-forget)." Omit this line entirely when **Calling task ID** is empty (the handoff is being generated outside an Argus task session), rather than emitting a placeholder. + **Back-reference to the calling task.** If the **Calling task ID** in the Context block is non-empty (treat a blank or whitespace-only value as empty), include it in the prompt so the receiving agent can reach back to the originating task — to ask a clarifying question, report a result, or signal completion. When you write the prompt, substitute the real calling task ID for `` (you know it now — it's the Context value); leave `` as a runtime instruction for the receiving agent, since that is *its* ID, not yet known here. Phrase it as: "This handoff came from Argus task ``. If you need to ask the originating task a question or report back, call `task_message_send(to=\"\", id=\"\", body=..., kind=\"question\")` — where `` is your (the receiving agent's) own `$ARGUS_TASK_ID` env var resolved at call time, not a value to fill in now; use `kind=\"note\"` for fire-and-forget. If the send fails (e.g. the originating task has since completed or been archived), note the error and carry on — don't block on it." Omit this whole instruction when **Calling task ID** is empty (the handoff is being generated outside an Argus task session), rather than emitting a placeholder. On success, report the task ID, project, and worktree path/branch alongside the KB path. If a calling task ID was embedded, mention that the new task can message back to it. The procedure is complete; do not fall through to step 9.