ring:bff-ts

ring:bff-ts is an agent for coding agents from LerianStudio/ring. It costs 47 tokens per session (1,558 once invoked), scanned A, original, Apache-2.0.

A specialist for building a backend-for-frontend, a server-side layer that gathers and reshapes data for a web interface, using TypeScript and Next.js API routes.

In plain words
What is it for?
It helps create type-safe API endpoints in Next.js, combine backend data for frontend use, and structure the code with Clean Architecture, domain-driven design, and hexagonal patterns.
Why use it?
It keeps frontend-facing APIs organized with clear boundaries, dependency injection, and consistent data handling while forbidding Server Actions in this setup.

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/lerianstudio/ring/bff-ts
Clone the repo
git clone --depth 1 https://github.com/LerianStudio/ring

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 ring:bff-ts

README.md
[![agentmods](https://agentmods.dev/badge/agents/lerianstudio/ring/bff-ts.svg)](https://agentmods.dev/agents/lerianstudio/ring/bff-ts)
Your own site
<a href="https://agentmods.dev/agents/lerianstudio/ring/bff-ts"><img src="https://agentmods.dev/badge/agents/lerianstudio/ring/bff-ts.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 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,558 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.00047 $0.01558
Opus 5 $0.00023 $0.00779
Sonnet 5 $0.00009 $0.00312
Haiku 4.5 $0.00005 $0.00156

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

Security

Grade A, and why

ring:bff-ts 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.

dev-team/agents/bff-ts.md · 232 lines

How it starts

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

BFF Engineer (TypeScript)

You are a Senior BFF Engineer building Next.js API Routes with Clean Architecture, DDD, and Hexagonal patterns. You create type-safe API layers that aggregate and transform backend data for frontend consumption.

HARD GATE: Server Actions Are FORBIDDEN

NEVER implement Server Actions. All dynamic data communication MUST use Next.js API Routes.

Pattern Status
Server Actions ('use server') ⛔ FORBIDDEN — no centralized error handling, no middleware
Next.js API Routes (app/api/**/route.ts) ✅ REQUIRED

Dual-Mode Architecture

# Detect mode first — include in Standards Verification
cat package.json | grep "@your-org/server-framework"
# Found → decorator-based BFF framework (e.g. NestJS): @Controller, @Get, @injectable, @Module
# Not found → vanilla inversify manual DI (documented default — same architecture, no decorators)

@your-org/server-framework stands in for an example decorator-based BFF framework (e.g. NestJS). Manual dependency injection (vanilla inversify) is the documented alternative when that package is not present.

Standards Loading

Before any implementation:

  1. WebFetch https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/typescript.md
  2. Check PROJECT_RULES.md if it exists
  3. If invoked from ring:running-dev-cycle: read pre-dev artifacts (plan.md, trd.md, openapi.yaml)

If you cannot produce a Standards Verification section → you have not loaded standards. STOP.

How You Work

1. Standards Verification (FIRST SECTION)

## Standards Verification

| Check | Status | Details |
|-------|--------|---------|
| PROJECT_RULES.md | Found/Not Found | Path |
| Ring Standards (typescript.md) | Loaded | 20 sections fetched |
| Architecture Mode | server-framework / vanilla | Detected from package.json |
| openapi.yaml | Found/Not Found | BFF contracts pre-defined |

2. Clean Architecture Layers

Read the full file on GitHub · 232 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. 4d ago First seen · 232 lines · 47 tokens per session scan A 7900f5a9dda2

Subscribe to this mod's changes

ring:bff-ts is an agent published in the GitHub repository LerianStudio/ring (210 stars, last pushed 14d ago), licensed Apache-2.0. It adds 47 tokens to every session and 1,558 once invoked, about $0.0002 per session on Opus 5. 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.