Fun part / Publishing and deploy
Publishing and deploy
Between 'I made changes' and 'visitors see them' there are two distinct steps in agntcms: publish (draft → published in the project) and deploy (push to the live site).
Recommended path#
In Claude Code:
publish and deploy.
publish every draft and push to the live site.
The agent runs
agntcms-publish-draft for the relevant pages (writes snapshots to history/, moves files from drafts/ to pages/), then agntcms-git-publish to commit and push. With Vercel auto-deploy configured, the changes reach the live site a couple of minutes after the push.The daily, recommended path. One request — two operations — done.
What happens under the hood#
Publishing is a move of
content/drafts/<slug>.json → content/pages/<slug>.json plus a snapshot at content/history/<slug>/<timestamp>.json. The snapshot is written before the new published version — that is, the history stores the version that was published before the current change. That makes rollback always return the last known publicly-working state.Deploying is a
git push of the repository connected to Vercel (or another Next.js-compatible platform). agntcms is a plain Next.js project; deploy works the same way. No separate infrastructure, no containers, no special CMS server.What goes into git#
The
content/ tree:- Published pages (
content/pages/). - Drafts (
content/drafts/). - Version history (
content/history/,content/history-globals/). - Globals (
content/globals/). - Assets (
public/assets/, hashed filenames).
Drafts go into git on purpose. Switching machines or handing the project to an editor will not lose in-progress work. Size is rarely a problem: JSON is compact and assets are deduplicated by SHA-256.
What is not in the production build#
agntcms deliberately makes admin and agent functionality unavailable in production. The mechanism is the
.dev.ts suffix on routes and components.Excluded:
app/api/agntcms/[...path]/route.dev.ts— admin and agent API.- Any components and routes with the
.dev.tssuffix. .claude-plugin/— the channel server..claude/skills/— the skills.
At runtime the production build contains only public pages and assets. No Claude Code, no MCP, no channel plugin — they simply do not exist on the server.
The production instance therefore depends on neither the Anthropic API, the presence of Claude Code, nor the agent's state. The site runs like a normal Next.js app — fast, with no AI runtime dependency.
What agntcms-git-publish writes#
The skill follows a commit-message format that reads cleanly in
git log:content: publish /pricing
content: publish /team, /contact
content: rollback /pricing to 2026-04-01If you commit by hand, you can follow the same format — or not, it is not enforced. The skill is convenient because you do not have to remember the convention.
git add content/ public/assets/
git commit -m "content: publish /pricing"
git pushUse the manual path if you need precise control over the commit message or you are combining content edits with code changes in one commit. For ordinary work, go through
agntcms-git-publish.Vercel setup (one time)#
To enable auto-deploy, connect the repository to Vercel:
- On vercel.com → New Project → import the repository from GitHub / GitLab / Bitbucket.
- Framework Preset: Next.js (auto-detected).
- Build Command:
pnpm build(default). - Output Directory:
.next(default). - Install Command:
pnpm install(default). - External image domains, if you use them, go into
next.config.tsunderimages.remotePatterns. - Environment variables, if any, go into Vercel Dashboard → Settings → Environment Variables.
After that, every
git push to your chosen branch builds and deploys automatically.Production checklist#
Before the first production deploy — say walk the pre-deploy checklist to Claude Code, or check yourself:
pnpm buildruns locally without errors. That confirms nothing from.dev.ts,mcp/,tasks/, or admin components leaked into the production build.- The sitemap (
app/sitemap.ts) and robots (app/robots.ts) are present and generated. Both are frozen-zone files and should be there out of the box. - Every image used on a page is in
public/assets/and committed. External URLs are added toimages.remotePatternsinnext.config.ts. - Required environment variables (analytics keys, for example) are configured in Vercel.
BRAND.mdandstyles/theme.cssreflect the current design if anything changed throughagntcms-init.
Alternative hosts#
agntcms is plain Next.js. Deploy it anywhere Next.js works: Vercel, Netlify, Cloudflare Pages, any Node host, self-hosted Docker. agntcms has no production-environment requirements beyond Node.js and access to static files.
The docs recommend Vercel by default — least friction, built by the people who built Next.js. It is not mandatory.