Skip to content

/forge-cost-optimizer

Optimizes Atlassian Forge apps to reduce platform consumption and avoid unnecessary costs using Atlassian's "Optimise Forge platform costs" guidance. Use when the user asks to optimize Forge app costs, reduce Forge invocations, lower GB-seconds, reduce storage or log usage, tune

From plugin
forge-skills
277 skills2 MCP

Claude Code

$ npx -y skills add atlassian/forge-skills --skill forge-cost-optimizer --agent claude-code

SKILL.md

forge-cost-optimizer.SKILL.md
name: forge-cost-optimizer
description: >
  Optimizes Atlassian Forge apps to reduce platform consumption and avoid unnecessary costs using Atlassian's
  "Optimise Forge platform costs" guidance. Use when the user asks to optimize Forge app costs, reduce Forge
  invocations, lower GB-seconds, reduce storage or log usage, tune memory, replace polling, improve scheduled triggers,
  reduce KVS writes, move work to the frontend, use bridge APIs, batch API calls, add caching, or evaluate Forge Remote
  trade-offs. By default, perform an audit first and offer to make the recommended changes after presenting the audit.
  Only modify files immediately when the user explicitly asks the agent to implement or apply optimizations.

Forge Cost Optimizer

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.

Source Guidance

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.

Core Principle

Prioritize changes that reduce unnecessary work:

1. **Avoid invocations entirely** — move safe work to UI Kit / Custom UI frontend, use context from the bridge, replace polling with events, add trigger filters. 2. **Do less work per invocation** — bulk API calls, field selection, source-side filtering, pagination, early exits, bounded concurrency. 3. **Reduce billed data volume** — trim resolver payloads, reduce KVS reads/writes, avoid large log payloads, use entity properties where appropriate. 4. **Tune compute cost** — right-size `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 Triggered

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:

1. `manifest.yml` / `manifest.yaml` — functions, modules, triggers, scheduled triggers, remotes, resources, permissions, endpoint mappings, `memoryMiB`. 2. `package.json` — dependencies, scripts, Forge package versions. 3. Backend/resolver code — `src/**`, handlers referenced by the manifest, storage usage, API calls, logging, async control flow. 4. Frontend code — UI Kit or Custom UI resources, bridge usage, `invoke()` patterns, render lifecycle, caching, payload needs. 5. Any tests or fixtures that describe behavior to preserve.

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.

Optimization Workflow

Step 1: Establish the Cost Profile

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`.

Step 2: Find No-Invocation Opportunities

Prefer removing function invocations over making them cheaper.

Check for:

  • Resolver calls that only fetch product context. Replace with:
  • UI Kit: `useProductContext()` from `@forge/react`
  • UI Kit or Custom UI: `view.getContext()` from `@forge/bridge`
  • Read-only Jira/Confluence API calls routed through a resolver even though user-context access is acceptable. Consider `requestJira()` / `requestConfluence()` from `@forge/bridge`.
  • Formatting, sorting, grouping, client-safe validation, or UI-only transformation in resolvers. Move to frontend when data is already authorized for the context user.
  • `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.

Step 3: Optimize Triggers and Scheduling

Check `scheduledTrigger`, `trigger`, and `webtrigger` modules.

Recommended changes:

  • Increase scheduled trigger intervals when business requirements allow (`fiveMinutes` → `hour` → `day` → `week`).
  • Replace scheduled polling of Atlassian product changes with product events.
  • Replace scheduled polling of external services with inbound webhooks via Forge web trigge
Read more
@atlassian
Ships withforge-skills

Atlassian Forge lets you build and deploy apps directly on the Atlassian platform - issue panels, Confluence macros, dashboard gadgets, and more.

Stars on GitHub

Momentum

stars in total
27
Star history of atlassian/forge-skills on GitHub, a chart by star-history.com

Other skills on forge-skills.

forge-app-builder
Auto-invoked

forge-app-builder

Plan, build, scaffold, or safely extend Atlassian Forge apps using current official documentation. Use for fresh Forge apps,…

forge-app-review
Auto-invoked

forge-app-review

Performs a lightweight pre-release readiness review of Atlassian Forge apps across manifest/module wiring, architecture, runtime…

forge-connector
Auto-invoked

forge-connector

Guides building and deploying Atlassian Forge Teamwork Graph connector apps that ingest external data into Atlassian's Teamwork…

forge-debugger
Auto-invoked

forge-debugger

Diagnoses and fixes issues in Atlassian Forge apps. Use this skill whenever a Forge app has errors, crashes, shows blank UI,…

forge-onboarding
Auto-invoked

forge-onboarding

Guide a first-time Forge builder through building Forge Guru, a Rovo Agent that answers Forge questions. Use for Forge…

forge-security-review
Auto-invoked

forge-security-review

Performs a white-box security review of Atlassian Forge apps using structured, Forge-specific security rules and evidence-driven…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about forge-cost-optimizer.

Which coding agents can use forge-cost-optimizer?
forge-cost-optimizer installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.