Skip to content
Agentic AI Builder's Guide

Search every lesson, prompt, glossary term and troubleshooting topic. Use ↑ ↓ to move and Enter to open.

Build Your First Application

A guided walkthrough that takes a simple task manager from idea to a deployed application on a custom domain.

Full printable guide

This walkthrough applies the complete method to a simple task management application called TaskTrail — from an idea to a live application on a custom domain. It follows the same low-prompt, LOW GAS approach used to build this website: a plan, a handful of consolidated sprint prompts, human testing after every sprint and a review loop through ChatGPT.

Every prompt and command on this page has a copy button. Work through the steps in order and tick the checklists as you go — your progress is saved in your browser.

1. Application idea and business problem

Idea: a fast, simple personal task list that works equally well on a laptop and a phone.

Business problem: busy professionals track tasks across sticky notes, email flags and chat messages. Nothing shows in one place what is due soon, so deadlines are missed and time is wasted searching.

Success looks like: a user can capture a task in seconds, see what is due today and this week, and mark work done from any device.

2. Target users

PersonaGoalTechnical comfort
Busy professional (primary)Capture tasks quickly and see what is dueLow to moderate
FreelancerTrack client deliverables by due dateModerate

There is no administrator role in the MVP. Every user manages only their own tasks — a deliberate simplification that keeps authorization rules easy to test.

3. MVP feature definition

In scope (MVP)Out of scope (later)
Email-based sign up, sign in, sign outSocial sign-in, teams, sharing
Create, edit, complete, reopen and delete tasksRecurring tasks, subtasks, attachments
Optional due date and notesReminders and notifications
Filter: open, done, due this weekSearch, tags, analytics
Responsive layout for phone and desktopNative mobile apps, offline mode

Acceptance criteria (sample):

  • A signed-in user can create a task with a title of 1 to 200 non-whitespace characters.
  • A user cannot read or change another user's task, even by editing the URL or API request.
  • The task list is usable at 375 pixels wide.
  • Tests, type checking and the production build pass.
LayerChoiceWhy
ApplicationNext.js (App Router) with TypeScriptFront end and server logic in one deployable service
StylingTailwind CSSFast, consistent responsive UI
DatabasePostgreSQL on RailwayStructured, related records (users and tasks)
Data accessPrisma ORMType-safe queries and versioned migrations
AuthenticationAn established authentication libraryAvoids hand-written security code
HostingRailway, deployed from a private GitHub repositoryApp and database in one project, private networking

Railway application and database architecture

Users

Browser or mobile device

GitHub

Push to main triggers a deployment

Railway project · production environment

Application service

Public domain, PORT, environment variables, health check

PostgreSQL

Primary relational data

Redis (optional)

Cache, sessions, queues
Users reach the application service over HTTPS on its public domain. The application reaches databases over Railway's private network using reference variables such as DATABASE_URL. Databases are not exposed publicly unless you choose to.

Redis, background workers and an email service were considered and deliberately left out of the MVP.

5. Project directory setup

Open the macOS Terminal (or the VS Code integrated terminal) and run:

bash
mkdir -p ~/projects/tasktrail
cd ~/projects/tasktrail
code .

VS Code opens the empty folder. Open the integrated terminal inside VS Code and confirm you are in the right place:

bash
pwd
# /Users/yourname/projects/tasktrail

6. GitHub repository setup

Confirm the GitHub CLI is authenticated:

bash
gh auth status

You will create the private repository as part of the Sprint 0 prompt in step 8, so there is nothing else to do yet. If you prefer to do it manually, follow Getting Started.

0 of 3 complete

7. ChatGPT planning prompt

Open a new ChatGPT conversation and paste this prompt. It is the library's Application Planning prompt with TaskTrail's details filled in.

markdown
Act as an experienced product manager and software architect. Help me plan a web application
that I will build with Claude Code (an AI coding agent) and deploy to Railway from a private
GitHub repository.
 
## My idea
TaskTrail: a fast, simple personal task list for desktop and phone.
 
## Target users
Busy professionals and freelancers who want one place to see what is due.
 
