Idea
The agent asks what the application needs to do. You answer as you would answer another person.
Use a coding agent, such as Codex or Claude Code, to understand your idea, build the application securely, and help you publish it.
I want to create a web application. I don't know how to code. Read https://start.martins.pub and follow all the instructions on the site. Ask the necessary questions about the product and help me until the application is working and published.
Tip: before you start, you can discuss your idea with any AI and save your Codex or Claude Code usage limits.
The agent asks what the application needs to do. You answer as you would answer another person.
The agent plans and builds every technical part. You do not need to do anything, and your application will be completed as planned.
The application first runs on your computer. Use it, talk to the agent, and request changes until it works the way you want.
When you authorize it, the agent publishes the application to your own Cloudflare account, making it available on the internet.
Tests and improvements are where you participate the most. Use the application as if it were already yours and keep talking to the agent about what is confusing, what is missing, and what should work differently. Use everyday language, without technical terms. Each request becomes another round of adjustments and verification, and it is normal to repeat this cycle several times before the application is ready. There is no need to rush publication.
This site does not need your password or the credentials for your coding agent or Cloudflare. You use your own Codex, Claude Code, or other agent account and authorize Cloudflare directly through its official flow.
To validate this protocol, start with a small application. Check whether the agent understands the idea, creates and reviews a technical plan internally, implements it in small phases, verifies it, and presents a working local application before requesting any Cloudflare access. Publication should only happen after local testing. A custom domain is an optional later step.
AUTHORITATIVE INSTRUCTIONS FOR CODING AGENTS
Protocol version: 1.1 · Updated: 2026-10-15
This tool-neutral protocol guides coding agents, including Codex and Claude Code, from a non-technical user's idea to a verified local application and, with explicit approval, publication in their own Cloudflare account.
Required access: Read the complete canonical protocol at https://start.martins.pub, through section 13. If retrieval is incomplete, stop and explain the access needed; never reconstruct instructions from memory.
Required capabilities: Before planning, confirm file editing, tool execution, verification, and a local preview accessible to the user. Check network and execution permissions without accessing a Cloudflare account. If a capability is missing, explain the blocker and smallest setup change needed; resume dependent work only when it is available. Never replace local validation with a deployment.
Use this repository as the application base:
https://github.com/marcelomartins/hvbc-hono-vue-bun-cloudflare
AGENTS.md, README.md, package.json, wrangler.jsonc, and, while present, AI-GUIDED-SETUP.md before changing code. Use the setup guide for initializer and cleanup details; do not use AI-GUIDED-SETUP.md or SETUP.md as the workflow authority.AGENTS.md is authoritative for architecture, security, migrations, secrets, and verification invariants. Read it explicitly even when your tool expects a different filename for repository instructions, such as CLAUDE.md, and do not create a duplicate instruction file for your own tool unless the user asks for one.AGENTS.md authoritative for repository-specific architecture, security, migrations, secrets, and verification invariants. Apply the interface-language rule in section 3 even when the inherited instructions require English visible text, and align that instruction in the new application's AGENTS.md.package.json because script names may evolve.Start with: “O que você quer que a aplicação faça?” or the equivalent in the user's language. From the conversation, determine only what is needed to build the first useful version:
Use that language throughout the interface, including validation/error messages and document lang attributes. Do not ask the user to choose a language already established by their request. Keep technical names, code, tests, logs, and project documentation in English.
Assess feasibility during the interview, before planning. The application must run as one Cloudflare Worker with one D1 database. The framework also supports running locally on Bun, but publication under this protocol targets Cloudflare; do not introduce self-hosting, Docker deployment, or another hosting provider. R2, Durable Objects, Workers KV, and Queues are optional only when their configuration satisfies the free-only boundary. A second Worker, second D1 database, or server outside Cloudflare is out of scope.
Basic registration limitation: The base provides registration and login without configured email delivery, email verification, or password recovery. Treat the absence of password recovery as an accepted limitation of the default scope. Explain it during the interview when accounts matter to the product, and include it in the handover when relevant. Do not add email delivery, password recovery, or multi-factor authentication unless the user explicitly requests them; assess any such request against this protocol's feasibility and free-only boundaries.
Free-only boundary: Hosting must use Cloudflare's Free plan; required integrations must also be free. Check current official quotas, eligibility, and exhaustion behavior against expected usage before planning. Exclude paid activation, automatic overage charges, expiring trials, and paid integrations. Never upgrade a plan, enable billing, or purchase a domain. If the product cannot fit, explain the limit and offer a smaller free version; do not implement the paid requirement. Free quotas may interrupt service, so explain that consequence. Name every additional remote resource in the publication plan.
Complexity boundary: Before planning, assess whether the product can be reliably built, verified, and maintained by a non-technical person with a coding agent. Projects requiring a dedicated technical team, specialist oversight, or complex ongoing operations are outside this protocol. Explain the specific limitation in plain language before implementation. Offer a smaller, independently useful alternative only if it removes that complexity. Splitting an unsuitable system into phases does not make it suitable, and accepting a smaller version is not a commitment to deliver the full system.
Sort what they asked for into three groups:
When an accepted scope needs multiple phases, explain that work may span conversations. Each completed phase must leave a working checkpoint.
Do not ask the user to choose frameworks, databases, API styles, authentication libraries, rendering strategies, package managers, or Cloudflare products when the framework already makes that decision.
If the user volunteers a domain, acknowledge it and defer configuration and follow-up questions to section 9.
bun run init --name <name> --title "<Title>" --host <name>.invalid --dry-run, inspect its summary, then apply the same command without --dry-run. Do not use --create-d1 or access Cloudflare during local setup. If scripts/init.ts is absent, inspect the existing project and checkpoint instead of repeating initialization..dev.vars when needed and preserves an existing file. Never commit local secret files.After cloning and initialization, read the local copies of AGENTS.md, README.md, package.json, and wrangler.jsonc before creating the implementation plan. When the project initially has no real public hostname, keep the repository's deliberate invalid placeholder for production host/origin during local work. Local development uses the local values from the project's local environment file.
Make the inherited files describe the user's application. Remove framework-only examples, unused code/assets/dependencies, and files that serve no purpose in the requested application. Update imports, routes, scripts, configuration, tests, and documentation references together; preserve licensing, working features, security controls, and the full verification pipeline.
README.md to the application, keeping the architecture, development, verification, and Cloudflare publication instructions that remain useful. Remove framework attribution/contact text and contribution templates that do not apply; retain license notices and any documentation required by a remaining invariant, such as dependency-override justifications.lang attributes, and align the inherited visible-text instruction in AGENTS.md. Preserve its other architecture and security invariants.scripts/ directory when it contains only bootstrap tooling, including scripts/init.ts and scripts/tsconfig.json. Remove the init package script, the bootstrap typecheck prefix, and bootstrap-only references in README.md and AGENTS.md. Preserve the separate application tooling in server/scripts/ and web-vue/scripts/.AI-GUIDED-SETUP.md after its applicable setup and cleanup details have been incorporated. Remove unused contribution, issue, and pull-request templates; keep or adapt files still required by the application.Run bun run verify after setup and cleanup. If it fails, repair the cause without removing or weakening checks. Repeat this cleanup review before local acceptance so the finished application contains no unused framework leftovers.
Before implementing features, create and internally validate IMPLEMENTATION_PLAN.md at the project root, unless the repository defines a planning location. Keep decisions, current state, and next steps concise; do not copy this protocol or command logs into it. The user does not approve the technical plan.
AGENTS.md that materially affect the implementation;Size each phase by work, verification effort, remaining usage allowance, and context capacity, with margin to finish and checkpoint. A usage window, such as Codex's five-hour window, is a consumption limit, not guaranteed execution time. When remaining capacity is unknown, use smaller phases. Split work before checks or checkpointing become unlikely to fit.
Finish each phase with a runnable repository and passing phase checks. Do not plan checkpoints with half-applied migrations, broken types, incomplete authentication, or unresolved imports.
For every phase record:
Update the plan after each phase and before an expected interruption. Record unfinished work honestly if interrupted mid-phase. On resume, read the checkpoint and inspect actual files and check results before continuing; conversation memory alone is insufficient.
Before changing application feature code, review the plan yourself. Implementation may start only when all of the following are true:
AGENTS.md and does not weaken security or architecture invariants;If this internal review fails, revise the plan. Ask the user only about unresolved product behavior they are qualified to decide; never ask them to validate framework choices, schema design, implementation sequence, or other technical details.
Implement only after the internal plan has passed its validation gate. Work on one planned phase at a time; do not start later phases merely because context is available.
IMPLEMENTATION_PLAN.md, and leave a clear next-step checkpoint before starting another phase.While iterating, run targeted tests. Before presenting the application as ready, run the repository's full verification command, currently documented as:
bun run verify
If verification fails, diagnose and fix the cause. Never skip the command, disable a check, weaken a test, or change an invariant merely to obtain a passing result.
Once the planned first useful version is implemented and full verification is passing, start the repository's integrated development server and give the user the local preview URL. Test the important user journey yourself when the environment allows it. Do not claim the application is ready merely because the build succeeds.
Ask for feedback in product language: whether the application behaves as expected, what should change, what is confusing, and what is missing. Iterate as needed, updating and internally revalidating the plan when the requested change is material, and run full verification again.
After the user accepts the working local version, present the publication plan in section 8.1 and ask once whether to proceed.
Follow the publication gate in section 1. Perform the technical steps yourself; explain only user decisions and required browser approvals. For interrupted publication, apply section 10 before repeating a step.
After local acceptance and before any Cloudflare account access, explain the free publication plan and request approval. For a new application:
“A aplicação passou nas verificações. Para colocá-la na internet, vou conectar a sua conta Cloudflare, criar um banco novo para esta aplicação, configurar uma chave de segurança que não será mostrada nem salva no código, criar as tabelas e publicar. Posso continuar?”
One approval covers authentication, account selection, the named resources, missing secrets, migrations, deployment, and health checks. Include any optional resources and adapt the plan for a resumed publication. Keep that approval across interruptions; do not ask again for covered steps. Separate approval is required for destructive, unrelated, or materially different actions; paid actions remain out of scope. Pause for user-only browser authorization or an ambiguous account/resource choice.
Use one authentication configuration throughout publication. Inspect the repository scripts before running any Cloudflare command. The following rules apply to every command in sections 8–11, including commands launched through package scripts:
bunx wrangler resolves to that installation and supports device OAuth, keyring storage, and structured whoami. Keep the same version throughout the flow; if an update is required, update the project dependency and lockfile together and rerun verification.XDG_CONFIG_HOME=.wrangler-config in its scripts, so apply that value from the project root to direct authentication, account, database, migration, and secret commands too. Set it explicitly in each tool invocation using the host shell or process environment; a previous terminal's environment may not survive. Preserve the same effective credential location, auth profile, and keyring preference across direct commands and package scripts.CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY, CLOUDFLARE_EMAIL, and their legacy CF_* equivalents. Prevent inherited variables or project environment files from replacing the chosen OAuth session in these commands. Never display their values or change unrelated global settings.The command examples below assume that configuration is applied. Check authentication before initiating a login:
bunx wrangler whoami --json
Reuse an existing valid OAuth session. whoami --json exits non-zero when Wrangler is not authenticated; distinguish that result from network, permission, or configuration failures. Only when authentication is confirmed missing or expired, initiate OAuth yourself:
bunx wrangler login --device --use-keyring
The user must complete the authorization on the official Cloudflare page opened by Wrangler. Do not ask them to copy an API token. Do not use wrangler auth token to extract the OAuth token merely to automate this workflow.
Main browser requirement: the authorization only works in the user's main browser, the one where they are already signed in to Cloudflare. Hand them the verification URL and code as plain text so they can open it there themselves. Do not open it in a private window, a secondary browser profile, an in-app or embedded browser, or a browser you drive through automation: those sessions are not signed in to the user's Cloudflare account, and signing in there would require credentials this protocol forbids you to handle. If your environment cannot reach the user's main browser, say so and let them open the URL themselves.
The --device flow does not require a localhost callback. Wrangler prints a verification URL/code and polls while the user approves. --use-keyring opts into operating-system keychain-backed credential protection. If Wrangler warns that keychain storage is unavailable and would fall back to plaintext credential storage, tell the user in plain language before continuing.
After authorization, rerun the check using the same configuration. Confirm the authenticated identity and available accounts before continuing:
bunx wrangler whoami --json
A Cloudflare identity may belong to more than one account. Parse the structured whoami result:
account_id in wrangler.jsonc so future commands for this project are pinned to the intended account. Preserve all existing configuration.CLOUDFLARE_ACCOUNT_ID, legacy account overrides, command flags, and package scripts cannot redirect operations to another account. Confirm that the authenticated identity can access the pinned account before remote writes and after any authentication/configuration change. Resolve a mismatch before proceeding.Never guess between multiple Cloudflare accounts.
First inspect existing databases:
bunx wrangler d1 list --json
Reconcile the configured database ID and publication checkpoint with the selected account's databases. Reuse a database only when confirmed to belong to this project. If ownership or a previous creation result is uncertain, resolve it before proceeding; do not delete or duplicate a database to bypass uncertainty.
Only when this project has no database, create one using the initializer's name, or a distinct name if that name belongs to another project:
bunx wrangler d1 create <database-name>
Immediately record the confirmed UUID in the checkpoint and intended D1 binding in wrangler.jsonc (currently DB). Preserve migrations_dir and other settings.
A Cloudflare account has exactly one account-wide workers.dev address, and every Worker in the account is published beneath it as <worker-name>.<account-subdomain>.workers.dev. The first label is this application. The second label is the person's account: it is chosen once, it is shared by every application they ever publish, and it appears in every URL they hand out.
If the account already has an address, it is settled: use it and choose nothing. It cannot be changed without breaking every existing URL beneath it.
If the account has none, Wrangler stops the first deploy, asks whether to register one now, and then prompts in the terminal for the name. Never answer that prompt with a name you invented. Agree the name with the user before you start the deploy, so the decision is never taken under a prompt that is blocking your own progress.
Rules for the candidates you propose:
rotinae.rotinae-br.workers.dev is the outcome this rule exists to prevent.^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$: lowercase letters, digits, and internal hyphens.You already have the account identity from the authentication step:
bunx wrangler whoami --json
The result carries the signed-in email and the accounts list with human-readable names. Build two or three candidates from the person's name, the local part of their email, or their account name, reduced to the allowed characters, and ask one plain-language question that shows the resulting URL:
“Sua conta na Cloudflare precisa de um endereço próprio, que vai aparecer em todos os aplicativos que você publicar nela. Sugiromariasilva: este aplicativo ficaria emrotinae.mariasilva.workers.dev. Esse é o endereço inicial — depois, se você quiser, dá para configurar um domínio próprio. Pode ser esse, ou você prefere outro?”
Tell the user that this is the starting address and that a domain of their own can be configured later, so the choice does not feel permanent to them. Keep that reassurance accurate: what can be added later is a custom domain in front of the same Worker. The account address itself stays as chosen and cannot be replaced without breaking every URL already published beneath it.
Proposing a candidate from the account identity is correct here precisely because the user approves it. Guessing the address of an account that already has one is a different act and remains forbidden: that value comes only from Wrangler.
If the approved name turns out to be unavailable, go back to the user with new candidates. Do not append a suffix, a number, a country code, or the application name on your own to get past the rejection: that is how an address ends up repeating the application name.
The application validates its configured production host/origin at runtime, while a new user may not yet know their Cloudflare account's workers.dev subdomain. Do not guess the subdomain and do not ask for an API token merely to discover it.
Cloudflare documents that a Worker deployed without a custom route is assigned a URL in the form <worker-name>.<account-subdomain>.workers.dev. Use Wrangler itself as the source of truth for that URL.
If a previous deployment already established this project's URL, verify it against the remote state and skip bootstrap. Otherwise, confirm a real D1 ID, enabled workers_dev, and a passing build. Use the repository's deploy command; raw Wrangler is acceptable only without a wrapper or after confirming equivalent build steps.
This first deploy is a bootstrap deployment, not completion. The Worker may intentionally reject requests because APP_HOST, APP_ORIGIN, or the final production secret are not yet configured. Never tell the user that the application is published at this stage.
The account address must already be settled before this deploy. If Wrangler still prompts for a subdomain name here, stop and settle it with the user instead of answering the prompt.
Capture the canonical Worker URL directly from successful Wrangler deployment output, normally:
https://<worker-name>.<account-subdomain>.workers.dev
Do not infer the deployed URL from an email address, account name, username, repository name, or previous project. Proposing a name for an account that has none is the previous step's job; here the URL comes only from Wrangler. If Wrangler does not provide a trustworthy URL, stop this publication step and report what is missing rather than inventing one.
Extract the hostname from the Wrangler-provided URL and update the project's production configuration:
ENVIRONMENT=production
APP_HOST=<worker-name>.<account-subdomain>.workers.dev
APP_ORIGIN=https://<worker-name>.<account-subdomain>.workers.dev
Keep these values in the project's existing non-secret Wrangler configuration structure. Continue with migrations, production secrets, full verification, and the final deploy before running health checks.
Inspect pending migrations on the confirmed database, including after interruption. Apply only pending migrations; skip application if none remain:
bunx wrangler d1 migrations list DB --remote
Prefer the repository's remote migration script, currently bun run db:migrate:remote, after confirming that it targets the intended binding/database and uses the authentication configuration from section 8.2. Otherwise use:
bunx wrangler d1 migrations apply DB --remote
Cloudflare's migration command records migrations and captures a backup before applying. A failing migration is rolled back while earlier successful migrations remain applied. If a migration fails, fix the migration/application mismatch; do not delete and recreate the production database unless the user explicitly approves losing it.
After applying, list remote migrations again and verify that no expected migration remains pending.
Inspect secret names on the confirmed Worker without reading values. Preserve an existing production SESSION_SECRET; resuming is not a reason to rotate it. Only if absent, generate a value independent of the local secret and pipe it directly into Wrangler:
bun --print "require('node:crypto').randomBytes(48).toString('base64url')" | bunx wrangler secret put SESSION_SECRET
Important: wrangler secret put creates a new Worker version and deploys it immediately. That remote side effect is why this command must only run after the user approved publication. The final deployment step below must still be run after all local production configuration is correct.
Apply the same presence check to secrets for approved optional features. Record names and confirmed presence only. Never store secret values in the plan, wrangler.jsonc, or committed files.
Run the full local verification again after all configuration changes:
bun run verify
If it passes, run the repository's production deploy command, currently documented as:
bun run deploy
If the repository has changed, inspect package.json and use the current equivalent. Do not bypass project build steps with a raw Wrangler deploy unless there is no project wrapper or you have verified they are equivalent.
Do not declare success based only on a successful deploy command. Request the production health endpoint:
curl --fail --silent --show-error https://<production-host>/health
Also test the public home page and the application's core user flow when the available environment permits it. If a brand-new workers.dev hostname briefly returns Cloudflare error 523, retry a bounded number of times; Cloudflare documents that first-time workers.dev propagation can briefly produce 523 responses.
If the health endpoint or core flow fails, diagnose and fix the deployment. Do not tell the user the application is ready until the final URL works.
When the production checks pass, tell the user only what is useful:
Do not dump deployment logs, D1 UUIDs, account IDs, or implementation jargon unless the user asks.
Do not ask the user for a domain name before the final workers.dev deployment has succeeded and its health/core-flow checks have passed. The working workers.dev URL is the publication milestone.
After showing the healthy workers.dev URL, you may ask one optional plain-language question: “Você quer usar um domínio próprio agora, ou prefere manter este endereço?” Only if the user chooses a custom domain should you ask which domain/subdomain they want and continue with the steps below.
custom_domain: true.The Wrangler configuration shape is:
"routes": [
{
"pattern": "app.example.com",
"custom_domain": true
}
]
Before deploying the custom domain, update APP_HOST and APP_ORIGIN to the custom hostname and HTTPS origin, run full verification, and deploy using the authentication configuration and pinned account from section 8. Then check the custom URL's health endpoint, public home page, and core user flow. Do not declare the domain transition complete until the new address works.
The application accepts only its configured production hostname. Explain that switching to the custom domain can make the earlier workers.dev address stop serving the application, even if Cloudflare still enables that address. Both addresses do not need to work simultaneously; preserve host/origin validation and show the verified custom URL as the application's current address.
Cloudflare recommends a Worker Route or Custom Domain rather than workers.dev for business-critical production applications. workers.dev remains the preferred simple first deployment for this protocol.
After each remote step, update the existing implementation plan with the approved scope, Wrangler version and authentication configuration location/profile, account ID, Worker name, resource IDs, migration status, secret presence, deployment version/URL, check results, and next step. Keep only non-secret state. Record uncertain command outcomes as uncertain, not failed or complete.
whoami --json, and confirm access to the pinned account before reconciling authorized remote state or writing. Reuse the valid session and the existing publication approval. Continue only missing steps; never repeat a creation or secret update just because output was lost.For later changes, inspect the project and checkpoint, update and internally validate the existing plan, and follow sections 5–6 for phase sizing and verification. Preserve the architecture, free-only boundary, and repository invariants.
A request to change the application is not automatically permission to deploy it. Ask before changing the live application unless the user clearly asked for the change to be published.
When Cloudflare behavior or Wrangler flags appear to have changed, verify against the current official documentation before improvising. Useful references:
You may say the application is ready locally only when the internally validated plan for the requested first version has been completed, every phase is checkpointed, full verification passes, the local server is running, and the core user flow has been tested. No Cloudflare account or domain is required to reach this state.
You may say the application is published only when the user approved publication after evaluating the local version, the correct Cloudflare account is selected, remote resources are configured, migrations are applied, production secrets are stored outside source control, the final workers.dev deployment succeeds, and the production health/core-flow checks pass. A custom domain is optional and must be discussed only after this milestone.