Back to the episode map

Guide

How to Build a Small App With an AI Coding Agent

A bounded learning workflow for building a small local app with an AI coding agent while preserving scope, repository state, tests, review, understanding, and recovery.

Aug 4, 20266 min readBy Dalton Anderson

How to Build a Small App With an AI Coding Agent

The safest useful first project for an AI coding agent is a small local application with one user flow, explicit exclusions, observable acceptance checks, a clean repository, and no production authority. Build one vertical slice, verify it, explain it, and stop before the project outruns your ability to review it.

This guide is for learning. It does not authorize payments, personal data, secrets, public deployment, production access, regulated workflows, or irreversible infrastructure.

flowchart TD
    A["Choose one local user flow"] --> B["Write acceptance checks and exclusions"]
    B --> C["Create clean repository baseline"]
    C --> D["Review plan before edits"]
    D --> E["Build one vertical slice"]
    E --> F["Read diff and run checks"]
    F --> G["Explain and change it manually"]
    G --> H["Commit a coherent state or restore baseline"]

Choose behavior, not a stack

Start with something a person can do and observe.

A useful scope might allow a user to add a local task, list tasks, and mark one complete. The initial version can use an in-memory collection or a local file. It does not need accounts, a database service, cloud hosting, notifications, analytics, or collaboration.

Write the exclusions beside the outcome. This prevents the agent from turning a learning exercise into an architecture project.

In the first sliceExplicitly outside it
One local userAuthentication and authorization
Synthetic sample dataPersonal or regulated data
Local processPublic deployment
One storage methodMigrations and distributed systems
Manual run commandCI/CD and infrastructure
Reversible filesPayments, messages, or external mutations

If an excluded capability becomes necessary, stop and reclassify the work with [[Which Software Tasks Should You Give an AI Coding Agent]].

Write observable acceptance checks

An agent needs a target it can test.

For the task example, the acceptance record might say that a user can start the program, add a task with valid text, see it in the list, mark it complete, receive a clear error for an unknown task, and restart without corrupting the local store.

Describe failure behavior. What happens when the file is missing, input is empty, a record is malformed, or the port is unavailable?

Do not ask the agent to decide product behavior implicitly. If the expected result matters, write it before the implementation.

Establish the baseline

Create one project directory and confirm its absolute path. Initialize Git. Record the language and tool versions. Run the initial command or test suite and preserve the result.

The E037 experiment lost time because duplicate paths held related files. Avoid that by checking the repository root, branch, status, and file tree before the agent edits anything.

Pro Git provides the durable version-control foundation. A clean baseline makes every later change inspectable and recoverable.

If you choose Go, the official getting-started tutorial explains modules, dependency tracking, files, and the go command. Use official language documentation for toolchain facts instead of relying on generated explanations.

Ask for a plan before code

Give the agent the outcome, exclusions, acceptance checks, repository root, language version, permitted commands, and files it may change.

Ask it to inspect the repository and propose the smallest vertical slice. The plan should name the expected files, interfaces, tests, commands, risks, and stopping point.

Cursor's current agent best-practices guide recommends planning for complex tasks and describes using plans as editable Markdown. The idea is product-neutral: review the intended change before granting an editing loop.

Reject a plan that adds unnecessary frameworks, dependencies, services, abstractions, or unrelated cleanup.

Build one vertical slice

A vertical slice connects the smallest useful path from input to observable output.

For a local task application, the first slice might accept one task in a function, store it in memory, and return it through one interface. Tests can cover valid input and one failure case.

Keep the diff small enough to read in one sitting. Do not ask the agent to build the entire application, write every test, refactor the architecture, and produce documentation in one request.

After the slice works, decide whether the next behavior earns another slice.

Inspect the paths and diff

Confirm the repository root and branch again. Read every changed file, including generated configuration, lockfiles, tests, and documentation.

Trace the behavior from entry point to storage and back. Resolve every imported symbol and external package. Compare documentation claims with the code.

An agent may invent a method that sounds right, call an obsolete interface, add a package with a similar name, or change a test to make a failure disappear. A green summary from the agent is not the review.

Use [[How to Review AI Generated Code Before Accepting It]] before you preserve the slice.

Run layered verification

Start with the focused test for the changed behavior. Run the broader project suite. Run formatters, linters, type checks, dependency checks, and the application command that a new user would follow.

Exercise the acceptance checks manually. Include at least one failure path.

NIST SP 800-218 provides a secure-development framework that places software security across the lifecycle. A small learning project does not need to imitate a large enterprise process, but it should not teach that generation replaces review.

Preserve the commands and results in a short build record.

Prove that learning occurred

Close the agent conversation and explain the application without copying its summary.

Describe where input enters, how validation works, where state lives, how errors propagate, which dependencies are used, and how the tests observe behavior.

Make one small manual change. Add a field, change a validation rule, or add a failure test. Run the checks again.

If you cannot explain or modify the slice, the project produced output without transferring understanding. Narrow the scope and revisit it.

Commit or restore

When the slice is understood and the checks pass, create a coherent commit with a message that describes the behavior, not the agent.

Do not combine generated documentation, dependency upgrades, unrelated formatting, and new behavior in one opaque commit.

If the result is confused, restore the clean baseline. A discarded attempt is still useful when it reveals a missing requirement or a weak test.

Build record fieldWhat to preserve
OutcomeOne user-visible behavior
ExclusionsAuthority and scope not granted
BaselineRepository, branch, commit, tools, initial checks
PlanFiles, interfaces, commands, risks
ChangeFull diff and dependency changes
EvidenceTests, checks, manual path, failure path
LearningExplanation and manual modification
DecisionCommit, revise, or restore

The point of a small agent-assisted app is not to see how much code can appear. It is to learn how a verified change moves from intent to repository evidence while the consequences remain low.

This guide was developed with AI assistance from the immutable E037 transcript, current Cursor first-party guidance, official Go and Git documentation, NIST SSDF, and the linked bounded-build framework. Dalton Anderson remains the author. Technical, security, current-source, and founder review are mandatory before publication. Publication is not authorized.

Sources

Follow the evidence.

  1. daltonanderson.net: how i built a go app in 4 hours with cursor aidaltonanderson.net
  2. owasp.org: www project top 10 for large language model applicationsowasp.org
  3. go.dev: getting startedgo.dev
  4. csrc.nist.gov: finalcsrc.nist.gov
  5. cursor.com: auto reviewcursor.com
  6. daltonanderson.ghost.io: how i built a go app in 4 hours with cursor aidaltonanderson.ghost.io
  7. cursor.com: 1 7cursor.com
  8. Spotify episodeopen.spotify.com
  9. cursor.com: teamscursor.com
  10. youtu.be: n4 J1tDwreMyoutu.be
  11. owasp.org: www project code review guideowasp.org
  12. cursor.com: privacycursor.com
  13. cursor.com: securitycursor.com
  14. slsa.dev: v1.2slsa.dev
  15. git-scm.com: v2git-scm.com
  16. cursor.com: agent best practicescursor.com
  17. cursor.com: data usecursor.com
How to Build a Small App With an AI Coding Agent