ClauseClock — SLA credits without spreadsheet double-counting

When incidents overlap, adding ticket durations overstates the outage. ClauseClock merges those intervals, subtracts scheduled maintenance, clips the result to the contract’s billing month and timezone, and calculates the customer credit and vendor recovery in integer cents.

Try the standalone Web Studio · Watch The Calibre Escape · Read the source

Forge Installation Link

What it does

In the hero example, two overlapping incidents report 120 minutes. Their union is 90 minutes; subtracting 15 minutes of maintenance leaves 75 minutes. The locked contract produces a $1,500 credit instead of the spreadsheet’s $5,000. Vendor recovery receives $900 and internal absorption receives $600. November’s New York billing window includes the DST transition, so the calculated uptime is 99.8266%.

ClauseClock workbench

Interval waterfall

Scenario Demonstration
Overlapping incidents 120 raw minutes → 75 billable minutes; $5,000 spreadsheet credit → $1,500
Billing timezone An outage from November 30 23:20 UTC to December 1 00:20 UTC is 40 November minutes in UTC ($0), but 60 November minutes in Los Angeles ($1,500)
Monthly cap A $3,000 gross credit is capped to $800; three vendors receive 26,667 + 26,667 + 26,666 cents
Draft contract Preview remains available; settlement requires an explicit Finance override reason

How we built it

A shared TypeScript engine drives Next.js and Forge Custom UI. The Forge handler uses @forge/api for Jira and Teamwork Graph (read:graph:issue:jira), @forge/kvs for a persistent customer/month ledger, @forge/realtime for refresh hints, and @forge/bridge for frontend invocation. It reads related work from Teamwork Graph as the current user and structured scenario data from a Jira entity property. If the test site has no matching issue or cannot supply the live data, the receipt explicitly says seeded and gives the fallback reason.

The ledger transaction is conditional on its revision. Jira notes, entity properties and realtime delivery follow the ledger save; failures report pending delivery and can be retried. The standalone Web Studio uses in-memory demo state. Approval tokens bind proposals but are not authentication credentials.

Settlement views

The PBT auditor checks interval algebra against an independent minute bitmap, monetary cap bounds and cent conservation. Additional tests compare physical UTC minutes with Intl calendar membership across timezones and exercise persistent-store reload, concurrent settlement and delivery retry. The portable skill calls the deterministic tools instead of asking an LLM to calculate money.

The public MCP endpoint (https://atlassian-clause-clock.vercel.app/api/mcp) accepts JSON-RPC initialization, initialized notifications, tool discovery/calls and resource discovery/reads. Its legacy inspector request format remains supported.

MCP inspector

Try it in three minutes

This is a walkthrough target, not a measured installation-time guarantee.

  1. Follow the Forge Installation Link above and install on a Jira test site (or open the standalone Web Studio).
  2. Open the ClauseClock global page. Select the hero scenario and verify 75 minutes and $1,500 credit.
  3. Select the timezone scenario. Toggle UTC to Los Angeles and compare $0 with $1,500.
  4. Enter an approver, approve the displayed proposal and commit. Reload to verify persistence, then watch the Finance view refresh.
  5. Run the PBT tool in the inspector, inspect its receipt, and reset the demo.

For live data preparation, internal-note checks and production commands, use the Forge deployment guide.

Film contact sheet

Download the demo film · MIT License

Share this project:

Updates

Submission history