Concrete
Reference

Workspace

Looking up what a file in a template workspace is for, or which of the framework's subpaths a config defers to.

A template workspace is a directory: one workspace, one template, one repository. npx create-concrete writes it, concrete owns its toolchain, and the four config files below each defer to the framework and carry no configuration of their own — so a framework update never edits them.

template.ts        the one file found by name — the template's key, name, format, pages, fixture list
pages/             React components that place sections; nothing else
sections/          each section: its slots, how the AI fills them, and its markup
globals.css        the stylesheet entry (Tailwind + the framework's utilities + your tokens)
icon.svg           the template's icon, imported by template.ts
fixtures/          dev data `dev` and `check` run the template over, as JSON documents; never published
package.json       three scripts, one framework dependency, React
tsconfig.json      extends the framework's compiler options
eslint.config.mjs  re-exports the framework's flat config
.env               gitignored; the publisher key lives here
.concrete/         gitignored build and cache output

Only template.ts is found by file name. Pages, sections, the stylesheet and the icon are reached from it by import, and the fixtures by the fixture list it names (fixtures: "./fixtures/index.json"), so components/, lib/, fonts/, assets/ — and fixtures/ itself — are yours to organise and to name. A workspace with no template.ts, or one that does not default-export a defineTemplate value, cannot be loaded at all (workspace/template-missing, workspace/template-invalid).

The framework publishes three subpaths a workspace reaches: @homepages/concrete (the authoring API and the primitives), @homepages/concrete/tsconfig and @homepages/concrete/eslint (the two config bases), plus @homepages/concrete/styles.css and @homepages/concrete/browser. Nothing else is exported — not the dev client, not the codemods, not the command modules.

package.json

Constraints

Three scripts, and they are the whole interface: concrete dev previews the template with its editor, concrete check runs every requirement a template must satisfy, and concrete build writes the template's built files, rebuilding only what changed.

Declare only the libraries your template itself imports. TypeScript, ESLint, the bundler and Tailwind are the framework's own dependencies, installed beside it, so the workspace declares none of them and an editor extension finds them hoisted in node_modules/. React is declared because your components import it.

A lockfile is required — every dependency gate is measured from it, and its absence is dependencies/lockfile-missing. It must satisfy this file (dependencies/lockfile-stale), install exactly one copy of React (dependencies/single-react), and carry no high or critical advisory (dependencies/audit-severity).

Example

{
  "name": "riverside",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "concrete dev",
    "check": "concrete check",
    "build": "concrete build"
  },
  "dependencies": {
    "@homepages/concrete": "^1.0.0",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@types/react": "^19.0.0",
    "@types/react-dom": "^19.0.0"
  }
}

Rules that apply

dependencies/lockfile-missing, dependencies/lockfile-stale, dependencies/single-react, dependencies/audit-severity.

tsconfig.json

Constraints

Always extends: "@homepages/concrete/tsconfig" — the compiler options concrete check compiles your workspace with, so what your editor accepts and what the gate accepts are the same program. Among them strict; noUncheckedIndexedAccess, which is why an indexed read is T | undefined in a section exactly as it is in a test; and noUncheckedSideEffectImports, which is why a side-effect import of a stylesheet that does not exist — import "./styles.css" with no such file beside the section — is typecheck/error rather than a stylesheet that silently never compiles.

Never restate an option the base sets. What belongs here is what is yours: a paths alias, and the include/exclude that keep node_modules/ and .concrete/ out. A TypeScript error anywhere in the workspace — or in this file — is typecheck/error.

Example

{
  "extends": "@homepages/concrete/tsconfig",
  "compilerOptions": {
    "paths": { "@/*": ["./*"] }
  },
  "include": ["**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules", ".concrete"]
}

Rules that apply

typecheck/error.

eslint.config.mjs

Constraints

