-
Notifications
You must be signed in to change notification settings - Fork 7
AI prototyping workflow
Summary: This guide outlines the "4-Step Loop" for rapid prototyping in StartER using AI agents like Cursor, Windsurf, or GitHub Copilot.
To move from an idea to a working feature in minutes, follow this structured loop. It provides the AI with the constraints it needs to be successful.
Before writing any logic, define the API behavior in tests/contracts.ts.
- Why? This provides a declarative source of truth that the AI can parse.
-
Action: add your new resource and its scenarios (success, bad_request, etc.) to the
contractsobject.
Use the CLI to create the module structure.
-
Why?
make:cloneprovides the AI with a working master template of your specific architectural style. -
Action:
npm run make:clone -- src/express/modules/item src/express/modules/task item task
Guide your AI agent using the context of the contract and the cloned files.
- Why? AI works best when given a clear goal and a relevant example.
-
Sample prompt:
"I've added a
taskmodule. Based on thetaskdefinitions intests/contracts.tsand the logic insrc/express/modules/item, implement thetaskRepositoryandtaskActions."
Run the automated tests to catch AI hallucinations.
- Why? AI often misses edge cases (like 404s or validation errors) defined in your contract.
-
Action:
npm run test -
If it fails: Feed the error back to the AI: "The
readtest failed with 404. Fix thefindmethod inTaskRepository."
- Reference the contracts: always tell the AI: "Respect the structure defined in the contracts."
-
Paste the schema: if you change the database, share
src/database/schema.sqlwith the AI. - One module at a time: focus the AI on one resource (Express module or React component) to keep the context window clean.
AI co-creation
Getting started
Explanations
How-To Guides
Reference
Digging deeper