Skip to content

feat(integration-v2): publish the handoff via publish_handoff in one call - #303

Merged
gewenyu99 merged 3 commits into
mainfrom
posthog-code/publish-handoff-skill
Jul 31, 2026
Merged

feat(integration-v2): publish the handoff via publish_handoff in one call#303
gewenyu99 merged 3 commits into
mainfrom
posthog-code/publish-handoff-skill

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

The integration handoff relies on a passive path: the agent Writes a report file into the user's project and a wizard-side watcher mirrors it into the session. The file is an artifact nobody asked for, and the watcher is one more moving part that can drift.

Changes

Coordinated with PostHog/wizard#1045, which removes the handoff watcher and adds a publish_handoff wizard tool — one explicit call that publishes the report markdown to the wizard session. The notebook remains the agent's job, created via notebooks-create as before.

  • integration-v2 report agent + skill: compose the report from the run's queue log and event plan, one publish_handoff call, then mirror the same markdown into the notebook ([NOTEBOOK_URL] marker kept). No report file; Write stays out of allowedTools.
  • integration-v2-notebook skill: retained — now takes the composed report markdown directly instead of reading a file.
  • integration (v1) conclude step: same treatment; posthog-setup-report.md is no longer written.
  • quack: ends with a publish_handoff call — the cheap end-to-end test of the tool.

events-audit's notebook flow and the self-driving skills are intentionally untouched.

Release order

The wizard change (PostHog/wizard#1045) must be released first — skills are fetched at runtime, so this PR lands only once the tool exists in the field.

Test plan

npm test (137 pass) and npm run build (integration-v2-notebook back in the manifest; the report, conclude, and quack bundles carry the new instructions).


Created with PostHog Code

…call

Coordinated with PostHog/wizard, which adds a publish_handoff wizard tool that
writes the report file, mirrors it into a PostHog notebook, and pushes
handoff_text to the session in one deterministic host-side call. The integration-
v2 report step now calls that tool with the full report markdown instead of
Write-ing the file and then driving notebooks-create by hand; the notebook step
becomes a no-op confirmation. The events-audit notebook step (a richer
ProseMirror artifact) is left intact for now as a follow-up.

Generated-By: PostHog Code
Task-Id: 42ae71e9-0c89-4553-97a6-53c62e784fbb
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue
  • /wizard-ci self-driving

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit

Results will be posted here when complete.

…he notebook skill

The wizard now ships a publish_handoff tool: one call takes the full report
markdown, mirrors it into a shareable PostHog notebook (direct API,
credentials from the wizard session), and publishes it to the wizard session
as handoff_text. The notebook is no longer produced by the agent driving
notebooks-create through MCP, and no report file is written to the project.

- integration-v2-notebook skill: deleted (superseded by the tool).
- integration-v2 report agent + skill: compose the report from the run's
  queue log and event plan, then one publish_handoff call. Write dropped
  from allowedTools; no [NOTEBOOK_URL] marker.
- quack: publishes a short duck report via publish_handoff — the cheap
  end-to-end test of the tool without a real integration.

events-audit's notebook flow (a rich multi-node ProseMirror artifact) is
intentionally untouched.

Release order: the wizard change (PostHog/wizard#1045) must be released
first — skills are fetched at runtime, so this lands only once the tool
exists in the field.

Generated-By: PostHog Code
Task-Id: 42ae71e9-0c89-4553-97a6-53c62e784fbb
…ish_handoff only

The wizard's publish_handoff tool now does exactly one thing: publish
the report markdown to the wizard session. The notebook stays the
agent's job, created via notebooks-create as before.

- integration-v2-notebook skill restored; it now takes the composed
  report markdown directly (there is no file to Read) and keeps the
  notebooks-create transport and [NOTEBOOK_URL] marker.
- integration-v2 report agent + skill: compose the report, one
  publish_handoff call, then mirror into the notebook. No report file
  is written; Write stays out of allowedTools.
- integration (v1) conclude step: same treatment — compose in memory,
  publish_handoff, notebook. The local posthog-setup-report.md is gone.
- quack: keeps its publish_handoff ending as the cheap end-to-end test,
  with the notebook claims removed from the tool contract.

Release order unchanged: PostHog/wizard#1045 ships the tool first;
skills are fetched at runtime, so this lands only after that release.

Generated-By: PostHog Code
Task-Id: 6316a1d9-7a35-4a2b-8525-566e9931bcac
@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Real run, 1-file Express app, project 228144. This branch's skills + agents served from a local dev server on :8765, wizard side #1045 b15323fe.

28-outro

Notebook created on this path — cnQzg9rC — fetched back out:

short_id:       cnQzg9rC
title:          PostHog setup (wizard) – wz-express-app
node types:     [ph-markdown-notebook]
markdown chars: 2540
first line:     # PostHog post-wizard report

Second run through the wizard's headless route produced its own: rxswIWNn.

One publish_handoff call, no report file left in the project:

publish_handoff: Handoff published (2541 chars)
store.setHandoffText: 2541 chars
{ "runPhase": "completed", "skillsComplete": true, "newDeps": ["posthog-node"],
  "screenPath": ["intro","auth","run","outro","mcp","slack-connect","keep-skills"] }
Full run — 31 frames

01-intro

02-auth

03-run

04-run

05-run

06-run

07-run

08-run

09-run

10-run

11-run

12-run

13-run

14-run

15-run

16-run

17-run

18-run

19-run

20-run

21-run

22-run

23-run

24-run

25-run

26-run

27-run

28-outro

29-mcp

30-slack-connect

31-keep-skills

Comment on lines +1 to +9
# Compose and publish the setup report

Compose the full setup report as markdown, then publish it in **one**
`publish_handoff` call — that call is how the report reaches the user's wizard
session. Do not write a report file. The same markdown is then mirrored into a
shareable PostHog notebook (see the notebook skill), whose URL you emit with
the `[NOTEBOOK_URL]` marker.

## Sources

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can give it a few test runs to see how it works in prod. but if it works, let's reuse this prompting across all context mill skills

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a stacked PR for this. This is also backward compatible for now (we kept the notebooks separate as an agent driven MCP call like before). If we like this direction we can move every skill to this

@gewenyu99
gewenyu99 merged commit f399bc2 into main Jul 31, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants