- Home
- Skills
- APIs & Backend
- SuiteScript Governance Guard: Estimate Units Before Deploy
Works with the AI Agents you already use
SuiteScript Governance Guard: Estimate Units Before Deploy
Agents write this bug often, since they don't know what each N/ call costs or what each script type is allowed.
$11.99
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.
| Line | Call | Units | Counted as | Detail |
|---|---|---|---|---|
| 20 | record.load | 10 | fixed | salesorder, transaction rate |
| 34 | record.load | 5 | per iteration | inventoryitem, other rate |
| 38 | search.lookupFields | 1 | per iteration | |
| 45 | record.submitFields | 2 | per iteration | customrecord_line_audit, custom rate |
| 59 | Record.save | 20 | fixed | salesorder, 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:
| Fixed | Per line | Safe lines | Units at 400 lines | |
|---|---|---|---|---|
| Before | 30 | 8 | 121 | 3,230 (FAIL) |
| After | 41 | 2 | 479 | 841 (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.loadin 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.pywithcosts.json(96 priced calls, 11 priced methods) andlimits.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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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 CodeorCodexorCursor- Optional
- Largest lineorresult count in productionA NetSuite sandboxCurrent NetSuite help topics
Permissions
Allowed Hosts