One line: re-export the framework's flat config. The preset is the whole lint venue concrete check runs — the correctness rules, the server-purity rules, the island rules, the slot rules and the style rules — and a workspace that adds or disables rules is no longer measured by the same gate the platform publishes against.

Never add a plugin here to silence a rule. A rule that fires is resolved at /rules/<id>, which the message names.

Example

export { default } from "@homepages/concrete/eslint";

globals.css

Constraints

The stylesheet entry: the first CSS file template.ts imports. Every .css reachable by import from template.ts compiles into the one template stylesheet, in import order.

Exactly one file in that graph imports Tailwind, and it is this one. Two double-emit Tailwind's preflight reset; none leaves every utility undefined. Either is css/tailwind-import. Import @homepages/concrete/styles.css after Tailwind — it carries only what is true of every template (the spacing base unit, the motion defaults) and must not import Tailwind itself.

Your design tokens are yours: declare them with @theme after those two imports, under names you choose, and Tailwind turns each into a utility — --color-ink yields text-ink. Nothing about a visual system is shared and there is no global file to edit to make a token of yours usable. The framework declares no breakpoints and resets none, so Tailwind's own reach you untouched; declare --breakpoint-* tokens to swap them.

Author CSS is unlayered. A stylesheet that cannot resolve or compile is css/compile-failed, and a compiled stylesheet referencing an external URL is css/external-url — the renderer cannot reach one, so ship the bytes instead.

Example

@import "tailwindcss";
@import "@homepages/concrete/styles.css";

@theme {
  --color-ink: #171717;
  --color-background: #ffffff;
}

Rules that apply

css/tailwind-import, css/external-url, css/compile-failed.

.env

Constraints

Gitignored, and the workspace's only secret. concrete publish reads CONCRETE_TOKEN from the process environment first and from this file second.

The key is the environment. A publisher key names its environment in its prefix — cpt_prod_…, cpt_staging_…, cpt_dev_… — and publish goes where the prefix points. There is no environment flag and no default to get wrong, and the server refuses a key minted for another environment. CONCRETE_API_URL replaces the endpoint the prefix names, for an unusual local setup; it can point a key at the wrong API but can never publish there.

Never commit it, and never read it from a section: this file is the publisher's, not the template's. A published page's own configuration is embedded by the platform and read with readSiteConfig.

Example

CONCRETE_TOKEN=cpt_dev_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

.concrete/

Constraints

Gitignored output: .concrete/build/ is where concrete build writes the template's built files and build.json, .concrete/cache/ is where the commands bundle the workspace before importing it, and .concrete/schema/ is where concrete dev writes the JSON Schemas a fixture document's $schema member names.

It is excluded everywhere it would otherwise be found — section discovery skips it, the dev server does not watch it, and the artifact's source listing omits it. Never edit anything inside it and never commit it; delete the whole directory to force a cold build.

Example

concrete build          # writes .concrete/build/

Deleting .concrete/, from your file manager or your shell, makes the next command rebuild from cold.

*.test.*

Constraints

A file whose name carries a .test. segment is skipped by section discovery, as is any .d.ts. That is what lets a test sit beside the section it tests without the framework mistaking its section values for a second declaration of the same key. Fixtures need no exclusion: only the documents the fixture list names are loaded.

The one other exclusion by name is a tool's config at the workspace root — eslint.config.mjs, vite.config.ts, any <name>.config.<js|ts> and their .mjs/.cjs/.mts/.cts forms — which is the tool's input, never template code. A *.config.ts inside a folder is found like any other module. A helper, a component and a constant are found by import alone, so where they sit and what they are called is yours.

Example

sections/hero/
  section.tsx         discovered — its exported sections are the template's
  section.test.tsx    skipped
fixtures/
  index.json          the list template.ts names — the content fixtures it lists are the corpus
  notes.json          not listed, so not a fixture

See also

Fixtures for the fixture documents, the command line for what the three scripts run, the rest of the reference, and every rule.