> ## Documentation Index
> Fetch the complete documentation index at: https://aixyz.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Templates

> Working agent templates demonstrating common patterns

These templates are working examples in the [`examples/`](https://github.com/AgentlyHQ/aixyz/tree/main/examples) directory. Each follows the standard aixyz `app/` directory structure and can be run locally.

## Running a Template

```bash theme={null}
cd examples/boilerplate
bun install
bun run dev
```

The agent starts at `http://localhost:3000` with all protocol endpoints enabled.

## Basic

Standard agents using `app/agent.ts` + `app/tools/`. No custom server — the server is auto-generated by the build pipeline. Start here.

<CardGroup cols={2}>
  <Card title="Boilerplate" icon="cube" href="/templates/basic/boilerplate">
    Unit conversion agent with length, weight, and temperature tools.
  </Card>

  <Card title="Flight Search" icon="plane" href="/templates/basic/flight-search">
    Flight search with Skyscanner API and Stripe payments.
  </Card>

  <Card title="Chainlink" icon="link" href="/templates/basic/chainlink">
    Chainlink price feeds on Ethereum mainnet.
  </Card>
</CardGroup>

## Advanced

Custom server wiring, bring-your-own payment facilitator, and testing patterns. These templates demonstrate how to take full control of the aixyz server.

<CardGroup cols={2}>
  <Card title="Sub-Agents" icon="diagram-project" href="/templates/advanced/sub-agents">
    Multiple A2A endpoints from one deployment using app/agents/\[name].ts.
  </Card>

  <Card title="Custom Server" icon="server" href="/templates/advanced/with-custom-server">
    Manual server control with app/server.ts — wire A2A, MCP, and x402 yourself.
  </Card>

  <Card title="BYO Facilitator" icon="shield" href="/templates/advanced/with-custom-facilitator">
    Bring-your-own x402 facilitator via app/accepts.ts.
  </Card>

  <Card title="Agent with Tests" icon="flask-vial" href="/templates/advanced/with-tests">
    Testing patterns with bun:test — deterministic and non-deterministic tests.
  </Card>

  <Card title="Fake Model Agent" icon="vial" href="/templates/advanced/fake-llm">
    Fully deterministic testing with `fake()` — no API key required.
  </Card>

  <Card title="Express Integration" icon="plug" href="/templates/advanced/with-express">
    Mount AixyzApp as Express middleware alongside your own routes.
  </Card>

  <Card title="x402 Sessions" icon="database" href="/templates/advanced/x402-sessions">
    Payer-scoped session storage with x402 payment identity.
  </Card>
</CardGroup>
