- Home
- Skills
- Data & Databases
- Experiment, Pricing & B2B Guard Pack
Works with the AI Agents you already use
Experiment, Pricing & B2B Guard Pack
This pack gives you the arithmetic and the code review for each, as single-file scripts an agent can run.
$24
Experiment, Pricing & B2B Guard Pack
Example session with this skill installed
Compute Wilson 95% intervals and Fisher exact p-value for a 12/200 vs 25/210 A/B test, calculate unit margin at $24 (30% fee, 5% refunds), and scan webhook code for missing idempotency.
- Read your context and instructions
- Compiled the experiment pricing
Real output from running the packaged scripts on small fixtures.
1. node ab_sample_and_ci_calc.mjs --a-success 12 --a-n 200 --b-success 25 --b-n 210
$ node ab_sample_and_ci_calc.mjs --a-success 12 --a-n 200 --b-success 25 --b-n 210
A: 12/200 = 0.06 Wilson 95% CI [0.0347, 0.1019]
B: 25/210 = 0.119 Wilson 95% CI [0.0819, 0.1698]
B - A = 0.059 (98.4% relative), 95% CI [0.0043, 0.1138]
z = 2.086, p = 0.037; Fisher exact p = 0.0397
significant at 0.05: true
warning: Underpowered: detecting the observed lift reliably needs about 366 per arm; you have 200.
warning: Decide the stopping n before looking; repeated peeking inflates false positives.
(exit 0)
2. node unit_economics_calc.mjs --price 24 --fee-pct 30 --fixed-fee 0.30 --refund-pct 5 --hours 12 --target-hourly 30 --units 40
$ node unit_economics_calc.mjs --price 24 --fee-pct 30 --fixed-fee 0.30 --refund-pct 5 --hours 12 --target-hourly 30 --units 40
price 24, fees 30% + 0.3 fixed, refunds 5%
net per kept sale: 16.5
expected net per order: 15.66 (fees and refunds take 34.75% of the price)
break-even: 23 sale(s) to cover 360 (12 h x 30 + costs 0)
at 40 sales: net income 626.4, effective hourly 52.2
lowest price that still meets the target: 13.98 (max discount 41.73%)
(exit 0)
3. node idempotency_audit.mjs bad (webhook handlers)
$ node idempotency_audit.mjs bad
idempotency_audit: 4 file(s) scanned
[error] hook.js:1 missing-idempotency-key - Handler has no idempotency key, event id or dedupe check.
fix: Store the provider event id (unique constraint) and return early when it was already processed.
[error] hook.js:5 non-atomic-update - Read-modify-write on a balance-like field without a transaction, lock or atomic increment.
fix: Use one atomic statement (UPDATE ... SET x = x + ?) or a transaction with a row lock.
[error] hook.js:7 non-atomic-rewrite - Delete followed by insert without a transaction: a crash between them loses the data.
fix: Wrap both in one transaction, or replace with an upsert.
[error] hook.py:4 check-after-write - A side effect (line 4) runs before the dedupe check (line 5).
fix: Check or claim the event id first, in the same transaction as the write.
[error] retry.js:1 missing-idempotency-key - Handler has no idempotency key, event id or dedupe check.
fix: Store the provider event id (unique constraint) and return early when it was already processed.
[error] retry.js:3 retry-duplicate-risk - Retry logic wraps a write that is not protected against repeats.
fix: Make the write idempotent (upsert or unique key) before adding retries.
[warn] hook.js:3 float-currency - Money handled as a floating-point number.
fix: Keep integer minor units (cents, yen) or a decimal type; round once, at display time.
[warn] hook.py:4 float-currency - Money handled as a floating-point number.
fix: Keep integer minor units (cents, yen) or a decimal type; round once, at display time.
[warn] store.js:2 non-atomic-file-write - Ledger-like file is overwritten in place; a crash mid-write leaves it truncated.
fix: Write to a temporary file in the same folder, then rename it over the original.
summary: 6 error(s), 3 warning(s)
(exit 1)
Connects securely to your tools. The creator never sees your data.
About this skill
Stop taking the agent's word for it
With a few hundred visitors most A/B differences are noise, a price is not income until fees and refunds are taken out, and a webhook that works in a test charges twice in production. This pack gives you the arithmetic and the code review for each, as single-file scripts an agent can run.
Each skill ships one self-contained Node.js script (Node 18+, standard library only). It prints findings or results with a fix, and exits non-zero when the gate fails. Add --json for machine-readable output.
The 3 skills
1. small-n-experiment-and-kpi-judge judges A/B results with small samples:
- Wilson 95% intervals, z test and Fisher exact p-value
- required sample size per arm for a chosen minimum detectable effect
- warnings for small n, thin cells, underpowered tests and peeking
2. net-margin-pricing-calculator turns a price into what you keep and what your time earns:
- net per sale after fee percent, fixed fee and refunds
- effective hourly rate and break-even number of sales
- the largest discount that still meets your target hourly rate
3. idempotent-webhook-and-ledger-guard audits JS/TS/Python webhook and billing code:
- handlers with no idempotency key or event-id check; writes before the dedupe check
- retries around unprotected writes
- non-atomic balance updates and delete-then-insert, in-place ledger file writes, float currency math
Built for agents and for review
- Single file per skill, standard library only: copy one script anywhere and run it
- Works when the skill is loaded through the Agensi MCP: write the script to a temporary file, run it, delete it
- No network access, no shell commands, no environment reads
- Exit code and counts you can quote as evidence
What is in the ZIP
- README.md
- shared/verification-principles.md
- skills/idempotent-webhook-and-ledger-guard/scripts/idempotency_audit.mjs
- skills/idempotent-webhook-and-ledger-guard/SKILL.md
- skills/net-margin-pricing-calculator/scripts/unit_economics_calc.mjs
- skills/net-margin-pricing-calculator/SKILL.md
- skills/small-n-experiment-and-kpi-judge/scripts/ab_sample_and_ci_calc.mjs
- skills/small-n-experiment-and-kpi-judge/SKILL.md
The experiment tool handles two arms and one binary metric. Other designs need other methods.
The pricing model uses constant fee and refund shares and no tax.
The webhook audit is line-based and per file; a dedupe check in middleware or in the database schema is not seen.
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 any payment.
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
Requires