Skip to content

feat: ACP Handoff skill β€” automatic completion-to-review handoff#35

Merged
dgarson merged 4 commits intoa2a-protocolfrom
merlin/acp-handoff
Feb 23, 2026
Merged

feat: ACP Handoff skill β€” automatic completion-to-review handoff#35
dgarson merged 4 commits intoa2a-protocolfrom
merlin/acp-handoff

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Feb 21, 2026

Summary

Adds the ACP Handoff skill β€” Automatic Completion Protocol for structured handoff from implementation to code review.

When agents complete work, this skill automates:

  • PR creation via gh CLI
  • Reviewer auto-selection based on tier pipeline + squad affinity
  • SLA tracking with escalation (P0: 15min, P1: 30min, P2: 2h, P3: 8h)
  • SQLite-backed handoff state tracking

Files Changed

  • skills/acp-handoff/SKILL.md
  • skills/acp-handoff/scripts/acp-handoff.sh
  • skills/acp-handoff/scripts/acp-status.sh
  • skills/acp-handoff/scripts/acp-escalate.sh
  • skills/acp-handoff/scripts/acp-complete.sh
  • skills/acp-handoff/scripts/tier-config.json
  • skills/acp-handoff/references/spec.md

Priority: P2 | Author: merlin

Phase 1 implementation of the Automatic Completion Protocol (ACP).
When agents complete work, this skill automates:
- PR creation via gh CLI
- Reviewer auto-selection based on tier pipeline + squad affinity
- SLA tracking with escalation (P0: 15min, P1: 30min, P2: 2h, P3: 8h)
- SQLite-backed handoff state tracking
- Companion scripts for status checking, escalation, and completion

Scripts:
- acp-handoff.sh: Main handoff workflow
- acp-status.sh: Query pending/overdue reviews
- acp-escalate.sh: Cron-driven escalation checks
- acp-complete.sh: Mark reviews as done

Requested by David to fix the gap where agents say 'ready for review'
but no PR is opened and no reviewer is assigned.
Detect fork vs upstream remotes and use FORK_OWNER:branch format
for cross-fork PRs. Also handle gh pr create output format
(returns URL string, not JSON).
NEVER open PRs against openclaw/openclaw. Always target dgarson/clawdbot.
Added explicit safety check that blocks any attempt to target upstream.
Also updated WORK_PROTOCOL.md with new Section 6: PR Target Rule.
@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Tim review (P2) complete. I found script-level edge-case defects and fixed them directly on this branch.

βœ… Direct fixes pushed

Commit: 860a4d2b4

Files updated:

  • /Users/openclaw/worktrees/acp-handoff/skills/acp-handoff/scripts/acp-escalate.sh
  • /Users/openclaw/worktrees/acp-handoff/skills/acp-handoff/scripts/acp-handoff.sh

1) acp-escalate.sh robustness fixes

  • Normalize empty sqlite3 -json output to [] (prevents jq --argjson crashes).
  • Removed incorrect early exit on OVERDUE_COUNT==0 so SLA-warning reminders still emit when reviews are approaching SLA.
  • Fixed reminder update loop key from .[].handoffId to .[].id (so reminder_sent_at actually updates).

2) acp-handoff.sh PR parse fix

  • Removed broken PR_JSON dereference path (variable was undefined after URL-based parse).
  • Failure details now report from PR_OUTPUT directly.

βœ… Validation

  • Bash syntax checks passed for all ACP scripts.
  • Reproduced + verified acp-escalate.sh in temp DB scenarios:
    • no overdue + approaching SLA -> emits warning action and sets reminder_sent_at
    • no overdue + no approaching -> returns empty actions cleanly

No additional architectural blockers from my side after these fixes.

@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Starting review β€” Tim

@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Architecture pass complete. Handoff flow is directionally good; please keep escalation boundaries and tier config ownership explicit before merge. β€” Tim

@dgarson dgarson changed the base branch from main to dgarson/fork February 21, 2026 22:37
dgarson added a commit that referenced this pull request Feb 22, 2026
Built by Piper (790 lines):
- Side-by-side comparison of any two agents
- Agent selectors with swap button
- Comparison sections: Identity, Model, Capabilities, Personality, Performance, Working Hours
- Diff highlighting β€” amber ring on cells where values differ
- 'Differences: X' count badge in header
- 4 seed agents: Luis, Xavier, Stephan, Piper
- Default: Luis vs Xavier
- Responsive layout (stacks on narrow viewports)
- Strict TypeScript, full a11y

Build: βœ“ 0 TS errors, 1.43s, 17.10 kB / gzip 3.85 kB
@dgarson dgarson changed the base branch from dgarson/fork to a2a-protocol February 23, 2026 13:56
@dgarson
Copy link
Owner Author

dgarson commented Feb 23, 2026

Architecture Review (Tim)

Target: a2a-protocol βœ“ β€” Correctly targeted.

Content Review:

  • skills/acp-handoff/SKILL.md (215 lines) β€” Detailed skill documentation with usage, scripts, database schema, and tier configuration
  • Defines structured handoff process: PR creation, reviewer assignment (tier-based), notification, workq update, SLA tracking
  • Includes scripts for handoff, status, escalate, complete
  • SQLite schema for handoffs table with indices

Code Quality:

  • Clear separation of scripts and configuration
  • Proper SLA and escalation model per priority
  • Tier pipeline for reviewer selection aligns with WORK_PROTOCOL.md
  • Database design supports querying by status/reviewer/author

Verdict: βœ… LGTM β€” Well-designed skill for automatic completion handoff. Ready to merge.

Merging now.

@dgarson dgarson merged commit 6288ed7 into a2a-protocol Feb 23, 2026
12 of 19 checks passed
@dgarson dgarson deleted the merlin/acp-handoff branch February 23, 2026 14:31
dgarson added a commit that referenced this pull request Feb 24, 2026
* feat: add acp-handoff skill β€” automatic completion-to-review handoff

Phase 1 implementation of the Automatic Completion Protocol (ACP).
When agents complete work, this skill automates:
- PR creation via gh CLI
- Reviewer auto-selection based on tier pipeline + squad affinity
- SLA tracking with escalation (P0: 15min, P1: 30min, P2: 2h, P3: 8h)
- SQLite-backed handoff state tracking
- Companion scripts for status checking, escalation, and completion

Scripts:
- acp-handoff.sh: Main handoff workflow
- acp-status.sh: Query pending/overdue reviews
- acp-escalate.sh: Cron-driven escalation checks
- acp-complete.sh: Mark reviews as done

Requested by David to fix the gap where agents say 'ready for review'
but no PR is opened and no reviewer is assigned.

* fix: handle fork workflow in acp-handoff.sh

Detect fork vs upstream remotes and use FORK_OWNER:branch format
for cross-fork PRs. Also handle gh pr create output format
(returns URL string, not JSON).

* fix: CRITICAL β€” hardcode PR target to origin, block upstream PRs

NEVER open PRs against openclaw/openclaw. Always target dgarson/clawdbot.
Added explicit safety check that blocks any attempt to target upstream.
Also updated WORK_PROTOCOL.md with new Section 6: PR Target Rule.

* fix: harden ACP script edge cases (empty sqlite JSON + PR parsing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant