Build with AI

An AI agent can write most of a Core feature for you. It can also write a page that works perfectly in testing and shows one client's customers to another. The difference is not which tool you pick. It's whether the agent knows Core's rules without you pasting them, and whether you read what it wrote before you keep it.

This page assumes your app is in its own folder under XAMPP's htdocs and open in VS Code. If not, start with Set up your computer.

The rules load by themselves

Core ships with AGENTS.md in the project root. It tells an agent where code goes, how database changes are made, which files it must never edit, and the security rules every page follows. It also tells the agent to plan before it writes and to ask before it runs a command.

ToolReads the rules from
GitHub Copilot, agent mode in VS CodeAGENTS.md
CursorAGENTS.md
OpenAI CodexAGENTS.md
Claude CodeCLAUDE.md, which points at AGENTS.md

Support for these files changes quickly. If an agent breaks a rule from the file, ask it whether it read AGENTS.md. If it didn't, check your tool's documentation for the setting that turns it on.

The file is yours. Add a few lines about your own app at the end: what it does, its tables, anything an agent should leave alone. Every session starts from what you write there.

Which tool

If you have nothing yet, use GitHub Copilot in VS Code. It is built into the editor you already have and has a free tier. Switch it to Agent mode in the chat panel, so it can open and edit files itself.

If you already pay for Claude Code or Cursor, use that. The rules and the loop below are the same.

Whichever you use, keep terminal commands on "ask every time". An agent that can run php bin/install.php can also run a command that deletes your work.

The loop, once per feature

1. Ask for a plan, not code

Describe the feature in plain words and ask for the plan first:

I want customers to be able to leave a note when they book.
Plan it first: which files you'll change, and any migration. No code yet.

Check the plan before you agree. Two quick tests: it doesn't touch anything in app/lib/, and if it changes the database, it writes a migration for both SQLite and MySQL.

2. Build one feature

"Add invoicing" is too big for one go. "Add an invoices table and a page that lists them" is right. Small steps give small diffs, and a small diff is one you will actually read.

3. Read the diff

Open the Source Control panel (the branch icon on the left). Every changed file is listed; click one to see each line added and removed.

Ask the agent to explain any line you can't. This step is what makes the app yours: when your client rings because something broke, you'll be fixing code you've read, not code you've only seen scroll past.

4. Test it in the browser

Open http://localhost/your-app/ and use the feature the way a customer would, including the wrong way: empty fields, very long text, the back button.

If a page goes blank or shows an error, open storage/logs/app.log. Paste the last entry to the agent instead of describing the problem.

5. Commit, or throw it away

If it works, commit it in Source Control with a message saying what the feature does. If it doesn't, and fixing it is turning into a long conversation, discard the changes and you're back where you started. Then ask again with a smaller step.

Git is what makes letting an agent loose safe. Commit every time something works, and a bad session costs you minutes, not a weekend.

Two checks no agent does for you

An agent's worst mistakes don't announce themselves.

Make a second account. Most data leaks come from one missing line: a query without AND user_id = ?. It passes every test you run as yourself, because you only have one account. Register a second user. Signed in as them, paste in the address of something the first user owns, such as project-edit.php?id=1, and confirm you get "not found". Do it for every feature that stores anything.

Run the review before you go live. AGENTS.md ends with an eight-point review checklist. Before a client sees the app, ask the agent:

Review every file I've added or changed against the review checklist in AGENTS.md.
Quote each problem and give the fix.

Then fix what it finds, and run the second-account check again.

Signs the agent has gone off track

  • It wants to install something: Composer, npm, a framework, a library from a CDN. Core has no dependencies on purpose. Say no and ask for the same thing in plain PHP.
  • It edits app/lib/ or app/bootstrap.php. Your change would be wiped by the next Core update. Discard it and ask for a new function in app/custom.php instead.
  • A button does nothing and the browser console mentions "Content Security Policy". It wrote inline JavaScript. Ask it to move the script into public/assets/js/.
  • It edits a migration that has already run. The change will never reach your database. Ask for a new migration file instead.

Without an editor agent

If you'd rather use a chat in the browser, AI-PROMPTS.md has a context block to paste at the start of every chat, plus prompts for common features: email verification, "remember me", payments, two-factor sign-in. You'll paste files in and code out by hand. Reading the diff before you commit matters even more that way.