# trigger-chat-agent-advanced

trigger-chat-agent-advanced — a skill for the operational layer of Trigger.dev chat.agent: raw sessions, durable sub-agents, background injection, fast starts, and context compaction.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 265 installs · ★ 35 repo stars
- Author: triggerdotdev
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/triggerdotdev/skills/tree/HEAD/trigger-chat-agent-advanced/SKILL.md
- Updated: 2026-11-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/trigger-chat-agent-advanced

## What it does

Gives agents access to the primitives that power `chat.agent`: the `sessions` API (durable, bi-directional I/O channels keyed on `externalId`), server-side `AgentChat` for running agents from tasks or webhooks, and `chat.forwardSubAgent` for streaming sub-agent replies to the frontend. Handles durable sub-agents as tools (`AgentChat` inside `tool()`), background injection (`chat.defer`, `chat.inject`), and fast starts via preload and Head Start from `@trigger.dev/sdk/chat-server`.

Covers context compaction when hitting limits, recovery after OOM, testing with `mockChatAgent`, and version upgrades. For the standard `chat.agent({...})` definition and frontend binding via `useTriggerChatTransport`, there is a separate `trigger-authoring-chat-agent` skill.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add triggerdotdev/skills --skill trigger-chat-agent-advanced -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/trigger-chat-agent-advanced/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/trigger-chat-agent-advanced/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add triggerdotdev/skills --skill trigger-chat-agent-advanced -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/trigger-chat-agent-advanced/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add triggerdotdev/skills --skill trigger-chat-agent-advanced -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/trigger-chat-agent-advanced/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install triggerdotdev/skills trigger-chat-agent-advanced
```

2. **Manually: put the files in place**
- File: `.github/skills/trigger-chat-agent-advanced/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add triggerdotdev/skills --skill trigger-chat-agent-advanced -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/triggerdotdev/skills --path trigger-chat-agent-advanced
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/trigger-chat-agent-advanced/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add triggerdotdev/skills --skill trigger-chat-agent-advanced -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/triggerdotdev/skills/tree/HEAD/trigger-chat-agent-advanced/SKILL.md

## When to use it
- run an agent from a server task or webhook with `AgentChat`
- delegate work to a durable sub-agent and stream its reply
- run background work alongside streaming with `chat.defer`
- recover a session after OOM or context compaction
- test an agent offline with `mockChatAgent`

## Example prompts
- Start agent `my-chat` with message "Review PR #42" using `AgentChat`
- Add `research-agent` as a tool and stream its reply to the frontend
- Set up preload for fast agent start on user signal

## Similar
- [trigger-dev](https://affpapa.org/en/nevibecode/skills/trigger-dev.md) — skill · 93 installs
- [pp-trigger-dev](https://affpapa.org/en/nevibecode/skills/pp-trigger-dev.md) — skill · 144 installs
- [trigger.basic](https://affpapa.org/en/nevibecode/rules/triggerbasic.md) — rule · ★ 1120 repo stars
- [cli-chat](https://affpapa.org/en/nevibecode/skills/cli-chat.md) — skill · 1300 installs
- [migrating-to-workflow-sdk](https://affpapa.org/en/nevibecode/skills/migrating-to-workflow-sdk.md) — skill · 792 installs
- [testing-websocket-api-security](https://affpapa.org/en/nevibecode/skills/testing-websocket-api-security.md) — skill · 379 installs

From the same set: [triggerdotdev/skills](https://affpapa.org/en/nevibecode/by/triggerdotdev/skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
