Publish your own OwnersClub-style wiki
A from-zero guide to deploy a Git-backed, OKF-compatible wiki on Cloudflare Workers — for humans and their AI agents. Copy this page's URL into an agent chat to automate the build. Owning your own AI Workshop.
playbook template cloudflare how-to agent-zero
Publish your own OwnersClub-style wiki
This page does two jobs:
- For the owner — get from nothing to a live public site at a free
*.workers.devURL without writing code or running commands — your AI agent does the technical work. A custom domain is a completely optional second phase with its own chapter. - For the owner's AI agent (Agent Zero or similar) — paste this page's URL into the chat and the agent can build and deploy it for you, asking only for the credentials it can't create itself.
The whole thing is Git + Markdown + a static build. No database, no CMS vendor. Content lives in
knowledge/as Markdown with YAML front matter; Astro renders it; Cloudflare Workers serves it.
Part A — For the owner (human)
A0. What you need
| Requirement | Notes |
|---|---|
| A Cloudflare account | Free tier is enough. Create one at https://dash.cloudflare.com/sign-up if you don't have it. |
| An AI agent — Agent Zero or similar | The agent does the building, checking, and deploying for you. You never touch a terminal — see Part B. |
| Optional: a domain | Not needed to start — deploy on the free *.workers.dev URL first and add a domain later (Part A2). |
Owners don't code in this workflow. All installs, builds, checks, and deploys are run by your agent. The only things you do by hand are create a Cloudflare account, create an API token (A2), and paste it into the agent's secrets file (A2b).
No domain needed to start. You'll deploy and test everything on a free
*.workers.devURL first. Adding a domain later is a separate chapter (see Part A2) — it never requires redoing the deploy.
A1. Hand the task to your agent
Copy this block into your Agent Zero chat (the agent's detailed instructions are in Part B):
Read this page and follow it end-to-end to deploy my own copy of the
OwnersClub-style wiki: https://ownersclub.ai/knowledge/playbooks/deploy-your-own-wiki/
- I do NOT have a domain (use the *.workers.dev URL) [change this line if I do]
- My Cloudflare credentials are in .a0proj/secrets.env (CLOUDFLARE_API_TOKEN,
CLOUDFLARE_ACCOUNT_ID). Source that file before deploying; do NOT print the values.
- Work on a branch, validate and build before deploying, and report the live URL.
The agent will get the code, install dependencies, validate and build the site, and ask you for credentials before deploying. You don't run anything yourself — every command the agent uses is documented in B1 and B3.
A2. Create a Cloudflare API token (this is the only secret)
Go to https://dash.cloudflare.com → click your avatar → My Profile → API Tokens → Create Token.
Choose Create Custom Token (or the “Edit Cloudflare Workers” template).
Give it these permissions (minimum):
Scope Permission Needed for Account → Workers Scripts Edit Deploy the Worker Account → Workers KV / assets (auto) Static assets - Account resources: include your account.
- Zone resources: none needed for the workers.dev-only deploy. If you later add a domain (A2 chapter), you'll add Zone → DNS: Edit + Zone → Zone: Read then. You can also just create a second, domain-scoped token then.
Create Token and copy it (shown once). Also copy your Account ID (dashboard right sidebar).
Keep the token out of Git. It goes into your shell environment or your agent's secret store — never a committed file.
A2b. Store the credentials with Agent Zero (no terminal needed)
You don't have to touch a shell. Agent Zero has a file browser and editor — use it to drop your credentials into the agent's secret store so the agent can deploy for you.
In the Agent Zero WebUI, open the file browser for your project and go to the
.a0proj/folder.Open
secrets.envwith the built-in editor (create it if it doesn't exist).Add these two lines — each is just
NAME=valueon its own line:CLOUDFLARE_API_TOKEN=your-token-from-A2 CLOUDFLARE_ACCOUNT_ID=your-account-id-from-A2Save. Do not commit it —
.a0proj/and.envfiles are git-ignored.Tell your agent: “The Cloudflare credentials are in the project secrets file — go ahead.”
| File | Purpose | Committed? |
|---|---|---|
.a0proj/secrets.env |
Agent Zero project secrets (your CF token + account id) | No (git-ignored) |
.dev.vars |
Local Wrangler dev vars (copy from .dev.vars.example) |
No |
.env |
Never used for the token in this template | No |
The agent reads secrets.env as environment variables for its terminal commands, so no pasting into
chat is required after that. Prefer this over pasting the token into the chat.
🔐 If you ever paste a token into a chat by accident, roll it (create a new namespaced one, delete the old one) in My Profile → API Tokens. Treat any token shown in a transcript as compromised.
A3. Deploy
Once your token is stored (A2b), tell your agent: “Credentials are in the secrets file — deploy.” It will deploy with Wrangler and report your live URL, something like https://my-wiki.<your-subdomain>.workers.dev.
A4. Test it on the workers.dev URL
Before you touch anything else, click through the site:
/(home)/knowledge/,/events/,/projects/,/about/,/contact//sitemap.xml,/rss.xml/api/health(should return a small JSON blob)
All good? You're done with Phase 1. Your wiki is live and publicly readable on its free URL. To update content later, just ask your agent — it edits the Markdown under knowledge/ (each file needs a non-empty type in front matter), rebuilds, and redeploys.
⚠️ The
*.workers.devURL is your production URL until you choose to add a domain. Don't skip this test — everything in the domain chapter assumes this base works.
Part A2 — Adding your own domain (optional)
Do this only if you want https://yourdomain.com (or a subdomain like wiki.yourdomain.com) instead of the free workers.dev URL. Nothing in this chapter affects the deploy from Part A; it's entirely additive, and you can stop after any step and still have a working site on workers.dev.
Three situations:
| Your situation | Go to |
|---|---|
| You don't own a domain yet | A2.1 Buy one on Cloudflare |
| You own a domain at another registrar | A2.2 Transfer it to Cloudflare or A2.3 Keep it where it is and point it at Cloudflare |
| You own a domain already in Cloudflare | Skip to A2.4 |
A2.1 Buy a domain on Cloudflare Registrar
Buying directly inside Cloudflare is the simplest path — the zone, DNS, and registrar all live in one place.
- In the Cloudflare dashboard, go to Domain Registration → Register Domains.
- Search for the name you want. Cloudflare sells at wholesale cost — no markup, and it includes standard DNS.
- Buy it. The zone is created automatically — you don't need to do the A2.3 “add site” flow at all.
- Wait for the zone to become Active (usually minutes; check Websites → your domain).
- Skip to A2.4.
Note: Cloudflare Registrar doesn't support all TLDs. If yours isn't offered, buy at any registrar and use A2.2 or A2.3.
A2.2 Transfer an existing domain to Cloudflare
Moving the registration to Cloudflare consolidates billing and DNS. Requirements before you start:
- The domain is older than 60 days (ICANN rule — you can't transfer a newly registered domain).
- The domain is unlocked at your current registrar, and you have its auth/EPP code.
- WHOIS shows your real email (or you can receive mail at the registrant contact).
Steps:
- At your current registrar: unlock the domain, get the auth code, and (optionally) disable WHOIS privacy if it blocks the transfer — Cloudflare re-enables redaction for free.
- In Cloudflare: Domain Registration → Transfer Domains → enter the domain + auth code → pay (transfers add a year of registration).
- Cloudflare initiates the transfer; the old registrar may send a confirmation email — approve it to speed things up.
- Wait for the transfer to complete (usually 1–5 days).
- DNS records are copied over by Cloudflare when the zone is set up. Verify your nameservers show Cloudflare's (e.g.
*.ns.cloudflare.com). - Skip to A2.4. Before attaching the apex record, make sure there's no stale
A/CNAMErecord for it in the Cloudflare zone.
A2.3 Keep your registrar and point the domain at Cloudflare
You keep buying renewals where you are; you just use Cloudflare as your DNS/CDN layer.
- In Cloudflare: Websites → Add a domain → enter
yourdomain.com→ pick the Free plan. - Cloudflare scans existing DNS records and imports them. Review them — don't just accept defaults blindly.
- Cloudflare gives you two nameservers, e.g.
ada.ns.cloudflare.comandbob.ns.cloudflare.com. Copy them. - At your current registrar, replace the domain's nameservers with Cloudflare's.
- Wait for the zone to become Active (Cloudflare emails you; can take minutes to 24h).
- Skip to A2.4. Before attaching, make sure the zone has no stale
A/CNAMErecords for the exact hostnames you plan to attach — e.g.yourdomain.comandwww.yourdomain.com.
A2.4 Attach the hostname to your Worker
Your domain is now a zone in your Cloudflare account. Now the wiki takes it over:
Token check: if your API token from A2 lacks it, add Zone → DNS: Edit and Zone → Zone: Read (or create a new token with those scopes). Your agent will need this scope for the domain deploy.
Ask your agent to attach the hostnames — for example: "Add custom domains
yourdomain.comandwww.yourdomain.comtowrangler.jsoncascustom_domainroutes, keepworkers_devenabled, and redeploy." The resulting config looks like:"routes": [ { "pattern": "yourdomain.com", "custom_domain": true }, { "pattern": "www.yourdomain.com", "custom_domain": true } ]Wrangler creates/updates the custom domains on deploy; you don't create DNS records by hand.
Keep
"workers_dev": trueso your workers.dev URL stays alive (Wrangler disables it by default once custom domains exist) — your agent handles this.Old URL (
*.workers.dev) keeps working — nice for testing changes without touching the real domain.
If Cloudflare complains the hostname “already has externally managed DNS records”: delete the old A/CNAME records for that hostname first (keep MX/TXT for email!), then redeploy.
A2.5 Fix any old redirect behavior
If the domain previously redirected somewhere (for example, a Luma page) or served another site:
- A domain redirect is separate from DNS and will keep firing even after the Worker owns the hostname.
- Check Rules → Redirect Rules, Page Rules, and account-level Bulk Redirects in the Cloudflare dashboard and disable anything pointing the hostname away from your Worker.
- If the hostname served a different site before, make sure no stale
A/CNAMEremains — covered in A2.4's note.
A2.6 Domain troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| “Hostname already has externally managed DNS records” | Old A/CNAME on that hostname |
Delete those records first (keep MX/TXT), then redeploy |
| Site still redirects to the old destination | An edge redirect rule, not DNS | Disable it in Rules → Redirect Rules (also check Page Rules and account Bulk Redirects) |
Authentication error on DNS/rules API |
Token lacks that scope | Add Zone → DNS: Edit (or use the dashboard) |
| workers.dev URL went empty after adding a domain | Adding a custom domain disables the workers.dev URL by default | Set "workers_dev": true and redeploy |
| DNS not resolving anywhere | Zone not Active, or nameservers not updated at registrar | Check zone status in dashboard; verify nameservers at your registrar |
Part B — For the AI agent (paste this)
Owner: copy this block into your Agent Zero chat:
Read this page and follow it end-to-end to deploy my own copy of the
OwnersClub-style wiki: https://ownersclub.ai/knowledge/playbooks/deploy-your-own-wiki/
- I do NOT have a domain (use the *.workers.dev URL) [change this line if I do]
- My Cloudflare credentials are in .a0proj/secrets.env (CLOUDFLARE_API_TOKEN,
CLOUDFLARE_ACCOUNT_ID). Source that file before deploying; do NOT print the values.
- Work on a branch, validate and build before deploying, and report the live URL.
B1. What the agent should do
Fetch this page and read it. (An agent can
document_querythe URL, orcurlit.)Scaffold or clone the project. If starting fresh, reproduce this structure — an Astro static site, a dev-only Tiptap editor shell, and a Wrangler config:
apps/site Astro static site (home, events, knowledge, projects, about, contact) apps/editor dev-only Tiptap shell (optional) apps/worker Worker adding security headers + /api/health packages/okf front-matter parse/validate/index/JSON-LD packages/config scripts validate-okf, check-links, build-index knowledge/ canonical Markdown + YAML front matter (source of truth) wrangler.jsonc Cloudflare Workers static-assets configInstall and verify locally before any deploy:
corepack enable && corepack prepare pnpm@9.12.0 --activate pnpm install pnpm validate:okf && pnpm test:links && pnpm check && pnpm buildGet the credentials from the project secrets file
.a0proj/secrets.env(set by the owner via the file browser/editor, see A2b). Load them into the environment for your deploy commands — never commit them, never echo them:set -a; . /a0/usr/projects/<project>/.a0proj/secrets.env; set +a # or: export CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=...If the file is empty or missing, ask the owner to add the two variables (A2b) rather than pasting them in chat. For the workers.dev deploy, the token needs only Account → Workers Scripts: Edit; add Zone → DNS: Edit + Zone → Zone: Read only if a custom domain is attached (then see B5).
Deploy with Wrangler v4:
npx wrangler@4 deploy --config wrangler.jsonc.Verify the live URL returns 200 on
/,/events/,/knowledge/,/sitemap.xml,/api/health, and report the live*.workers.devURL. Stop and report. Do not proceed to domain work unless the owner explicitly asked for it (B5).
B2. Hard rules for the agent (from this project's governance)
- Canonical content is
knowledge/. Never edit generated output (dist/,public/knowledge-index.json); regenerate withpnpm build. - Every knowledge document needs a non-empty
type. Preserve unknown front-matter keys on parse/serialize. - Default to
status: draft. Let the human promote topublished/verified. - Every factual external claim needs a
sources:entry or a clearly marked uncertainty. Never invent events, organizers, venues, links, or history. - Record agent-authored material as
generated.by: agent-zero/<skill-or-version>. - Never set human verification metadata.
- Calibrate caution to the request. If the owner's request reasonably implies completion (“deploy it”, “publish this”), do the full cycle — commit, merge, publish/deploy — then report. If the request is inquisitive, experimental, or draft-stage, work on a branch and hold off publishing or deploying until the owner finalizes. Auth-involving or infrastructure changes (configuration, DNS, redirect rules, credentials, anything affecting the live domain) always warrant extra care and explicit confirmation before applying. Keep meaningful changes on a branch with reviewable commits.
- Run validation, link checks, and build before committing.
B3. Agent command reference
# Load deploy credentials first (from A2b), never echo them:
set -a; . .a0proj/secrets.env; set +a
pnpm install
pnpm dev # local dev server
pnpm validate:okf # front matter + Markdown validation
pnpm test:links # internal link check
pnpm check # type-check site + okf package
pnpm build # static build + regenerate public/knowledge-index.json
pnpm preview # preview the built site
pnpm deploy # wrangler deploy (needs credentials)
pnpm deploy:preview # wrangler versions upload (no traffic shift)
B4. Extracting real event data (optional, no API needed)
To turn a public Luma link into a sourced event entry without inventing anything:
curl -sSL -A 'Mozilla/5.0' 'https://lu.ma/<slug>' -o /tmp/luma.html -w 'http=%{http_code} url=%{url_effective}\n'
grep -oP '"(start_at|end_at|timezone)":"[^"]*"' /tmp/luma.html | sort -u
grep -oP '"(full_address|address|city)":"[^"]*"' /tmp/luma.html | sort -u
grep -oP '"name":"[^"]*"' /tmp/luma.html | sort -u # filter out attendee names
grep -oP '"(is_free|ticket_types)":(\[[^]]*\]|true|false)' /tmp/luma.html
Transcribe the real values, put the Luma URL in sources:, and mark the entry status: draft.
B5. If the owner wants a custom domain (optional phase)
Only do this if the owner explicitly asked. Confirm:
- The domain is a zone in the owner's Cloudflare account (A2.1–A2.3, whichever applies).
- The token has Zone → DNS: Edit + Zone → Zone: Read.
Then:
- Add the
routeswithcustom_domain: truetowrangler.jsonc(A2.4). - Deploy:
npx wrangler@4 deploy --config wrangler.jsonc. - Keep
"workers_dev": trueso the test URL survives. - Check redirect rules and stale
A/CNAMErecords per A2.5. - Verify the custom domain returns 200 on the same paths as B1 step 6, and that the workers.dev URL also still works.
How this site is built (reference)
- Content: Markdown + YAML front matter under
knowledge/(OKF-compatible / OKF-oriented). - Build: Astro reads the corpus, generates
public/knowledge-index.json, JSON-LD, sitemap, RSS, robots. - Hosting: Cloudflare Workers static assets via
wrangler.jsonc; a tiny Worker adds security headers. - Governance: see the repository
AGENTS.md.
This guide is itself part of the knowledge corpus. Copy the repo, point an agent prompt here, and you have your own version of OwnersClub.ai.