git clone --depth 1 https://github.com/anthropics/claude-plugins-community /tmp/tres-recon-gaps && cp -r /tmp/tres-recon-gaps/tres-finance-plugin/skills/tres-recon-gaps ~/.claude/skills/tres-recon-gapsSKILL.md
# TRES Reconciliation Gaps Skill
End-to-end workflow for surfacing, analyzing, and resolving reconciliation gaps in TRES Finance.
---
## Pre-flight: confirm date and asset scope
**Before fetching any data**, confirm two things with the user:
### 1. Target date
The reconciliation queries are scoped to a specific date (the `endDate` parameter).
- If the user **explicitly stated a date** — use it.
- If the user **did not mention a date** — assume today's date and inform them:
> "I'll fetch reconciliation gaps for today (YYYY-MM-DD). Let me know if you want a different date."
Use ISO format `YYYY-MM-DD` throughout.
### 2. Asset filter (optional)
- If the user **named specific assets** (e.g. "for ETH and USDC", "just BTC") — note them. After fetching, filter the results to only those `asset.symbol` values before displaying.
- If the user **did not specify assets** — fetch and display all gaps.
---
## Step 1 — Fetch reconciliation gaps
Use the `reconciliation` query. Always pass the confirmed `endDate`. Fetch up to 200 at a time.
```graphql
query GetReconciliationGaps($limit: Int, $offset: Int, $endDate: Date) {
reconciliation(limit: $limit, offset: $offset, endDate: $endDate) {
totalCount
results {
id
amount
calculatedBalance
state
status
gap
belongsTo {
id
name
identifier
}
asset {
key
identifier
symbol
platform
}
pendingTransactionsCount
pendingTransactionsTotalAmount
}
}
}
```
Variables: `{"limit": 200, "offset": 0, "endDate": "<confirmed-date>"}`
> Note: `gap` = `calculatedBalance − historicalBalance`. Positive means the ledger has *more* than on-chain; negative means the ledger has *less*.
If the user requested specific assets, filter the results now: keep only rows where `asset.symbol` matches the requested symbols (case-insensitive).
---
## Step 2 — Enrich with fiat values and on-chain balances
Take all IDs from the (filtered) Step 1 results and query `assetBalance`:
```graphql
query GetAssetBalancesWithFiat($ids: [String], $limit: Int, $currency: String) {
assetBalance(id_In: $ids, limit: $limit, currency: $currency, excludeUnderDelegation: true) {
totalCount
results {
id
calculatedBalance
historicalBalance
reconciliation
fiatValue {
value
unitPrice
fiatCurrency
}
belongsTo {
id
name
identifier
}
asset {
key
symbol
platform
identifier
}
}
}
}
```
Variables: `{"currency": "usd", "ids": ["<id1>", "<id2>", ...], "limit": 200}`
**Important**: `id_In` expects `[String]`, not `[ID]`.
Compute for each row:
```
fiatGap = reconciliation (token gap) × fiatValue.unitPrice
```
---
## Step 3 — Display: always render the HTML dashboard
**Always** generate a standalone `.html` file as the primary output — do not fall back to an inline widget.
Read `references/html-template-notes.md` for the full visual spec (fonts, colors, layout, column widths, modal behavior, API call mechanism).
Key requirements for the generated file:
- Dark financial dashboard aesthetic (spec in reference file)
- Sticky header showing the **target date** and a refresh timestamp badge
- 5 summary metric cards: net fiat gap, positive gap count, negative gap count, asset group count, pending tx count
- If an **asset filter** was applied, show a visible filter badge in the toolbar (e.g. `Filtered: ETH, USDC`)
- Search + direction filter + platform filter toolbar
- Asset-grouped collapsible sections, sorted by absolute net fiat gap descending
- Full column set per row — last column has two copy-prompt buttons: **↳ Plug** (blue) and **⟳ Auto-fill** (purple)
- Clicking either button copies a ready-to-paste prompt to clipboard and shows a toast: "Prompt copied — paste it in the Claude chat to resolve this gap."
- **No HTTP requests** — the HTML is a pure display interface; all mutations happen in Claude after the user pastes the prompt
After generating the file, present it to the user with `present_files`.
---
## Step 4 — Actions (plug-once and auto-fill)
The user triggers actions by copying a prompt from the HTML dashboard and pasting it into the Claude chat. When Claude receives one of these prompts, execute the corresponding mutation immediately — no further confirmation needed (the user already chose the action in the dashboard).
### One-time plug (`createPlug`)
```graphql
mutation CreatePlug(
$hash: String!
$platform: Platform!
$timestamp: DateTime!
$belongsToId: ID!
$assetId: ID!
$assetIdentifier: String!
$amount: Float!
$direction: Direction!
$thirdPartyIdentifier: String!
) {
createPlug(
hash: $hash
platform: $platform
timestamp: $timestamp
belongsToId: $belongsToId
assetId: $assetId
assetIdentifier: $assetIdentifier
amount: $amount
direction: $direction
thirdPartyIdentifier: $thirdPartyIdentifier
) {
transaction { id identifier platform timestamp }
}
}
```
**Variable mapping:**
| Field | Value |
|---|---|
| `hash` | `plug_<assetId>_<walletId>_<timestamp_ms>` |
| `platform` | `asset.platform` |
| `timestamp` | `new Date().toISOString()` |
| `belongsToId` | `belongsTo.id` |
| `assetId` | `asset.key` |
| `assetIdentifier` | `asset.identifier` (use `"native"` for native assets like ETH/AVAX) |
| `amount` | `Math.abs(gap)` |
| `direction` | `gap > 0 ? "INFLOW" : "OUTFLOW"` |
| `thirdPartyIdentifier` | `belongsTo.identifier` (wallet address) |
### Auto gap-fill rule (`createReconciliationGapFillRule`)
```graphql
mutation CreateGapFillRule(
$name: String!
$assetId: String!
$internalAccountId: Int!
$interval: Interval!
$startDate: Date!
$endDate: Date!
) {
createReconciliationGapFillRule(
name: $name
assetId: $assetId
internalAccountId: $internalAccountId
interval: $interval
startDate: $startDate
endExplain a topic like I'm a 5 year old. Use when the user types /eli5 <topic> or asks for a dead-simple picture explainer of how something works.
Use the `quickdesign` CLI to generate AI media — UGC promo videos, image edits, product creatives, video upscales — through Seedance, Kling, Sora2, Nano Banana, and GPT Image. Invoke this skill whenever the user asks for a talking-avatar video, multi-segment ad / promo / explainer, image edit (object swap, angle change, state change), product photoshoot, or video upscale via QuickDesign.
Use only when the user explicitly asks for a TestDino audit of Playwright automated test code. Routes through the audit tools the TestDino MCP server exposes (get_audit_report + submit_audit_report, or the legacy test_audit). For generic code review or non-Playwright targets, do a normal review instead.
Use when the user wants to check TestDino connection status, validate their PAT, discover available organizations and projects, or find the right projectId. Always call this first when the project context is ambiguous before any other TestDino tool.
Use when the user wants to manage a manual execution run or update case-level results inside a run — listing runs, creating runs for a release, inspecting a run, assigning cases, or marking case results (passed/failed/blocked/skipped/retest/untested). Accepts counter-style IDs like RUN-12 and TC-156.
Use when the user wants to create, update, or browse manual QA test cases and suites in TestDino — not execution runs. Covers list_manual_test_suites, list_manual_test_cases, get_manual_test_case, create_manual_test_case, update_manual_test_case, create_manual_test_suite.
Use when the user wants to browse, inspect, create, or update releases/milestones in a TestDino project. Covers list_releases, get_release, create_release, and update_release. Accepts counter-style IDs like MS-12.
Use when the user wants to inspect automated test runs, list failed or flaky tests, debug a failing testcase with historical context, or filter runs by branch, commit, author, environment, browser, status, or tags. Includes list_testruns, get_run_details, list_testcase, get_testcase_details, and debug_testcase.