@agent-native/recap-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +10 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +3 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/openai-compatible-endpoint.d.ts +3 -0
  10. package/dist/openai-compatible-endpoint.d.ts.map +1 -0
  11. package/dist/openai-compatible-endpoint.js +23 -0
  12. package/dist/openai-compatible-endpoint.js.map +1 -0
  13. package/dist/plan-blocks.d.ts +19 -0
  14. package/dist/plan-blocks.d.ts.map +1 -0
  15. package/dist/plan-blocks.js +96 -0
  16. package/dist/plan-blocks.js.map +1 -0
  17. package/dist/plan-publish-store.d.ts +62 -0
  18. package/dist/plan-publish-store.d.ts.map +1 -0
  19. package/dist/plan-publish-store.js +128 -0
  20. package/dist/plan-publish-store.js.map +1 -0
  21. package/dist/pr-visual-recap-workflow.d.ts +3 -0
  22. package/dist/pr-visual-recap-workflow.d.ts.map +1 -0
  23. package/dist/pr-visual-recap-workflow.js +3 -0
  24. package/dist/pr-visual-recap-workflow.js.map +1 -0
  25. package/dist/recap.d.ts +565 -0
  26. package/dist/recap.d.ts.map +1 -0
  27. package/dist/recap.js +3877 -0
  28. package/dist/recap.js.map +1 -0
  29. package/dist/skill-content/connection.d.ts +2 -0
  30. package/dist/skill-content/connection.d.ts.map +1 -0
  31. package/dist/skill-content/connection.js +53 -0
  32. package/dist/skill-content/connection.js.map +1 -0
  33. package/dist/skill-content/local-files.d.ts +2 -0
  34. package/dist/skill-content/local-files.d.ts.map +1 -0
  35. package/dist/skill-content/local-files.js +101 -0
  36. package/dist/skill-content/local-files.js.map +1 -0
  37. package/dist/skill-content/visual-recap-skill.d.ts +2 -0
  38. package/dist/skill-content/visual-recap-skill.d.ts.map +1 -0
  39. package/dist/skill-content/visual-recap-skill.js +548 -0
  40. package/dist/skill-content/visual-recap-skill.js.map +1 -0
  41. package/dist/skill-content/wireframe.d.ts +4 -0
  42. package/dist/skill-content/wireframe.d.ts.map +1 -0
  43. package/dist/skill-content/wireframe.js +347 -0
  44. package/dist/skill-content/wireframe.js.map +1 -0
  45. package/dist/skill-content.d.ts +8 -0
  46. package/dist/skill-content.d.ts.map +1 -0
  47. package/dist/skill-content.js +11 -0
  48. package/dist/skill-content.js.map +1 -0
  49. package/package.json +50 -0
