From forge-skills
Audits and optimizes Atlassian Forge apps to reduce platform consumption, invocations, storage, and compute costs following Atlassian's official guidance.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge-skills:forge-cost-optimizerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Optimize Forge apps for lower platform consumption while preserving correctness, security, and maintainability. This skill turns Atlassian's Forge cost optimization guidance into an actionable agent workflow.
Optimize Forge apps for lower platform consumption while preserving correctness, security, and maintainability. This skill turns Atlassian's Forge cost optimization guidance into an actionable agent workflow.
Base recommendations on Atlassian's official guide: https://developer.atlassian.com/platform/forge/optimise-forge-costs/
If live Forge documentation tools are available, search the Forge docs for the exact module or API before changing code that depends on current manifest syntax, bridge APIs, storage APIs, trigger filters, or Forge Remote behavior.
Prioritize changes that reduce unnecessary work:
memoryMiB, reduce duration, offload only when the operational trade-off is justified.Never reduce costs by weakening authorization, exposing secrets to the frontend, skipping required validation, dropping necessary error handling, or making data stale beyond the user's business requirements.
When the user asks to optimize an existing Forge app, immediately inspect the app before asking questions unless the target app directory is ambiguous.
Default behavior is audit-first: complete the cost optimization audit, present prioritized recommendations, and ask the user whether they want the agent to make the recommended changes. Do not modify files during the initial audit unless the user explicitly requested implementation in the same prompt, such as "make the changes", "apply the optimizations", "fix these issues", or "update the code".
Read, in order:
manifest.yml / manifest.yaml — functions, modules, triggers, scheduled triggers, remotes, resources, permissions, endpoint mappings, memoryMiB.package.json — dependencies, scripts, Forge package versions.src/**, handlers referenced by the manifest, storage usage, API calls, logging, async control flow.invoke() patterns, render lifecycle, caching, payload needs.After the audit, offer clear next-step options such as implementing all quick wins, implementing selected high-impact changes, or collecting usage measurements first. If the user explicitly requested implementation upfront, make safe, localized improvements after the audit findings are understood and explain trade-offs.
Identify which cost drivers the app likely uses:
| Driver | Inspect | Common signals |
|---|---|---|
| Function GB-seconds | manifest.yml, handlers | many resolver calls, slow sequential APIs, high memoryMiB, heavy transforms |
| Invocations | frontend invoke(), triggers | calls on render, chatty UI, scheduled polling, broad event subscriptions |
| KVS / Custom Entities | storage.* usage | writes on every request, loops over keys, low TTL cache churn, large values |
| Logs | console.* | full event/API payload logging, debug logs in hot paths |
| Forge SQL | SQL client usage | frequent compute requests, long queries, oversized stored data |
| Remote / egress | remotes, fetch calls | external polling, compute offload candidates, Runs on Atlassian implications |
When usage metrics are unavailable, mark estimates as qualitative: High, Medium, Low, or Unknown.
Prefer removing function invocations over making them cheaper.
Check for:
useProductContext() from @forge/reactview.getContext() from @forge/bridgerequestJira() / requestConfluence() from @forge/bridge.invoke() calls inside render bodies, unbounded effects, repeated event handlers, or multiple calls on page load that can be cached or batched.Keep logic in the backend when it requires asApp(), Forge storage, secrets, external credentials, cross-user authorization checks, or sensitive business rules.
Check scheduledTrigger, trigger, and webtrigger modules.
Recommended changes:
fiveMinutes → hour → day → week).filter.expression to suppress irrelevant product events before invocation.filter.ignoreSelf: true for Jira triggers that would otherwise process events caused by the app itself.Every API request inside a function contributes to duration. Look for:
fields, expand, limit, or maxResults constraints. Request only what the app uses.Promise.all or bounded concurrency.KVS and Custom Entity reads/writes are billed by data volume above free allowances; writes are much more expensive than reads.
Check for:
storage.query().getMany() followed by in-memory filtering. Use .index(...), .where(...), .limit(...), and cursor pagination.Do not move sensitive or confidential data to entity/content properties because they may be visible through product REST APIs.
Find console.log, console.info, console.warn, console.error, and structured logger calls.
Recommended changes:
process.env.DEBUG_LOGGING === 'true'.Inspect function entries in manifest.yml.
(memoryMiB / 1024) × durationSeconds.Forge Remote can remove Forge function execution for suitable workloads, but it shifts responsibility to externally operated infrastructure.
Only recommend Forge Remote when one or more are true:
Always mention trade-offs:
When modifying code:
Search for these patterns:
invoke(
useAction(
useEffect(
requestJira(
requestConfluence(
asApp().requestJira
asUser().requestJira
storage.get
storage.set
storage.query
console.log
console.info
scheduledTrigger
ignoreSelf
memoryMiB
Promise.all
for await
for (
Interpret results carefully; a pattern is not automatically a problem.
For default audit-first requests, return the audit and end by offering to implement recommended changes:
# Forge Cost Optimization Audit
## Summary
- Overall opportunity: High | Medium | Low
- Highest-impact lever: <invocations | duration | storage | logs | memory | remote>
- Files inspected: <list>
## Prioritized Opportunities
1. [High] <title>
- Evidence: `<file:line>` and observed pattern
- Why it costs money: <cost driver>
- Recommended change: <specific fix>
- Safety notes: <authorization/data freshness/trade-offs>
## Quick Wins
- <low-risk change>
## Needs Measurement
- <changes that require usage metrics or profiling>
## Recommended Next Step
Would you like me to implement the quick wins, implement selected high-impact changes, or collect usage measurements first?
For requests where the user explicitly asked for implementation, return:
# Forge Cost Optimization Complete
## Changes Made
- <file>: <change and cost driver reduced>
## Validation
- <commands run and results>
## Expected Impact
- <qualitative or measured impact>
## Follow-ups
- <optional deeper optimizations or metrics to collect>
asApp() operations to the frontend.npx claudepluginhub atlassian/forge-skills --plugin forge-skillsPerforms pre-release readiness reviews of Atlassian Forge apps: manifest/module wiring, architecture, runtime compatibility, dependencies, tests, deploy hygiene, and security/cost/reliability smells.
Audits deployed Vercel apps for cost and performance issues using production metrics, config, and version-aware recommendations.
Optimizes Vercel costs by analyzing Fluid Compute billing, reducing serverless function execution, and monitoring usage via API. Useful for plan selection and spend management.