---
name: handoff-feature
description: Generates a feature handoff document in .handoff/ capturing files changed, shared artifacts, non-obvious decisions, and next feature. Use at the end of a feature build, or standalone after completing work that needs a handoff for the next session.
metadata:
  category: Handoff
---

# Skill: Handoff Feature

Writes a handoff document so the next session (or next feature) starts with clean, minimal context — capturing only what is not obvious from reading the code.

## When to use

- As the final step of `/build-feature` (mandatory there)
- Standalone, after finishing a feature that was built outside the `/build-feature` flow
- Before `/compact` or starting a new session on the same project

## Prerequisites

- Feature work completed (commit made, or at least staged and ready)
- Project root is a humand-create-app project

## Inputs

- **`paths`** *(optional)* — explicit list of files or folders that belong to this feature (e.g. `src/pages/Orders/`). Used when the project wasn't built via `/build-feature` and the git diff may include unrelated changes or nothing at all. If omitted, the skill resolves files from `git diff --name-only`.

## Steps

### 1. Gather context

Collect from the current session:
- Module name, screen name, feature name, order number
- Commit hash + message (if already committed)
- Notion feature record link (if applicable)
- Files created and files modified:
  - If `{paths}` provided: list files under those paths (`find {paths} -type f`)
  - Otherwise: `git diff --name-only` + `git diff --name-only --diff-filter=A` for new files
- Shared artifacts: contexts, types, services, hooks, reusable components created in this feature
- Non-obvious decisions made during the build

If anything is missing, ask the user before writing.

### 2. Write the handoff document

Follow `templates/HANDOFF-TEMPLATE.md` (sibling to this SKILL.md).

Write to `.handoff/feature-{order}-{screen-kebab}.md` in the project root.
Example: `.handoff/feature-01-order-list.md`.

Keep it minimal. Omit "Shared artifacts" if nothing was shared. Omit "Non-obvious decisions" if none.

### 3. Ask about context cleanup

> Feature lista. ¿Limpiamos el contexto antes de seguir con la siguiente? (sí/no, default: sí)

- **If yes (default)**: run `/compact` and then ask `¿Seguimos con la siguiente pantalla?`
- **If no**: skip compact and ask `¿Seguimos con la siguiente pantalla, o querés ajustar algo de esta antes?`

## How the handoff is consumed

At the start of a `/build-feature`, if files exist in `.handoff/`:
1. Read **only the latest** handoff (highest order number)
2. Pay attention to **Shared artifacts** and **Non-obvious decisions**
3. Older handoffs are unnecessary — the relevant parts are cumulative in the latest
