diff --git a/context/skills/integration-v2/notebook/description.md b/context/skills/integration-v2/notebook/description.md index d289b222..a2b0d244 100644 --- a/context/skills/integration-v2/notebook/description.md +++ b/context/skills/integration-v2/notebook/description.md @@ -4,9 +4,13 @@ Once `posthog-setup-report.md` exists, mirror it into a shareable PostHog notebo so the user has an in-app copy to link and comment on. The notebook is an extra copy, not a replacement — keep the local report file in place. -Call `notebooks-create` through `posthog_exec` with a `title` (e.g. -`PostHog setup (wizard) – `) and `content` set to a single markdown -node that wraps the report verbatim: +First `Read` the finished `posthog-setup-report.md` — don't reconstruct the +report from memory, and don't try to read it before the report step has written +it. + +Then call `notebooks-create` through `posthog_exec` — that exact tool name, no +tool search needed — with a `title` (e.g. `PostHog setup (wizard) – `) +and `content` set to a single markdown node that wraps the report verbatim: ```json { @@ -17,6 +21,13 @@ node that wraps the report verbatim: } ``` +The `markdown` value is a JSON string, so the report's raw contents cannot be +pasted in verbatim: escape every newline as `\n`, every double quote as `\"`, +and every backslash as `\\`, yielding one single-line string. Getting this wrong +is the most common failure in this step — the tool call fails to parse and you +burn attempts re-escaping. If the payload is rejected, fix the escaping; do not +trim or summarize the report to make it fit. + Take the `short_id` from the response, build the URL as `/project//notebooks/`, and emit it on its own line in your final message with this exact marker so the wizard surfaces it: diff --git a/context/skills/integration-v2/report/description.md b/context/skills/integration-v2/report/description.md index 197d9978..7ccb95f6 100644 --- a/context/skills/integration-v2/report/description.md +++ b/context/skills/integration-v2/report/description.md @@ -1,7 +1,10 @@ # Write the setup report Write `posthog-setup-report.md` at the project root summarizing the integration. -It is a new file you create — write it directly, do not read it first. +When the file doesn't exist, write it directly — don't attempt a read first. If +a previous run left one behind, `Read` it, then replace it wholesale (harnesses +refuse to overwrite a file that wasn't read; nothing in the old report is worth +merging). Draw on two sources only: - the run's queue log — `.posthog-wizard-cache/queue.json`, which holds each