bff-design
БесплатноБез исполняемых скриптовНе проверенDecide whether a system needs a backend-for-frontend, how many, and what each one may own: adoption signals and honest costs, one-experience-one-BFF…
от citypaul★ 764 звезды на GitHubОб этом скилле
BFF Design
A backend-for-frontend is an ownership pattern before it is a technology: the API a client application uses is part of that application, owned by the team that owns the frontend, and consumed by no other application (Calçado, the pattern's originator). Architecturally it is a driving host for one user experience — it shapes, aggregates, and mediates; it does not decide.
This skill owns the pattern-level decisions: whether to have a BFF, how many, what each may own, how it aggregates and survives upstream failure, and how it carries user identity toward upstream services. Load bff-entry-points for protecting the BFF's own boundary — access classification, the prepared registrar, sessions/CSRF, realtime protection, enforcement gates; nothing in this skill repeats it. Load structure-codebase for the physical endpoints/ tree, hexagonal-architecture for the driving-host framing, api-design for contracts with consumers you do not control (which a healthy BFF never has), and secure-oauth-oidc for the OAuth/OIDC protocol invariants behind everything in the upstream-identity reference.
Read the relevant reference before deciding:
- Read
references/adoption-and-granularity.mdwhen deciding whether to adopt, how many BFFs to run, who owns them, mobile version skew, and the deployable-vs-module sizing call. - Read
references/aggregation-and-resilience.mdwhen a BFF fans out to upstream services: composition, partial failure, timeout/retry budgets, and caching. - Read
references/upstream-identity.mdwhen the BFF calls upstream services on behalf of a user: token exchange, scope narrowing, confused-deputy prevention, revocation propagation. - Read
references/alternatives.mdwhen weighing a BFF against a shared gateway, GraphQL federation, a token-mediating backend, direct SPA→API, or a meta-framework server.
Do You Need One?
| Signal | Reading |
|---|---|
| A second client type is arriving (mobile app, partner surface, TV) | Strongest adoption trigger — Newman: consider a BFF for each party from the outset |
| One page/screen fans out to many downstream calls | Aggregation belongs server-side, near the services, shaped per experience |
| Frontend teams queue behind a general-purpose API team for every endpoint | The SoundCloud problem — a BFF moves the contract inside the frontend team |
| Browser app handles sensitive/personal data (default: any app with logins qualifies) | The IETF browser-apps BCP-track guidance strongly recommends the BFF architecture on security grounds alone — tokens stay server-side |
| Only one interface, making simple, similar requests to one backend | Skip it — Azure's explicit "not suitable" case — unless another row fires: the rows answer different questions, and the security row alone justifies a BFF for a sensitive single-backend SPA (token confinement needs no aggregation motive) |
| You already run GraphQL with frontend-specific resolvers, or a meta-framework server (Next/Remix/SvelteKit) | You may already have a BFF — apply this skill to it instead of adding another box |
A meta-framework server is a BFF: Remix documents its server as exactly this, and Next.js route handlers carry the same responsibilities (and the same risks — they are publicly reachable by default, so bff-entry-points applies to them unchanged).
One Experience, One BFF
The unit of granularity is the experience — one coherent product surface, whatever platforms render it. iOS and Android listener apps rendering the same experience are one consumer with two builds, not two consumers; the creator app is a different experience and gets its own BFF (SoundCloud's practice, Newman's rule).
- Experience sets the default count. Team structure can override it: separate iOS/Android teams may justify separate BFFs even for near-identical experiences, because the pattern's value is a team owning its own pace (Conway). One experience served by two teams is an ownership smell — pick a single owning team or accept the split; do not share the BFF across teams.
- The frontend team owns its BFF: language, release cadence, priorities. A BFF owned by a backend platform team recreates the coordination queue the pattern exists to remove.
- BFF and frontend are one logical deployment unit: same repo where practical, contracts co-evolved rather than versioned. Versioning discipline scales with consumer recallability — the adoption reference carries the web-relaxation vs mobile-concentration split and the CDC alternative.
Shape, Don't Decide
The BFF owns presentation-model work: aggregation, reshaping, payload thinning, per-experience defaults, and translating upstream results into what one UI renders. It does not own:
- Business rules. Pricing, eligibility, workflow state — the moment a BFF decides these, it
Установить bff-design в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bff-design?
Decide whether a system needs a backend-for-frontend, how many, and what each one may own: adoption signals and honest costs, one-experience-one-BFF granularity with frontend-team ownership, the shape-don't-decide rule, upstream aggregation with partial-failure and resilience budgets, identity-keyed BFF caching, mediating user identity toward upstream services (token exchange, confused-deputy prevention), and the alternatives (shared gateway, GraphQL federation, token-mediating backend, direct SPA→API, meta-framework server as BFF). Use when adopting or splitting BFFs, aggregating upstream services, handling upstream failures, forwarding user identity downstream, weighing GraphQL against per-client BFFs, or auditing a BFF that has drifted into a public API or a business-logic layer. For protecting the BFF's own entry points use bff-entry-points; for physical route layout use structure-codebase; for externally consumed API contracts use api-design; for OAuth/OIDC protocol flows use secure-oauth-oidc.
Как установить скилл bff-design?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bff-design запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic