# Duo backend architecture

> Duo backend architecture is an open-source agent skill for developer tools. Guides an agent through making slow or fragile server requests faster and safer. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/HKTITAN/duolingo/tree/main/skills/duo-backend-architecture
- **Repository:** https://github.com/hktitan/duolingo
- **GitHub stars:** 10
- **License:** MIT
- **Skill name:** duo-backend-architecture
- **Collection:** https://github.com/HKTITAN/duolingo
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill walks an agent through reducing latency and failure risk on a live backend. It starts with auditing a request path for shared dependencies that can be removed, then covers splitting data into precomputed, cached values versus per-caller inputs, keeping database locks short, and instrumenting the failure a fix introduces.

It also covers server-driven UI, where the interface is sent as configuration so changes ship without an app release, and how to version clients by the last config they could parse. Further sections address when optimistic rendering is worth its rollback risk, and how to plan, justify and stage a long migration of a running system.

The material is drawn from Duolingo's published engineering write-ups and is organized as linked reference notes. It is guidance rather than tooling: no scripts are bundled, and it expects a codebase or architecture question to work from.

## When your agent uses it

> Make a server request fast and hard to break, using Duolingo's published engineering results as the case study. Covers what to delete from the synchronous request path, how to split data into precompute-and-cache versus caller-injected, how long to hold a lock and when to go optimistic, instrumenting the failure mode a fix trades you into, server-driven UI and versioning clients without branching on client version, when optimistic rendering is worth its rollback cost, and how to stage, fund and survive a long runtime migration. Use when someone says our API is slow, p99 latency, this endpoint has too many dependencies, database contention, lock timeouts, optimistic locking, we want to ship UI changes without an app release, server-driven UI, optimistic updates, should we roll back the prediction, how do we sell this migration to leadership, or the migration broke production.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/HKTITAN/duolingo/tree/HEAD/skills/duo-backend-architecture)
- [License: MIT](https://github.com/HKTITAN/duolingo/tree/HEAD/skills/duo-backend-architecture)

## Features

- **Request path auditing:** Identifies shared resources in a live request path that add both latency and independent failure risk, and suggests removing them.
- **Precompute versus inject:** Separates expensive shared data to precompute and cache from cheap personal data the caller supplies.
- **Lock duration control:** Shortens critical sections by moving network calls out of locks and weighing optimistic locking.
- **Failure mode instrumentation:** Covers measuring and rehearsing the new failure mode a latency fix introduces.
- **Server-driven UI guidance:** Explains shipping interface definitions as server config with per-user data and versioning clients by last good config.
- **Optimistic rendering trade-offs:** Helps decide which values are safe to predict on the client and when a loading state is preferable to rollback.
- **Migration staging:** Covers slicing a long runtime migration into measurable units with a revert path and a clear business case.

## Good for

- Diagnose why an API endpoint has high p99 latency
- Reduce database lock contention in a checkout or write path
- Decide whether an optimistic UI update is worth its rollback cost
- Plan a server-driven UI so interface changes skip app releases
- Stage a multi-quarter backend migration without stopping production
- Pitch a migration's business value to engineering leadership

## Install

### Claude Code

This skill ships in the `duolingo` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add HKTITAN/duolingo
/plugin install duolingo@duolingo
```

Or copy only this skill to `~/.claude/skills/duo-backend-architecture`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/HKTITAN/duolingo.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/duo-backend-architecture &&
cp -R "$tmp/skills/duo-backend-architecture" ~/.claude/skills/duo-backend-architecture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/duo-backend-architecture` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/duo-backend-architecture` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/HKTITAN/duolingo.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/duo-backend-architecture &&
cp -R "$tmp/skills/duo-backend-architecture" ~/.agents/skills/duo-backend-architecture &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/duo-backend-architecture` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/duo-backend-architecture` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/HKTITAN/duolingo.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/duo-backend-architecture &&
cp -R "$tmp/skills/duo-backend-architecture" ~/.cursor/skills/duo-backend-architecture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/duo-backend-architecture` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/HKTITAN/duolingo.git --path skills/duo-backend-architecture
```

Or copy the folder to `~/.gemini/skills/duo-backend-architecture` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/duo-backend-architecture`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/HKTITAN/duolingo.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/duo-backend-architecture &&
cp -R "$tmp/skills/duo-backend-architecture" ~/.copilot/skills/duo-backend-architecture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/duo-backend-architecture` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/HKTITAN/duolingo.git
```

Then copy `duolingo/skills/duo-backend-architecture` into your agent's skills folder as `duo-backend-architecture`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Duo backend architecture need to run?

It has no scripts and no tool requirements. It is a set of guidance notes that the agent applies to your backend architecture question.

### When does Duo backend architecture trigger?

It is meant for requests about slow APIs, p99 latency, lock timeouts, optimistic locking, server-driven UI, optimistic updates, and recovering from a broken migration.

### Is Duo backend architecture tied to Duolingo's codebase?

No. It uses Duolingo's published engineering posts as the case study, and the lessons are general backend guidance.

### How do I install Duo backend architecture in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/duo-backend-architecture to use it in all your projects, or to .claude/skills/duo-backend-architecture in one project. Or install the duolingo plugin, which includes it: /plugin marketplace add HKTITAN/duolingo, then /plugin install duolingo@duolingo.

### Does Duo backend architecture run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Duo backend architecture?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Duo backend architecture?

The closest alternatives to Duo backend architecture are Duo mobile engineering, Debug async UI, Duo production reliability, Backend patterns and Duo ML in production.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Duo mobile engineering](https://ai-powered.com/skills/duo-mobile-engineering): Duo mobile engineering is an open-source agent skill for developer tools.
- [Debug async UI](https://ai-powered.com/skills/debug-async-ui): Debug async UI is an open-source agent skill for developer tools.
- [Duo production reliability](https://ai-powered.com/skills/duo-production-reliability): Duo production reliability is an open-source agent skill for developer tools.
- [Backend patterns](https://ai-powered.com/skills/backend-patterns-fmarzochi): Backend patterns is an open-source agent skill for developer tools.
- [Duo ML in production](https://ai-powered.com/skills/duo-ml-in-production): Duo ML in production is an open-source agent skill for developer tools.
- [Performance optimization](https://ai-powered.com/skills/performance-optimization): Performance optimization is an open-source agent skill for developer tools.
- [Deprecation and migration](https://ai-powered.com/skills/deprecation-and-migration): Deprecation and migration is an open-source agent skill for developer tools.
- [Frontend UI engineering](https://ai-powered.com/skills/frontend-ui-engineering): Frontend UI engineering is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/duo-backend-architecture