## Problem being solved
Tasks are scattered across notes, email and chat; deadlines are missed.
 
## Must-have features
Email sign up/sign in/sign out; create, edit, complete, reopen and delete tasks; optional due
date and notes; filters for open, done and due this week; responsive layout.
 
## Constraints
Low monthly cost, mainstream stable technologies, no unnecessary services, MVP in about a week
of part-time work.
 
## Produce the following plan
Product summary, business requirements, personas, use cases, MVP in/out of scope, recommended
stack with justification, architecture, data model, database recommendation, screens and user
flows, security requirements, environment variable names (no values), testing approach,
measurable acceptance criteria, risks and open questions, and what to avoid to prevent
overengineering.
 
Ask up to five clarifying questions first if anything critical is ambiguous.

Plan excerpt (illustrative)

Data model
  User:  id, email, name, created_at
  Task:  id, user_id → User, title (1–200), notes, status (open | done),
         due_date (nullable), created_at, updated_at
Environment variables: DATABASE_URL, AUTH_SECRET, APP_URL
Avoid for MVP: Redis, background jobs, email reminders, team features

Review the plan with the checklist in Application Planning. In this example ChatGPT first suggested Redis for caching; asking "what can be removed without hurting the MVP?" removed it.

Then ask ChatGPT for the sprint prompts, using the Sprint Planning prompt with three sprints:

Sprint 0 — Foundation: repository, scaffold, database schema, CLAUDE.md, first push
Sprint 1 — Core: accounts, task features, authorization, validation, tests
Sprint 2 — Launch readiness: health check, PORT, docs, production polish (written after review)

8. Claude Code Sprint 0 prompt

Paste the whole prompt into Claude Code from the tasktrail folder. Notice that it consolidates repository setup, scaffolding, the schema and project documentation into one prompt instead of four.

markdown
# Sprint 0 — Foundation
 
## Operating instructions
Use LOW GAS throughout this task. Minimize token consumption, unnecessary analysis, repetitive
audits, readiness checks and intermediate reports. Consolidate related implementation
activities. Do not create additional planning phases or request approval for routine
implementation decisions. Run essential tests, type checking and production builds. Do not
compromise security or functionality to reduce model usage.
 
## Scope
1. Initialize Git with a main branch and a .gitignore that excludes .env files, node_modules
   and build output.
2. Scaffold a Next.js (App Router) + TypeScript + Tailwind CSS application in this folder.
3. Add Prisma with PostgreSQL. Create User and Task models per the approved data model and an
   initial migration.
4. Add .env.example with placeholder values for DATABASE_URL, AUTH_SECRET and APP_URL.
5. Add a minimal responsive layout and a placeholder task list page that reads from the database.
6. Add a test runner with one passing smoke test.
7. Create README.md (setup, commands, environment variables) and CLAUDE.md (architecture,
   commands, conventions, LOW GAS rule, never force-push, never commit secrets).
8. Create a PRIVATE GitHub repository named tasktrail with the GitHub CLI if it does not exist,
   set it as origin, commit and push main. Never force-push.
 
## Completion
Run tests, typecheck and the production build. Provide a concise completion report: features,
files, results, how to run locally, commit hash, limitations, manual actions, remaining work.
Do not proceed to the next sprint until instructed.

Local database for development

Sprint 0 needs a PostgreSQL database on your computer for development. One option with Homebrew (check the current PostgreSQL version available):

bash
brew install postgresql@16
brew services start postgresql@16
createdb tasktrail_dev

Then copy the example environment file and set the local connection string — never your production database:

bash
cp .env.example .env
# edit .env: DATABASE_URL="postgresql://localhost:5432/tasktrail_dev"
npx prisma migrate dev

9. Core functionality implementation prompt

After Sprint 0 is reviewed (step 11), ChatGPT produces the Sprint 1 prompt. This one prompt covers accounts, every task feature, authorization, validation and tests.

markdown
# Sprint 1 — Core functionality
 
## Operating instructions
Use LOW GAS throughout this task. Minimize token consumption, unnecessary analysis, repetitive
audits, readiness checks and intermediate reports. Consolidate related implementation
activities. Do not create additional planning phases or request approval for routine
implementation decisions. Run essential tests, type checking and production builds. Do not
compromise security or functionality to reduce model usage.
 
## Context
Read CLAUDE.md and README.md first.
 
## Scope
1. Email sign up, sign in and sign out using an established authentication library.
   Protect all task pages and server actions.
2. Task features: create, edit, complete, reopen, delete; optional due date and notes.
3. Filters: open, done, due this week. Sensible empty states.
4. Authorization: every query is scoped to the signed-in user. Requests for another user's
   task return not found.
5. Server-side validation: title 1–200 characters and not whitespace-only; valid due date.
   Friendly error messages; never show stack traces.
6. Responsive layout usable at 375px wide.
7. Tests for validation, authorization (cross-user access is rejected) and task actions.
8. Update README.md, CLAUDE.md and .env.example for any new variables.
 
## Acceptance criteria
All MVP acceptance criteria in the approved plan.
 
## Completion
Run tests, typecheck and the production build. Commit and push to main without force-pushing.
Provide a concise completion report. Do not proceed to the next sprint until instructed.

10. Example completion report

Sprint 1 completion report (hypothetical)
 
1. Features: email auth, protected routes, task CRUD with complete/reopen, due dates, notes,
   filters (open/done/this week), empty states, responsive layout
