@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.
- package/README.md +86 -86
- package/SKILL.md +160 -160
- package/dist/index.js +38 -9
- package/dist/index.js.map +1 -1
- package/dist/kit-catalog.json +1509 -1509
- package/dist/skills/bettercms/SKILL.md +206 -206
- package/dist/skills/bettercms/references/accessibility.md +171 -171
- package/dist/skills/bettercms/references/animation.md +296 -296
- package/dist/skills/bettercms/references/astro.md +148 -148
- package/dist/skills/bettercms/references/bindings.md +366 -366
- package/dist/skills/bettercms/references/componentize.md +185 -185
- package/dist/skills/bettercms/references/components.md +415 -415
- package/dist/skills/bettercms/references/content-experiments.md +62 -62
- package/dist/skills/bettercms/references/content-modeling.md +382 -382
- package/dist/skills/bettercms/references/detection.md +465 -465
- package/dist/skills/bettercms/references/dock-input.md +121 -121
- package/dist/skills/bettercms/references/editor-chrome.md +92 -92
- package/dist/skills/bettercms/references/external-content.md +78 -78
- package/dist/skills/bettercms/references/finish-site.md +377 -377
- package/dist/skills/bettercms/references/forms-and-interactions.md +245 -245
- package/dist/skills/bettercms/references/frameworks.md +159 -159
- package/dist/skills/bettercms/references/getting-started.md +156 -156
- package/dist/skills/bettercms/references/integrations.md +364 -364
- package/dist/skills/bettercms/references/kit-catalog.md +3259 -3259
- package/dist/skills/bettercms/references/kit-scenarios.md +712 -712
- package/dist/skills/bettercms/references/localization.md +85 -85
- package/dist/skills/bettercms/references/media-and-brand.md +181 -181
- package/dist/skills/bettercms/references/next.md +189 -189
- package/dist/skills/bettercms/references/other-frameworks.md +85 -85
- package/dist/skills/bettercms/references/portable-text.md +213 -213
- package/dist/skills/bettercms/references/programmatic-seo.md +98 -98
- package/dist/skills/bettercms/references/publishing.md +289 -289
- package/dist/skills/bettercms/references/seo.md +357 -357
- package/dist/skills/bettercms/references/shopify-headless.md +52 -52
- package/dist/skills/bettercms/references/site-blueprints.md +895 -895
- package/dist/skills/bettercms/references/site-review.md +74 -74
- package/dist/skills/bettercms/references/worked-examples-advanced.md +509 -509
- package/dist/skills/bettercms/references/worked-examples.md +885 -885
- package/dist/skills/bettercms/references/write-limits.md +217 -217
- 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)).
|