trigger-cost-savings
Skill70 starsChanged 2 months agoMITView on GitHub
Analyze Trigger.dev tasks, schedules, and runs for cost optimization opportunities. Use when asked to reduce spend, optimize costs, audit usage, right-size machines, or review task efficiency. Requires Trigger.dev MCP tools for run analysis.
6 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- triggerdotdev/skillsedited, first seen Oct 19, 2026
- adrianhajdin/ghost-aiword for word, first seen Oct 9, 2026
- papermark/papermarkword for word, first seen Oct 8, 2026
- VladSez/easy-invoice-pdfedited, first seen Oct 8, 2026
- mfts/papermarkword for word, first seen Oct 8, 2026
- Visitha2001/ghost-ai-sseword for word, first seen Jun 24, 2026
Other versions6 projects use a version of this.
Word for word · 4
- mfts/papermark★ 9.2k100% same
- papermark/papermark★ 9.2k100% same
- adrianhajdin/ghost-ai★ 332100% same
- Visitha2001/ghost-ai-sse★ 0100% same
Edited · 2
- VladSez/easy-invoice-pdf★ 1.1k16% same
- triggerdotdev/skills★ 3538% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- graduate-to-triggerSkill
- research-agentSkill
- research-process-builderSkill
- trigger-agentsSkill
- trigger-configSkill
- trigger-realtimeSkill
- trigger-setupSkill
- trigger-tasksSkill
- research-process-builderSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Before analysis, verify these MCP tools are available:
- Distinctive: line 21
If these tools are not available, instruct the user:
- Distinctive: line 33
Do NOT proceed with run analysis without MCP tools.
- Distinctive: line 37
Before giving recommendations, fetch the latest guidance:
- Very specific: line 43
Use the fetched content to ensure recommendations are current.
- Distinctive: line 63
Use MCP tools to analyze actual usage patterns:
- Distinctive: line 86
Check if failures are retryable (transient) vs permanent
- Very specific: line 97
If a task on large-2x consistently runs in < 1 second, it's over-provisioned
- Distinctive: line 98
If tasks are I/O-bound (API calls, DB queries), they likely don't need large machines
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trigger.dev Cost Savings Analysis
Analyze task runs and configurations to find cost reduction opportunities.
Prerequisites: MCP Tools
This skill requires the Trigger.dev MCP server to analyze live run data.
Check MCP availability
Before analysis, verify these MCP tools are available:
list_runs— list runs with filters (status, task, time period, machine size)get_run_details— get run logs, duration, and statusget_current_worker— get registered tasks and their configurations
If these tools are not available, instruct the user:
To analyze your runs, you need the Trigger.dev MCP server installed.
Run this command to install it:
npx trigger.dev@latest install-mcp
This launches an interactive wizard that configures the MCP server for your AI client.Do NOT proceed with run analysis without MCP tools. You can still review source code for static issues (see Static Analysis below).
Load latest cost reduction documentation
Before giving recommendations, fetch the latest guidance:
WebFetch: https://trigger.dev/docs/how-to-reduce-your-spendUse the fetched content to ensure recommendations are current. If the fetch fails, fall back to the reference documentation in references/cost-reduction.md.
Analysis Workflow
Step 1: Static Analysis (source code)
Scan task files in the project for these issues:
- Oversized machines — tasks using
large-1xorlarge-2xwithout clear need - Missing
maxDuration— tasks without execution time limits (runaway cost risk) - Excessive retries —
maxAttempts> 5 withoutAbortTaskRunErrorfor known failures - Missing debounce — high-frequency triggers without debounce configuration
- Missing idempotency — payment/critical tasks without idempotency keys
- Polling instead of waits —
setTimeout/setInterval/sleep loops instead ofwait.for() - Short waits —
wait.for()with < 5 seconds (not checkpointed, wastes compute) - Sequential instead of batch — multiple
triggerAndWait()calls that could usebatchTriggerAndWait() - Over-scheduled crons — schedules running more frequently than necessary
Step 2: Run Analysis (requires MCP tools)
Use MCP tools to analyze actual usage patterns:
2a. Identify expensive tasks
list_runs with filters:
- period: "30d" or "7d"
- Sort by duration or cost
- Check across different task IDsLook for:
- Tasks with high total compute time (duration x run count)
- Tasks with high failure rates (wasted retries)
- Tasks running on large machines with short durations (over-provisioned)
2b. Analyze failure patterns
list_runs with status: "FAILED" or "CRASHED"For high-failure tasks:
- Check if failures are retryable (transient) vs permanent
- Suggest
AbortTaskRunErrorfor known non-retryable errors - Calculate wasted compute from failed retries
2c. Check machine utilization
get_run_details for sample runs of each taskCompare actual resource usage against machine preset:
- If a task on
large-2xconsistently runs in < 1 second, it's over-provisioned - If tasks are I/O-bound (API calls, DB queries), they likely don't need large machines
2d. Review schedule frequency
get_current_worker to list scheduled tasks and their cron patternsFlag schedules that may be too frequent for their purpose.
Step 3: Generate Recommendations
Present findings as a prioritized list with estimated impact:
## Cost Optimization Report
### High Impact
1. **Right-size `process-images` machine** — Currently `large-2x`, average run 2s.
Switching to `small-2x` could reduce this task's cost by ~16x.
```ts
machine: { preset: "small-2x" } // was "large-2x"Medium Impact
- Add debounce to
sync-user-data— 847 runs/day, often triggered in bursts.debounce: { key: `user-${userId}`, delay: "5s" }
Low Impact / Best Practices
- Add
maxDurationtogenerate-report— No timeout configured.maxDuration: 300 // 5 minutes
## Machine Preset Costs (relative)
Larger machines cost proportionally more per second of compute:
| Preset | vCPU | RAM | Relative Cost |
|--------|------|-----|---------------|
| micro | 0.25 | 0.25 GB | 0.25x |
| small-1x | 0.5 | 0.5 GB | 1x (baseline) |
| small-2x | 1 | 1 GB | 2x |
| medium-1x | 1 | 2 GB | 2x |
| medium-2x | 2 | 4 GB | 4x |
| large-1x | 4 | 8 GB | 8x |
| large-2x | 8 | 16 GB | 16x |
## Key Principles
- **Waits > 5 seconds are free** — checkpointed, no compute charge
- **Start small, scale up** — default `small-1x` is right for most tasks
- **I/O-bound tasks don't need big machines** — API calls, DB queries wait on network
- **Debounce saves the most on high-frequency tasks** — consolidates bursts into single runs
- **Idempotency prevents duplicate work** — especially important for expensive operations
- **`AbortTaskRunError` stops wasteful retries** — don't retry permanent failures
See `references/cost-reduction.md` for detailed strategies with code examples.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