2. Files: app/(auth)/*, app/tasks/*, lib/auth.ts, lib/tasks.ts, lib/validation.ts,
   tests/validation.test.ts, tests/authorization.test.ts, README.md, CLAUDE.md
3. Results: 24 tests passed · typecheck passed · production build passed
4. Run locally: npm install → npx prisma migrate dev → npm run dev
5. Commit: 9c2e4b1 (main)
6. Known limitations: no pagination; no password reset
7. Manual actions: set AUTH_SECRET in .env (openssl rand -base64 32)
8. Remaining: health check, PORT handling review, deployment documentation

11. ChatGPT review and iteration prompt

Before reviewing, test the application yourself (step 12). Then paste the report and your observations into the same ChatGPT conversation:

markdown
Claude Code has completed Sprint 1. Review its completion report against the approved plan and
the Sprint 1 prompt in this conversation.
 
## Completion report
[PASTE THE FULL COMPLETION REPORT]
 
## My own local testing observations
- Creating a task whose title is only spaces is accepted.
- On my phone the "Delete" button is very close to "Complete".
- Everything else in the acceptance criteria worked.
 
## Please provide
1. Verdict: complete, complete with minor gaps, or incomplete.
2. Material gaps and risks, including security concerns.
3. Claims I should verify manually and how.
4. ONE consolidated next prompt for Claude Code: fix the gaps AND include Sprint 2 launch
   readiness (health check, PORT, deployment docs) so we do not need a separate corrective
   cycle. Start it with the LOW GAS operating instructions, require tests, typecheck and a
   production build, require commit and push without force-push, and end with a request for a
   concise completion report.

In this example ChatGPT judged Sprint 1 "complete with minor gaps" and folded both fixes into the Sprint 2 prompt — saving a full cycle. That is the low-prompt approach in practice: fix forward in the next consolidated prompt instead of sending many small corrective prompts.

12. Local application testing

Start the application and test as a real user:

bash
npm run dev
# open http://localhost:3000

0 of 8 complete

Also confirm the automated checks yourself rather than relying only on the report:

bash
npm test
npx tsc --noEmit
npm run build

13. Database setup

TaskTrail needs a database because tasks must persist and belong to users. Locally you used tasktrail_dev. In production you will add PostgreSQL as a Railway service in step 14; Railway provisions it and exposes its connection variables.

Migrations created during development (in the prisma/migrations folder) are committed to Git and applied to production with a deploy-safe command:

bash
npx prisma migrate deploy

Never run development reset commands against production.

14. Railway deployment

First ask ChatGPT for configuration using the Railway Deployment Configuration prompt, pasting README.md, package.json and .env.example. Then in Railway:

  1. Log in with GitHub and create a New Project → deploy from the tasktrail GitHub repository. Grant the Railway GitHub app access to this repository only.
  2. Add a PostgreSQL database service to the project.
  3. Configure the application service's variables (step 15).
  4. Set the pre-deploy command to npx prisma migrate deploy.
  5. Set the health check path to /api/health.
  6. Deploy and read the build logs, then the deploy logs.

A deployment failure (illustrative)

Error: Environment variable not found: DATABASE_URL

Pasted into ChatGPT with the Railway Troubleshooting prompt, the root cause was clear: the reference variable had been added to the database service instead of the application service. Moving it fixed the deployment — no code change needed. Reading the logs first saved a needless Claude Code cycle.

15. Environment variable configuration

Set these on the application service (values are illustrative or placeholders):

bash
DATABASE_URL=${{Postgres.DATABASE_URL}}   # reference variable — match your database service's name
AUTH_SECRET=[generate a new value with: openssl rand -base64 32]
APP_URL=https://[your-domain]               # set after step 16

0 of 4 complete

16. Custom domain setup

  1. In the service's networking settings, generate a Railway domain and confirm the application works on it (illustrative: tasktrail-production.up.railway.app).
  2. Add the custom domain — in this example the owner used the subdomain tasks.example.com.
  3. Railway displays the DNS records to create. Illustrative values:
TypeNameValue
CNAMEtasksabc123.up.railway.app
TXTname shown by Railwayvalue shown by Railway
  1. At the DNS provider, add only these records. Existing MX and TXT records for email are left untouched.
  2. Wait for verification and automatic HTTPS certificate issuance; check progress with dig tasks.example.com +short.
  3. Update APP_URL and any authentication callback URLs to https://tasks.example.com.

DNS and custom domain configuration

1. Railway networking

Add custom domain, copy the record type, name and value

2. DNS provider

Create the records. Keep unrelated records.

3. Verification + HTTPS

Railway verifies and issues a certificate

4. Users

https://app.example.com reaches your service
TypeNameValue (illustrative)
CNAMEappexample-value.up.railway.app
TXTverification name from Railwayverification value from Railway
Railway gives you the DNS record values. You create those records at your DNS provider. Once DNS resolves to Railway and verification succeeds, Railway provisions the HTTPS certificate. Values shown are illustrative only.

17. Production validation

Run the production smoke test on the custom domain and on a real phone, then complete the production launch checklist. For a one-time deeper review, use the Production Readiness Validation prompt.

0 of 7 complete

18. Further enhancements

TaskTrail is live. New features follow Maintenance and Optimization: plan the change with ChatGPT, implement it on a feature branch with the Application Enhancement prompt, test, merge and smoke test.

Candidate enhancements, each a single consolidated prompt:

  • Email reminders for tasks due tomorrow (adds an email service and a scheduled job — review the cost first with the Cost Calculator).
  • Search and tags for larger task lists.
  • Password reset flow using the authentication library's built-in support.
  • Shared lists for small teams (requires new authorization rules and careful testing).

Ongoing application enhancement lifecycle

  1. 1. Feedback and ideas

    Users, logs, metrics
  2. 2. Plan with ChatGPT

    Scope, risks, prompt
  3. 3. Feature branch

    Claude Code implements and tests
  4. 4. Validate

    Local and staging testing
  5. 5. Merge and deploy

    Main → production
  6. 6. Monitor

    Logs, errors, costs, backups
Monitoring produces new feedback and the cycle repeats
Every change follows the same loop. Small, frequent, validated releases are safer than large infrequent ones.

What this example demonstrates

  • A clear plan with an explicit out-of-scope list kept the build to three consolidated sprints.
  • Every Claude Code prompt carried the LOW GAS instructions and requested a concise completion report.
  • Human testing caught gaps that automated tests missed.
  • Fixing forward in the next consolidated prompt avoided extra cycles.
  • Reading logs first turned a deployment failure into a configuration fix.
  • Using Railway's own DNS values — and preserving existing records — made the domain setup safe.