@agent-native/core 0.41.0 → 0.42.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 (109) hide show
  1. package/dist/action.d.ts +13 -1
  2. package/dist/action.d.ts.map +1 -1
  3. package/dist/action.js.map +1 -1
  4. package/dist/agent/production-agent.d.ts +8 -0
  5. package/dist/agent/production-agent.d.ts.map +1 -1
  6. package/dist/agent/production-agent.js +93 -0
  7. package/dist/agent/production-agent.js.map +1 -1
  8. package/dist/cli/app-skill.d.ts +16 -0
  9. package/dist/cli/app-skill.d.ts.map +1 -1
  10. package/dist/cli/app-skill.js +33 -3
  11. package/dist/cli/app-skill.js.map +1 -1
  12. package/dist/cli/create.d.ts.map +1 -1
  13. package/dist/cli/create.js +57 -0
  14. package/dist/cli/create.js.map +1 -1
  15. package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
  16. package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
  17. package/dist/cli/pr-visual-recap-workflow.js +1 -1
  18. package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
  19. package/dist/cli/recap.d.ts.map +1 -1
  20. package/dist/cli/recap.js +14 -3
  21. package/dist/cli/recap.js.map +1 -1
  22. package/dist/cli/skills.d.ts +34 -3
  23. package/dist/cli/skills.d.ts.map +1 -1
  24. package/dist/cli/skills.js +172 -48
  25. package/dist/cli/skills.js.map +1 -1
  26. package/dist/cli/workspacify.d.ts.map +1 -1
  27. package/dist/cli/workspacify.js +19 -4
  28. package/dist/cli/workspacify.js.map +1 -1
  29. package/dist/client/AssistantChat.d.ts.map +1 -1
  30. package/dist/client/AssistantChat.js +2 -2
  31. package/dist/client/AssistantChat.js.map +1 -1
  32. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  33. package/dist/client/agent-chat-adapter.js +172 -5
  34. package/dist/client/agent-chat-adapter.js.map +1 -1
  35. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts +19 -0
  36. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
  37. package/dist/client/blocks/library/AnnotatedCodeBlock.js +5 -57
  38. package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
  39. package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -1
  40. package/dist/client/blocks/library/ApiEndpointBlock.js +116 -7
  41. package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -1
  42. package/dist/client/blocks/library/DataModelBlock.d.ts.map +1 -1
  43. package/dist/client/blocks/library/DataModelBlock.js +75 -9
  44. package/dist/client/blocks/library/DataModelBlock.js.map +1 -1
  45. package/dist/client/blocks/library/DiffBlock.d.ts +1 -1
  46. package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -1
  47. package/dist/client/blocks/library/DiffBlock.js +195 -34
  48. package/dist/client/blocks/library/DiffBlock.js.map +1 -1
  49. package/dist/client/blocks/library/HighlightedCode.d.ts +1 -1
  50. package/dist/client/blocks/library/HighlightedCode.js +1 -1
  51. package/dist/client/blocks/library/HighlightedCode.js.map +1 -1
  52. package/dist/client/blocks/library/annotation-rail.d.ts +96 -0
  53. package/dist/client/blocks/library/annotation-rail.d.ts.map +1 -0
  54. package/dist/client/blocks/library/annotation-rail.js +120 -0
  55. package/dist/client/blocks/library/annotation-rail.js.map +1 -0
  56. package/dist/client/blocks/library/api-endpoint.config.d.ts +31 -6
  57. package/dist/client/blocks/library/api-endpoint.config.d.ts.map +1 -1
  58. package/dist/client/blocks/library/api-endpoint.config.js +30 -6
  59. package/dist/client/blocks/library/api-endpoint.config.js.map +1 -1
  60. package/dist/client/blocks/library/code.d.ts.map +1 -1
  61. package/dist/client/blocks/library/code.js +32 -15
  62. package/dist/client/blocks/library/code.js.map +1 -1
  63. package/dist/client/blocks/library/columns.d.ts.map +1 -1
  64. package/dist/client/blocks/library/columns.js +56 -35
  65. package/dist/client/blocks/library/columns.js.map +1 -1
  66. package/dist/client/blocks/library/data-model.config.d.ts +17 -0
  67. package/dist/client/blocks/library/data-model.config.d.ts.map +1 -1
  68. package/dist/client/blocks/library/data-model.config.js +15 -0
  69. package/dist/client/blocks/library/data-model.config.js.map +1 -1
  70. package/dist/client/blocks/library/diff.config.d.ts +28 -6
  71. package/dist/client/blocks/library/diff.config.d.ts.map +1 -1
  72. package/dist/client/blocks/library/diff.config.js +30 -6
  73. package/dist/client/blocks/library/diff.config.js.map +1 -1
  74. package/dist/client/blocks/types.d.ts +2 -2
  75. package/dist/client/blocks/types.d.ts.map +1 -1
  76. package/dist/client/blocks/types.js.map +1 -1
  77. package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +1 -1
  78. package/dist/client/rich-markdown-editor/DragHandle.js +75 -9
  79. package/dist/client/rich-markdown-editor/DragHandle.js.map +1 -1
  80. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts +25 -1
  81. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -1
  82. package/dist/client/rich-markdown-editor/RegistryBlockNode.js +29 -6
  83. package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -1
  84. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +8 -1
  85. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -1
  86. package/dist/client/rich-markdown-editor/SharedRichEditor.js +5 -1
  87. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -1
  88. package/dist/extensions/actions.d.ts.map +1 -1
  89. package/dist/extensions/actions.js +159 -12
  90. package/dist/extensions/actions.js.map +1 -1
  91. package/dist/extensions/store.d.ts +21 -0
  92. package/dist/extensions/store.d.ts.map +1 -1
  93. package/dist/extensions/store.js +33 -1
  94. package/dist/extensions/store.js.map +1 -1
  95. package/dist/server/recap-image-route.d.ts.map +1 -1
  96. package/dist/server/recap-image-route.js +12 -3
  97. package/dist/server/recap-image-route.js.map +1 -1
  98. package/dist/templates/default/pnpm-workspace.yaml +7 -0
  99. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +30 -5
  100. package/dist/templates/workspace-root/package.json +0 -5
  101. package/dist/templates/workspace-root/pnpm-workspace.yaml +14 -0
  102. package/docs/content/plan-plugin.md +107 -0
  103. package/docs/content/skills-guide.md +8 -0
  104. package/docs/content/visual-plans.md +2 -0
  105. package/package.json +5 -1
  106. package/src/templates/default/pnpm-workspace.yaml +7 -0
  107. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +30 -5
  108. package/src/templates/workspace-root/package.json +0 -5
  109. package/src/templates/workspace-root/pnpm-workspace.yaml +14 -0
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAkrBjE,eAAO,MAAM,qBAAqB,gywCA6OjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,+8mCAqK5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,oiOA6JnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,46IA4GhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,q10BA0QjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,yvMAwIrC,CAAC;AA4UF,KAAK,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC;IACb;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;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AE,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAwJD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAqEhE;AA2SD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA0L1B;AAgBD,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAkIf"}
@@ -393,13 +393,23 @@ for example, a new \`Edit with AI\` action in a popover header belongs in the
393
393
  top-right header slot, aligned with the title, not in the body or footer. Use
394
394
  the same frame size, scale, outer padding, border radius, and visual density on
395
395
  both sides unless the change itself alters those properties, and let the frame
396
- height fit the content rather than leaving a tall empty lower half. Choose the
397
- before/after layout by geometry: use a \`columns\` block labeled \`Before\`/\`After\`
398
- when each state stays legible side by side; stack \`Before\` then \`After\`
399
- vertically in normal document flow when the surface is very wide, when
400
- full-width scanning matters, or when columns would shrink or crop the detail.
401
- Label each state visibly (for example, a header pill) so cropped screenshots
402
- stay unambiguous.
396
+ height fit the content rather than leaving a tall empty lower half.
397
+
398
+ **Name the states with the column header, never inside the frame.** Put the two
399
+ states in a \`columns\` block and set each column's \`label\` to \`Before\` and
400
+ \`After\` the renderer draws that label as an \`h4\` heading above each frame. Do
401
+ NOT bake a \`Before\`/\`After\` pill, title, or heading into the wireframe \`html\`: a
402
+ label placed inside reads as part of the product UI, lands in a random corner,
403
+ and clutters the comparison. The column header is the one and only place the
404
+ state name belongs.
405
+
406
+ **Let the surface choose side-by-side vs. stacked.** The \`columns\` renderer lays
407
+ narrow surfaces (\`mobile\`, \`popover\`, \`panel\`) out side by side, and
408
+ automatically stacks wide surfaces (\`desktop\`, \`browser\`) vertically at full
409
+ document width so a large frame is never crushed into a half-width column and
410
+ cropped. Author both wireframes with the real \`surface\` and the matching
411
+ \`Before\`/\`After\` column labels; do not hand-stack the pair into separate
412
+ top-level wireframes or duplicate the state name as body content.
403
413
 
404
414
  **Good example — a contacts list, surface \`browser\`.** A small, real screen
405
415
  composed from the helper classes and tokens, layout in inline flex, no fonts or
@@ -582,19 +592,28 @@ machine-checked list of block types and their data schemas, call \`get-plan-bloc
582
592
  so you never emit a block the editor cannot render or round-trip:
583
593
 
584
594
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
585
- - \`code\` for the file map: show how the few load-bearing files actually change
586
- as real, syntax-highlighted code the new action, the changed schema, the
587
- wiring point. Highlight only the files worth reading; never an exhaustive list
588
- of every touched file, and never a prose-only description of a file. When more
589
- than one file matters, group the \`code\` blocks in a vertical \`tabs\` block
590
- (the standard tab primitive) rather than a bespoke container. Reach for
591
- \`annotated-code\` instead only when a snippet needs line-anchored margin notes.
592
- If the exact code is unknown, show the smallest plausible planned shape or a
595
+ - \`annotated-code\` for the file map: when a load-bearing file is worth
596
+ highlighting, prefer the annotated walkthrough over a bare \`code\` block — carry
597
+ the real, syntax-highlighted code AND anchor short margin notes to the lines
598
+ that actually change (the new action, the changed schema, the wiring point), so
599
+ the reader sees what matters and why instead of code for code's sake. Each
600
+ annotation is \`{ lines: "12" | "12-18"; label?; note }\`; keep a few high-signal
601
+ notes per file, not one per line. Highlight only the files worth reading; never
602
+ an exhaustive list of every touched file, and never a prose-only description of
603
+ a file. Drop to a plain \`code\` block only for a throwaway snippet with nothing
604
+ to call out. When more than one file matters, group the blocks in a vertical
605
+ \`tabs\` block (the standard tab primitive) rather than a bespoke container. If
606
+ the exact code is unknown, show the smallest plausible planned shape or a
593
607
  commented stub naming what to fill in. (\`code-tabs\` and \`implementation-map\`
594
608
  are legacy: their renderers stay for old plans, but do not author new ones.)
595
- - \`decision\` for two or three option cards with consequences. These are static
596
- records; do not style them like clickable tabs or chips unless the renderer
597
- truly supports changing the selection.
609
+ - \`decision\` ONLY for a genuinely-open either/or the reviewer must still pick
610
+ between two or three option cards with real consequences. If you have already
611
+ committed to an approach, state it as settled prose or a \`callout\`, NOT a
612
+ \`decision\` block; a decision card for a question you have already answered just
613
+ reads as a confusing mid-document form. Never duplicate the same choice across a
614
+ \`decision\` block and the bottom Open Questions \`question-form\` — pick one home
615
+ for it. These are static records; do not style them like clickable tabs or chips
616
+ unless the renderer truly supports changing the selection.
598
617
  - \`columns\` for side-by-side before/after or current/target comparisons where
599
618
  each side needs real nested blocks; label the columns clearly and avoid
600
619
  stacking comparison blocks vertically when parallel reading is the point.
@@ -739,6 +758,16 @@ plan needs a richer review surface.
739
758
  patterns first; name actual files, symbols, and data shapes instead of
740
759
  inventing them. Check existing \`actions/\` before proposing endpoints and prefer
741
760
  named client helpers over raw fetch. Delegate wide exploration to a sub-agent.
761
+ Lead with reuse: for each step, name what it reuses — existing actions, schema,
762
+ components, helpers — before what it adds, so the plan explains the genuinely new
763
+ delta instead of redescribing what already exists.
764
+ - **Decide the hard-to-reverse bets first.** For non-trivial backend, data, or API
765
+ work, sketch where the feature is headed, then call out the decisions that are
766
+ expensive to undo once data or callers depend on them — wire format, public ids,
767
+ data-model shape, auth and ownership boundaries — and get those right in the plan
768
+ even if most of the feature ships later. Then scope to the smallest first cut that
769
+ proves the approach without foreclosing it, stating both what is in and what is
770
+ explicitly deferred.
742
771
  - **Preserve existing plans.** If the user pasted, referenced, or already has a
743
772
  Codex / Claude Code / Markdown plan, treat it as source material. Preserve its
744
773
  intent, do not invent codebase facts, label inferred visuals as inferred, and
@@ -791,7 +820,10 @@ plan needs a richer review surface.
791
820
  model. Plans should load out of the box for the local agent and local browser
792
821
  session; if a signed-in embedded browser cannot read a local plan that an
793
822
  anonymous/tool check can read, fix the app/action ownership or access path
794
- rather than patching one plan by hand.
823
+ rather than patching one plan by hand. For high-stakes plans (architecture,
824
+ backend, data, multi-file, or risky), also kick off the self-review pass in
825
+ **Self-Review Before Handoff** while the user reads, instead of blocking the
826
+ handoff on it.
795
827
  5. Call \`get-plan-feedback\` before editing, after review, after any long pause,
796
828
  and before the final response. Treat \`anchorDetails\`, resolver intent, recent
797
829
  review events, and any focused screenshots from browser handoff as the source
@@ -803,6 +835,34 @@ plan needs a richer review surface.
803
835
  7. Export with \`export-visual-plan\` only when the user wants a shareable receipt
804
836
  or repo-check-in artifacts.
805
837
 
838
+ ## Self-Review Before Handoff
839
+
840
+ For high-stakes plans — architecture, backend, data-model, migration, multi-file,
841
+ or otherwise risky work — run one adversarial self-review pass before treating the
842
+ plan as final. Skip it for small, UI-only, or single-decision plans where the cost
843
+ outweighs the value. Keep the pass cheap and non-blocking:
844
+
845
+ - **Surface the plan first, review concurrently.** Post the link and let the user
846
+ start reading, then run the review in parallel — never make the user wait on it.
847
+ - **Review the written plan; do not re-research.** Critique the plan text and its
848
+ own blocks. The grounding was already done while drafting, so the review checks
849
+ the output instead of re-exploring the repo.
850
+ - **Spawn one skeptical reviewer** whose only job is to find what is weak, missing,
851
+ or wrong — not to praise. Point it at: hard-to-reverse decisions made implicitly
852
+ or not at all (wire format, public ids, data-model shape, auth, ownership); steps
853
+ not anchored in real files or symbols; a menu of options where the plan should
854
+ commit to one; obvious missing decisions ("what happens when X?", "why not Y?");
855
+ and padding or single-step filler.
856
+ - **Fix vs. ask.** Apply clear-cut fixes yourself with \`update-visual-plan\`
857
+ \`contentPatches\` — vague non-goals, unanchored claims, an obvious missing
858
+ decision. Route genuine judgment calls back to the user instead: add them to the
859
+ bottom \`question-form\` Open Questions block or batch them into the normal
860
+ ask-user-question flow. Do not silently decide them.
861
+ - **Do not surprise the user mid-read.** On a large plan, apply the patches before
862
+ the editor loads; otherwise note briefly that a self-review is running so the
863
+ plan changing under them is expected. When you next respond, summarize what the
864
+ review changed and what it surfaced for the user to decide.
865
+
806
866
  ## Visual Surface Choice
807
867
 
808
868
  Choose the surface before creating the plan or after reading the source plan. Do
@@ -1382,6 +1442,26 @@ schema, API, file, and architecture changes become the same \`data-model\`,
1382
1442
  now they summarize work that exists. A reviewer scans the shape of the change
1383
1443
  before spending attention on the literal lines.
1384
1444
 
1445
+ ## Always Publish As An Agent-Native Plan — Never Inline
1446
+
1447
+ The deliverable is ALWAYS a published Agent-Native Plan, created with the
1448
+ \`create-visual-recap\` tool on the \`plan\` MCP server. NEVER hand the recap to the
1449
+ user as inline chat content — not Markdown prose, not an ASCII sketch, not a
1450
+ table, not a fenced "wireframe", not a "here's the recap" summary. A recap's
1451
+ entire value is the hosted, interactive, annotatable plan; an inline summary is
1452
+ not a recap, it is the thing a recap replaces. The only supported output is to
1453
+ publish the plan and return its absolute URL.
1454
+
1455
+ If the \`plan\` MCP server's tools are not available, do NOT improvise an inline
1456
+ recap as a fallback. The usual cause is a connector that did not finish
1457
+ connecting this session (it registers zero tools), NOT necessarily an auth
1458
+ problem — so do not assume the user must authenticate. Stop and tell the user
1459
+ how to restore it: reconnect the plan MCP server (in Claude Code, run \`/mcp\` and
1460
+ reconnect, or restart the session); only if it is genuinely unauthenticated, run
1461
+ \`agent-native connect <plan-app-url>\` or re-authenticate via \`/mcp\`. Then publish
1462
+ once the tool is reachable. Falling back to inline content is a defect, not a
1463
+ degraded mode.
1464
+
1385
1465
  ## When To Use
1386
1466
 
1387
1467
  Build a recap when a PR or commit is large, multi-file, or touches schema, API
@@ -1479,25 +1559,42 @@ text-match screenshot is not enough; visually inspect the captured image.
1479
1559
  ## Open And Report The Recap
1480
1560
 
1481
1561
  After creating the recap, link the reviewer to the rendered plan with an
1482
- **absolute URL**. Never make the primary link a local \`plan.mdx\` file, a local
1562
+ **absolute URL on the origin whose database actually holds the plan**. That
1563
+ origin is the Plan MCP server you just created the recap through — NOT whatever
1564
+ dev server you happen to know is running. The create tool returns the correct
1565
+ link; report THAT. Never make the primary link a local \`plan.mdx\` file, a local
1483
1566
  mirror folder, or a relative path such as \`/plans/<id>\`.
1484
1567
 
1568
+ A recap lives only in the database of the MCP that created it. A separately
1569
+ running local dev server (e.g. \`http://localhost:8081\`) has its OWN database and
1570
+ will NOT contain a recap created through the hosted MCP, so a hand-built
1571
+ \`localhost\` link returns "Plan not found". This is the most common recap
1572
+ mistake — do not guess an origin you have not confirmed shares the MCP's data.
1573
+
1485
1574
  Resolve the URL in this order:
1486
1575
 
1487
- 1. When creating a recap for local edits and a running local/dev Plan app origin
1488
- is known, prefer that local origin even if \`plan.mdx\` includes a hosted
1489
- \`visualUrl\`, e.g. \`http://localhost:8081/plans/<id>\`.
1490
- 2. Use the absolute \`visualUrl\` exported in \`plan.mdx\` frontmatter when present,
1491
- e.g. \`https://plan.agent-native.com/plans/<id>\`.
1492
- 3. If the action returns only a relative \`url\`/\`path\` and the running app origin
1493
- is known, construct an absolute URL from that origin, e.g.
1494
- \`http://localhost:5173/plans/<id>\`.
1495
- 4. If only the plan id is available, build the hosted absolute URL
1496
- \`https://plan.agent-native.com/plans/<id>\` and say if that URL was inferred.
1576
+ 1. Use the absolute URL the create tool RETURNS \`openLink.webUrl\`, else the
1577
+ \`visualUrl\` in the returned \`plan.mdx\` frontmatter, else \`url\`/\`path\`
1578
+ resolved against the MCP server's own origin (for the hosted MCP that is
1579
+ \`https://plan.agent-native.com\`). This always points at the database that has
1580
+ the plan.
1581
+ 2. Use a \`localhost\`/dev origin ONLY when the recap was created through a Plan
1582
+ MCP bound to that same origin i.e. that MCP's url is
1583
+ \`http://localhost:<port>/_agent-native/mcp\`. Creating through the hosted MCP
1584
+ and linking to localhost is the exact mismatch that 404s.
1585
+ 3. If only a plan id is available, build the MCP origin's absolute URL
1586
+ (hosted: \`https://plan.agent-native.com/plans/<id>\`) and say it was inferred.
1587
+
1588
+ If the user wants to review on localhost but the recap was created through the
1589
+ hosted MCP, say so plainly: the local dev server cannot see it. To view a recap
1590
+ on localhost (e.g. to exercise un-deployed local renderer changes), they must
1591
+ connect a LOCAL Plan MCP (\`http://localhost:<port>/_agent-native/mcp\`) and
1592
+ re-create the recap through it so it lands in the local database; offer to do
1593
+ that rather than handing over a localhost URL that will not resolve.
1497
1594
 
1498
1595
  When running in Codex and the Browser/in-app side browser tools are available,
1499
- open the absolute recap URL there automatically after creation. Still include the
1500
- same absolute URL in the final response. Local mirror files like
1596
+ open the returned absolute recap URL there automatically after creation. Still
1597
+ include the same absolute URL in the final response. Local mirror files like
1501
1598
  \`plans/<slug>/plan.mdx\` may be mentioned only as secondary source-control
1502
1599
  artifacts, not as the main way to open the recap.
1503
1600
 
@@ -1507,12 +1604,17 @@ Map each kind of change to the block that carries it, derived mechanically from
1507
1604
  the actual diff:
1508
1605
 
1509
1606
  - **Schema / migration change** → \`data-model\` for the resulting entities,
1510
- fields, and relations, plus a \`diff\` with \`mode: "split"\` for the literal SQL
1511
- or schema text that changed. The \`data-model\` shows the new shape; the split
1512
- \`diff\` shows exactly what moved.
1607
+ fields, and relations. Flag what moved per field/entity with
1608
+ \`change: "added" | "modified" | "removed" | "renamed"\`, and for a changed type
1609
+ set \`was\` to the prior value (e.g. the old column type) — grounded in the real
1610
+ migration diff. That diff-aware \`data-model\` is the headline; reach for a split
1611
+ \`diff\` of the literal SQL only when the exact statement still matters, not by
1612
+ default.
1513
1613
  - **API / action / route change** → \`api-endpoint\` with the method, path,
1514
- params, request, and responses as they are after the change. Mark removed
1515
- endpoints with \`deprecated: true\` and explain in prose.
1614
+ params, request, and responses as they are after the change. Flag each changed
1615
+ param/response with \`change\` (and \`was\` on a param whose type/shape changed),
1616
+ and set \`change\` on the endpoint root for a wholly added or removed route. Mark
1617
+ removed endpoints with \`deprecated: true\` and explain in prose.
1516
1618
  Keep multiple API endpoints in the normal single-column document flow unless
1517
1619
  they are an explicit before/after contract comparison.
1518
1620
  - **Compatibility-sensitive change** → short \`rich-text\` notes beside the
@@ -1521,14 +1623,35 @@ the actual diff:
1521
1623
  pair that note with a split \`diff\` for the literal lines.
1522
1624
  - **Any meaningful code hunk** → \`diff\` with \`mode: "split"\`, carrying the real
1523
1625
  \`before\` / \`after\` text and the \`filename\` / \`language\`. Split mode is the
1524
- default for a recap because before/after legibility is the whole point.
1525
- When several key files each need a substantial diff, group those \`diff\` blocks
1526
- in a reusable \`tabs\` block with \`orientation: "vertical"\` so file labels form a
1527
- left rail and the selected file's split diff renders on the right. Keep each
1528
- tab label to the file path or a short basename plus directory hint.
1626
+ default for a recap because before/after legibility is the whole point. Give
1627
+ every \`diff\` a one-line \`summary\` saying what the hunk changes and why; it
1628
+ renders as a description above the code so the reviewer reads intent first.
1629
+ Never leave a diff unlabeled.
1630
+ For the KEY changed files, attach \`annotations\` to the \`diff\` so the recap
1631
+ calls out what each important hunk does — this is the headline affordance for
1632
+ annotating the key files updated. Each annotation is
1633
+ \`{ side?: "before" | "after"; lines: "13" | "13-15"; label?: string; note }\`
1634
+ and anchors to the AFTER-side line numbers by default (set \`side: "before"\` to
1635
+ point at removed lines). Keep it to a few high-signal notes per file, not one
1636
+ per line.
1637
+ When several key files each need a substantial diff, introduce the group with a
1638
+ \`rich-text\` heading block whose markdown is \`## Key changes\`, then place the
1639
+ \`diff\` blocks under it in a reusable \`tabs\` block with
1640
+ \`orientation: "vertical"\` so file labels form a left rail and the selected
1641
+ file's split diff renders on the right. Let that heading label the section — do
1642
+ NOT also set a \`title\` on the \`tabs\` block. Keep each tab label to the file
1643
+ path or a short basename plus directory hint.
1529
1644
  If the recap ends with more than one supporting diff, that trailing diff
1530
- appendix should be one vertical \`tabs\` block, not a stack of separate \`diff\`
1531
- blocks.
1645
+ appendix should be one vertical \`tabs\` block under its own \`## Key changes\`
1646
+ heading, not a stack of separate \`diff\` blocks.
1647
+ - **Brand-new file or a substantial added block with no meaningful "before"** →
1648
+ \`annotated-code\` rather than a one-sided split \`diff\`. Carry the real new code
1649
+ with its \`filename\` / \`language\` and anchor a few high-signal notes to the lines
1650
+ that matter (\`{ lines: "12" | "12-18"; label?; note }\`) so the reviewer reads
1651
+ what the new code does, not code for code's sake. Keep split \`diff\` for true
1652
+ before/after hunks where the removed lines still carry meaning, and group
1653
+ several annotated walkthroughs in a vertical \`tabs\` block the same way diffs are
1654
+ grouped.
1532
1655
  - **Files added / removed / renamed** → \`file-tree\` with each entry's \`change\`
1533
1656
  flag (\`added\`, \`removed\`, \`modified\`, \`renamed\`) and a short \`note\`; attach a
1534
1657
  \`snippet\` only when one tells the reviewer something the path does not.
@@ -1576,9 +1699,10 @@ For UI diffs, wireframes are the visual comparison primitive. Use before/after
1576
1699
  wireframes when the comparison clarifies the change; use after-only or a state
1577
1700
  sequence when that better matches the change. The visual headline must show
1578
1701
  exact placement, realistic chrome, and adequate padding before any abstract
1579
- explanation. The Wireframe Quality core owns the before/after layout choice
1580
- (side-by-side \`columns\` vs. vertical stack, picked by geometry); never
1581
- hand-build a side-by-side wireframe layout in \`custom-html\`. For document-body
1702
+ explanation. The Wireframe Quality core owns the before/after layout choice
1703
+ the \`columns\` renderer keeps narrow surfaces side by side and auto-stacks wide
1704
+ \`desktop\`/\`browser\` frames vertically; never hand-build a side-by-side
1705
+ wireframe layout in \`custom-html\`. For document-body
1582
1706
  comparisons, there is no other multi-column primitive — \`columns\` plus split
1583
1707
  \`diff\` are the whole comparison vocabulary. Do not hand-build side-by-side
1584
1708
  layouts in \`custom-html\`, and do not stack two \`data-model\` blocks vertically
@@ -1765,7 +1889,7 @@ is available.
1765
1889
  Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1766
1890
  not put shared secrets in skill files.
1767
1891
  `;
1768
- const BUILT_IN_APP_SKILLS = {
1892
+ export const BUILT_IN_APP_SKILLS = {
1769
1893
  assets: {
1770
1894
  skillName: "assets",
1771
1895
  manifest: normalizeAppSkillManifest({