create-kywi-app 0.30.0 → 0.32.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.
- package/assets/agent-patterns.md +67 -0
- package/package.json +1 -1
package/assets/agent-patterns.md
CHANGED
|
@@ -845,6 +845,12 @@ grows past one.
|
|
|
845
845
|
- **Changesets** batch related edits (a product launch touching six pages) and
|
|
846
846
|
publish them together, optionally on a schedule. Use one whenever a launch
|
|
847
847
|
spans multiple nodes — partial launches are worse than late ones.
|
|
848
|
+
- **To hand a staged changeset to QA or a client**, set its preview visibility to
|
|
849
|
+
`public` (`set_changeset_preview_visibility`), then create a preview link
|
|
850
|
+
(`create_changeset_preview_link`). The URL is shown once, so pass it on
|
|
851
|
+
immediately. Add a passcode (8+ characters) for sensitive content. Links end
|
|
852
|
+
when they expire, when the changeset publishes, or when it goes private
|
|
853
|
+
(which revokes every link for good).
|
|
848
854
|
|
|
849
855
|
## 11. Multilingual sites
|
|
850
856
|
|
|
@@ -887,6 +893,67 @@ early, so ask at scoping time.
|
|
|
887
893
|
`Link` header. Never write a static `public/llms.txt` or a hand-made `.md`
|
|
888
894
|
file — the generated ones follow every publish.
|
|
889
895
|
|
|
896
|
+
## When the user pastes a `kywi:` reference
|
|
897
|
+
|
|
898
|
+
The editor's module and section chrome has **Copy reference**, which copies one
|
|
899
|
+
line like this for the owner to paste to you:
|
|
900
|
+
|
|
901
|
+
```
|
|
902
|
+
kywi:marketing/page/3f2a91c0-…/m/7c91e2… — Heading "Run the whole room" on /about
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
The token is the address; the text after ` — ` is what the owner was looking
|
|
906
|
+
at. Its grammar:
|
|
907
|
+
|
|
908
|
+
```
|
|
909
|
+
kywi:{site}/{contentType}/{contentId}/{m|s}/{nodeId}[@pv:{variantId} | @ab:{experimentId}:{variantId}]
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
`m` = module, `s` = section. `site` is the site's slug or UUID, or `_` when the
|
|
913
|
+
editor couldn't tell (the content id is unique across sites, so it still
|
|
914
|
+
resolves). The `@…` suffix appears only when the node was copied from a page
|
|
915
|
+
variant or a page A/B variant: those start as a copy of the default page and
|
|
916
|
+
reuse its node ids. A reference without it always means the default page.
|
|
917
|
+
|
|
918
|
+
1. **Call `resolve_ref` first** with the whole line. It returns the page, where
|
|
919
|
+
the node sits, its props and props schema, ready-made `next` arguments, a
|
|
920
|
+
`design` hint and `warnings`.
|
|
921
|
+
2. **Sanity-check against the description.** If the module type or text
|
|
922
|
+
doesn't match what the owner described, say so before editing.
|
|
923
|
+
3. **Content or settings change** ("change the heading", "make the button say
|
|
924
|
+
Book a demo"): use the site tools with the `next` arguments
|
|
925
|
+
(`update_module_props`, `remove_module`, `add_module`). When `next` says the
|
|
926
|
+
node isn't directly addressable (an arm, a page variant), read the page with
|
|
927
|
+
`get_layout`, change that node by id in the copy `location` names, and write
|
|
928
|
+
it back with `update_layout`.
|
|
929
|
+
4. **Design change** ("make this band tighter", "bigger image"): spacing and
|
|
930
|
+
colors live in the node's `style` (theme tokens). Markup and visual
|
|
931
|
+
behavior live in code: for a custom module, the component named by its
|
|
932
|
+
`defineModule` entry in `kywi.config.ts`; a built-in module's markup is not
|
|
933
|
+
yours to change, so use props/Style Overrides or propose a custom module.
|
|
934
|
+
5. **Linked component** (a warning names it; this includes a module inside a
|
|
935
|
+
linked section): `next` carries no edit arguments. The live page renders the
|
|
936
|
+
component definition (`resolvedProps` when the node can be matched in it,
|
|
937
|
+
otherwise a `resolvedNote` saying the stored copy may differ), and editing
|
|
938
|
+
the component changes
|
|
939
|
+
every page that uses it. Check its reach (`list_components` with
|
|
940
|
+
`withUsage`) and confirm with the owner first. Never patch the placement
|
|
941
|
+
with `update_module_props`: that silently forks it into a page-local
|
|
942
|
+
override. If they want only this page changed, the instance has to be
|
|
943
|
+
detached first (the editor's Detach).
|
|
944
|
+
6. **Inside a personalization or A/B arm** (`location.container`): the change
|
|
945
|
+
only reaches visitors in that arm. Confirm that's what the owner meant, and
|
|
946
|
+
edit the arm with `get_layout` + `update_layout`.
|
|
947
|
+
7. **Ambiguous or not on the default page** (`ambiguous: true`, or
|
|
948
|
+
`notOnDefaultPage: true`, with several `locations` and no edit arguments):
|
|
949
|
+
the id occurs more than once in the copy the reference names, or the
|
|
950
|
+
reference has no variant suffix but the id is now only in page variants.
|
|
951
|
+
Ask the owner which one they meant (or to copy the reference again from
|
|
952
|
+
what's on screen); don't guess.
|
|
953
|
+
8. **Stale reference** (the node or the variant was removed): `resolve_ref`
|
|
954
|
+
lists the page's current modules and sections. Match the owner's
|
|
955
|
+
description, then confirm the match with them before changing anything.
|
|
956
|
+
|
|
890
957
|
## Other capabilities worth knowing
|
|
891
958
|
|
|
892
959
|
- **Comments:** a moderated Comments module (submissions land pending) for
|
package/package.json
CHANGED