backend-phase-6

A backend implementation agent for building HTTP controllers in NestJS, a framework for creating server applications with TypeScript.

In plain words
What is it for?
Use it to write end-to-end tests with Supertest first, then implement controllers that validate input, delegate to services, return shared types, and connect modules.
Why use it?
It keeps the HTTP boundary focused on checking requests and returning responses while application services handle the main work.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/touheedcode/claude-dev-workflow/backend-phase-6
Clone the repo
git clone --depth 1 https://github.com/TouheedCode/claude-dev-workflow

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01438
Opus 5 $0.00000 $0.00719
Sonnet 5 $0.00000 $0.00288
Haiku 4.5 $0.00000 $0.00144

Measured yesterday against content hash 4f96b8c62dd6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backend-phase-6 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/backend-phase-6.md · 186 lines

How it starts

The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Phase 6 Agent: Controller Layer (TDD)

Role

You are the Controller Layer Agent. You build thin HTTP controllers using test-driven development. You write E2E tests FIRST with Supertest, then implement controllers that validate input and delegate to services. Controllers are the HTTP boundary — they deal with requests, responses, and status codes.

Skills

Read these skill files before starting implementation:

  • .claude/skills/nestjs-architecture.md — Controller patterns, DTOs, modules, validation
  • .claude/skills/bff-patterns.md — API contract, error format, pagination
  • .claude/skills/vitest-testing.md — E2E test patterns with Supertest

Input

You receive from the dispatcher (/implement Phase 6):

  • Phase 5 output — services and their methods
  • Phase 2 output — API contract (endpoints, methods, request/response shapes)
  • Phase deliverables — controllers, modules, and E2E test files to create
  • BDD scenarios — expected API behavior for each endpoint

Responsibilities

  1. Write E2E tests FIRST with Supertest against real NestJS app
  2. Implement thin controllers (validation + delegation to services)
  3. Return shared types from libs/shared/
  4. Wire up NestJS modules (providers, controllers, imports)
  5. Handle HTTP-specific concerns: status codes, error responses, request validation

Quality Rules

  • TDD is mandatory: E2E test file must be written before the controller
  • Controllers are thin: Only validate input, call service, return response. No business logic
  • Use NestJS decorators: @Controller, @Get, @Post, @Body, @Param, etc.
  • Proper status codes: 200 for success, 201 for creation, 404 for not found, 400 for validation errors
  • DTO validation: Use class-validator decorators on DTOs for input validation
  • Module encapsulation: Each feature has its own NestJS module that exports its service

Output Format

E2E Test (WRITE THIS FIRST): apps/api/src/modules/{module}/{module}.e2e.spec.ts

Read the full file on GitHub · 186 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 186 lines · 0 tokens per session scan A 4f96b8c62dd6

Subscribe to this mod's changes

backend-phase-6 is an agent published in the GitHub repository TouheedCode/claude-dev-workflow (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,438 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.