AI Coding Workflow
The deliverable is not “the model wrote code.” It is a change an engineer can explain, test, revert, and hand to a reviewer. Tools change; the stable workflow is to define the outcome, understand the repository, implement in small steps, verify, and preserve evidence.
A reliable development loop
outcome and boundaries
→ read repository rules
→ locate current behaviour and neighbouring patterns
→ plan with acceptance criteria
→ capture the failing baseline
→ implement the smallest vertical slice
→ unit / integration / UI or real-client verification
→ review diff and security boundaries
→ scoped commit plus evidence
| Stage | Question | Evidence |
|---|---|---|
| Outcome | What can the user do at the end? | Acceptance criteria |
| Exploration | Where are the existing patterns and constraints? | Files, rules, neighbouring implementation |
| Baseline | How does it fail before the change? | Reproducible command or screenshot |
| Implementation | What is the smallest valid change? | Scoped diff |
| Verification | Which checks cover the risk? | Tests, HTTP, browser, provider read-back |
| Handoff | How can the next engineer verify it? | Commit, result summary, known limits |
Choose a surface by task shape
Do not treat a product brand as a permanent capability boundary:
| Task | Useful surface | Reason |
|---|---|---|
| Local completion, one-function refactor, instant preview | IDE inline or chat | Fast feedback and clear local context |
| Multi-file change, tests, and Git inspection | Terminal agent | Sustained command and repository observation |
| New feature with unresolved requirements | Spec-first workflow | Stabilise requirements, design, and tasks first |
| Risky migration or production incident | Human-led, read-only diagnosis | Control scope and authority before mutation |
| Many independent tasks | Isolated worktrees or parallel tasks | Reduce file conflict and context contamination |
Cursor, Claude Code, Codex, and Kiro may cover several surfaces. Capabilities and prices change, so a learning page should not permanently crown one product as the best.
Write a Task Brief before prompting
## Outcome
After a failed login, the user sees a recoverable error instead of a blank page.
## In scope
- Login form error state
- User messages for 401 and 429
- Unit tests and browser regression
## Out of scope
- Changing the authentication provider
- Changing public URLs
- Redesigning the whole page
## Constraints
- Preserve the API contract
- Reuse the repository request/error helper
- Never log passwords or tokens
## Acceptance
- Wrong password shows a clear message
- 429 asks the user to retry later
- The form works again after refresh
- Tests and the browser flow pass
“Fix login” makes the agent guess the outcome, scope, and finish line. A brief is not a long PRD; it records the decisions that must not be guessed.
Explore before editing
pwd
rg --files -g 'AGENTS.md' -g 'CLAUDE.md' -g 'README.md'
rg -n "login|signIn|401|429" src
git status --short
git log -5 --oneline
Ask the agent to report the current data path, nearest existing pattern, user changes that must be preserved, the narrowest reproduction, and whether the task touches URLs, access, data, or publication.
Starting without evidence often creates duplicate utilities, changes the wrong directory, or overwrites parallel work.
A plan should expose risk
1. Preserve 401/429 categories in the request error mapper
2. Render recoverable copy from the login form
3. Add mapper boundary tests
4. Run wrong-password and rate-limit browser flows
5. Stage only the scoped files
Every step needs a completion signal. A plan that changes a public URL, deletes data, sends a message, or deploys production requires explicit authority before execution.
Implement and verify in small increments
change one behaviour
→ run the narrowest test
→ inspect the diff
→ repair or continue
→ complete the vertical slice
→ run the higher-level check
| Change | Narrow check | Higher-level check |
|---|---|---|
| Pure mapper | Unit test | Caller integration test |
| API rule | Service/controller test | HTTP status and response shape |
| Page interaction | Component test | Real browser flow |
| Migration | Dry run and fixtures | Backup, sampled read-back, rollback rehearsal |
| External publication | Local preflight | Provider status and public URL read-back |
A command exiting zero is not always the requested user outcome. Verification must reach the actual finish line.
Review the diff, not the agent summary
Check scope drift, invented imports, deviation from existing patterns, hidden writes or network calls, error semantics, server-side access boundaries, and whether tests validate behaviour rather than mirror implementation.
git diff --check
git diff --stat
git diff -- path/to/scoped/files
git status --short
The summary can omit a file. Git is the change source of truth.
Put team knowledge in the right artefact
| Knowledge | Artefact |
|---|---|
| Repository invariants, safety, and Git rules | AGENTS.md / CLAUDE.md |
| Directory or language-specific rules | A closer scoped rule file |
| Reusable specialist workflow | Skill |
| Feature outcome, design, and tasks | Spec / PRD / issue |
| Facts for one change | Commit and verification evidence |
Kiro Specs currently organise features into requirements, design, and tasks; coding tools also support project rule files. The durable principle is versioned, scoped guidance instead of repeating conventions in every chat.
Measure productivity with evidence
| Metric | Calculation | Avoiding misuse |
|---|---|---|
| Cycle time | Task ready → merged | Group by task type and size |
| First-review pass | PRs with no behavioural revision / all PRs | Separate copy edits from logic changes |
| Escaped defects | Related defects found after merge | Link to the originating PR |
| Rework | Generated code later deleted or heavily changed | Compare generated and retained code |
| Verification cost | Test, review, and repair time | Do not count generation time alone |
| Provider cost | Actual bill / successful task | Do not hard-code web pricing |
Use comparable time windows and task groups. If the baseline is missing, record unavailable rather than inventing a number.
Additional gates for high-risk work
- Auth, access, and billing: the human writes the threat model and invariants first.
- Migration: backup, dry run, sample, and rollback; never let an agent execute production by assumption.
- Concurrency: validate multiple processes or pods, not only one process.
- Deletion and publication: resolve exact targets, approve, and read back external state.
- Secrets: keep them out of logs, prompts, screenshots, and commits.
AI can diagnose and propose a patch; the accountable engineer must understand the failure modes.
Practice task
Choose one real, small bug:
- Write the brief and out-of-scope list.
- Ask for read-only exploration with cited repository patterns.
- Save the failing baseline.
- Implement one behaviour at a time with the narrowest test.
- Review the diff and execute the actual user flow.
- Produce an evidence pack: files, commands, results, uncovered risk, and commit.
Definition of done
- Outcome, scope, and acceptance were not guessed by the agent.
- The same flow has before and after evidence.
- I read the scoped diff and can explain high-risk code.
- The commit excludes other workspace changes.
- Productivity claims use comparable evidence, not invented figures.
Related reading
- Vibe Coding in Practice
- AI Rules Configuration
- Claude Code Context Management
- Long-Running Agent Harness
Official references
📚 Related resources
❓ Common questions
Open a question to review the practical answer.
What does an AI Coding workflow actually entail?
The core loop is: define the user outcome and boundaries, read repository rules and existing patterns, preserve the failing baseline, plan the smallest vertical slice, edit and test incrementally, verify the real user flow, then review and commit a scoped diff with evidence. AI accelerates exploration and candidate implementation; engineers retain architecture, approval, and production responsibility.
Which of Cursor, Claude Code, and GitHub Copilot should I learn first?
Choose by working surface, not a permanent product ranking: IDE tools suit local completion and instant preview; terminal agents suit multi-file changes, tests, and Git inspection; spec-first flows suit unresolved features; migrations and incidents start with human-led read-only diagnosis. Product capabilities and prices change, so pick one that satisfies the task, access, testing, and version-control requirements.
Why should I make AI propose a plan before touching code?
A plan exposes scope, dependencies, acceptance, and risky side effects before mutation. It should list concrete vertical slices and a completion signal for each step. URL changes, deletion, messaging, and deployment require authority before execution. A tiny local edit may not need a formal plan, but it still needs an expected outcome and diff review.
Should I let AI edit a dozen files at once?
File count is not the only criterion; one change should correspond to one verifiable vertical slice. A dozen files may be necessary for a type migration or may indicate scope drift. Use the rhythm change one behaviour, run the narrowest check, inspect the scoped diff, then continue, while staging exact files around parallel workspace work.
What actually separates a fast AI Coding workflow from a slow one?
The durable advantage is reusable repository rules, task briefs, acceptance checklists, fixtures, debug runbooks, and real outcome evidence, not decorative prompts. Track cycle time, first-review pass, rework, escaped defects, verification time, and actual billing. Without a baseline, mark the metric unavailable instead of inventing an improvement percentage.