@bettercms-ai/mcp 0.83.0 → 0.83.2

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 (40) hide show
  1. package/README.md +86 -86
  2. package/SKILL.md +160 -160
  3. package/dist/index.js +38 -9
  4. package/dist/index.js.map +1 -1
  5. package/dist/kit-catalog.json +1509 -1509
  6. package/dist/skills/bettercms/SKILL.md +206 -206
  7. package/dist/skills/bettercms/references/accessibility.md +171 -171
  8. package/dist/skills/bettercms/references/animation.md +296 -296
  9. package/dist/skills/bettercms/references/astro.md +148 -148
  10. package/dist/skills/bettercms/references/bindings.md +366 -366
  11. package/dist/skills/bettercms/references/componentize.md +185 -185
  12. package/dist/skills/bettercms/references/components.md +415 -415
  13. package/dist/skills/bettercms/references/content-experiments.md +62 -62
  14. package/dist/skills/bettercms/references/content-modeling.md +382 -382
  15. package/dist/skills/bettercms/references/detection.md +465 -465
  16. package/dist/skills/bettercms/references/dock-input.md +121 -121
  17. package/dist/skills/bettercms/references/editor-chrome.md +92 -92
  18. package/dist/skills/bettercms/references/external-content.md +78 -78
  19. package/dist/skills/bettercms/references/finish-site.md +377 -377
  20. package/dist/skills/bettercms/references/forms-and-interactions.md +245 -245
  21. package/dist/skills/bettercms/references/frameworks.md +159 -159
  22. package/dist/skills/bettercms/references/getting-started.md +156 -156
  23. package/dist/skills/bettercms/references/integrations.md +364 -364
  24. package/dist/skills/bettercms/references/kit-catalog.md +3259 -3259
  25. package/dist/skills/bettercms/references/kit-scenarios.md +712 -712
  26. package/dist/skills/bettercms/references/localization.md +85 -85
  27. package/dist/skills/bettercms/references/media-and-brand.md +181 -181
  28. package/dist/skills/bettercms/references/next.md +189 -189
  29. package/dist/skills/bettercms/references/other-frameworks.md +85 -85
  30. package/dist/skills/bettercms/references/portable-text.md +213 -213
  31. package/dist/skills/bettercms/references/programmatic-seo.md +98 -98
  32. package/dist/skills/bettercms/references/publishing.md +289 -289
  33. package/dist/skills/bettercms/references/seo.md +357 -357
  34. package/dist/skills/bettercms/references/shopify-headless.md +52 -52
  35. package/dist/skills/bettercms/references/site-blueprints.md +895 -895
  36. package/dist/skills/bettercms/references/site-review.md +74 -74
  37. package/dist/skills/bettercms/references/worked-examples-advanced.md +509 -509
  38. package/dist/skills/bettercms/references/worked-examples.md +885 -885
  39. package/dist/skills/bettercms/references/write-limits.md +217 -217
  40. package/package.json +1 -1
