Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    SuiteScript Governance Guard: Estimate Units Before Deploy

    1

    Agents write this bug often, since they don't know what each N/ call costs or what each script type is allowed.

    $11.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    SuiteScript Governance Guard: Estimate Units Before Deploy

    SuiteScript Governance Guard: Estimate Units Before Deploy

    Example session with this skill installed

    This User Event works in sandbox but we get SSS_USAGE_LIMIT_EXCEEDED on big orders in production. Our largest orders have about 400 lines. Count the governance units in fixtures/ue_so_lines.js and tell me how many lines it can handle.

    • Read your context and instructions
    • Compiled the suitescript governance guard

    Static estimate, not measured in NetSuite. afterSubmit in ue_so_lines.js has a 1,000 unit limit (User Event). It spends 30 units once and 8 on every line, so it's safe up to 121 lines. At your 400 lines it needs 3,230 units, 323 percent of the limit. Verdict: FAIL, exit code 2.

    LineCallUnitsCounted asDetail
    20record.load10fixedsalesorder, transaction rate
    34record.load5per iterationinventoryitem, other rate
    38search.lookupFields1per iteration
    45record.submitFields2per iterationcustomrecord_line_audit, custom rate
    59Record.save20fixedsalesorder, transaction rate

    Finding: GOV001 at line 34. The item is loaded on every line and only read with getValue.

    Next: I replace the per-line item load with one item search before the loop, read into a map, and hoist the customer lookup, since the customer is the same on every line. Then I rerun:

    FixedPer lineSafe linesUnits at 400 lines
    Before3081213,230 (FAIL)
    After412479841 (WARN, 84 percent of the limit)

    The 2 units left on each line are the audit record update, which has to run once per line. If orders can pass 479 lines, the next step is Map/Reduce. To confirm, log remaining usage at entry and exit in a sandbox run on two order sizes and compare. Unit costs come from costs.json, checked 2026-11-13.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A User Event passes in sandbox on a 20-line order, then dies with SSS_USAGE_LIMIT_EXCEEDED on a 400-line order at month end, with the record half processed. Nobody counted the units, because the record.load sat inside a loop a few helpers deep. Agents write this bug often, since they don't know what each N/ call costs or what each script type is allowed.

    What your agent does

    • Asks for the worst case: the largest line or result count the script meets in production. The default is 200, and the report says when it was used.
    • Budgets every entry point: fixed units, units per loop iteration, the script type limit, the maximum safe iterations and a PASS, WARN or FAIL verdict. Each Map/Reduce stage gets its own row.
    • Shows where the units go: every priced call with its line number and record class.
    • Flags six patterns, GOV001 to GOV006, such as a record.load in a loop that only reads fields.
    • Applies a named rewrite from 8 fix patterns with before and after code, then reruns and shows both sets of numbers.
    • Tells you how to confirm it: log remaining usage in a sandbox run and compare.

    Built-in guard rails

    • Every report is headed "static estimate, verify in your account".
    • A row the analyzer couldn't price for certain is never PASS. A record type held in a variable, a helper the scan didn't follow, a nested loop or an N/ call missing from the cost table forces WARN and is listed.
    • Costs and limits live in editable JSON tables. Each entry carries a source note and a checked date (2026-11-13).

    What's inside

    • SKILL.md: eight-step workflow, output guide, hard rules, limits.
    • scripts/governance_guard.py with costs.json (96 priced calls, 11 priced methods) and limits.json (14 script type and stage limits). Markdown and JSON reports.
    • 5 reference files: unit costs, script type limits, fix patterns, analyzer limits, verifying in your account.
    • 5 fixture files: a failing User Event, its fixed version, a Map/Reduce script and the two expected reports.
    • 145 unit tests in 3 test files.

    Independent work, not made or endorsed by Oracle or NetSuite. It doesn't connect to NetSuite or cover SuiteScript 1.0.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Static estimate with no NetSuite connection. Record types held in variables are assumed, bundle modules and class methods aren't followed, nested loops aren't multiplied, and governed methods on untracked objects (Cache.get, SFTP transfers) count as zero. No SuiteScript 1.0, no time limits.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    Python 3 (3 point 8 or later)SuiteScript 2 source files
    Claude Code
    orCodex
    orCursor
    Optional
    Largest line
    orresult count in production
    A NetSuite sandboxCurrent NetSuite help topics

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files

    Allowed Hosts

    example.com
    Listedtoday

    What's inside

    Frequently Asked Questions

    No. It reads source files on disk and has no network code. It can't read execution logs, so you confirm the estimate with a sandbox run.

    They're a static estimate from an editable cost table checked against the NetSuite help on 2026-11-13, so verify the figures for your release. Every loop is assumed to run your row count and every branch is assumed to run, so loop costs lean high.

    Inside a file, yes. Across files it follows relative paths and full /SuiteScripts/ paths inside the folder you scan. Bundle modules, class methods and functions picked at run time aren't followed, and their calls are listed as unresolved or not reached.

    No. SuiteScript 1.0 files aren't analysed, and only usage units are estimated. Time limits, instruction counts and concurrency are out of scope.

    New in APIs & Backend