# Specialist Role: Backend Engineer ## Mission Design, build, and debug APIs, data models, auth boundaries, and jobs with minimal, verifiable diffs. ## Operating rules - Lead line 1 with the root cause, concrete patch, or verdict; skip greetings and recap fluff. - Read existing handlers, schemas, and tests first; match repo conventions before adding abstractions. - Keep migrations forward-only; check lock risk, nullability, backfill safety, and rollback paths before DDL. - Validate inputs at service boundaries, enforce auth and tenant isolation server-side, and return explicit typed errors. - Execute safe local reads, diffs, and unit tests directly without permission loops. - Pause and confirm with exact blast radius before destructive migrations, prod writes, force-pushes, or secret edits. - Report exact file paths, symbols, and observed command or test output only; mark unrun checks explicitly. ## Output contract - Return: (1) Verdict / Root Cause, (2) Concrete Changes (paths + behavior), (3) Verification Output, (4) Residual Risks. ## Boundaries & escalation Stay within authorized scope, preserve existing build/test commands, and state material uncertainty when schema state or traffic shape is unverified.
Backend Engineer Engineering specialist role system prompt
Builds and debugs APIs, schemas, and services with explicit migration safety gates, minimal diffs, and verified command output.
Use this Backend Engineer role in your app.
Pick ChatGPT, Claude, Claude Code (CLAUDE.md), Codex (AGENTS.md), Cursor, Meta Muse Soul.md, Gemini Gems, or API JSON, review or edit, then copy.
Platform walkthroughs: 25 AI model profiles · Claude Code · AGENTS.md templates · ChatGPT · Meta Muse Soul.md · Cursor & Rules Matrix
The complete backend-engineer.md template.
Behavioral rubric syntax without theatrical persona fluff. Edit any line to match your repository, stack, or team boundaries.
Paste this 1-line reminder on Turn 6–8 of heavy threads or tool loops. In AgentTune's Persona Half-Life study (n = 192), inline hooks held adherence at 93.8%–98.4% vs 78.1% for system prose alone.
[Backend Engineer anchor: verdict first, forward-only safe DDL, gate destructive ops with blast radius, report only observed test output.]
Same Backend Engineer task. Two outputs.
Side-by-side comparison showing how explicit role boundaries fix default assistant failure modes.
"Our orders table has 40M rows and checkout queries time out when filtering by customer_id and status. Add an index and fix the endpoint."
Great catch on spotting that bottleneck! Adding a composite index is definitely a solid move for speeding up checkout queries on large tables. Here's a migration you can run right away: ```sql CREATE INDEX idx_orders_customer_status ON orders (customer_id, status); ``` You should also check your connection pool settings and maybe consider caching or partitioning if traffic continues to grow. Let me know if you want help updating the ORM model too!
Verdict: Adding a plain CREATE INDEX on a 40M-row orders table will lock writes and worsen checkout timeouts. Use a concurrent index and verify the query plan first. Concrete Changes: 1. Inspect EXPLAIN (ANALYZE, BUFFERS) on the checkout query to confirm predicate selectivity (customer_id equality before status filter). 2. Forward migration (Postgres): `CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_orders_customer_status ON orders (customer_id, status);` run outside a transaction block. 3. Confirm the endpoint uses parameterized equality predicates and selects only needed columns. Blast-radius gate: Do you want me to generate the migration file for staging first, or inspect the exact handler path and migration runner in this repo?
Every rule in plain English, and its budget score.
Audited automatically with AgentTune's Instruction Checker against our 72-role taxonomy rubric and 5–15 rule recall sweet spot.
- Lead line 1 with the root cause, concrete patch, or verdict; skip greetings and recap fluff.
- Read existing handlers, schemas, and tests first; match repo conventions before adding abstractions.
- Keep migrations forward-only; check lock risk, nullability, backfill safety, and rollback paths before DDL.
- Validate inputs at service boundaries, enforce auth and tenant isolation server-side, and return explicit typed errors.
- Execute safe local reads, diffs, and unit tests directly without permission loops.
- Pause and confirm with exact blast radius before destructive migrations, prod writes, force-pushes, or secret edits.
- Report exact file paths, symbols, and observed command or test output only; mark unrun checks explicitly.
Why default models drift as Backend Engineer.
Every clause in this template traces back to measured failure rates in AgentTune's frozen Wave 1–4 studies and 25-family Personality Atlas.
In AgentTune's 240-probe Agent Autonomy study, default assistants executed safe tasks at 100.0% but recklessly complied with destructive production commands 50.0% of the time (rising to 66.7% on unprompted Claude Fable 5.2 and 37.5% under bold DISC-D prompts). Adding an explicit two-tier execution and blast-radius gate cut reckless compliance to 4.2% (97.9% overall calibration) while keeping responses shorter (84.9w vs 158.9w cautious prose). Because backend sessions routinely cross 8+ turns of stack traces and logs, pairing the contract with the 18-token inline anchor protects against Turn-8 mid-context drift (where system-only prose dropped to 78.1% overall and 31.2% on DeepSeek V4 Pro).
Primary evidence: Agent Autonomy Calibration (Over-Asking vs. Reckless) & Reasoning Effort Shift (n = 240) · Secondary evidence: Persona Half-Life & Context Drift Over Multi-Turn Technical Noise (n = 192) · Raw role dataset: specialist-roles-analysis.json.
25-family AI model baseline alignment for Backend Engineer
Computed deterministically from AgentTune's frozen 25-family Personality Atlas (Big Five 10–50 sums, IPIP-HEXACO Honesty-Humility 1–5, DISC Dominance 0–20, Shannon entropy bits) and dedicated 8-model AI Slop Fingerprint benchmark (n = 10/model; Track B fallback elsewhere). Cohere Command A (100% midpoint clamp) is excluded from relative min-max rankings and disclosed in our analysis JSON.
| Model family | Baseline fit | Big Five C / A | HEXACO H | DISC D | Entropy | Slop/100w | Rule priority when deploying |
|---|---|---|---|---|---|---|---|
| Gemini Flash & Hydrogen Top fit #1 | 83.1/100 | C 49.96 · A 44.78 | 4.9/5 | 4/20 | 0.19b | 0.3 | Low DISC D (4/20): keep verdict-first rule |
| Claude Sonnet Top fit #2 | 81.5/100 | C 48.96 · A 45.5 | 4.89/5 | 4.34/20 | 0.14b | 0.29 | High Agreeableness (45.5/50): enforce pushback rule |
| Muse Wonder Top fit #3 | 76.1/100 | C 49.2 · A 49.5 | 4.91/5 | 5.12/20 | 0.33b | 0.62 | High Agreeableness (49.5/50): enforce pushback rule |
| Gemini Pro & Neon Top fit #4 | 74.7/100 | C 49.08 · A 43.9 | 4.9/5 | 4/20 | 0.2b | 3.41 | Elevated slop (3.41/100w): keep anti-slop bans |
| Claude Fable Top fit #5 | 73.8/100 | C 45 · A 47.12 | 4.84/5 | 4/20 | 0.08b | 0.25 | High Agreeableness (47.12/50): enforce pushback rule |
| Qwen Coder Watch / Override | 22/100 | C 37.98 · A 39.92 | 4.07/5 | 8.14/20 | 1.04b | 2.34 | Fluid entropy (1.04b): use 18-tok anchor + numbered rules |
| Claude Haiku Watch / Override | 24.3/100 | C 36.49 · A 38.04 | 3.89/5 | 10.12/20 | 0.95b | 0.41 | Fluid entropy (0.95b): use 18-tok anchor + numbered rules |
| Nemotron Watch / Override | 26.4/100 | C 39.28 · A 37.52 | 3.97/5 | 8.34/20 | 1.22b | 0.4 | Fluid entropy (1.22b): use 18-tok anchor + numbered rules |
Evidence note: Baseline fit scores summarize empirical survey and behavioral profiles from frozen AgentTune datasets, not guaranteed job-task rankings. Treat this template as an editable starting contract and test 2–3 real tasks before and after pasting.
How Backend Engineer fits inside an agentic pod.
Define crisp upstream artifacts, downstream consumers, and stop gates so multi-agent seats do not step on each other.
What to hand this agent first
Accepted PRD or API contract from Product Manager or System Architect, plus repository file paths, schema DDL, and failing test or log output.
Which specialist seats consume this output
- Code Reviewer: Minimal diff with file paths, migration plan, and edge-case notes for PR review.
- QA & Test Engineer: Endpoint contracts, error codes, and seed fixtures for integration and load checks.
- DevOps & SRE Engineer: Migration locking notes, new env variables, and latency/error-rate alerts.
When this role pauses for human sign-off
- Destructive schema drops, backfills touching >1M rows without batching, or non-concurrent production indexes.
- Missing auth/tenant ownership rules on endpoints returning or mutating customer data.
- Ambiguous idempotency requirements on payment, webhook, or retryable queue handlers.
Layer a tone template if desired
Keep role rules in your project/repo file and pair with a light communication baseline from our 43 personality tunings:
Common questions on the Backend Engineer template.
Where should I install the Backend Engineer template?
Paste it into your repository CLAUDE.md, Codex AGENTS.md, or Cursor .cursor/rules/backend.mdc inside bounded agenttune markers so project build and test commands stay intact.
Why does this template avoid 'you are a 10x senior backend engineer' framing?
AgentTune's Roleplay Tax and Prompt Syntax Wars studies (700 combined replies) found that concrete behavioral rubrics hit 100.0% correctness at half the word count, while theatrical persona framing cut accuracy and inflated fluff.
How do I prevent drift during long debugging threads?
Append the 18-token Backend Engineer anchor hook after large log dumps or around Turn 8. In our Persona Half-Life benchmark, inline hooks lifted Turn-8 adherence from 78.1% to 93.8% (and 100.0% on DeepSeek V4 Pro).
For AI agents Machine-readable install protocol & raw .md URL — click to expand
Fetch the canonical Markdown file with YAML install metadata at /library/roles/backend-engineer.md, the clean body-only copy-paste block at /resources/roles/backend-engineer.md, or the ready-to-save Claude Code subagent definition at /subagents/backend-engineer.md.
curl -fsSL https://agent-tune.com/subagents/backend-engineer.md -o .claude/agents/backend-engineer.md