@@ -0,0 +1,2 @@
1
+ export declare const CONNECTION_REFERENCE_MD = "# Connecting & publishing \u2014 single source of truth\n\nThis file is the canonical rule for the never-inline deliverable, finding the\nPlan MCP connector, and restoring it when its tools are missing. It is shared\nword for word by `/visual-plan` and `/visual-recap`. Read it when you are about\nto publish, or whenever a connector or auth error appears; do not improvise an\ninline fallback from memory.\n\n<!-- SHARED-CORE:connection START -->\n\n**The deliverable is ALWAYS a published Agent-Native Plan, never inline chat\ncontent.** Do not hand the plan or recap to the user as Markdown prose, an ASCII\nsketch, a table, a fenced \"wireframe\", or a \"here's the summary\" paragraph. The\nentire value is the hosted, interactive, annotatable Plan; an inline summary is\nthe thing a Plan replaces, not a degraded version of one. The only supported\noutput is to publish through the Plan MCP connector and return its absolute URL.\nLocal-files privacy mode (`references/local-files.md`) is the one exception.\n\n**The connector is usually the `plan` server**, but older installed agents may\nexpose the same hosted connector as `agent-native-plans` \u2014 both names are valid,\nso never report the connector as missing just because it is named\n`agent-native-plans` instead of `plan`. Some clients also lazy-load connector\ntools through a deferred tool registry instead of showing the namespace upfront.\nBefore declaring the connector missing, search/load tools with the host's\ndiscovery surface (`tool_search` when available) for `create_visual_plan`,\n`create_visual_recap`, or `get_plan_blocks`, then use the tools it exposes.\n\n**If the tools are still missing after discovery, do NOT fall back to inline\noutput.** The usual cause is a connector that did not finish connecting this\nsession (it registers zero tools), NOT necessarily an auth problem \u2014 so do not\nassume the user must re-authenticate. Stop and give the user the exact restore\nstep for their current client:\n\n- **Codex / Codex Desktop:** run\n `npx -y @agent-native/core@latest reconnect https://plan.agent-native.com --client codex`\n and start a new Codex session.\n- **Claude Code:** run `/mcp` and choose Authenticate/Reconnect, or run the same\n reconnect command with `--client claude-code` and restart Claude.\n\nThe same applies when a Plan tool returns `needs auth`, `Unauthorized`, or\n`Session terminated`: stop retrying the tool and give the reconnect step instead.\n\nAuth is stored per client config/session, so one client's reconnect does not make\nanother running client load tools. `--client all` refreshes every local client\nconfig that already has the Plan entry, but each running client still has to\nreload its MCP tools afterward. Reconnect re-authenticates WITHOUT reinstalling\nand finds the entry by URL regardless of connector name \u2014 never reinstall from\nscratch just to fix auth. Publish once the tool is reachable. Falling back to\ninline content is a defect, not a degraded mode.\n\n<!-- SHARED-CORE:connection END -->\n";
2
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/skill-content/connection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,4+FAmDnC,CAAC"}
@@ -0,0 +1,53 @@
1
+ export const CONNECTION_REFERENCE_MD = `# Connecting & publishing — single source of truth
2
+
3
+ This file is the canonical rule for the never-inline deliverable, finding the
4
+ Plan MCP connector, and restoring it when its tools are missing. It is shared
5
+ word for word by \`/visual-plan\` and \`/visual-recap\`. Read it when you are about
6
+ to publish, or whenever a connector or auth error appears; do not improvise an
7
+ inline fallback from memory.
8
+
9
+ <!-- SHARED-CORE:connection START -->
10
+
11
+ **The deliverable is ALWAYS a published Agent-Native Plan, never inline chat
12
+ content.** Do not hand the plan or recap to the user as Markdown prose, an ASCII
13
+ sketch, a table, a fenced "wireframe", or a "here's the summary" paragraph. The
14
+ entire value is the hosted, interactive, annotatable Plan; an inline summary is
15
+ the thing a Plan replaces, not a degraded version of one. The only supported
16
+ output is to publish through the Plan MCP connector and return its absolute URL.
17
+ Local-files privacy mode (\`references/local-files.md\`) is the one exception.
18
+
19
+ **The connector is usually the \`plan\` server**, but older installed agents may
20
+ expose the same hosted connector as \`agent-native-plans\` — both names are valid,
21
+ so never report the connector as missing just because it is named
22
+ \`agent-native-plans\` instead of \`plan\`. Some clients also lazy-load connector
23
+ tools through a deferred tool registry instead of showing the namespace upfront.
24
+ Before declaring the connector missing, search/load tools with the host's
25
+ discovery surface (\`tool_search\` when available) for \`create_visual_plan\`,
26
+ \`create_visual_recap\`, or \`get_plan_blocks\`, then use the tools it exposes.
27
+
28
+ **If the tools are still missing after discovery, do NOT fall back to inline
29
+ output.** The usual cause is a connector that did not finish connecting this
30
+ session (it registers zero tools), NOT necessarily an auth problem — so do not
31
+ assume the user must re-authenticate. Stop and give the user the exact restore
32
+ step for their current client:
33
+
34
+ - **Codex / Codex Desktop:** run
35
+ \`npx -y @agent-native/core@latest reconnect https://plan.agent-native.com --client codex\`
36
+ and start a new Codex session.
37
+ - **Claude Code:** run \`/mcp\` and choose Authenticate/Reconnect, or run the same
38
+ reconnect command with \`--client claude-code\` and restart Claude.
39
+
40
+ The same applies when a Plan tool returns \`needs auth\`, \`Unauthorized\`, or
41
+ \`Session terminated\`: stop retrying the tool and give the reconnect step instead.
42
+
43
+ Auth is stored per client config/session, so one client's reconnect does not make
44
+ another running client load tools. \`--client all\` refreshes every local client
45
+ config that already has the Plan entry, but each running client still has to
46
+ reload its MCP tools afterward. Reconnect re-authenticates WITHOUT reinstalling
47
+ and finds the entry by URL regardless of connector name — never reinstall from
48
+ scratch just to fix auth. Publish once the tool is reachable. Falling back to
49
+ inline content is a defect, not a degraded mode.
50
+
51
+ <!-- SHARED-CORE:connection END -->
52
+ `;
53
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/skill-content/connection.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDtC,CAAC","sourcesContent":["export const CONNECTION_REFERENCE_MD = `# Connecting & publishing — single source of truth\n\nThis file is the canonical rule for the never-inline deliverable, finding the\nPlan MCP connector, and restoring it when its tools are missing. It is shared\nword for word by \\`/visual-plan\\` and \\`/visual-recap\\`. Read it when you are about\nto publish, or whenever a connector or auth error appears; do not improvise an\ninline fallback from memory.\n\n<!-- SHARED-CORE:connection START -->\n\n**The deliverable is ALWAYS a published Agent-Native Plan, never inline chat\ncontent.** Do not hand the plan or recap to the user as Markdown prose, an ASCII\nsketch, a table, a fenced \"wireframe\", or a \"here's the summary\" paragraph. The\nentire value is the hosted, interactive, annotatable Plan; an inline summary is\nthe thing a Plan replaces, not a degraded version of one. The only supported\noutput is to publish through the Plan MCP connector and return its absolute URL.\nLocal-files privacy mode (\\`references/local-files.md\\`) is the one exception.\n\n**The connector is usually the \\`plan\\` server**, but older installed agents may\nexpose the same hosted connector as \\`agent-native-plans\\` — both names are valid,\nso never report the connector as missing just because it is named\n\\`agent-native-plans\\` instead of \\`plan\\`. Some clients also lazy-load connector\ntools through a deferred tool registry instead of showing the namespace upfront.\nBefore declaring the connector missing, search/load tools with the host's\ndiscovery surface (\\`tool_search\\` when available) for \\`create_visual_plan\\`,\n\\`create_visual_recap\\`, or \\`get_plan_blocks\\`, then use the tools it exposes.\n\n**If the tools are still missing after discovery, do NOT fall back to inline\noutput.** The usual cause is a connector that did not finish connecting this\nsession (it registers zero tools), NOT necessarily an auth problem — so do not\nassume the user must re-authenticate. Stop and give the user the exact restore\nstep for their current client:\n\n- **Codex / Codex Desktop:** run\n \\`npx -y @agent-native/core@latest reconnect https://plan.agent-native.com --client codex\\`\n and start a new Codex session.\n- **Claude Code:** run \\`/mcp\\` and choose Authenticate/Reconnect, or run the same\n reconnect command with \\`--client claude-code\\` and restart Claude.\n\nThe same applies when a Plan tool returns \\`needs auth\\`, \\`Unauthorized\\`, or\n\\`Session terminated\\`: stop retrying the tool and give the reconnect step instead.\n\nAuth is stored per client config/session, so one client's reconnect does not make\nanother running client load tools. \\`--client all\\` refreshes every local client\nconfig that already has the Plan entry, but each running client still has to\nreload its MCP tools afterward. Reconnect re-authenticates WITHOUT reinstalling\nand finds the entry by URL regardless of connector name — never reinstall from\nscratch just to fix auth. Publish once the tool is reachable. Falling back to\ninline content is a defect, not a degraded mode.\n\n<!-- SHARED-CORE:connection END -->\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const LOCAL_FILES_REFERENCE_MD = "# Local-files privacy mode \u2014 single source of truth\n\nThis file is the canonical contract for fully local, no-database planning and\nrecaps. It is shared word for word by `/visual-plan` and `/visual-recap`. Read it\nin full before using local-files mode; do not call any hosted Plan tool for a\nlocal plan/recap except the schema-only block-catalog lookup described below.\n\n<!-- SHARED-CORE:local-files START -->\n\n**When to use it.** Use local-files privacy mode when the user explicitly asks\nfor no DB writes, no hosted Plan database writes, no Plan MCP publish, fully local\nfiles, offline/private work, or repo-owned/source-controlled artifacts, or when\n`AGENT_NATIVE_PLANS_MODE=local-files` is set. Also use it when a user or repo\npolicy says the work must stay under their own brand, domain, source control, or\ninfrastructure. In this mode the plan/recap data must never be sent to the Plan\nMCP server or the Plan app action surface. This is the only exception to the\nalways-publish rule in `references/connection.md`.\n\nThe local-files contract:\n\n- **Read context locally.** Read source, diff, and stat context from local files\n and shell commands only. For recaps, the\n `npx @agent-native/recap-cli@latest recap collect-diff`, `scan`, and\n `build-prompt --local-files` helpers are safe \u2014 they operate on local files and\n do not write to the Plan database.\n- **Fetch the block catalog first** (it sends no plan content). Use the MCP\n `get-plan-blocks` tool if it is already available, or run\n `npx @agent-native/core@latest plan blocks --out plan-blocks.md` and read that\n file before authoring MDX; it calls the public no-auth `get-plan-blocks` route.\n Use `--format schema` when you need exact nested fields. If network access is\n unavailable, use the bundled `references/*.md` and rely on `plan local check` to\n catch invalid tags. Copy the catalog examples verbatim for the fields the\n registry table cannot encode: `checklist` items need `id` and `label`;\n `question-form` questions need `id`, `title`, and `mode`, and each option needs\n `id` and `label`; and `Code` / `AnnotatedCode` / `Diff` are whitespace-sensitive\n \u2014 encode multiline code as JSON string attributes such as `code={\"const x =\\n y\"}`\n (a static template literal is accepted only when it has no `${...}`\n interpolation). `plan local check` is a quick OFFLINE lint (a subset of the\n renderer schema), so a green `check` does not guarantee the plan renders.\n `plan local verify` also stays on-device: it uses the offline lint unless it\n can reach a Plan renderer on an explicit loopback `--app-url`.\n- **Write a local MDX folder.** Use `plans/<slug>/` to check the artifact into the\n repo, or a repo-ignored/temporary folder such as `.agent-native/plans/<slug>/`\n or `/tmp/agent-native-plans/<slug>/` when it should not be checked in. The\n folder holds `plan.mdx`, optional `canvas.mdx`, optional `prototype.mdx`, and\n optional `.plan-state.json`. For a recap, set `kind: \"recap\"` and\n `localOnly: true` in the frontmatter/state. Use that exact folder as\n `<plan-dir>` in every command below.\n- **Check, then serve.** Run\n `npx @agent-native/core@latest plan local check --dir <plan-dir>` before any\n preview, then\n `npx @agent-native/core@latest plan local serve --dir <plan-dir> --kind <plan|recap> --open`\n (use `--kind plan` for plans, `--kind recap` for recaps). Report the local\n bridge URL from stdout or `<plan-dir>/.plan-url`; treat `.plan-url` as a local\n token file and do not commit it. The URL opens the hosted Plan UI but reads from\n the localhost bridge on this machine, so it is not shareable across machines.\n The token is carried in the URL fragment (which is not sent to the hosted\n origin), and the local-plan route disables DOM autocapture and session replay\n while retaining sanitized pageviews and error monitoring. On\n macOS `--open` prefers Chromium browsers; if Safari opens, switch to\n Chrome/Chromium because Safari can block the hosted HTTPS page from fetching the\n HTTP localhost bridge. If the Plan app itself is running locally with the same\n `PLAN_LOCAL_DIR`, the `/local-plans/<slug>` route is also valid. In a truly\n offline environment, hand off the `<plan-dir>` path after `plan local check` and\n note that interactive preview requires network access to the hosted Plan UI or a\n running local Plan app.\n- **Headless verify.** Run\n `npx @agent-native/core@latest plan local verify --dir <plan-dir> --kind <plan|recap>`.\n It starts the bridge and checks the private-network preflight and JSON payload\n entirely on loopback. It never sends MDX or assets to a remote validation\n action. When `--app-url` points to a loopback Plan app, verify also validates\n against that local app's real renderer schema via `validate-local-plan-source`.\n A non-`ok` result with\n `validation.valid: false` lists the renderer's exact schema-path issues (e.g.\n `blocks[1].data.tabs[0]...`); fix those before handing off. If `validation.ran`\n is `false`, verify used the offline lint because the app URL was remote or the\n local Plan app was unavailable. Run a local Plan app and pass\n `--app-url http://localhost:8096` for the authoritative check. If the browser hangs on\n \"Loading plan\", fetch the `bridgeUrl` from the verify/serve JSON to read the\n concrete validation error.\n- **Never call hosted tools for that plan/recap.** Do not call\n `create-visual-plan`, `create-ui-plan`, `create-prototype-plan`,\n `create-plan-design`, `create-visual-recap`, `create-visual-questions`,\n `import-visual-plan-source`, `update-visual-plan`, `patch-visual-plan-source`,\n `get-plan-feedback`, `export-visual-plan`, `set-resource-visibility`, or any\n other hosted Plan tool \u2014 except the schema-only block-catalog lookup above.\n- **Feedback is file/chat feedback.** Update the MDX files directly, rerun\n `plan local check`, and rerun `serve` or `verify` when that preview path is\n available. Summarize the new local URL when one exists; otherwise summarize the\n checked `<plan-dir>` path. Hosted comments, sharing, screenshots, history, usage\n attachment, and publish/export receipts are unavailable until the user\n explicitly opts into publishing.\n\nLocal-files mode prevents plan/recap content from being uploaded to the\nAgent-Native Plan server or database. It does not by itself make the coding agent's language model local;\nfor that stronger boundary the host agent/model must also be local or otherwise\napproved by the user.\n\n<!-- SHARED-CORE:local-files END -->\n";
2
+ //# sourceMappingURL=local-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-files.d.ts","sourceRoot":"","sources":["../../src/skill-content/local-files.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,6+MAmGpC,CAAC"}
@@ -0,0 +1,101 @@
1
+ export const LOCAL_FILES_REFERENCE_MD = `# Local-files privacy mode — single source of truth
2
+
3
+ This file is the canonical contract for fully local, no-database planning and
4
+ recaps. It is shared word for word by \`/visual-plan\` and \`/visual-recap\`. Read it
5
+ in full before using local-files mode; do not call any hosted Plan tool for a
6
+ local plan/recap except the schema-only block-catalog lookup described below.
7
+
8
+ <!-- SHARED-CORE:local-files START -->
9
+
10
+ **When to use it.** Use local-files privacy mode when the user explicitly asks
11
+ for no DB writes, no hosted Plan database writes, no Plan MCP publish, fully local
12
+ files, offline/private work, or repo-owned/source-controlled artifacts, or when
13
+ \`AGENT_NATIVE_PLANS_MODE=local-files\` is set. Also use it when a user or repo
14
+ policy says the work must stay under their own brand, domain, source control, or
15
+ infrastructure. In this mode the plan/recap data must never be sent to the Plan
16
+ MCP server or the Plan app action surface. This is the only exception to the
17
+ always-publish rule in \`references/connection.md\`.
18
+
19
+ The local-files contract:
20
+
21
+ - **Read context locally.** Read source, diff, and stat context from local files
22
+ and shell commands only. For recaps, the
23
+ \`npx @agent-native/recap-cli@latest recap collect-diff\`, \`scan\`, and
24
+ \`build-prompt --local-files\` helpers are safe — they operate on local files and
25
+ do not write to the Plan database.
26
+ - **Fetch the block catalog first** (it sends no plan content). Use the MCP
27
+ \`get-plan-blocks\` tool if it is already available, or run
28
+ \`npx @agent-native/core@latest plan blocks --out plan-blocks.md\` and read that
29
+ file before authoring MDX; it calls the public no-auth \`get-plan-blocks\` route.
30
+ Use \`--format schema\` when you need exact nested fields. If network access is
31
+ unavailable, use the bundled \`references/*.md\` and rely on \`plan local check\` to
32
+ catch invalid tags. Copy the catalog examples verbatim for the fields the
33
+ registry table cannot encode: \`checklist\` items need \`id\` and \`label\`;
34
+ \`question-form\` questions need \`id\`, \`title\`, and \`mode\`, and each option needs
35
+ \`id\` and \`label\`; and \`Code\` / \`AnnotatedCode\` / \`Diff\` are whitespace-sensitive
36
+ — encode multiline code as JSON string attributes such as \`code={"const x =\\n y"}\`
37
+ (a static template literal is accepted only when it has no \`\${...}\`
38
+ interpolation). \`plan local check\` is a quick OFFLINE lint (a subset of the
39
+ renderer schema), so a green \`check\` does not guarantee the plan renders.
40
+ \`plan local verify\` also stays on-device: it uses the offline lint unless it
41
+ can reach a Plan renderer on an explicit loopback \`--app-url\`.
42
+ - **Write a local MDX folder.** Use \`plans/<slug>/\` to check the artifact into the
43
+ repo, or a repo-ignored/temporary folder such as \`.agent-native/plans/<slug>/\`
44
+ or \`/tmp/agent-native-plans/<slug>/\` when it should not be checked in. The
45
+ folder holds \`plan.mdx\`, optional \`canvas.mdx\`, optional \`prototype.mdx\`, and
46
+ optional \`.plan-state.json\`. For a recap, set \`kind: "recap"\` and
47
+ \`localOnly: true\` in the frontmatter/state. Use that exact folder as
48
+ \`<plan-dir>\` in every command below.
49
+ - **Check, then serve.** Run
50
+ \`npx @agent-native/core@latest plan local check --dir <plan-dir>\` before any
51
+ preview, then
52
+ \`npx @agent-native/core@latest plan local serve --dir <plan-dir> --kind <plan|recap> --open\`
53
+ (use \`--kind plan\` for plans, \`--kind recap\` for recaps). Report the local
54
+ bridge URL from stdout or \`<plan-dir>/.plan-url\`; treat \`.plan-url\` as a local
55
+ token file and do not commit it. The URL opens the hosted Plan UI but reads from
56
+ the localhost bridge on this machine, so it is not shareable across machines.
57
+ The token is carried in the URL fragment (which is not sent to the hosted
58
+ origin), and the local-plan route disables DOM autocapture and session replay
59
+ while retaining sanitized pageviews and error monitoring. On
60
+ macOS \`--open\` prefers Chromium browsers; if Safari opens, switch to
61
+ Chrome/Chromium because Safari can block the hosted HTTPS page from fetching the
62
+ HTTP localhost bridge. If the Plan app itself is running locally with the same
63
+ \`PLAN_LOCAL_DIR\`, the \`/local-plans/<slug>\` route is also valid. In a truly
64
+ offline environment, hand off the \`<plan-dir>\` path after \`plan local check\` and
65
+ note that interactive preview requires network access to the hosted Plan UI or a
66
+ running local Plan app.
67
+ - **Headless verify.** Run
68
+ \`npx @agent-native/core@latest plan local verify --dir <plan-dir> --kind <plan|recap>\`.
69
+ It starts the bridge and checks the private-network preflight and JSON payload
70
+ entirely on loopback. It never sends MDX or assets to a remote validation
71
+ action. When \`--app-url\` points to a loopback Plan app, verify also validates
72
+ against that local app's real renderer schema via \`validate-local-plan-source\`.
73
+ A non-\`ok\` result with
74
+ \`validation.valid: false\` lists the renderer's exact schema-path issues (e.g.
75
+ \`blocks[1].data.tabs[0]...\`); fix those before handing off. If \`validation.ran\`
76
+ is \`false\`, verify used the offline lint because the app URL was remote or the
77
+ local Plan app was unavailable. Run a local Plan app and pass
78
+ \`--app-url http://localhost:8096\` for the authoritative check. If the browser hangs on
79
+ "Loading plan", fetch the \`bridgeUrl\` from the verify/serve JSON to read the
80
+ concrete validation error.
81
+ - **Never call hosted tools for that plan/recap.** Do not call
82
+ \`create-visual-plan\`, \`create-ui-plan\`, \`create-prototype-plan\`,
83
+ \`create-plan-design\`, \`create-visual-recap\`, \`create-visual-questions\`,
84
+ \`import-visual-plan-source\`, \`update-visual-plan\`, \`patch-visual-plan-source\`,
85
+ \`get-plan-feedback\`, \`export-visual-plan\`, \`set-resource-visibility\`, or any
86
+ other hosted Plan tool — except the schema-only block-catalog lookup above.
87
+ - **Feedback is file/chat feedback.** Update the MDX files directly, rerun
88
+ \`plan local check\`, and rerun \`serve\` or \`verify\` when that preview path is
89
+ available. Summarize the new local URL when one exists; otherwise summarize the
90
+ checked \`<plan-dir>\` path. Hosted comments, sharing, screenshots, history, usage
91
+ attachment, and publish/export receipts are unavailable until the user
92
+ explicitly opts into publishing.
93
+
94
+ Local-files mode prevents plan/recap content from being uploaded to the
95
+ Agent-Native Plan server or database. It does not by itself make the coding agent's language model local;
96
+ for that stronger boundary the host agent/model must also be local or otherwise
97
+ approved by the user.
98
+
99
+ <!-- SHARED-CORE:local-files END -->
100
+ `;
101
+ //# sourceMappingURL=local-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-files.js","sourceRoot":"","sources":["../../src/skill-content/local-files.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGvC,CAAC","sourcesContent":["export const LOCAL_FILES_REFERENCE_MD = `# Local-files privacy mode — single source of truth\n\nThis file is the canonical contract for fully local, no-database planning and\nrecaps. It is shared word for word by \\`/visual-plan\\` and \\`/visual-recap\\`. Read it\nin full before using local-files mode; do not call any hosted Plan tool for a\nlocal plan/recap except the schema-only block-catalog lookup described below.\n\n<!-- SHARED-CORE:local-files START -->\n\n**When to use it.** Use local-files privacy mode when the user explicitly asks\nfor no DB writes, no hosted Plan database writes, no Plan MCP publish, fully local\nfiles, offline/private work, or repo-owned/source-controlled artifacts, or when\n\\`AGENT_NATIVE_PLANS_MODE=local-files\\` is set. Also use it when a user or repo\npolicy says the work must stay under their own brand, domain, source control, or\ninfrastructure. In this mode the plan/recap data must never be sent to the Plan\nMCP server or the Plan app action surface. This is the only exception to the\nalways-publish rule in \\`references/connection.md\\`.\n\nThe local-files contract:\n\n- **Read context locally.** Read source, diff, and stat context from local files\n and shell commands only. For recaps, the\n \\`npx @agent-native/recap-cli@latest recap collect-diff\\`, \\`scan\\`, and\n \\`build-prompt --local-files\\` helpers are safe — they operate on local files and\n do not write to the Plan database.\n- **Fetch the block catalog first** (it sends no plan content). Use the MCP\n \\`get-plan-blocks\\` tool if it is already available, or run\n \\`npx @agent-native/core@latest plan blocks --out plan-blocks.md\\` and read that\n file before authoring MDX; it calls the public no-auth \\`get-plan-blocks\\` route.\n Use \\`--format schema\\` when you need exact nested fields. If network access is\n unavailable, use the bundled \\`references/*.md\\` and rely on \\`plan local check\\` to\n catch invalid tags. Copy the catalog examples verbatim for the fields the\n registry table cannot encode: \\`checklist\\` items need \\`id\\` and \\`label\\`;\n \\`question-form\\` questions need \\`id\\`, \\`title\\`, and \\`mode\\`, and each option needs\n \\`id\\` and \\`label\\`; and \\`Code\\` / \\`AnnotatedCode\\` / \\`Diff\\` are whitespace-sensitive\n — encode multiline code as JSON string attributes such as \\`code={\"const x =\\\\n y\"}\\`\n (a static template literal is accepted only when it has no \\`\\${...}\\`\n interpolation). \\`plan local check\\` is a quick OFFLINE lint (a subset of the\n renderer schema), so a green \\`check\\` does not guarantee the plan renders.\n \\`plan local verify\\` also stays on-device: it uses the offline lint unless it\n can reach a Plan renderer on an explicit loopback \\`--app-url\\`.\n- **Write a local MDX folder.** Use \\`plans/<slug>/\\` to check the artifact into the\n repo, or a repo-ignored/temporary folder such as \\`.agent-native/plans/<slug>/\\`\n or \\`/tmp/agent-native-plans/<slug>/\\` when it should not be checked in. The\n folder holds \\`plan.mdx\\`, optional \\`canvas.mdx\\`, optional \\`prototype.mdx\\`, and\n optional \\`.plan-state.json\\`. For a recap, set \\`kind: \"recap\"\\` and\n \\`localOnly: true\\` in the frontmatter/state. Use that exact folder as\n \\`<plan-dir>\\` in every command below.\n- **Check, then serve.** Run\n \\`npx @agent-native/core@latest plan local check --dir <plan-dir>\\` before any\n preview, then\n \\`npx @agent-native/core@latest plan local serve --dir <plan-dir> --kind <plan|recap> --open\\`\n (use \\`--kind plan\\` for plans, \\`--kind recap\\` for recaps). Report the local\n bridge URL from stdout or \\`<plan-dir>/.plan-url\\`; treat \\`.plan-url\\` as a local\n token file and do not commit it. The URL opens the hosted Plan UI but reads from\n the localhost bridge on this machine, so it is not shareable across machines.\n The token is carried in the URL fragment (which is not sent to the hosted\n origin), and the local-plan route disables DOM autocapture and session replay\n while retaining sanitized pageviews and error monitoring. On\n macOS \\`--open\\` prefers Chromium browsers; if Safari opens, switch to\n Chrome/Chromium because Safari can block the hosted HTTPS page from fetching the\n HTTP localhost bridge. If the Plan app itself is running locally with the same\n \\`PLAN_LOCAL_DIR\\`, the \\`/local-plans/<slug>\\` route is also valid. In a truly\n offline environment, hand off the \\`<plan-dir>\\` path after \\`plan local check\\` and\n note that interactive preview requires network access to the hosted Plan UI or a\n running local Plan app.\n- **Headless verify.** Run\n \\`npx @agent-native/core@latest plan local verify --dir <plan-dir> --kind <plan|recap>\\`.\n It starts the bridge and checks the private-network preflight and JSON payload\n entirely on loopback. It never sends MDX or assets to a remote validation\n action. When \\`--app-url\\` points to a loopback Plan app, verify also validates\n against that local app's real renderer schema via \\`validate-local-plan-source\\`.\n A non-\\`ok\\` result with\n \\`validation.valid: false\\` lists the renderer's exact schema-path issues (e.g.\n \\`blocks[1].data.tabs[0]...\\`); fix those before handing off. If \\`validation.ran\\`\n is \\`false\\`, verify used the offline lint because the app URL was remote or the\n local Plan app was unavailable. Run a local Plan app and pass\n \\`--app-url http://localhost:8096\\` for the authoritative check. If the browser hangs on\n \"Loading plan\", fetch the \\`bridgeUrl\\` from the verify/serve JSON to read the\n concrete validation error.\n- **Never call hosted tools for that plan/recap.** Do not call\n \\`create-visual-plan\\`, \\`create-ui-plan\\`, \\`create-prototype-plan\\`,\n \\`create-plan-design\\`, \\`create-visual-recap\\`, \\`create-visual-questions\\`,\n \\`import-visual-plan-source\\`, \\`update-visual-plan\\`, \\`patch-visual-plan-source\\`,\n \\`get-plan-feedback\\`, \\`export-visual-plan\\`, \\`set-resource-visibility\\`, or any\n other hosted Plan tool — except the schema-only block-catalog lookup above.\n- **Feedback is file/chat feedback.** Update the MDX files directly, rerun\n \\`plan local check\\`, and rerun \\`serve\\` or \\`verify\\` when that preview path is\n available. Summarize the new local URL when one exists; otherwise summarize the\n checked \\`<plan-dir>\\` path. Hosted comments, sharing, screenshots, history, usage\n attachment, and publish/export receipts are unavailable until the user\n explicitly opts into publishing.\n\nLocal-files mode prevents plan/recap content from being uploaded to the\nAgent-Native Plan server or database. It does not by itself make the coding agent's language model local;\nfor that stronger boundary the host agent/model must also be local or otherwise\napproved by the user.\n\n<!-- SHARED-CORE:local-files END -->\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const VISUAL_RECAP_SKILL_MD = "---\nname: visual-recap\ndescription: >-\n Turn a PR, branch, commit, or git diff into an interactive visual recap with\n diagrams, file maps, API/schema summaries, annotated diffs, and focused review\n notes.\nmetadata:\n visibility: exported\n---\n\n# Visual Recap\n\n`/visual-recap` creates a visual plan built **from** a diff, not toward one. It\nis the reverse of forward planning: instead of describing the change you are\nabout to make, you describe the change that was just made, at a higher altitude\nthan line-by-line review. The same plan data model serves both directions \u2014\nschema, API, file, and architecture changes become the same `data-model`,\n`api-endpoint`, `file-tree`, and `diagram` blocks a forward plan would use, only\nnow they summarize work that exists. A reviewer scans the shape of the change\nbefore spending attention on the literal lines.\n\n## Publish As An Agent-Native Plan \u2014 Never Inline\n\nThe deliverable is ALWAYS a published Agent-Native Plan, created with\n`create-visual-recap` on the Plan MCP connector \u2014 NEVER inline chat content (not\nMarkdown prose, an ASCII sketch, a table, a fenced \"wireframe\", or a \"here's the\nrecap\" summary). A recap's entire value is the hosted, interactive, annotatable\nplan; an inline summary is not a degraded recap, it is the thing a recap\nreplaces. If the `plan` (or legacy `agent-native-plans`) tools are not visible,\ndiscover them through the host's `tool_search` first; if they are still missing,\nSTOP and give the user the client-specific reconnect step rather than improvising\nan inline recap. Before publishing, or whenever a connector or auth error\nappears, READ `references/connection.md` in this skill directory \u2014 it is the\nsingle source of truth for the never-inline rule, connector discovery, and the\nper-client reconnect steps. Local-files privacy mode (below) is the one\nexception.\n\n## Local-Files Privacy Mode \u2014 read `references/local-files.md`\n\nWhen the user wants no hosted Plan database writes \u2014 no DB writes, no Plan MCP\npublish, fully local/offline/private recaps, or `AGENT_NATIVE_PLANS_MODE=local-files`\n\u2014 do not call any hosted Plan tool except the schema-only `get-plan-blocks`\ncatalog lookup. Read the diff with the local `recap collect-diff` / `scan` /\n`build-prompt --local-files` helpers, author a local MDX folder (set\n`kind: \"recap\"` and `localOnly: true`), and preview it with `plan local check`,\n`plan local serve --kind recap`, and `plan local verify --kind recap`. Before\nusing local-files mode, READ `references/local-files.md` in this skill directory\n\u2014 it is the single source of truth for the full contract.\n\n## When To Use\n\nBuild a recap when a PR or commit is large, multi-file, or touches schema, API\ncontracts, or architecture, and a reviewer would benefit from seeing the change\nmapped to structured blocks before reading the raw diff. A GitHub Action can\ngenerate one automatically from a PR diff; an agent can generate one on request\n(\"recap this PR\", \"show me what this branch changed\"). Skip it for small,\nsingle-file, or obvious diffs \u2014 a recap is review overhead, and a tiny change\nreviews faster as plain diff.\n\n## Recap The Whole Work Unit\n\nWhen `/visual-recap` is invoked in a chat thread after work has already happened,\nthe default scope is the whole current work unit/thread, not only the most recent\nuser message, tool action, or follow-up fix. Gather the thread-owned changes\nacross the conversation: original implementation work, later bug fixes, UI\nfollow-ups, tests, changesets, skill/instruction updates, generated plan/source\nartifacts, and any local import/linking fixes needed to make the recap open.\n\nUse the current diff plus conversation context to separate thread-owned changes\nfrom unrelated dirty work that existed before the thread. Exclude unrelated\npre-existing edits. If the scope is genuinely ambiguous and cannot be inferred,\nstate the assumption or ask a concise question before publishing.\n\nWhen updating an existing recap after feedback, revise the recap so it still\ncovers the whole thread/work unit plus the new correction. Do not replace a broad\nrecap with a narrow recap of only the latest feedback unless the user explicitly\nasks for that narrower scope.\n\n## Keep The Recap Body Lean\n\nDo not add boilerplate intro, disclaimer, provenance, or summary prose blocks to\nthe generated plan body. In particular, do not create a `rich-text` block just to\nsay the recap is an aid, that the reviewer should still review the diff, how many\nfiles changed, or which ref/working tree generated the recap. The plan title,\nbrief, and `file-tree` (which carries the per-file change stats) already carry\nthat context.\n\nOnly add prose blocks when they tell the reviewer something specific about the\nchange that the structured blocks do not: the objective, a real compatibility\nrisk, an important decision visible in the diff, or a grounded review note.\n\n## Recaps Must Be Substantial\n\nLean is not the same as thin. A recap is not a single wireframe plus one\nsentence \u2014 that under-serves the reviewer as much as boilerplate prose over-serves\nthem. Alongside the visual/structural headline (wireframes, `data-model`,\n`api-endpoint`, `diagram`), a substantial recap also carries the implementation\nevidence:\n\n- A short surface/state inventory before authoring: list the changed routes,\n components, popovers/dialogs, role/access states, empty/error states, and\n shared abstractions visible in the diff. The final recap must either represent\n each meaningful item with a block or intentionally omit it because it is tiny,\n redundant, or not user-visible.\n- A `file-tree` of the changed files with each entry's `change` flag, so the\n reviewer sees the footprint of the work at a glance.\n- The split `diff` of the KEY changed files, grouped under a `## Key changes`\n `rich-text` heading in a single horizontal `tabs` block (the default\n orientation, one file per tab), with a one-line `summary` and a few\n `annotations` on each \u2014 so the reviewer can drop from the high-altitude shape\n straight into the load-bearing code. Use horizontal file tabs, not a vertical\n side rail, so the selected file has enough width for the side-by-side diff.\n\nSkip the diff appendix only for a genuinely tiny change that reviews faster as\nplain diff (see \"When To Use\"); for any change worth recapping, the file-tree and\nkey-change diffs belong in the plan.\n\n## Canonical Shape And Budgets\n\nA strong recap follows one skeleton, top to bottom:\n\n1. UI-impact headline \u2014 wireframes first, when the diff changed rendered UI.\n2. Short outcome narrative (`rich-text`): what changed and why, 1-3 paragraphs.\n3. `data-model` / `api-endpoint` blocks for schema and contract changes.\n4. `file-tree` of the changed files with `change` flags.\n5. `## Key changes` \u2014 one horizontal `tabs` block of `diff` / `annotated-code`.\n\nBudgets that keep the recap reviewable:\n\n- 3-8 key-change tabs. Fewer than 3 on a large change under-serves the\n reviewer; more than 8 stops being a summary.\n- Keep each diff/annotated-code excerpt focused \u2014 prefer under ~150 lines per\n tab; summarize or link the rest of a long file instead of dumping it.\n- Title at most ~70 characters; brief 1-3 sentences.\n\n**GOOD.** A 25-file auth change: Before/After wireframes of the login surface,\na two-paragraph narrative, a diff-aware `data-model` of the sessions table, an\n`api-endpoint` for the new refresh route, a `file-tree` with change flags, and\n`## Key changes` with five focused tabs, each with a one-line `summary` and a\nfew annotations on the load-bearing hunks.\n\n**BAD.** One giant unsegmented diff dump with no summaries or annotations; or a\nsparse three-block recap of a 40-file change (one wireframe, one sentence, one\nfile list) that forces the reviewer back into the raw diff anyway.\n\n## UI Impact Needs Wireframes\n\nWhen the diff changes rendered UI, layout, density, visual state, interaction\naffordances, navigation, controls, menus, dialogs, or design tokens, the recap\nMUST include one or more wireframes. Prose and file diffs are not a substitute\nfor showing what changed visually.\n\nBefore choosing wireframes, make a UI coverage pass from the diff:\n\n- Identify the entry surface where the change appears, such as a page header,\n list row, toolbar, route shell, or menu trigger.\n- Identify the interaction surface that opens or changes, such as a popover,\n dialog, tab, sheet, dropdown, inline editor, or toast.\n- Identify the resulting destination or persistent state, such as a public page,\n read-only view, empty state, error state, loading state, permission-denied\n state, or saved/shared state.\n- Identify access or role variants when permissions change. Owner/admin/editor\n versus viewer/non-manager differences are visual behavior and need a compact\n matrix, paired wireframes, or clearly labeled state sequence.\n\nFor UI-heavy PRs, a single before/after of the entry surface is not enough.\nShow the changed entry point, the main changed interaction surface, and the\nresulting/destination state. Add more states when the diff adds tabs, role-based\ncontrols, public/private visibility, invite/manage flows, destructive controls,\nor empty/error branches.\n\nChoose the smallest visual surface that makes the review clear:\n\n- Use a `Before` / `After` wireframe pair when the reviewer benefits from direct\n comparison, such as a removed or added control, a changed state, layout\n density, ordering, navigation, or a visible component replacement.\n `references/wireframe.md` owns how to lay that pair out (columns vs.\n vertical stack by geometry).\n- Use an after-only wireframe when the change is purely additive or the \"before\"\n state would only show absence without adding review value.\n- Use more than two wireframes when the UI change is flow-dependent, responsive,\n or stateful; show the meaningful states in order instead of forcing a single\n before/after pair.\n- For tiny surfaces like menus, popovers, dialogs, toasts, or panels, use the\n matching `surface` (`popover`, `panel`, etc.) and show the focused sub-surface.\n Do not redraw a full page unless placement in the page is itself part of the\n change.\n\nGround each wireframe in the changed UI behavior, component names, file paths,\nand diff-visible labels/states. If exact pixels are inferred rather than\ncaptured, say so in the wireframe caption or a concise annotation. For\nlocal/manual recaps, import or update the plan source that holds the wireframes\nso the rendered recap opens with the UI visual available.\n\n## Wireframe Quality \u2014 read `references/wireframe.md`\n\nUI recap/plan wireframes must meet a strict quality bar \u2014 full-width chrome,\npinned bottom bars, real product content, before/after comparability, the right\n`surface` preset, `--wf-*` tokens instead of hex, and no `<html>`/`<style>`/font\ntags. Before authoring ANY wireframe / `<Screen>` / `WireframeBlock`, READ\n`references/wireframe.md` in this skill directory \u2014 it is the single source of\ntruth for HTML wireframe quality, shared word for word with `/visual-plan`\nand `/visual-recap`. Do not author wireframes from memory.\n\nUse the standard `WireframeBlock` / `<Screen>` format so the Plan viewer owns the\nsurface frame, theme, and sketchy/clean toggle. HTML wireframes are appropriate\nwhen placement precision matters, especially popovers, menus, dialogs, and dense\nforms. For HTML\nwireframes, keep `renderMode` unset or `wireframe` unless a design-only editable\nmockup is explicitly required, because `renderMode=\"design\"` disables the\nsketchy rough overlay.\n\nWhen a browser tool is available, render a UI-impact recap in the Plan viewer\nand visually inspect it at the current theme before sharing. If any label,\nannotation, toolbar, or wireframe content overlaps another element, fix the MDX\nand re-import before reporting the link. A text-match screenshot is not enough;\nvisually inspect the captured image. When no browser is available (for example\na headless CI agent), state that in the recap handoff instead.\n\n## Top Canvas Recaps \u2014 read `../visual-plan/references/canvas.md`\n\nWhen a recap includes a top canvas, storyboard, or flow view, READ\n`../visual-plan/references/canvas.md` before authoring `canvas.mdx`. Recap\ncanvas artboards must use the same HTML wireframe path as good document-body\nwireframes: `<Screen surface=\"...\" html={...} />` with a semantic HTML fragment.\nDo not author fresh kit-tree children such as `<FrameScreen>`, `<Card>`,\n`<Row>`, `<Title>`, or `<Btn>` inside canvas `<Screen>` tags. Those components\nare legacy compatibility markup for old plans; in new canvas storyboards they\ncan produce cramped or overlapping layouts even when the inline body wireframe\nlooks good. If a canvas mockup looks worse than the same screen below the fold,\nassume it used the legacy kit path and replace it with an HTML screen.\n\n## Open And Report The Recap\n\nIn local-files privacy mode, run `plan local check` first, then report the local\nbridge URL from\n`npx @agent-native/core@latest plan local serve --dir <plan-dir> --kind recap --open`\nor from `<plan-dir>/.plan-url`. It opens the hosted Plan UI but reads from the\nlocalhost bridge on this machine, so it is not shareable across machines. If the\nPlan app itself is running locally with the same `PLAN_LOCAL_DIR`, the\n`/local-plans/<slug>` route is also valid. Do not invent a hosted database URL\nand do not publish just to get an absolute Plan link.\n\nAfter creating the recap, link the reviewer to the rendered plan with an\n**absolute URL on the origin whose database actually holds the plan**. That\norigin is the Plan MCP server you just created the recap through \u2014 NOT whatever\ndev server you happen to know is running. The create tool returns the correct\nlink; report THAT. Never make the primary link a local `plan.mdx` file, a local\nmirror folder, or a relative path such as `/plans/<id>`.\n\nWhen the recap is posted to a PR for a private repo, the plan link is not a\npublic URL. Make the PR comment/handoff copy explicit: reviewers may need to\nsign in to Agent-Native Plans with an account that has access to the owning\norganization before the link loads. Use wording like: \"Private repo recap:\nsign in with access to this org if the plan does not open.\" Do not imply the\nlink is broken or public when access is gated by repo/org visibility.\n\nA recap lives only in the database of the MCP that created it. A separately\nrunning local dev server (e.g. `http://localhost:8081`) has its OWN database and\nwill NOT contain a recap created through the hosted MCP, so a hand-built\n`localhost` link returns \"Plan not found\". This is the most common recap\nmistake \u2014 do not guess an origin you have not confirmed shares the MCP's data.\n\nResolve the URL in this order:\n\n1. Use the absolute URL the create tool RETURNS \u2014 `openLink.webUrl`, else the\n `visualUrl` in the returned `plan.mdx` frontmatter, else `url`/`path`\n resolved against the MCP server's own origin (for the hosted MCP that is\n `https://plan.agent-native.com`). This always points at the database that has\n the plan.\n2. Use a `localhost`/dev origin ONLY when the recap was created through a Plan\n MCP bound to that same origin \u2014 i.e. that MCP's url is\n `http://localhost:<port>/mcp`. Creating through the hosted MCP\n and linking to localhost is the exact mismatch that 404s.\n3. If only a plan id is available, build the MCP origin's absolute URL\n (hosted: `https://plan.agent-native.com/plans/<id>`) and say it was inferred.\n\nIf the user wants to review on localhost but the recap was created through the\nhosted MCP, say so plainly: the local dev server cannot see it. To view a recap\non localhost (e.g. to exercise un-deployed local renderer changes), they must\nconnect a LOCAL Plan MCP (`http://localhost:<port>/mcp`) and\nre-create the recap through it so it lands in the local database; offer to do\nthat rather than handing over a localhost URL that will not resolve.\n\nWhen running in Codex and the Browser/in-app side browser tools are available,\nopen the returned absolute recap URL there automatically after creation. Still\ninclude the same absolute URL in the final response. Local mirror files like\n`plans/<slug>/plan.mdx` may be mentioned only as secondary source-control\nartifacts, not as the main way to open the recap.\n\n## Diff \u2192 Block Mapping\n\nMap each kind of change to the block that carries it, derived mechanically from\nthe actual diff. The names below are the CONCEPTUAL block types, not the JSX\ntags \u2014 resolve every conceptual name to its exact tag + prop schema with the\n`get-plan-blocks` tool (see \"Block reference\" below) before authoring.\n\n- **Schema / migration change** \u2192 `data-model` for the resulting entities,\n fields, and relations. Flag what moved per field/entity with\n `change: \"added\" | \"modified\" | \"removed\" | \"renamed\"`, and for a changed type\n set `was` to the prior value (e.g. the old column type) \u2014 grounded in the real\n migration diff. That diff-aware `data-model` is the headline; reach for a split\n `diff` of the literal SQL only when the exact statement still matters, not by\n default.\n- **API / action / route change** \u2192 `api-endpoint` with the method, path,\n params, request, and responses as they are after the change. Flag each changed\n param/response with `change` (and `was` on a param whose type/shape changed),\n and set `change` on the endpoint root for a wholly added or removed route. Mark\n removed endpoints with `deprecated: true` and explain in prose.\n Keep multiple API endpoints in the normal single-column document flow unless\n they are an explicit before/after contract comparison.\n Author each request/response example as a SINGLE valid JSON value \u2014 one\n top-level object or array, parseable on its own \u2014 so it renders in the\n collapsible JSON explorer. Do not put `//` or `/* */` comments, prose,\n trailing commas, or two or more concatenated top-level objects inside one\n example; a non-parseable body falls back to flat text and loses the explorer.\n When an endpoint has several distinct message shapes (for example separate\n websocket frame types, or a success body versus an error body), give each its\n OWN example with its own label rather than cramming them into one body.\n- **Compatibility-sensitive change** \u2192 short `rich-text` notes beside the\n relevant `data-model` / `api-endpoint` block. Name the changed field,\n endpoint, or behavior and mark whether it is breaking, risky, or non-breaking;\n pair that note with a split `diff` for the literal lines.\n- **Any meaningful code hunk** \u2192 `diff` with `mode: \"split\"`, carrying the real\n `before` / `after` text and the `filename` / `language`. Split mode is the\n default for recap code review because before/after legibility is the point;\n use `mode: \"unified\"` only for a genuinely narrow standalone hunk where\n side-by-side would hide the code. Give every `diff` a one-line `summary`\n saying what the hunk changes and why; it renders as a description above the\n code so the reviewer reads intent first. Never leave a diff unlabeled.\n For the KEY changed files, attach `annotations` to the `diff` so the recap\n calls out what each important hunk does \u2014 this is the headline affordance for\n annotating the key files updated. Each annotation anchors to the AFTER-side\n line numbers by default (set `side: \"before\"` to point at removed lines). Keep\n it to a few high-signal notes per file, not one per line.\n When several key files each need a substantial diff, introduce the group with a\n `rich-text` heading block whose markdown is `## Key changes`, then place the\n `diff` blocks under it in a reusable `tabs` block with horizontal orientation\n (the default \u2014 omit `orientation`) so the selected file's split diff gets the\n full document width. Let that heading label the section \u2014 do NOT also set a\n `title` on the `tabs` block. Keep each tab label to the file path or a short\n basename plus directory hint.\n The renderer's wide document layout is intentionally allowlisted: `diff`,\n `annotated-code`, vertical `tabs`, and `tabs` containing diff-like children\n break out wider than prose. Do not put API endpoints, OpenAPI specs, data\n models, JSON explorers, wireframes, question forms, or custom HTML into tabs\n merely to make them wide.\n If the recap ends with more than one supporting diff, that trailing diff\n appendix should be one horizontal `tabs` block under its own `## Key changes`\n heading, not a stack of separate `diff` blocks.\n- **Brand-new file or a substantial added block with no meaningful \"before\"** \u2192\n `annotated-code` rather than a one-sided split `diff`. Carry the real new code\n with its `filename` / `language` and anchor a few high-signal notes to the lines\n that matter so the reviewer reads what the new code does, not code for code's\n sake. Keep split `diff` for true before/after hunks where the removed lines\n still carry meaning, and group several annotated walkthroughs in a horizontal\n `tabs` block the same way diffs are grouped.\n- **Files added / removed / renamed** \u2192 `file-tree` with each entry's `change`\n flag (`added`, `removed`, `modified`, `renamed`) and a short `note`; attach a\n `snippet` only when one tells the reviewer something the path does not.\n- **Rendered UI / interaction change** \u2192 one or more wireframes showing the\n visible UI delta before the reviewer reads code. Use `Before` / `After`\n wireframes when the comparison clarifies the change; otherwise use after-only\n or a short state/flow sequence. Use realistic UI surfaces: for a popover\n change, show a popover with its title row, top-right actions, options/fields,\n tabs, selected/disabled states, people/lists/rows, and any opened prompt/menu\n anchored to the correct trigger. If a route was added, show the route body and\n the unavailable/empty state when the diff implements one. If permissions\n changed, show what managers can do and what viewers/non-managers see instead.\n Keep the body lean: the wireframe carries the UI story, while the file tree\n and `diff` blocks carry implementation evidence.\n- **Architecture or data-flow shift** \u2192 `diagram` with `data.html` / `data.css`\n as a two-panel before/after, layered, or swimlane layout, or `mermaid` for a\n quick graph. Use two-dimensional layouts; do not reduce a structural change to\n a left-to-right chain. Do not use `diagram` as a stand-in for rendered UI\n controls; UI changes need `wireframe` blocks.\n Author diagram HTML/CSS with the renderer-owned `.diagram-*` primitives\n (`.diagram-panel`, `.diagram-node`, `.diagram-pill`, `[data-rough]`, \u2026) and\n the same `--wf-*` theme tokens `references/wireframe.md` defines \u2014 never\n `font-family`, hex, rgb/hsl literals, or one-off dark/light palettes. Choose\n the outer `frame` intentionally: recap diagrams usually benefit from\n `frame: \"show\"` when they stand alone, but use `frame: \"hide\"` when columns,\n tabs, a card, or the diagram's own panels already provide the boundary.\n- **Outcome-first narrative** \u2192 `rich-text` for the \"what changed and why\" prose:\n the objective the diff served, the key decisions visible in it, and the risks a\n reviewer should weigh. This is the only place the model writes freely.\n\n## Block reference \u2014 call `get-plan-blocks`, do not memorize tags\n\nThe conceptual block names above (`api-endpoint`, `data-model`, `json-explorer`,\n`tabs`, \u2026) are NOT the JSX tags you author with, and the exact tags, required\nfields, and prop shapes change as the block library evolves. Do not author from\nmemorized tags \u2014 they drift and silently produce a wrong tag (`ApiEndpoint`\ninstead of `Endpoint`, `JsonExplorer` instead of `Json`, `Tabs` instead of\n`TabsBlock`) that errors on import.\n\n**Before writing any structured plan content, fetch/read the block catalog.** In\nhosted or self-hosted mode, call `get-plan-blocks` on the Plan MCP connector\n(`plan` or legacy `agent-native-plans`). If no Plan tools are visible yet in a\nlazy-loading client, search/load them through the host's tool discovery surface\nfirst (`tool_search` when available). In local-files mode, or when the skill was\ninstalled as plain text and no MCP tools are registered after discovery, run\n`npx @agent-native/core@latest plan blocks --out plan-blocks.md` and read that\nfile first. The CLI command calls the public no-auth `get-plan-blocks` route and\nsends no plan/recap content. If network access is unavailable, use the bundled\nreferences and validate with `plan local check`; run `plan local serve` only\nwhen the hosted Plan UI is reachable or a local Plan app is already running.\n\nThe catalog returns the authoritative, always-current block vocabulary generated\nlive from the app's own block registry \u2014 the same config the renderer and MDX\nround-trip use \u2014 so it can never be stale even if this SKILL.md is an old\ninstalled copy:\n\n- `get-plan-blocks` (default `format: \"reference\"`) \u2192 a compact table of every\n block's runtime `type`, exact MDX `<Tag>`, placement, and key data fields.\n This is your map from each conceptual name above to its real tag and props.\n- `get-plan-blocks` with `format: \"schema\"` \u2192 the full per-block JSON Schema\n plus a worked example for each block, when you need exact field types,\n enums, or nesting (e.g. `Diff.annotations`, `Endpoint.params[].in`,\n `DataModel.entities[].fields[]`).\n\nAuthor the recap source against the tags and schemas that call returns. The\ncomplete set of valid block-level tags is whatever `get-plan-blocks` lists;\nany other capitalized tag at the block level is rejected on import with an\n\"Unknown plan block\" / \"did you mean\" error. Lowercase HTML tags inside\n`rich-text`/markdown prose (`<div>`, `<span>`, `<code>`, `<br>`, \u2026) are always\nfine \u2014 only capitalized component-style block tags are validated.\n\nA few recap-specific authoring rules the registry table cannot encode:\n\n- Every structured block takes a REQUIRED `id` (unique across the whole plan)\n plus the shared optional `summary` / `editable` envelope. Ordinary top-level\n Markdown prose imports as rich-text automatically; use `<RichText id=\"...\">`\n only when prose needs explicit metadata or a preserved referenced block id.\n- Every capitalized block component must be self-closing (`<Diagram ... />`) or\n explicitly closed around children (`<RichText ...>...</RichText>`). Never\n leave a bare opening tag like `<RichText ...>` in a paragraph; MDX treats it\n as unclosed JSX and import fails before the recap can render.\n- Code-bearing blocks (`Code`, `AnnotatedCode`, and `Diff`) are\n whitespace-sensitive. Prefer the exact MDX form from the `get-plan-blocks`\n examples / source exporter, where multiline code is encoded as JSON string\n attributes such as `code={\"const x =\\n y\"}`. Static template literals are\n accepted only when they are static strings with no `${...}` interpolation.\n- `Endpoint`: prose `description` is the MDX **children** (body between the\n tags), not an attribute; for a WebSocket upgrade use `method=\"GET\"`. Each\n request/response `example` is a JSON **string** (the renderer parses it into\n the JSON explorer), so keep it a single parseable JSON value.\n- `TabsBlock`: the whole `tabs` array (including nested child blocks) is ONE\n JSON `tabs={[\u2026]}` prop \u2014 there is NO nested `<Tab>` element.\n- `WireframeBlock`: its body is a single `<Screen surface ... html=\u2026 />` subtree\n (nested MDX, not a flat prop); `html` must be a single-quoted string or static\n template literal, never a dynamic `html={someVar}` expression. See\n `references/wireframe.md` for the HTML rules.\n- `Diagram`: the whole payload is one `data={{ html?, css?, nodes?, edges?, \u2026 }}`\n attribute and requires either `html` or at least one node; `Mermaid` is its\n own separate block (`source` text), not a `Diagram` prop.\n\n## Before / After Is The Headline\n\nThe recap's center of gravity is the before/after comparison. For document-body\ncomparisons there are two primitives, and they cover the whole need together:\n\n- **`columns`** \u2014 the side-by-side container, for **structured** comparisons.\n Use two columns labeled `Before` and `After`, each holding a block (commonly a\n `data-model`, `api-endpoint`, or `rich-text`), so the reviewer reads the old\n shape against the new shape in one glance. This is the right primitive for\n \"the schema went from X to Y\" or \"the endpoint contract changed like this.\"\n Do not use `columns` simply to compact or group a list of API endpoints.\n- **`diff`** \u2014 for **code**. It renders the literal removed and added lines. Use\n it for the actual hunks. Use split mode by default for recap code review;\n reserve `mode: \"unified\"` for genuinely narrow standalone hunks where\n side-by-side would hide the code. Key-file diff groups should use horizontal\n tabs so split diffs get the full document width.\n\nFor UI diffs, wireframes are the visual comparison primitive. Use before/after\nwireframes when the comparison clarifies the change; use after-only or a state\nsequence when that better matches the change. The visual headline must show\nexact placement, realistic chrome, and adequate padding before any abstract\nexplanation. Do not stop at the first visible affordance when the diff adds a\nflow; show the entry point, the opened surface, and the resulting state or page\nso the reviewer can trace the actual user path. `references/wireframe.md` owns\nthe before/after layout choice \u2014\nthe `columns` renderer keeps narrow surfaces side by side and auto-stacks wide\n`desktop`/`browser` frames vertically; never hand-build a side-by-side\nwireframe layout in `custom-html`. For document-body\ncomparisons, there is no other multi-column primitive \u2014 `columns` plus the\n`diff` block are the whole comparison vocabulary. Do not hand-build side-by-side\nlayouts in `custom-html`, and do not stack two `data-model` blocks vertically\nand call it a comparison when `columns` exists to put them side by side.\n\n## Grounding Rule\n\nStructured blocks are **true by construction** only if they are derived from the\nactual changed lines. The `diff`, `data-model`, `api-endpoint`, and `file-tree`\nblocks MUST be built mechanically from the real diff \u2014 real paths, real fields,\nreal method/path, real before/after text \u2014 never inferred, rounded, or invented.\nThe model writes only the prose: the \"why\", the narrative, the risk read. A\nconfidently wrong recap is dangerous in a review context, because a reviewer who\ntrusts the summary may skip the very line the summary got wrong. When the diff\ndoes not contain a fact, leave it out rather than guess; mark anything the model\ninferred (not extracted) as inferred in prose.\n\n## Security\n\n- **Gate visibility.** Recaps of a private repo are org/login-gated \u2014 set the\n plan's visibility to the owning org or login, never auto-public. A recap can\n expose unreleased schema, internal endpoints, and architecture; treat it like\n the source it summarizes. Any PR comment or handoff that links to the recap\n must say that private-repo recaps require signing in with access to the owning\n org if the link does not load.\n- **Never transcribe secrets.** A diff can contain API keys, tokens, webhook\n URLs, signing secrets, `.env` values, or credential-looking literals. Do not\n copy any of these into a `diff`, `file-tree` snippet, `api-endpoint`, or prose\n block \u2014 redact them (`sk-\u2022\u2022\u2022`, `<redacted>`). This mirrors the repo's\n hardcoded-secret rule: obviously fake placeholders only, never the real value,\n in any block, caption, or note.\n\n## Bidirectional Loop\n\nIn hosted mode, because a recap is a real, editable plan, the same review loop\nas forward plans applies: a reviewer can annotate any block, and the coding\nagent reads `get-plan-feedback` to drive fixes back into the code \u2014 annotation \u2192\nagent \u2192 diff, the same close-the-loop flow forward plans use. After a reviewer\nannotates a block, call `get-plan-feedback` to read the structured feedback,\nthen either update the recap with `create-visual-recap` (passing the existing\n`planId` to replace it in place) or apply targeted changes with\n`update-visual-plan`. The loop is live and wired. In local-files privacy mode,\ndo not call those hosted tools; read review notes from chat or local files, edit\n`<plan-dir>/*.mdx` directly, and rerun `plan local check`, `serve`, or `verify`\nfor `<plan-dir>`. The one thing not yet automatic is PR-comment-triggered\nre-runs: the GitHub Action creates an initial recap per PR, but it does not yet\nre-run automatically when new review feedback is posted in GitHub \u2014 that\nauto-re-run is the remaining fast-follow.\n\n## Related Skills\n\n- **visual-plan** \u2014 the canonical command and the source of the shared Wireframe\n & Canvas and Document Quality cores; a recap follows the same block discipline\n in reverse.\n- **comment anchors** \u2014 recap comments use the same anchor rules as forward\n plans; see \"Interpreting comment anchors\" in the visual-plan skill for\n coordinate frames, wireframe node ids, text-quote resolution, detached\n threads, routing via `resolutionTarget`, and two-axis consumed/resolved state.\n- **security** \u2014 data scoping, secret handling, and the hardcoded-secret rule the\n recap's redaction and visibility gating mirror.\n- **sharing** \u2014 org/login-gated visibility for the plan that holds the recap.\n";
2
+ //# sourceMappingURL=visual-recap-skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visual-recap-skill.d.ts","sourceRoot":"","sources":["../../src/skill-content/visual-recap-skill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,2ziCAkiBjC,CAAC"}