Agent skill

Trigger.dev Agent Patterns

by papermark in papermark/papermark

Patterns for building LLM agents on Trigger.dev tasks: prompt chaining, routing, parallel workers, orchestrator-workers, evaluator loops and human approval gates.

Custom licenceAuto-check passedAI & LLM Engineering

Install Trigger.dev Agent Patterns

skills CLI
$ npx skills add papermark/papermark --skill trigger-agents -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install papermark/papermark trigger-agents --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/papermark/papermark.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/trigger-agents .claude/skills/trigger-agents && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trigger-agents
GitHub stars
9.2k
Token cost
~2k tokens
SKILL.md length
128 words
Files
5 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
Custom licence

At a glance

Patterns for building LLM agents on Trigger.dev tasks: prompt chaining, routing, parallel workers, orchestrator-workers, evaluator loops and human approval gates.

  • Works in 5 steps: Prompt Chaining (Sequential with Gates) → Routing (Classify → Dispatch) → Parallelization → …
  • Building an LLM task that fans work out to parallel workers
  • SKILL.md covers Pattern Selection, Core Patterns, Trigger-Specific Features and Error Handling, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill is a pattern guide for AI agents built on Trigger.dev's durable task execution. A selection table maps needs to patterns, followed by TypeScript examples for prompt chaining with validation gates, routing where a cheap model classifies the input before dispatch, parallelization with `batch.triggerByTaskAndWait`, orchestrator-workers with fan-out and fan-in, and an evaluator-optimizer loop that retries with feedback until a result is approved.

Trigger-specific features are covered in reference files: waitpoints for human approval gates and external callbacks, streams for live progress to a frontend, `ai.tool` for letting an LLM call your tasks as tools, and orchestration details for typed parallel runs. An error-handling section shows checking each run's result, and a quick reference lists common calls such as `triggerAndWait`. The examples use the `ai` package with `@ai-sdk/openai`, and the excerpt is cut off inside the quick reference.

When your agent uses it

  • Building an LLM task that fans work out to parallel workers
  • Adding a human approval step before an agent continues
  • Routing requests to different handlers after a cheap classification step
  • Letting an LLM call existing Trigger.dev tasks as tools

Example prompts

  • “Build a Trigger.dev task that classifies support tickets and routes each one to a billing or technical handler.”
  • “Add an approval gate to this content-publishing agent using waitpoints.”
  • “Refactor this report generator into an orchestrator that fans out one worker per section.”
  • “Make a translation task that evaluates its own output and retries with feedback until it passes.”

Requirements

  • A Trigger.dev project using the @trigger.dev/sdk package
  • The `ai` and `@ai-sdk/openai` packages used by the examples

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Prompt Chaining (Sequential with Gates)
  2. Routing (Classify → Dispatch)
  3. Parallelization
  4. Orchestrator-Workers (Fan-out/Fan-in)
  5. Evaluator-Optimizer (Self-Refining Loop)

What it can do on your machine

Read from SKILL.md and the folder at commit ed19717. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trigger.dev Agent Patterns loads about 2k tokens when it runs, and up to ~7.5k if it reads all its reference files. Until then it costs about 65 tokens; SKILL.md has 128 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 128 words (~1,999 tokens).

“Build production-ready AI agents using Trigger.dev's durable execution.”

— opening of SKILL.md by papermark, Custom licence
name
trigger-agents

Read the full SKILL.md on GitHub

Files

SKILL.md and 4 other files (references) in .agents/skills/trigger-agents of papermark/papermark.

  • SKILL.md
  • references/ai-tool.md
  • references/orchestration.md
  • references/streaming.md
  • references/waitpoints.md

Open the folder on GitHubat commit ed19717

Compare with similar skills

Trigger.dev Agent Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trigger.dev Agent Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trigger.dev Agent Patterns this skillpapermark/papermark9.2k—~2kAutomated safety check: PassCustom licence
Agent Squad for TypeScript2FastLabs/agent-squad7.8k—~4.3kAutomated safety check: PassApache-2.0
Agent Squad Python Guide2FastLabs/agent-squad7.8k—~4.7kAutomated safety check: PassApache-2.0
Add Example AgentGetBindu/Bindu10k—~1.1kAutomated safety check: NotesCustom licence
AgentSquad for Swift2FastLabs/agent-squad7.8k—~3.5kAutomated safety check: PassApache-2.0
Dive Into LangGraphluochang212/dive-into-langgraph457—~837Automated safety check: NotesCustom licence

