home / skills / chachamaru127 / claude-code-harness / handoff

handoff skill

/skills/handoff

This skill handles handoff between PM and implementation, producing completion reports, auto-fixes, and ready handoff materials.

npx playbooks add skill chachamaru127/claude-code-harness --skill handoff

Review the files below or copy the command above to add this skill to your agents.

Files (5)
SKILL.md
5.1 KB
---
name: handoff
description: "PMへの完了報告やエージェント間バトンタッチ。スムーズな引き継ぎを実現。Use when user mentions '/handoff', completion report, handoff to Cursor/OpenCode, auto-fix, or reporting to PM. Do NOT load for: casual completion statements, progress chat, informal status updates."
description-en: "Completion report to PM and agent handoff. Smooth transition achieved. Use when user mentions '/handoff', completion report, handoff to Cursor/OpenCode, auto-fix, or reporting to PM. Do NOT load for: casual completion statements, progress chat, informal status updates."
description-ja: "PMへの完了報告やエージェント間バトンタッチ。スムーズな引き継ぎを実現。Use when user mentions '/handoff', completion report, handoff to Cursor/OpenCode, auto-fix, or reporting to PM. Do NOT load for: casual completion statements, progress chat, informal status updates."
allowed-tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
argument-hint: "[cursor|opencode|auto-fix]"
---

# Handoff Skill

PM-実装役間のハンドオフとワークフロー遷移を管理するスキル。

## 機能詳細

| 機能 | 詳細 |
|------|------|
| **PM→実装役** | See [references/handoff-to-impl.md](references/handoff-to-impl.md) |
| **実装役→PM** | See [references/handoff-to-pm.md](references/handoff-to-pm.md) |
| **レビュー指摘自動修正** | See [references/auto-fixing.md](references/auto-fixing.md) |
| **コミット実行** | See [references/execute-commit.md](references/execute-commit.md) |

## Quick Reference

- "**Cursor に完了報告を書いて**" → `/handoff cursor`
- "**OpenCode にハンドオフ**" → `/handoff opencode`
- "**レビュー指摘を自動修正**" → `/handoff auto-fix`
- "**変更内容とテスト結果を含めて**" → Includes git diff and test results

## Prerequisites

> **This command should only run after harness-review APPROVE**

| Condition | Required | Check Method |
|-----------|----------|--------------|
| harness-review completed | Yes | Review result is APPROVE |
| No Critical/High issues | Yes | All fixed |
| Implementation complete | Yes | Plans.md tasks completed |

**Why handoff requires review approval:**
- PM receives unreviewed changes otherwise
- Quality not assured
- Breaks `/work` flow (implement → review → fix → OK → handoff)

## Usage

```bash
/handoff cursor     # Handoff to Cursor
/handoff opencode   # Handoff to OpenCode
```

---

## Execution Flow

### Step 1: Identify Completed Tasks

- Check Plans.md checkboxes
- Summarize work done

### Step 2: Update Plans.md

```markdown
# Before
- [ ] Task name `pm:依頼中`

# After
- [x] Task name `cc:完了` (YYYY-MM-DD)
```

### Step 3: Gather Changes

```bash
git status -sb
git diff --stat
```

### Step 4: Check CI/CD (if applicable)

```bash
gh run list --limit 3
```

### Step 4.5: Unified Memory Finalize(必須)

完了報告の前に、共通メモリへ最終状態を確定する:

```text
harness_mem_record_checkpoint(session_id, title, content, tags?, privacy_tags?)
harness_mem_finalize_session(session_id, summary_mode="standard")
```

これにより Claude Code / Codex / OpenCode のどこからでも同一セッションを再開できる。
`session_id` は `$CLAUDE_SESSION_ID` → `.claude/state/session.json` の `.session_id` の順で取得する。
`harness_mem_sessions_list(project, limit=1)` の先頭利用は read-only(resume確認)に限定し、handoff時の `record_checkpoint` / `finalize_session` では明示 `session_id` が無い場合に失敗扱いとする。
`harness_mem_finalize_session` が失敗している場合は handoff を確定しない。

