$npx -y skills add pulumi/agent-skills --skill pulumi-neo-handoffHand off the current thread to a new Pulumi Neo task as a one-way transfer. Use when the user explicitly asks to hand off, send, transfer, or continue current work in Pulumi Neo (e.g. "hand this to Neo", "continue in Neo", "/neo-handoff"). Do not load when the user only mentions
| 1 | # Pulumi Neo Handoff |
| 2 | |
| 3 | Transfer the current in-progress work to a new Pulumi Neo task. This is a one-way handoff: control passes to Neo and does not return to the calling agent. |
| 4 | |
| 5 | ## Calling agent behavior |
| 6 | |
| 7 | When this skill activates, act as a handoff coordinator, not the operator: |
| 8 | |
| 9 | - Do not narrate the handoff turn-by-turn. The user has decided; carry it out quietly. |
| 10 | - Do not paste the assembled prompt body into chat. Show only the temp file path so the user can inspect on demand. |
| 11 | - Do not continue working on the task after launching. Exit cleanly once the task URL is returned. |
| 12 | |
| 13 | ## What gets transferred |
| 14 | |
| 15 | The Neo task receives a single opening prompt with three sections: |
| 16 | |
| 17 | 1. **Goal** — one sentence describing what Neo should do next. |
| 18 | 2. **Repository pointers** — repo root, branch, working directory, working-tree state, and 3 to 5 files most relevant to the in-progress work. |
| 19 | 3. **Conversation summary** — a compact account of what has been discussed, decided, and left open. |
| 20 | |
| 21 | Do not include diffs, full file contents, or tool output. Neo sees the local working tree directly (including uncommitted changes); duplicating that content wastes Neo's opening context. |
| 22 | |
| 23 | ## Workflow |
| 24 | |
| 25 | ### 0. Preflight |
| 26 | |
| 27 | Verify the CLI is available before drafting anything: |
| 28 | |
| 29 | ```bash |
| 30 | command -v pulumi >/dev/null || { echo "pulumi CLI not installed"; exit 1; } |
| 31 | pulumi neo --help >/dev/null 2>&1 || { echo "pulumi neo unavailable — run 'pulumi login' or upgrade the CLI"; exit 1; } |
| 32 | ``` |
| 33 | |
| 34 | If preflight fails, surface the error to the user and stop. Do not assemble the prompt only to fail at launch. |
| 35 | |
| 36 | ### 1. Determine the goal |
| 37 | |
| 38 | The goal is one sentence describing what Neo should do next. If the user's handoff message contains it ("hand this off to Neo and apply the staging migration"), use it directly. Otherwise ask once: "What would you like Neo to do next?" |
| 39 | |
| 40 | Do not restate the goal back for confirmation — the handoff should feel seamless, and if Neo receives a misread goal the user can redirect inside the Neo task. |
| 41 | |
| 42 | ### 2. Gather repository context |
| 43 | |
| 44 | Capture the canonical repo pointer and branch state: |
| 45 | |
| 46 | ```bash |
| 47 | git rev-parse --show-toplevel # repo root (canonical pointer) |
| 48 | git rev-parse --abbrev-ref HEAD # branch; returns "HEAD" if detached |
| 49 | git status --short # working-tree summary |
| 50 | ``` |
| 51 | |
| 52 | If `git rev-parse --show-toplevel` fails the directory is not a git repo — omit the Repository section and note the working directory only. Neo can still operate, but its repo context will be limited. |
| 53 | |
| 54 | If the branch reads `HEAD`, record the commit SHA and label the entry "detached at `<sha>`". |
| 55 | |
| 56 | Identify 3 to 5 files most relevant to the in-progress work from the conversation (files read, edited, or repeatedly discussed). If the conversation does not clearly identify files, list none rather than guessing — wrong files mislead Neo more than missing files do. |
| 57 | |
| 58 | ### 3. Draft the conversation summary |
| 59 | |
| 60 | Write a compact summary against the structure below. Sections with nothing useful to say should be omitted, not padded. |
| 61 | |
| 62 | ``` |
| 63 | ## What's been done |
| 64 | <bullets: decisions made, code changed, dead ends ruled out> |
| 65 | |
| 66 | ## Open questions |
| 67 | <bullets: things the user has not resolved> |
| 68 | |
| 69 | ## Next step |
| 70 | <one or two sentences describing what Neo should do first> |
| 71 | ``` |
| 72 | |
| 73 | Target ~400 words for the summary. Compress aggressively. The goal is to give Neo enough to pick up cleanly, not to replay the conversation. |
| 74 | |
| 75 | ### 4. Assemble the prompt and write to a temp file |
| 76 | |
| 77 | Combine the three sections into a single markdown document. Use `mktemp` for a portable temp path: |
| 78 | |
| 79 | ```bash |
| 80 | PROMPT_FILE="$(mktemp -t neo-handoff.XXXXXX.md)" |
| 81 | ``` |
| 82 | |
| 83 | Shape: |
| 84 | |
| 85 | ```markdown |
| 86 | # Goal |
| 87 | <one-sentence goal> |
| 88 | |
| 89 | # Repository |
| 90 | - Root: <repo root> |
| 91 | - Branch: <branch or "detached at <sha>"> |
| 92 | - Working directory: <cwd> |
| 93 | - Working tree: <clean | dirty> |
| 94 | - Files in play: |
| 95 | - <file 1> |
| 96 | - <file 2> |
| 97 | |
| 98 | # Conversation summary |
| 99 | <summary from step 3> |
| 100 | ``` |
| 101 | |
| 102 | ### 5. Launch |
| 103 | |
| 104 | Print the temp file path with a one-line size summary so the user can inspect on demand: |
| 105 | |
| 106 | ``` |
| 107 | Prompt written to <PROMPT_FILE> (<line count> lines, <byte count> bytes). |
| 108 | Launching Neo task... |
| 109 | ``` |
| 110 | |
| 111 | Invoke the CLI: |
| 112 | |
| 113 | ```bash |
| 114 | pulumi neo "$(cat "$PROMPT_FILE")" |
| 115 | ``` |
| 116 | |
| 117 | `pulumi neo` accepts the prompt as a single positional argument; it has no `--file` flag, and stdin redirection launches the TUI instead of consuming the prompt. The `"$(cat ...)"` form captures the file's bytes as data (the shell does not re-evaluate `$`, backticks, or `\` inside command substitution) and passes them as one argument. Do not "fix" this to `pulumi neo --file ...` or `pulumi neo < ...` — |