Upgrade from 1.x
Move a 1.x project from doctor to check, and from links, stats, snapshot and brief to context.
Contentbit 2.0 checks the pages your build wrote.
contentbit check replaces doctor, and contentbit context replaces
links, stats, snapshot, and brief. Both commands read a build folder.
Checking a running server comes later.
Upgrade step by step
-
Move every contentbit package in
package.jsonto 2.0 at once.@contentbit/react,@contentbit/astroand@contentbit/blockshave no changes of their own, but the packages share one version and must match, andcontentbit studiostarts only the Studio of its own version. Name the packages your project has, and with npm runnpm installin place ofpnpm add:pnpm add -D contentbit@latest @contentbit/studio@latest pnpm add @contentbit/core@latest @contentbit/blocks@latest @contentbit/astro@latest -
Build the site.
checkandcontextread its build folder. -
Run
contentbit init. It keeps your files, prints thesite.buildandlinks.routesthat the config lacks, names each script that runs a removed command, and replaces the agent guidance that 1.x installed. -
Add the printed fields to
contentbit.config.ts. Change thecontent:checkscript tocontentbit check, and remove the scripts that run removed commands. In CI, build the site beforecontent:checkruns. -
Delete
.contentbit/link-index.json. Nothing reads or writes it any more. -
Run
content:checkand fix what it reports. If you kept the example that 1.xinitwrote,checkreports it:content/related.mdhas no built page, and the example page has no title. Delete the two files and the example page, or give each a page with a title and a description.
The sections below list every breaking change, in the words of the package changelogs.
Replace doctor with check
contentbit doctorexits 2 and namescheck.doctor --strict-warningsischeck --strict.checkkeeps--strict-seo,--watch,--json,--seo-config,--no-seo,--key-field,--slug-field,--locale-fieldand--default-locale.checktakes a build folder as its argument, not content globs. It reads Markdown only fromcontentin the Contentbit config, not from acontent:doctorscript. Build the site beforecheckruns, in CI too. Without a build folder,checkruns the Markdown checks alone and says so. A build folder that you pass or thatsite.buildnames must exist and hold an HTML page, orcheckexits 2.checkhas no--registryor--no-generic-blocks. It reports block findings only when the config names aregistryor setsgenericBlocks: true.checkhas no--link-resolve, and reports no frontmatter link finding, such asCB_LINK_ORPHAN,CB_LINK_UNRESOLVEDorCB_KEY_DUPLICATE.validatestill reports them.checkhas no--min-section-words, and nothing reportsCB_THIN_SECTIONorCB_BLOCKLESS_DOCUMENTany more.- The Markdown checks no longer report
CB_H1_MISSING,CB_INTERNAL_URL_UNRESOLVEDorCB_MARKDOWN_ANCHOR_UNRESOLVED, which guessed at the built page.checkreportsCB_PAGE_H1_MISSING,CB_LINK_PAGE_MISSINGandCB_LINK_ANCHOR_MISSINGfrom the built pages instead, and the two link findings are errors. A run with no build checks no internal URL or#anchorlink in Markdown. - With a build folder,
checkreportsCB_PAGE_TITLE_DUPLICATE,CB_PAGE_DESCRIPTION_DUPLICATE,CB_PAGE_H1_MULTIPLE,CB_LINK_FILE_MISSINGandCB_PAGE_IMAGE_ALT_MISSINGfrom the built pages, in place of the Markdown findingsCB_TITLE_DUPLICATE,CB_DESCRIPTION_DUPLICATE,CB_H1_MULTIPLE,CB_MARKDOWN_LINK_UNRESOLVEDandCB_IMAGE_ALT_MISSING. - The SEO config's
requiredLinksTo,minOutgoingLinksandminIncomingLinkscount content links between built pages. A link in the page's header, nav, aside or footer landmarks does not count, and neither does a link outside the page content or a frontmatterlinksTothat the page does not render. Aheaderinsidemain, anarticleor asectionis content, and so are a calloutasideand afooterinside ablockquoteor a card, so their links count.CB_PAGE_LINK_REQUIRED,CB_PAGE_OUTGOING_LINKS_MINandCB_PAGE_INCOMING_LINKS_MINreplaceCB_SEO_LINK_REQUIRED,CB_SEO_OUTGOING_LINKS_MINandCB_SEO_INCOMING_LINKS_MIN, and a Markdown file with no built page gets none of them. check --jsonprints acontentbit.site-check.v1report. The Markdown findings thatdoctor --jsonprinted infindingsare incontent.findings, with the same fields and with paths relative to the project root. The report has nolinkGraphorseosection and nosuggestionscount, and the text report has no repair plan.
Replace links, stats, snapshot and brief with context
contentbit links,stats,snapshotandbriefexit 2 and name what replaced them.contextlists every page's links in and out, gives each page's outline and words, prints the site as JSON with--json, and carries a page's SEO brief as its contract.contextreads the build folder, ascheckdoes, so build the site first. It takes--build,--origin,--seo-config,--no-seoand--json. It reads the registry and the link resolver fields from the Contentbit config, in place of--registry,--no-generic-blocks,--link-resolve,--key-field,--slug-field,--locale-fieldand--default-locale.snapshot --revision,stats --no-validateandlinks --outhave no replacement.- Nothing writes
.contentbit/link-index.jsonany more, andlinks --fixhas no replacement. An alias inlinksTostill resolves to its page, andvalidatestill reports a target that no page has. snapshotprinted acontentbit.project-snapshot.v1.context --jsonprints acontentbit.site-context.v1, which is a different format.- The page context's
contractis acontentbit.seo.brief.v2, wherebrief --jsonprinted acontentbit.seo.brief.v1. It has nofindings, since the page's findings are infindingsandcontentFindings. ItsrequiredLinksToholds the page type's links only, not the frontmatterlinksTo, and itsrelatedPagesare the pages of the same type.targetand each related page keepid,source,path,key,slug,locale,titleandtype.
Set up with init, adopt and agents
init prints the config fields that check needs. See
Site fields and
Page routes. content is optional
in the config, but validate still needs it or explicit globs.
initinstalls onlycontentbit.init --blockssets up what 1.xinitset up by default: the block registry, a renderer, Studio, the block guide and the example content.--target,--md,--no-pageand--no-styledneed--blocks.- The
content:checkscript thatinitwrites runscontentbit check, notcontentbit validate.initkeeps an existingcontent:checkscript and prints a note, and writes nocontent:linksorcontent:doctorscript. It keeps every other script too, and names each one that runs a removed command for you to remove. adopthas no--dry-run, which did nothing, sinceadoptchanges no file. It proposes a frontmattertitleonly where one is missing, and noslug.adopt --jsonprints acontentbit.adoption.v2, where 1.x printed acontentbit.adoption.v1. Its finding and proposal paths are relative to the project root, and it has nodryRunfield.- The agent guidance that 1.x installed tells agents to run removed commands.
initreplaces it ascontentbit agentsdoes: theAGENTS.mdblock, and the Claude Code skills when.claude/exists. Withinit --no-agents, runcontentbit agents.checkwarns withCB_SKILL_DRIFTwhile an installed skill is older than version 10.
Studio
- The Markdown dashboard moves to
/documents. It has no link graph, and a document lists no frontmatter links or backlinks, since its built page lists the links in and out. contentbit studiohas no--link-resolveor--min-section-words.contentbit studiostarts only the@contentbit/studioof its own version. With a 1.x Studio still installed, it exits 2 and prints the command that installs the right one.startStudio,scanProjectandscanDocumenttakeloadSeo, a function that reads the SEO config, in place ofseoConfigandseoConfigPath, and take nominSectionWords.scanGraphand theStudioGraphtype are removed. AStudioProjecthas nolinkGraph, and aStudioDocumenthas nolinksToorlinkedFrom.
Core API
@contentbit/coreno longer exportsbuildLinkIndex,validateLinks,serializeLinkIndex,aliasReplacementsForPage,linkGraphSummaryorDEFAULT_MIN_SECTION_WORDS, or theSerializedLinkIndexandLinkAliasEntrytypes. ALinkIndexhas noaliasesoraliasEntries.scanContentProjectstill returns the link index and its diagnostics.scanContentProjecttakes nominSectionWordsand reports noCB_THIN_SECTIONorCB_BLOCKLESS_DOCUMENT.scanContentIntegrityandscanContentProjectreport noCB_H1_MISSING,CB_INTERNAL_URL_UNRESOLVEDorCB_MARKDOWN_ANCHOR_UNRESOLVED.evaluateSeoProjecttakes nolinkIndexand reports noCB_SEO_LINK_REQUIRED,CB_SEO_OUTGOING_LINKS_MINorCB_SEO_INCOMING_LINKS_MIN. AnSeoPagehas nolinkedFrom.- An
SeoBriefis acontentbit.seo.brief.v2. It has nofindings, itstargetandrelatedPagesareSeoBriefPages, and itsrequiredLinksToholds the page type's links only.formatSeoBriefMarkdownprints no intent or keywords.