### Step 5: Generate Report

## Output Format

```markdown
## Completion Report

### Summary
- (1-3 lines describing what was done)

### Completed Tasks
- **Task Name**: [Task description]

### Changed Files
| File | Changes |
|------|---------|
| `path/to/file1` | [Summary] |
| `path/to/file2` | [Summary] |

### Verification Results
- [x] Build success
- [x] Tests passed
- [x] Manual verification complete

### Risks / Notes
- (If any)

### Next Actions (for PM)
1. [ ] [What PM should do next]
2. [ ] [Optional items]
```

---

## /work Integration Flow

```
/work execution
    ↓
Phase 1: Parallel implementation
    ↓
Phase 2: harness-review loop
    ├── NG (Critical/High) → Fix → Re-review
    └── OK (APPROVE) → Phase 3
    ↓
Phase 3: Auto-commit (if configured)
    ↓
Phase 4: This skill runs ← First time handoff happens
```

> `/work` automatically calls this skill in Phase 4.
> When running manually, always do so after harness-review APPROVE.

---

## Target-Specific Notes

### Handoff to Cursor

- Plans.md markers use `cc:完了` (Japanese)
- Report format optimized for Cursor PM workflow
- Includes context for `/review-cc-work` command

### Handoff to OpenCode

- Similar format to Cursor
- Compatible with OpenCode's command structure
- Works with multi-LLM development workflow

## Related Skills

- `work` - Main implementation workflow
- `harness-review` - Code review
- `setup` - Project setup (includes 2-Agent workflow)

Overview

This skill manages completion reports and handoffs between PM and implementation agents to ensure smooth transitions and clear ownership. It packages final changes, verification results, and next actions into a structured completion report and triggers target-specific delivery (Cursor or OpenCode) or automated fixes. Use only after a successful harness-review APPROVE to maintain quality and workflow integrity.

How this skill works

The skill inspects the implementation state: Plans.md task checkboxes, git status/diff, CI/CD results, and test/verifications. It compiles a Completion Report containing a brief summary, completed tasks, changed files with summaries, verification results, risks/notes, and PM next actions. Depending on the command, it formats and delivers the report for Cursor or OpenCode, or runs auto-fix and commit steps when configured.

When to use it

  • User issues the /handoff command explicitly (e.g., /handoff cursor, /handoff opencode, /handoff auto-fix).
  • You have a harness-review with result APPROVE and no remaining critical/high issues.
  • Implementation tasks in Plans.md are marked complete and you are ready to notify PM or switch agents.
  • When you need a structured completion report with diffs, test results, and recommended next actions.

Best practices

  • Run only after harness-review APPROVE to avoid handing off unreviewed work.
  • Ensure Plans.md checkboxes accurately reflect completed tasks before running the handoff.
  • Include git diff summary and recent CI/test results for transparent verification.
  • Keep the Completion Report concise: 1–3 line summary, clear task list, changed files table, verification checklist, and explicit PM next actions.
  • Use the auto-fix option only when review issues are limited and clearly automatable; document any automated changes in the report.

Example use cases

  • Finalizing a feature: mark tasks done, confirm CI/tests, then run /handoff cursor to notify the PM with a completion report.
  • Handing work to OpenCode for multi-LLM continuation using /handoff opencode with compatible report formatting.
  • After harness-review APPROVE, run /handoff auto-fix to apply minor automated fixes, commit changes, and produce an updated completion report.
  • Manually trigger handoff when a parallel /work cycle completes Phase 3 and ownership must transition to PM or another agent.

FAQ

Can I run handoff before review approval?

No. The skill requires harness-review APPROVE to prevent sending unreviewed or low-quality changes to PM or downstream agents.

What does the report include by default?

A short summary, completed tasks, changed files with brief summaries, verification results (build/tests), risks/notes, and explicit next actions for the PM.