cskwork/supergoal-skill / skills/supergoal
supergoal
UnverifiedRoute objective-driven development, verification, planning, "teach/explain", codebase learning, and skill evaluation through the Supergoal workflow. Use when Supergoal is requested or an autonomous delivery workflow is needed.
templates/harness-eval-cases/fixtures/revfactory-case-003-refactoring/test/order.hidden.test.mjs
View on GitHubimport assert from 'node:assert/strict';
import { test } from 'node:test';
import { calculateInvoice } from '../src/order.mjs';
test('SAVE20 over threshold applies 20%', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 60, qty: 2 }], region: 'US', coupon: 'SAVE20' }),
{ subtotal: 120, discount: 24, tax: 6.72, shipping: 3, total: 105.72 });
});
test('SAVE20 under threshold falls back to 10%', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 30, qty: 1 }], region: 'US', coupon: 'SAVE20' }),
{ subtotal: 30, discount: 3, tax: 1.89, shipping: 7.5, total: 36.39 });
});
test('HALF coupon is ignored for non-VIP', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 200, qty: 1 }], region: 'EU', coupon: 'HALF' }),
{ subtotal: 200, discount: 0, tax: 40, shipping: 0, total: 240 });
});
test('VIP floor gives 5% when no coupon', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 80, qty: 1 }], region: 'US', vip: true }),
{ subtotal: 80, discount: 4, tax: 5.32, shipping: 3, total: 84.32 });
});
test('VIP floor never reduces a larger coupon discount', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 200, qty: 1 }], region: 'US', coupon: 'SAVE10', vip: true }),
{ subtotal: 200, discount: 20, tax: 12.6, shipping: 0, total: 192.6 });
});
test('express fee is additive on free-shipping tier', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 120, qty: 1 }], region: 'US', express: true }),
{ subtotal: 120, discount: 0, tax: 8.4, shipping: 12, total: 140.4 });
});
test('express fee is additive on the lowest shipping tier', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 20, qty: 1 }], region: 'US', express: true }),
{ subtotal: 20, discount: 0, tax: 1.4, shipping: 19.5, total: 40.9 });
});
test('unknown region uses the 10% default tax', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 40, qty: 1 }], region: 'CA' }),
{ subtotal: 40, discount: 0, tax: 4, shipping: 7.5, total: 51.5 });
});
test('cent rounding on fractional line totals', () => {
assert.deepEqual(calculateInvoice({ items: [{ price: 9.99, qty: 3 }], region: 'US' }),
{ subtotal: 29.97, discount: 0, tax: 2.1, shipping: 7.5, total: 39.57 });
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |