Coding & Developer-Tooling Use Cases Basics
8 examples to get you started with coding-agent use cases - 5 basic and 3 intermediate.
Search across all documentation pages
8 examples to get you started with coding-agent use cases - 5 basic and 3 intermediate.
You will walk a minimal read → edit → test loop, package a task for an agent, and see how review and stop conditions turn a demo into something a team can trust.
# Example: work on a disposable branch
git switch -c agent-sandbox-demo
# Know how to run a narrow check, e.g.:
# pytest tests/test_math_utils.py -q
# npm test -- path/to/fileThis section is concept-heavy.
Snippets below are patterns, not a full framework. Swap command names for your stack.
Agents thrash when the goal is vibes.
Write the task the way you would write an acceptance check.
Goal: In math_utils.py, fix divide(a, b) so b == 0 raises ValueError("division by zero").
Done when: pytest tests/test_math_utils.py passes.
Out of scope: other modules, refactors, dependency upgrades.Related: How Coding Agents Changed Day-to-Day Software Development
Start the mental model with observe, not patch.
# Conceptual tool surface (host registers these for the model)
TOOLS = {
"search": "find paths/symbols by regex",
"read_file": "return file contents or a line range",
"list_dir": "list a directory",
}
# No apply_patch / shell yetPrefer surgical edits over regenerating whole files.
--- a/math_utils.py
+++ b/math_utils.py
@@ def divide(a, b):
- return a / b
+ if b == 0:
+ raise ValueError("division by zero")
+ return a / bWithout a verifier, you only have speculative code generation.
pytest tests/test_math_utils.py -q
# Agent treats exit code + stdout/stderr as the observationdef after_edit(run_shell):
result = run_shell("pytest tests/test_math_utils.py -q")
return {
"exit_code": result.code,
"output_tail": result.stdout[-2000:], # truncate for context
}Coding agents need the same stop discipline as any agent.
policy = {
"max_turns": 12,
"allowed_paths": ["src/math_utils.py", "tests/test_math_utils.py"],
"allowed_commands": ["pytest tests/test_math_utils.py -q"],
"stop_on": ["tests_passed", "max_turns", "path_violation"],
}Related: Autonomous Bug-Fixing Agents: From Issue to Verified Patch
Move from a toy function to a realistic issue shape.
Title: API returns 500 when page is negative
Repro: GET /items?page=-1
Expected: 400 with {"error": "page must be >= 1"}
Hints: src/api/items.py, tests/api/test_items.py
Verify: pytest tests/api/test_items.py -q
Do not: change auth, database migrations, or public URL pathsDay-to-day safety is a permissions ladder.
Level A: agent edits only; human runs tests and commits
Level B: agent edits + runs tests in sandbox; human opens PR
Level C: agent opens draft PR; human reviews and merges
Level D: auto-merge only for allowlisted chore classes (rare)When something is wrong, the trajectory explains why.
turn 1: search "divide" -> math_utils.py
turn 2: read_file math_utils.py
turn 3: apply_patch (+ guard for b == 0)
turn 4: shell pytest ... -> FAIL (test expects message "division by zero")
turn 5: apply_patch (adjust message)
turn 6: shell pytest ... -> PASS
stop: tests_passedStack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.
Reviewed by Chris St. John·Last updated Jul 16, 2026