@@ -1,156 +1,156 @@
1
- ---
2
- title: "Getting started"
3
- description: "Set up or resume a BetterCMS project: connect the MCP, pick or create the project, import or build the site, then publish and verify; the resume check for 'Continue BetterCMS setup'."
4
- ---
5
-
6
- # Getting started on a BetterCMS project
7
-
8
- The dashboard's launcher prompt points here. Its **Context** block holds what the dashboard
9
- already knows: project name and id, framework, source repo, and the job. Trust it, and ask only
10
- for what it leaves out.
11
-
12
- ## Communication style
13
-
14
- Be succinct. Say what you did ("Converted 12 routes; 3 values still unmatched on /pricing") and
15
- skip narrating what you are about to do. Give numbers, not adjectives. Finish the setup in this
16
- run: do not stop to ask anything the sections below give an answer for.
17
-
18
- **RESUME TRIGGER.** On "Continue BetterCMS setup", read `get_project`, `get_next_steps` and
19
- `get_binding_report` for the project and the gap ledger at `.bettercms/ledger.json` if it exists,
20
- find the first phase below whose check is not met, say which one in one line, and resume there.
21
- Never redo a phase whose check already holds.
22
-
23
- ## An existing site (imported from GitHub or a ZIP)
24
-
25
- ### Phase 1 — Connect and confirm
26
-
27
- Check: the MCP answers for this project id, and this folder is its repo.
28
-
29
- 1. Read the Connecting section of SKILL.md before your first tool call: a first-call 401 is the
30
- sign-in, and a project missing from `list_projects` means the wrong workspace.
31
- 2. `get_project` with the id from Context. Pass `projectId` on every project tool.
32
- 3. Confirm this folder holds the site's `package.json` and source. If it does not:
33
- - No repo on disk yet: clone it with `npx @bettercms-ai/cli@latest init --project-id <id>`
34
- in the folder where the repo should live. It signs in, clones or downloads the source into
35
- a new folder (named for the project unless you pass `--dir <path>`), installs dependencies,
36
- pre-fills `.env`, and sets up these skills and the hosted MCP in the user's editors
37
- (`npx -y @bettercms-ai/install@latest --global --mcp`). If it warned that the agent setup
38
- failed, run the command the warning prints, inside the clone.
39
- - Either way, stop and ask the user to restart you **inside** the repo folder: an MCP entry
40
- added while you run loads only when the agent starts, and every step below works on that
41
- folder's source. Not when `init` launched you: you already run there, connected.
42
-
43
- ### Phase 2 — No questions: the defaults are recorded
44
-
45
- Nothing here is asked. Record and report:
46
-
47
- 1. **Authoring**: components. A deploy, a promote and every `editor_setup` record it when nothing
48
- is set; call `set_authoring_preference` only if the prompt you were started with names `fields`.
49
- 2. **Media delivery**: the BetterCMS CDN, the project's default. Leave it.
50
- 3. **Git**: the prompt you were started with says whether you may push. Follow it; never ask.
51
-
52
- Everything else has a default too. Do not ask about it; decide, then report what you decided:
53
-
54
- - **Scope is the whole site**: every page, section, heading, paragraph, list item, link and image
55
- the site renders. Not the home page first, not "the main copy".
56
- - **Sections, their names and componentizing**: [components.md](components.md).
57
- - **Collections vs singletons**: [content-modeling.md](content-modeling.md).
58
- - **Field types and rich text**: [portable-text.md](portable-text.md).
59
-
60
- ### Phase 3 — Convert and componentize
61
-
62
- Check: `editor_setup { check: true }` reads `ready`, `get_next_steps` returns
63
- `receipt.complete: true` and `get_componentize_plan` proposes nothing more. Where the job was to
64
- convert the source, `submit_conversion_receipt` also returned complete.
65
-
66
- 0. A build brings in only SEO and meta, media, the brand and the models `bcms-content.json`
67
- declares. Pages, collections, forms, bindings and components come from `editor_setup`: run it
68
- and poll `editor_setup { check: true }` until `ready` before anything below. Run it again
69
- whenever `get_deploy_status` reports `editorSetup` `stale`: a re-run flags the auto fields the
70
- build no longer renders `stale` (hidden in the editor, never deleted) and never one a person edited, so never delete those by hand. It also fills missing meta from the
71
- page copy, merges identical components and switches to declared bindings when the build proves
72
- them; the receipt stays yours (it is the codemod's account of your repo).
73
- 1. Explore the repo (the "Read when" column of SKILL.md's reference table names the signals) and
74
- read `get_site_composition`.
75
- 2. If `list_env_vars` reports `missing` variables, run `npx @bettercms-ai/cli@latest env push`
76
- in the repository: it sets them from the user's own .env files without the values passing
77
- through you. If they are not found there and the site loads its content from another CMS,
78
- move that content into BetterCMS ([external-content.md](external-content.md)). Never ask the
79
- user for a key or read one: a site left depending on missing keys renders empty or crashes.
80
- 3. Work from `get_next_steps`: run `receipt.gate.nextAction`, read it again after each batch, and
81
- repeat until `receipt.complete` is true. On a site set up from its build that gate is the only
82
- finish line. Run the `convert_site` prompt only when the job is to convert the source (the gate
83
- asks for it, the owner wants the code to declare its bindings, or the project is headless), and
84
- then to its own complete receipt, never a partial one.
85
- 4. With components recorded: `get_componentize_plan`, then apply it with
86
- `componentize_sections` (the owner can undo it), then the repository half (`componentize_sections { codemod: true }`
87
- when there is no checkout) and `submit_componentize_receipt` ([componentize.md](componentize.md)).
88
- 5. Work the rest through [finish-site.md](finish-site.md) (gap ledger, repair order, proof loop).
89
- The gate's `sections` and `style` rows are part of it: a setup whose pages cannot take a new
90
- section, a new order or spacing is not finished.
91
- 6. End Phase 3 on the editor chrome of every component (step 8 of finish-site.md's repair order,
92
- [editor-chrome.md](editor-chrome.md)): the gate's `dock` row blocks until each has its V2 `ui`.
93
-
94
- ### Phase 4 — Publish and verify
95
-
96
- Check: the deployed site passes the numbers below on every route.
97
-
98
- 1. Deploy the way this project deploys: `deploy_project` on BetterCMS hosting; on a headless
99
- project, push to the repo its host builds (never `deploy_project` there).
100
- 2. `get_next_steps` reading `receipt.complete: true` is the finish line. `get_binding_report`
101
- says why a route is short of it: `unaddressable` below 2% on each route, and, on a source you
102
- converted, zero unmatched and an empty `coverage.pending`. `refreshReason: "never-generated"` on headless means
103
- fetch the live site instead.
104
- 3. Run the verify loop in SKILL.md against the live URL, then the two-path smoke test (click
105
- through to a detail page, clean console, direct reload) in [frameworks.md](frameworks.md)
106
- Verify step 5.
107
- 4. Send a coverage report with its denominators, per route: values bound out of values found
108
- (bound + unmatched), unaddressable text out of visible text, and routes converted out of
109
- `builtRoutes`. A percentage with no denominator is not a report.
110
- 5. Anything only the dashboard can do: name the exact click.
111
-
112
- ## A new site (nothing built yet)
113
-
114
- 1. Phase 1 above, then ask the authoring question (`set_authoring_preference`) before any schema
115
- write.
116
- 2. Read `bettercms://playbook/schema`. Plan routes and collections first
117
- ([site-blueprints.md](site-blueprints.md)), then build sections ([components.md](components.md)).
118
- 3. When a repo exists, clone it with the `init` command above, restart inside it, and continue
119
- from Phase 3.
120
-
121
- ## A headless project (its own front end)
122
-
123
- `get_project` says `hostingMode: "headless"`: BetterCMS never builds this site, its own host does.
124
- Done is `receipt.frontEnd` closed AND `receipt.gate` complete in get_next_steps: BetterCMS derived
125
- the owner's pages, their code reads the content, the front end has its site URL and rebuilds on
126
- publish. Work the rows in order; never `deploy_project` or `deploy_to_host`.
127
-
128
- 1. **Launched by `bettercms init`** (`--agent claude|codex|opencode|cursor|gemini`): you run in the
129
- owner's own front end, already connected. Do not ask to be restarted. **Their code, design and
130
- copy ARE the site:** keep every component, route, class, style and asset; never redesign a page,
131
- rebuild one from scratch or swap their components for new ones. A starter is only ever the
132
- starting point when the owner chose one (`init --framework`).
133
- 2. **Derive** (`derive` row). `npx @bettercms-ai/cli@latest derive` in the front end's folder builds
134
- the site, renders every page as a visitor sees it and sends the pages to BetterCMS, which derives
135
- their pages, fields and today's copy exactly as from a build it made. init runs it first; run it
136
- yourself while the row is open. Never model those pages again.
137
- 3. **Convert in place** (`receipt.gate`, the same gate as any built site). `get_conversion_brief
138
- { complete: true }`, the convert codemod over this folder (its command is in
139
- `bettercms://playbook/schema` §13), then `submit_conversion_receipt` with the receipt it wrote:
140
- each literal becomes a read of its field with the markup byte-identical. Bind what it leaves pending by hand the same way. Then
141
- start the build script with it, `"build": "bettercms pull-content && next build"`
142
- (`@bettercms-ai/cli` a devDependency; not a `prebuild` hook, which Yarn and pnpm skip): the
143
- converted pages read `bcms-content/*.json`, which only that step writes on the host's build.
144
- 4. **Wire and read.** `.env` gets `BCMS_API_URL`, `BCMS_WORKSPACE` and `BCMS_PROJECT_ID` (from
145
- `get_project`); published content needs no key. A starter whose config reads a key gets one
146
- from `create_delivery_key` (`scope: "published"`), written straight into `.env`, never into
147
- chat or a commit. Run the app and load a page: its first read closes `read`.
148
- 5. **Deploy.** `npx @bettercms-ai/cli@latest deploy --to vercel|netlify|cloudflare` from the
149
- folder: the host's own sign-in, the `BCMS_*` variables set there, and the rebuild hook
150
- registered (`publish-hook`). A front end that revalidates instead: `set_front_end
151
- { revalidation }`. Then `derive` again, so the gate measures what ships: on headless, every
152
- gate fix that says rebuild means deploy, then derive.
153
- 6. **Open it from BetterCMS.** `set_front_end { siteUrl, framework }` with the deployed URL
154
- (`preview`); editors' "Preview on site" opens drafts there.
155
- 7. **Publish**, then get_next_steps until `receipt.complete` is true. Schema and content work is
156
- the same as on any project ([content-modeling.md](content-modeling.md)).
1
+ ---
2
+ title: "Getting started"
3
+ description: "Set up or resume a BetterCMS project: connect the MCP, pick or create the project, import or build the site, then publish and verify; the resume check for 'Continue BetterCMS setup'."
4
+ ---
5
+
6
+ # Getting started on a BetterCMS project
7
+
8
+ The dashboard's launcher prompt points here. Its **Context** block holds what the dashboard
9
+ already knows: project name and id, framework, source repo, and the job. Trust it, and ask only
10
+ for what it leaves out.
11
+
12
+ ## Communication style
13
+
14
+ Be succinct. Say what you did ("Converted 12 routes; 3 values still unmatched on /pricing") and
15
+ skip narrating what you are about to do. Give numbers, not adjectives. Finish the setup in this
16
+ run: do not stop to ask anything the sections below give an answer for.
17
+
18
+ **RESUME TRIGGER.** On "Continue BetterCMS setup", read `get_project`, `get_next_steps` and
19
+ `get_binding_report` for the project and the gap ledger at `.bettercms/ledger.json` if it exists,
20
+ find the first phase below whose check is not met, say which one in one line, and resume there.
21
+ Never redo a phase whose check already holds.
22
+
23
+ ## An existing site (imported from GitHub or a ZIP)
24
+
25
+ ### Phase 1 — Connect and confirm
26
+
27
+ Check: the MCP answers for this project id, and this folder is its repo.
28
+
29
+ 1. Read the Connecting section of SKILL.md before your first tool call: a first-call 401 is the
30
+ sign-in, and a project missing from `list_projects` means the wrong workspace.
31
+ 2. `get_project` with the id from Context. Pass `projectId` on every project tool.
32
+ 3. Confirm this folder holds the site's `package.json` and source. If it does not:
33
+ - No repo on disk yet: clone it with `npx @bettercms-ai/cli@latest init --project-id <id>`
34
+ in the folder where the repo should live. It signs in, clones or downloads the source into
35
+ a new folder (named for the project unless you pass `--dir <path>`), installs dependencies,
36
+ pre-fills `.env`, and sets up these skills and the hosted MCP in the user's editors
37
+ (`npx -y @bettercms-ai/install@latest --global --mcp`). If it warned that the agent setup
38
+ failed, run the command the warning prints, inside the clone.
39
+ - Either way, stop and ask the user to restart you **inside** the repo folder: an MCP entry
40
+ added while you run loads only when the agent starts, and every step below works on that
41
+ folder's source. Not when `init` launched you: you already run there, connected.
42
+
43
+ ### Phase 2 — No questions: the defaults are recorded
44
+
45
+ Nothing here is asked. Record and report:
46
+
47
+ 1. **Authoring**: components. A deploy, a promote and every `editor_setup` record it when nothing
48
+ is set; call `set_authoring_preference` only if the prompt you were started with names `fields`.
49
+ 2. **Media delivery**: the BetterCMS CDN, the project's default. Leave it.
50
+ 3. **Git**: the prompt you were started with says whether you may push. Follow it; never ask.
51
+
52
+ Everything else has a default too. Do not ask about it; decide, then report what you decided:
53
+
54
+ - **Scope is the whole site**: every page, section, heading, paragraph, list item, link and image
55
+ the site renders. Not the home page first, not "the main copy".
56
+ - **Sections, their names and componentizing**: [components.md](components.md).
57
+ - **Collections vs singletons**: [content-modeling.md](content-modeling.md).
58
+ - **Field types and rich text**: [portable-text.md](portable-text.md).
59
+
60
+ ### Phase 3 — Convert and componentize
61
+
62
+ Check: `editor_setup { check: true }` reads `ready`, `get_next_steps` returns
63
+ `receipt.complete: true` and `get_componentize_plan` proposes nothing more. Where the job was to
64
+ convert the source, `submit_conversion_receipt` also returned complete.
65
+
66
+ 0. A build brings in only SEO and meta, media, the brand and the models `bcms-content.json`
67
+ declares. Pages, collections, forms, bindings and components come from `editor_setup`: run it
68
+ and poll `editor_setup { check: true }` until `ready` before anything below. Run it again
69
+ whenever `get_deploy_status` reports `editorSetup` `stale`: a re-run flags the auto fields the
70
+ build no longer renders `stale` (hidden in the editor, never deleted) and never one a person edited, so never delete those by hand. It also fills missing meta from the
71
+ page copy, merges identical components and switches to declared bindings when the build proves
72
+ them; the receipt stays yours (it is the codemod's account of your repo).
73
+ 1. Explore the repo (the "Read when" column of SKILL.md's reference table names the signals) and
74
+ read `get_site_composition`.
75
+ 2. If `list_env_vars` reports `missing` variables, run `npx @bettercms-ai/cli@latest env push`
76
+ in the repository: it sets them from the user's own .env files without the values passing
77
+ through you. If they are not found there and the site loads its content from another CMS,
78
+ move that content into BetterCMS ([external-content.md](external-content.md)). Never ask the
79
+ user for a key or read one: a site left depending on missing keys renders empty or crashes.
80
+ 3. Work from `get_next_steps`: run `receipt.gate.nextAction`, read it again after each batch, and
81
+ repeat until `receipt.complete` is true. On a site set up from its build that gate is the only
82
+ finish line. Run the `convert_site` prompt only when the job is to convert the source (the gate
83
+ asks for it, the owner wants the code to declare its bindings, or the project is headless), and
84
+ then to its own complete receipt, never a partial one.
85
+ 4. With components recorded: `get_componentize_plan`, then apply it with
86
+ `componentize_sections` (the owner can undo it), then the repository half (`componentize_sections { codemod: true }`
87
+ when there is no checkout) and `submit_componentize_receipt` ([componentize.md](componentize.md)).
88
+ 5. Work the rest through [finish-site.md](finish-site.md) (gap ledger, repair order, proof loop).
89
+ The gate's `sections` and `style` rows are part of it: a setup whose pages cannot take a new
90
+ section, a new order or spacing is not finished.
91
+ 6. End Phase 3 on the editor chrome of every component (step 8 of finish-site.md's repair order,
92
+ [editor-chrome.md](editor-chrome.md)): the gate's `dock` row blocks until each has its V2 `ui`.
93
+
94
+ ### Phase 4 — Publish and verify
95
+
96
+ Check: the deployed site passes the numbers below on every route.
97
+
98
+ 1. Deploy the way this project deploys: `deploy_project` on BetterCMS hosting; on a headless
99
+ project, push to the repo its host builds (never `deploy_project` there).
100
+ 2. `get_next_steps` reading `receipt.complete: true` is the finish line. `get_binding_report`
101
+ says why a route is short of it: `unaddressable` below 2% on each route, and, on a source you
102
+ converted, zero unmatched and an empty `coverage.pending`. `refreshReason: "never-generated"` on headless means
103
+ fetch the live site instead.
104
+ 3. Run the verify loop in SKILL.md against the live URL, then the two-path smoke test (click
105
+ through to a detail page, clean console, direct reload) in [frameworks.md](frameworks.md)
106
+ Verify step 5.
107
+ 4. Send a coverage report with its denominators, per route: values bound out of values found
108
+ (bound + unmatched), unaddressable text out of visible text, and routes converted out of
109
+ `builtRoutes`. A percentage with no denominator is not a report.
110
+ 5. Anything only the dashboard can do: name the exact click.
111
+
112
+ ## A new site (nothing built yet)
113
+
114
+ 1. Phase 1 above, then ask the authoring question (`set_authoring_preference`) before any schema
115
+ write.
116
+ 2. Read `bettercms://playbook/schema`. Plan routes and collections first
117
+ ([site-blueprints.md](site-blueprints.md)), then build sections ([components.md](components.md)).
118
+ 3. When a repo exists, clone it with the `init` command above, restart inside it, and continue
119
+ from Phase 3.
120
+
121
+ ## A headless project (its own front end)
122
+
123
+ `get_project` says `hostingMode: "headless"`: BetterCMS never builds this site, its own host does.
124
+ Done is `receipt.frontEnd` closed AND `receipt.gate` complete in get_next_steps: BetterCMS derived
125
+ the owner's pages, their code reads the content, the front end has its site URL and rebuilds on
126
+ publish. Work the rows in order; never `deploy_project` or `deploy_to_host`.
127
+
128
+ 1. **Launched by `bettercms init`** (`--agent claude|codex|opencode|cursor|gemini`): you run in the
129
+ owner's own front end, already connected. Do not ask to be restarted. **Their code, design and
130
+ copy ARE the site:** keep every component, route, class, style and asset; never redesign a page,
131
+ rebuild one from scratch or swap their components for new ones. A starter is only ever the
132
+ starting point when the owner chose one (`init --framework`).
133
+ 2. **Derive** (`derive` row). `npx @bettercms-ai/cli@latest derive` in the front end's folder builds
134
+ the site, renders every page as a visitor sees it and sends the pages to BetterCMS, which derives
135
+ their pages, fields and today's copy exactly as from a build it made. init runs it first; run it
136
+ yourself while the row is open. Never model those pages again.
137
+ 3. **Convert in place** (`receipt.gate`, the same gate as any built site). `get_conversion_brief
138
+ { complete: true }`, the convert codemod over this folder (its command is in
139
+ `bettercms://playbook/schema` §13), then `submit_conversion_receipt` with the receipt it wrote:
140
+ each literal becomes a read of its field with the markup byte-identical. Bind what it leaves pending by hand the same way. Then
141
+ start the build script with it, `"build": "bettercms pull-content && next build"`
142
+ (`@bettercms-ai/cli` a devDependency; not a `prebuild` hook, which Yarn and pnpm skip): the
143
+ converted pages read `bcms-content/*.json`, which only that step writes on the host's build.
144
+ 4. **Wire and read.** `.env` gets `BCMS_API_URL`, `BCMS_WORKSPACE` and `BCMS_PROJECT_ID` (from
145
+ `get_project`); published content needs no key. A starter whose config reads a key gets one
146
+ from `create_delivery_key` (`scope: "published"`), written straight into `.env`, never into
147
+ chat or a commit. Run the app and load a page: its first read closes `read`.
148
+ 5. **Deploy.** `npx @bettercms-ai/cli@latest deploy --to vercel|netlify|cloudflare` from the
149
+ folder: the host's own sign-in, the `BCMS_*` variables set there, and the rebuild hook
150
+ registered (`publish-hook`). A front end that revalidates instead: `set_front_end
151
+ { revalidation }`. Then `derive` again, so the gate measures what ships: on headless, every
152
+ gate fix that says rebuild means deploy, then derive.
153
+ 6. **Open it from BetterCMS.** `set_front_end { siteUrl, framework }` with the deployed URL
154
+ (`preview`); editors' "Preview on site" opens drafts there.
155
+ 7. **Publish**, then get_next_steps until `receipt.complete` is true. Schema and content work is
156
+ the same as on any project ([content-modeling.md](content-modeling.md)).