Similar skills

  • Agent Squad for TypeScript

    2FastLabs/agent-squad

    Guide to building Node.js and TypeScript apps on the agent-squad package: orchestrator, agent types, classifier routing, storage, retrievers and MCP tools.

    7.8k GitHub stars~4.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Agent Squad Python Guide

    2FastLabs/agent-squad

    Map of the agent-squad Python framework for async multi-agent orchestration: which agent, classifier, storage and tool provider to pick, and the pitfalls to avoid.

    7.8k GitHub stars~4.7k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Add Example Agent

    GetBindu/Bindu

    Add a new self-contained example agent under examples/. An agent skill from GetBindu/Bindu.

    10k GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • AgentSquad for Swift

    2FastLabs/agent-squad

    Guides building on-device multi-agent apps in Swift with the AgentSquad framework: which agent, orchestrator, classifier, storage or voice type fits each situation.

    7.8k GitHub stars~3.5k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Dive Into LangGraph

    luochang212/dive-into-langgraph

    A Chinese-language guide and reference for building agents with LangGraph 1.0, from a first ReAct agent through middleware, memory, MCP, RAG and web search.

    457 GitHub stars~837 tokensUpdated 26 days ago
    AI & LLM EngineeringAuto-check: notes
  • Langgraph Human In The Loop

    langchain-ai/langchain-skills

    Official

    INVOKE THIS SKILL when implementing human-in-the-loop patterns, pausing for approval, or handling errors in LangGraph.

    1.3k GitHub starsUsed in 2 repos~4.1k tokens
    AI & LLM EngineeringAuto-check passed

More from papermark/papermark

  • Trigger.dev Configuration

    papermark/papermark

    Configures Trigger.dev projects through trigger.config.ts, with build extensions for Prisma, Playwright, Puppeteer, FFmpeg, Python and system packages.

    9.2k GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Audits Trigger.dev tasks, schedules and run history for wasteful machine sizes, retries, polling and cron frequency to cut spend.

    9.2k GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Trigger.dev Realtime

    papermark/papermark

    Shows how to subscribe to Trigger.dev task runs from the backend and from React for progress indicators, live dashboards, AI response streams and approval waits.

    9.2k GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Trigger.dev Background Tasks

    papermark/papermark

    Guides building durable background tasks, scheduled jobs and queues with Trigger.dev, including retries, waits, idempotency and concurrency limits.

    9.2k GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • GitHub CLI Reference

    papermark/papermark

    Reference for the gh command line tool covering repositories, issues, pull requests, Actions, releases, gists and codespaces, with install and login steps.

    9.2k GitHub starsUsed in 4 repos~9.8k tokens
    Auto-check: warnings

Questions about Trigger.dev Agent Patterns

What does Trigger.dev Agent Patterns do?

Patterns for building LLM agents on Trigger.dev tasks: prompt chaining, routing, parallel workers, orchestrator-workers, evaluator loops and human approval gates. dev's durable task execution.triggerByTaskAndWait`, orchestrator-workers with fan-out and fan-in, and an evaluator-optimizer loop that retries with feedback until a result is approved.

When should I use Trigger.dev Agent Patterns?

Trigger.dev Agent Patterns fits situations like: building an LLM task that fans work out to parallel workers; adding a human approval step before an agent continues; routing requests to different handlers after a cheap classification step; letting an LLM call existing Trigger.dev tasks as tools.

How do I install Trigger.dev Agent Patterns in Claude Code?

Run `npx skills add papermark/papermark --skill trigger-agents -a claude-code`. Or copy the skill folder (.agents/skills/trigger-agents in papermark/papermark) into .claude/skills/trigger-agents in your project. Claude Code loads it when a task matches its description.

How do I install Trigger.dev Agent Patterns in Codex?

Run `npx skills add papermark/papermark --skill trigger-agents -a codex`. Or copy the skill folder (.agents/skills/trigger-agents in papermark/papermark) into .agents/skills/trigger-agents in your project. Codex loads it when a task matches its description.

Can I use Trigger.dev Agent Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add papermark/papermark --skill trigger-agents -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trigger-agents, .gemini/skills/trigger-agents, .github/skills/trigger-agents and .opencode/skills/trigger-agents in your project.

What does Trigger.dev Agent Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Trigger.dev Agent Patterns is instructions for the agent only. Our summary lists: A Trigger.dev project using the @trigger.dev/sdk package; The `ai` and `@ai-sdk/openai` packages used by the examples.

Does Trigger.dev Agent Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Trigger.dev Agent Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Trigger.dev Agent Patterns use?

Trigger.dev Agent Patterns has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Trigger.dev Agent Patterns use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.5k tokens, read only when the agent opens those files.

What are the alternatives to Trigger.dev Agent Patterns?

Skills that share tags, products or a category with Trigger.dev Agent Patterns: Agent Squad for TypeScript (2FastLabs/agent-squad, 7.8k stars), Agent Squad Python Guide (2FastLabs/agent-squad, 7.8k stars), Add Example Agent (GetBindu/Bindu, 10k stars) and AgentSquad for Swift (2FastLabs/agent-squad, 7.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trigger.dev Agent Patterns?

papermark (a GitHub organization) maintains it in papermark/papermark, which has 9,242 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on August 28, 2026.

Source: papermark/papermark on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.