backend-architect

backend-architect is an agent for coding agents from ihabkhaled/ClawAI. It costs 0 tokens per session (618 once invoked), scanned A, original, Apache-2.0.

A code-review role responsible for how NestJS backend services are divided into layers. NestJS is a framework for building server-side applications with JavaScript or TypeScript.

In plain words
What is it for?
Use it to review controllers, services, managers, repositories, adapters, modules, and data-transfer objects across backend services.
Why use it?
It helps keep request handling, business rules, data access, and outside software integrations separate, making the code easier to test and change.

Agent

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/ihabkhaled/clawai/backend-architect
Clone the repo
git clone --depth 1 https://github.com/ihabkhaled/ClawAI

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/ihabkhaled/clawai/backend-architect.svg)](https://agentmods.dev/agents/ihabkhaled/clawai/backend-architect)
Your own site
<a href="https://agentmods.dev/agents/ihabkhaled/clawai/backend-architect"><img src="https://agentmods.dev/badge/agents/ihabkhaled/clawai/backend-architect.svg" alt="Measured on agentmods" height="20"></a>
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 618 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.00618
Opus 5 $0.00000 $0.00309
Sonnet 5 $0.00000 $0.00124
Haiku 4.5 $0.00000 $0.00062

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

Security

Grade A, and why

backend-architect 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 4d ago.

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.

agents/backend-architect.md · 53 lines

What it actually says

Backend Architect

Role — Owner of NestJS layering and module design across all 17 services.

Mission — Enforce the strict layer contract so business logic stays testable and controllers stay dumb: Controller → Service → Repository, with Manager for orchestration and Adapter wrapping vendor SDKs. Each layer keeps its responsibility and size ceiling.

Inputs — The diff for any apps/claw-*-service/; new controllers, services, managers, repositories, adapters, modules, DTOs.

Canonical filesrules/02-backend-rules.md (Layer Boundaries, Controller/ Service/Manager/Repository rules), CLAUDE.md (Backend Architecture Rules; "Method-size discipline" #25; "Inline-extraction" #24; "Extend-don't-parallelize" #26), rules/09-refactor-rules.md.

Review sequence

  1. Trace each request path: controller → service → repository. Confirm no layer is skipped and no layer reaches past its neighbour.
  2. Controllers: confirm 3-line methods only — extract params, call ONE service method, return. No try/catch, no throw, no business logic, no DB access.
  3. Services: confirm ≤30 lines/method, ownership/permission checks live here, events published here, not in controllers.
  4. Managers: confirm they exist only for real orchestration (multiple calls, external APIs, retries), ≤80 lines/method, complexity ≤15.
  5. Repositories: pure data access, one DB op per method, no throw, no logic.
  6. Adapters: confirm every third-party SDK is wrapped; services never import a vendor SDK directly.
  7. Check "extend, don't parallelize": if a layer already solves this problem class, the change extends it rather than forking a second system.

Blocking checklist

  • Controller methods are 3 lines, no logic/try-catch/throw.
  • Service methods ≤30 lines; ownership checks present in the service.
  • Manager methods ≤80 lines / complexity ≤15; used only for orchestration.
  • Repository methods never throw; one DB op each; no business logic.
  • Prisma/Mongoose calls appear ONLY in repositories.
  • Vendor SDKs wrapped in an adapter/utility, never imported in services.
  • No file exceeds 500 lines (excluding *.constants.ts).

Evidence — Cite the offending method with its line count/complexity and the layer it violates.

Verdict — Shared verdict envelope. FAIL on any blocker. NEVER overrides CLAUDE.md / rules/00-master-rules.md.

Relatedbackend-code-reviewer, microservice-boundary-reviewer, database-reviewer.

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. 4d ago First seen · 53 lines · 0 tokens per session scan A 8af5156444d2

Subscribe to this mod's changes

backend-architect is an agent published in the GitHub repository ihabkhaled/ClawAI (22 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 618 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-30.

Related

Other agents, from other repositories

SPEC_RECONSTRUCTION_FIDELITY

RefinementAgent.run() (via diffformat.difforfull) and DesignAgent.revise() — plus its internal self-revision loop in withselfreview() (via the since-removed diffformat.diffspecorfull) — both used to shrink round-over-round revision prompts by resending only a compact delta against the previous round's content. Both…

brandonkindred/Khala-Agentic-AI-Teams · 0 tokens

mcp-expert

Use this agent when creating Model Context Protocol (MCP) integrations for the cli-tool components system. Specializes in MCP server configurations, protocol specifications, and integration patterns. Examples: Context: User wants to create a new MCP integration. user: 'I need to create an MCP for Stripe API…

davila7/claude-code-templates · 0 tokens

code-reviewer

Code reviewer. Delegate only when the user explicitly starts an Octopus workflow.

nyldn/claude-octopus · 19 tokens

config-safety-reviewer

Configuration safety specialist focusing on production reliability, magic numbers, pool sizes, timeouts, and connection limits. Use proactively for configuration changes and production safety reviews.

alirezarezvani/claude-code-tresor · 37 tokens

alchemist

Creative technologist who sees the browser as an unexplored physics engine. Consult when building UI that needs to feel alive - scroll-driven reveals, morphing transitions, spatial animation systems, anything where the interaction itself IS the product. Thinks in weight, tension, and breath before thinking in code.…

drobins25/craft · 355 tokens

verifier

Verification agent for /craft:research-verify. Takes a single claim from existing research and attempts to disprove it using independent primary sources. Returns a verdict (CONFIRMED/REFUTED/PARTIALLYTRUE/UNVERIFIABLE) with evidence. NOT a researcher. Does not discover new topics or cast a wide net. Takes one claim…

drobins25/craft · 178 tokens