Skip to content

feat(handoff): add 'flow handoff <slug>' command#495

Merged
Data-Wise merged 1 commit into
devfrom
feature/flow-handoff-command
Jul 7, 2026
Merged

feat(handoff): add 'flow handoff <slug>' command#495
Data-Wise merged 1 commit into
devfrom
feature/flow-handoff-command

Conversation

@Data-Wise

Copy link
Copy Markdown
Owner

Summary

  • Adds flow handoff <slug>, scaffolding a structured docs/planning/HANDOFF-<slug>.md for transferring context between Claude chat/planning sessions and Claude Code sessions (or across a context reset).
  • Pre-fills Relevant Files from git diff --name-only against a base branch, refuses to overwrite an existing handoff, and can file a GitHub issue (--issue) from the same content.
  • Wired into the flow dispatcher and completions; command reference + spec + proposal docs included.

Test plan

  • tests/e2e-handoff.zsh (7 tests) + tests/dogfood-handoff.zsh — all passing.
  • Full suite: 78 passed, 0 failed, 1 skipped (baseline-matching, external tool absence).

Implements the protocol proposed in docs/planning/PROPOSAL-claude-chat-to-code-handoff.md.

- lib/handoff-helpers.zsh: _flow_handoff() scaffolds docs/planning/HANDOFF-<slug>.md
  from a fixed schema (Summary, Key Decisions, Traps to Avoid, Working Agreements,
  Relevant Files, Open Work, Verification Note, Origin)
- Relevant Files pre-filled from 'git diff --name-only' against base branch
  (default dev, falls back to main)
- Refuses to overwrite an existing handoff for the same slug
- --issue flag files a GitHub issue via gh CLI using the handoff as the body
- Wired into commands/flow.zsh dispatcher and completions/_flow
- docs/commands/handoff.md command reference + mkdocs.yml nav entry
- CHANGELOG.md entry under Unreleased

Tests:
- tests/e2e-handoff.zsh: 7 tests against an isolated temp repo (help, fresh
  slug, overwrite refusal, real-diff pre-fill, empty-diff placeholder,
  --issue-without-gh failure, and a zsh -f regression test for a stray-stdout
  bug hit during prototyping) - all passing
- tests/dogfood-handoff.zsh: real-repo smoke test, self-cleaning artifact -
  passing

Fixes a zsh special-variable collision found during prototyping (local var
named 'fpath' collides with zsh's function-autoload array) by using
git diff --name-only instead of parsing --stat output.
@Data-Wise Data-Wise merged commit de11028 into dev Jul 7, 2026
2 checks passed
Data-Wise pushed a commit that referenced this pull request Jul 7, 2026
PR #495 shipped the command but missed the usual doc surfaces (QUICK-
REFERENCE.md, flow.1, MASTER-API-REFERENCE.md), and its own docs/commands/handoff.md
linked to docs/specs/ which mkdocs excludes from the built site.

- man/man1/flow.1: add handoff to Setup & Diagnostics + an example
- docs/help/QUICK-REFERENCE.md: add Session Handoff section
- docs/reference/MASTER-API-REFERENCE.md: add Handoff Helpers section
- mkdocs.yml: exclude the planning proposal doc from nav (working doc, like the ADHD templates)
- docs/commands/handoff.md: point the spec link at GitHub instead of the excluded specs/ path

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnVugoVjTHRK41krTTMi8L
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