HinterBuild logoHinterBuild
Developer Productivity · 13 min read

Daily AI Workflow for Backend Engineers

A daily AI workflow for backend engineers: route Cursor, Copilot, and Claude Code around APIs, SQL, tests, and reviews without leaking prod data.

Muhammad Abdul Sami, author

Muhammad Abdul Sami

· 13 min read

  • Backend
  • Developer Workflow
  • APIs
  • AI Assistants

A daily AI workflow for backend engineers is not “chat until the handler compiles.” It is a sequence you could explain to a teammate: complete the obvious line, ask the repo about the contract, run the tests, write the migration like an adult, and keep production data out of the prompt. This post is that sequence. Tool brands are routing, not religion — see Cursor vs Claude Code vs Copilot for the surface split.

Key Takeaways:

  • Backend work has a stable loop: contract → implementation → tests → migration → review. AI sits in each step with a different prompt.
  • Copilot fills the line; Cursor explains the service; Claude Code runs the hunt across files.
  • SQL, idempotency, and authz are where models sound confident and ship incidents.
  • Prod dumps, .env, and customer rows never go in the prompt — scan the repo locally.
  • Commit messages and reviews stay human-owned; the model drafts, you sign.
  • Teach the loop with a real curriculum from your services, not a thread of chat logs.

Table of Contents:

The backend loop, with AI in the gaps

Frontend AI demos look like magic because the feedback is visual. Backend feedback is a test, a log, a queue depth, a migration that cannot reverse. If you let the assistant drive, you get a handler that compiles and a data model that lies.

The loop we use on backend API engineering work:

  1. Name the contract. Public JSON, idempotency, authz, error codes.
  2. Find the existing pattern. Do not invent a second way to do refunds.
  3. Implement the smallest slice. One handler, one job, one migration.
  4. Prove it. Tests you would keep if the model vanished.
  5. Review the blast radius. Diff size, locks, backfills.
  6. Ship with a message that matches the patch.

AI is allowed in 2–5 as a draft. Humans own 1 and 6. That split matches how we think about production AI agents: the model proposes, the system validates.

HourHuman jobAI jobTool default
9:00Read the ticket; write the invariant in one sentenceNoneEditor
9:15—Locate existing middleware and call sitesCursor @codebase / Claude Code
10:00Accept or reject the approachDraft the handler against the invariantCursor composer
10:45Delete extra filesDraft tests for new branchesSee unit test prompts
11:30EXPLAIN, index names, rollback planDraft SQL from schema, not from vibesChatGPT for SQL
14:00Review othersHunt a named bug class on a bounded diffAI code review
16:30Edit subject lineDraft commit body from staged diffAI commit messages

If you need a self-hosted agent instead of a vendor CLI, that is OpenClaw vs Claude Code, not this post.

Morning: contracts before code

Start in the spec, even if the spec is a Slack thread. Write the invariant yourself:

text
POST /v1/refunds is idempotent on header Idempotency-Key scoped to merchant_id.
Replay returns 200 and the original body, including created_at.
Missing key → 400. Unknown payment → 404. Cross-merchant payment → 404 (not 403).

Then ask the repo, not the void. Cursor’s repo chat is documented as editor-native context, not a generic chatbot (Cursor documentation). Copilot remains the line-completer (GitHub Copilot).

text
Where do we already implement idempotency for POST handlers?
Quote the middleware and one call site. Do not propose a new Redis wrapper
if one exists. List the exact files.

That is a Cursor or Claude Code job. Copilot will complete a new Redis wrapper because new code is what ghost text does. Ghost text is for the line after you have opened the existing helper.

If the change is larger than a handler — a new resource, a new consistency model — stop and write an RFC. AI for RFC design docs is the companion, not a chatbot that “designs your payments platform” in one sitting.

Reading the service you do not own

Backend teams rotate. On call for a service you did not write, do not paste the tree into ChatGPT. Use AI to read a new codebase: entrypoints, middleware, datastore, jobs. Ask for a map. Then open the files.

MCP is usually the wrong layer for this hour. You need rg and the test runner, not a protocol to your calendar. When you are wiring tools into an agent, start from MCP explained with real code.

Midday: implement, test, refuse extra files

Prompt with a fence:

text
Implement the invariant in the existing refunds handler.
Touch only:
- internal/http/refunds.go
- internal/http/refunds_test.go

Do not add a package. Do not rename. Do not “improve” logging globally.
Show the test names you will add before you write them.

Then look at the diff. Models love:

  • A new interface for one call site
  • Context values you already had on the request struct
  • A retry loop that duplicates the job runner
  • Comments that restate the code

Delete those. This is pair programming with a junior who types at 2,000 tokens a second. You are still the engineer.

Tests are part of the slice

Do not accept “tests omitted for brevity.” Backend tests are the product. Prompt for:

  • Happy path
  • Replay / idempotency
  • Authz miss (wrong merchant)
  • Malformed body
  • Downstream 503 (if you claim you handle it)

Details live in prompt AI for better unit tests. Run them yourself:

bash
go test ./internal/http -run Refund -count=1
pytest -k refund -q

Claude Code can run that loop. You still read the assertion. A test that mocks the database and asserts the mock was called is a rubber stamp — the same failure mode as rubber-stamp code review.

Keyboard, not prompt essays

If you spend fifteen minutes restating the architecture, you are using the wrong surface. Bind the few commands you hit: inline complete, chat on selection, agent in repo root. Keyboard-first AI coding assistant habits is the muscle-memory version of this section.

SQL, queues, and other sharp edges

This is where backend AI workflows go to die.

SQL

Models remember popular Postgres. They do not remember your partial index, your tenant_id discriminator, or your statement timeout. Draft the query from information_schema or a migration file. Then EXPLAIN. Then a colleague if it locks a hot table.

Walkthrough: ChatGPT for SQL you forgot. Official Postgres docs remain the source of truth for isolation and locking (PostgreSQL documentation).

sql
-- Ask the model to fill the SELECT list only after you paste this
-- from your DB, not from memory:
-- \d+ refunds
EXPLAIN (ANALYZE, BUFFERS)
SELECT id, status
FROM refunds
WHERE merchant_id = $1 AND idempotency_key = $2;

Never paste SELECT * FROM customers LIMIT 50 results from prod into a vendor chat. That is a leak with a UI.

Queues and jobs

Ask: “Can this handler succeed, crash, and run again?” If the model adds at-most-once comments, delete them. You do not have at-most-once. You have a worker and a network.

Authz

Require the model to quote the middleware. If it cannot, the finding is “I did not find authz,” not “looks fine.” We treat that the way we treat tool calls in production agents: no evidence, no action.

Secrets and config

Backend repos accumulate .env.example, Helm values, and “temporary” connection strings. Before a long agent session:

bash
ocherfort scan

Ocherfort is a local-first repo security CLI — gates, findings, evidence on disk. Use it when the risk is secrets and dangerous config, which is most backend trees. Pair with the habits in AI pair programming without leaking secrets.

Untrusted ticket comments can instruct an agent to dump env. That is prompt injection. Do not let the daily workflow fetch HTML from the ticket into the same context as your shell.

Afternoon: review, release notes, wrap

Review

Use the hunt list from the AI code review post. You are a backend reviewer: authz, migrations, idempotency, missing tests. Let CI own formatting. Do not merge because Copilot Chat posted a summary.

Commit

Staged diff only. AI commit messages developers actually use is the ritual. Subject line is yours:

text
Reject duplicate refunds with the same Idempotency-Key

Notes for the next human

If you discovered how webhook retries actually work, do not leave it in Cursor history. Either update the runbook or turn it into a short series for the next on-call. Cadensend is an open-source email curriculum engine: one learning goal, sources from the repo, scheduled issues (GitHub). Backend onboarding is the use case — “how this service stores money,” not a generic Kubernetes course.

HinterBuild’s about story is building systems; Cadensend is how we would rather teach the next engineer than dump a Confluence tree.

What a backend team should standardize

Personal workflows do not survive a team of eight unless you write down four things:

  1. Where secrets must never go (prompts, commit bodies, PR templates). Scanner: Ocherfort.
  2. Which AI surface is default for which task — the table in the Cursor / Claude Code / Copilot post.
  3. REVIEW.md hunt list so bots cannot improvise architecture lectures.
  4. Onboarding series sourced from the real services, via Cadensend or an equivalent.

Do not standardize model vendors in a religious war. Do standardize contracts, tests, and scan-before-prompt.

If you are building internal agents that call your own APIs, that is AI agent development, with MCP where a protocol earns its keep (MCP with real code). A daily coding assistant is not that product. Mixing them is how a “helpful” bot gets a production database URL.

When you want this loop installed — not a tool bake-off — contact HinterBuild. Bring one service, one week of git log, and the last incident. We will map AI onto that, not onto a slide titled “transformation.”

python
# Tiny end-of-day checklist you can keep in the repo
CHECKS = [
    "invariant written in the PR body by a human",
    "diff bounded to the ticket",
    "tests for new branches actually ran",
    "EXPLAIN on new queries",
    "secret scan on the branch",
    "commit subject edited by a human",
]

Print it. Ignore it once and you will ship a second idempotency scheme.

Frequently Asked Questions

Should backend engineers disable Copilot?

No. Disable it when it fights your other Tab provider or when policy forbids the vendor. Keep it for obvious completions after you have opened the existing helper. Copilot is not your architect. Details: daily Cursor vs Claude Code vs Copilot.

Is Claude Code better than Cursor for backend work?

For multi-file hunts and test loops, the terminal agent is often faster. For “explain this handler I have open,” Cursor wins. Use both. Self-hosted alternatives: OpenClaw vs Claude Code.

How do I use AI on call?

Map first, patch second. Read the codebase with AI, reproduce with tests, bound the files. Do not paste pager screenshots that contain customer payloads into a vendor chat. Scan if you are on an unfamiliar repo (Ocherfort).

Can I let AI write database migrations?

Drafts only. You name the rollback. You check locks. You run against a copy of prod shape, not prod data in the prompt. See ChatGPT for SQL and Postgres docs.

Where does MCP fit in a backend daily workflow?

Rarely. MCP fits when an assistant must call external systems through a standard protocol. Daily backend work is files, tests, and git. Save MCP for agent products, not for completing a DTO.

How should we train juniors on this workflow?

Not with a 40-message Cursor export. Use a curriculum from your services — Cadensend plus pairing on one real ticket. Include secrets and review as modules so they do not learn speed without gates.

What if the model invents an endpoint that does not exist?

Treat it as a failed tool call. Demand quotes from the router file. If it cannot quote, the endpoint is fiction. This is the same honesty rule as prompt injection defense: untrusted or fabricated text does not get to steer the system.

Conclusion

  • Backend AI work follows the contract → code → tests → migration → review loop; the model does not skip steps.
  • Route Copilot, Cursor, and Claude Code by task shape; keep SQL and authz human-verified.
  • Scan locally, prompt second, and teach the loop as a curriculum.
  • For a team install on real APIs, contact HinterBuild or start from about and backend API engineering.

Free consultation

Book a free consultation call on AI workflows for backend engineers

30-minute call with the HinterBuild team. Discuss your project, architecture questions, or next steps — no obligation.

Book a meeting

Keep reading