[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M718D45XNPBV254AG3564NXQ":3,"skill-same:01M718D45XNPBV254AG3564NXQ":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":6,"updatedAt":63,"install":64,"resources":77},"01M718D45XNPBV254AG3564NXQ","tres-cost-basis",null,"Manage cost basis calculation in TRES Finance: check status, view\u002Fchange strategy (FIFO, LIFO, AVG, MAX_GAINS, MAX_LOSSES, FIFO_IMPAIRMENT), trigger recalculation, review financial issues, manage reevaluations\u002Fimpairments, set bulk fiat prices, configure spec-ID lot disposal rules, view per-asset cost basis results, and export cost basis reports. Trigger this skill whenever the user asks about cost basis, gains\u002Flosses, realized gains, unrealized gains, COGS, inventory lots, tax lots, cost basis strategy, reevaluation, impairment, fiat value override, spec-ID rules, financial issues (negative balance, missing fiat), or anything related to how their crypto assets are costed. Also trigger when the user says \"calculate cost basis\", \"what is my cost basis strategy\", \"show me financial issues\", \"create a reevaluation\", \"run cost basis\", \"change strategy to LIFO\", or similar.","anthropics\u002Fclaude-plugins-community","anthropics","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76263028?v=4","01M697XGDPXJAVQ8391V2BCYTE","Anthropic","01M718C1RS4JJFM9KNJMTCAYJG",4874,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-cost-basis\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000040","财务","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"tres cost basis","cost","me","change","create","reports","review","Connector","calculation","show me","configure","when","MCP","fiat","issues","inventory","prices","show","bulk","SET","2026-11-10 10:12:30",false,"---\nname: tres-cost-basis\ndescription: >\n  Manage cost basis calculation in TRES Finance: check status, view\u002Fchange strategy\n  (FIFO, LIFO, AVG, MAX_GAINS, MAX_LOSSES, FIFO_IMPAIRMENT), trigger recalculation,\n  review financial issues, manage reevaluations\u002Fimpairments, set bulk fiat prices,\n  configure spec-ID lot disposal rules, view per-asset cost basis results, and\n  export cost basis reports. Trigger this skill whenever the user asks about cost basis,\n  gains\u002Flosses, realized gains, unrealized gains, COGS, inventory lots, tax lots,\n  cost basis strategy, reevaluation, impairment, fiat value override, spec-ID rules,\n  financial issues (negative balance, missing fiat), or anything related to how\n  their crypto assets are costed. Also trigger when the user says \"calculate cost basis\",\n  \"what is my cost basis strategy\", \"show me financial issues\", \"create a reevaluation\",\n  \"run cost basis\", \"change strategy to LIFO\", or similar.\ncompatibility: \"Requires TRES Finance MCP connector\"\n---\n\n# TRES Finance — Cost Basis Management\n\nEnd-to-end skill for managing cost basis calculation, strategy configuration,\nreevaluations, financial issue review, and related operations in TRES Finance.\n\n---\n\n## MCP Server\n\nAll calls use the `user-tres-finance` MCP server (the TRES Finance MCP connector).\n\nAll variable keys and nested input fields MUST use **camelCase** (e.g. `assetClassId`, not `asset_class_id`).\n\n---\n\n## Step 1 — Authenticate and confirm org\n\nCall `get_viewer` with no arguments. Confirm the org name with the user if there\nis any ambiguity.\n\n---\n\n## Step 2 — Ensure a cost basis strategy is defined (gate before calculation)\n\nBefore any cost basis calculation can run, the organization must have a strategy\ndefined. This step is a **prerequisite gate** — run it automatically whenever the\nuser wants to calculate cost basis (Section D), or when they first ask for help\nwith cost basis.\n\n1. Fetch the current strategy using the query in Section B.\n2. If `defaultStrategy` is returned (any valid value like FIFO, LIFO, etc.),\n   the strategy is already set — **skip ahead** and inform the user:\n   > \"Your cost basis strategy is set to [STRATEGY]. Proceeding.\"\n3. If no strategy is configured (the query returns null or an error), present\n   the user with all available methods and ask them to choose:\n\n   > \"Before calculating cost basis, you need to choose a costing method.\n   > Here are the available strategies:\n   >\n   > 1. **FIFO** — First-in, first-out. Earliest acquired lots are disposed first. The most common method.\n   > 2. **LIFO** — Last-in, first-out. Most recently acquired lots are disposed first.\n   > 3. **AVG** — Weighted average cost across all lots.\n   > 4. **MAX_GAINS** — Disposes lowest-cost lots first, maximizing realized gains.\n   > 5. **MAX_LOSSES** — Disposes highest-cost lots first, maximizing realized losses (useful for tax-loss harvesting).\n   > 6. **FIFO_IMPAIRMENT** — FIFO with impairment accounting support (for orgs using impairment write-downs).\n   >\n   > Which method would you like to use?\"\n\n4. Once the user picks a strategy, set it using the mutation in Section C\n   (with an empty `strategyPeriods` array if they just want a single default).\n5. Then proceed to the requested operation (typically Section D — trigger calculation).\n\nThis gate ensures no calculation runs without an explicit strategy choice.\n\n---\n\n## Step 3 — Run cost basis calculation\n\nAfter confirming strategy, check the current calculation status (Section A) and\noffer to run or re-run the calculation:\n\n1. Fetch status using the query in Section A.\n2. If `status` is `IN_PROGRESS`, inform the user it's already running and offer\n   to wait:\n   > \"Cost basis calculation is currently in progress (started at [time]). Would you like me to wait for it to finish?\"\n3. If `status` is `DONE`, show when it last ran and ask:\n   > \"Cost basis was last calculated on [lastFinishedAt]. Would you like to\n   > recalculate now, or view the existing results?\"\n4. If `status` is `ITEM_NOT_FOUND`, this org has never calculated — proceed\n   directly to trigger.\n5. When the user confirms (or on first-time run), trigger the calculation\n   using the mutation in Section D.\n6. **Poll status** every ~10 seconds until `status = \"DONE\"`.\n7. Once done, automatically proceed to show results per asset (Section E)\n   and financial issues (Section F).\n\nThis step ensures the user always has fresh results and understands the\ncalculation state before viewing data.\n\n---\n\n## Available operations\n\nBased on the user's request, follow the appropriate section below.\nMany users will come in with a general question like \"help me with cost basis\" —\nin that case, run Steps 1–3 (authenticate, check strategy, run calculation),\nthen show results.\n\n---\n\n## A. Check cost basis calculation status\n\nUse this when the user asks whether cost basis is running, done, or when it last ran.\n\n```graphql\nquery CostBasisGetStatus {\n  costBasisGetStatus {\n    status\n    firstStartedAt\n    lastFinishedAt\n    updatedAt\n  }\n}\n```\n\n`status` values: `DONE`, `IN_PROGRESS`, `ITEM_NOT_FOUND` (never calculated).\n\nReport the status clearly. If `IN_PROGRESS`, let the user know it's still running\nand they should wait. If `DONE`, report when it last finished.\n\n---\n\n## B. View current cost basis strategy\n\nFetches the default strategy and any date-specific strategy overrides.\n\n```graphql\nquery GetCostBasisStrategyByDate {\n  getCostBasisStrategyByDate {\n    response {\n      strategyPeriods {\n        startDate\n        endDate\n        strategy\n      }\n      defaultStrategy\n    }\n  }\n}\n```\n\nPresent the default strategy and any period overrides clearly. Strategies:\n`FIFO`, `LIFO`, `AVG`, `MAX_GAINS`, `MAX_LOSSES`, `FIFO_IMPAIRMENT`.\n\nExplain what each means if the user asks:\n- **FIFO** — First-in, first-out. Earliest acquired lots are sold first.\n- **LIFO** — Last-in, first-out. Most recently acquired lots are sold first.\n- **AVG** — Weighted average cost across all lots.\n- **MAX_GAINS** — Sells lowest-cost lots first, maximizing realized gains.\n- **MAX_LOSSES** — Sells highest-cost lots first, maximizing realized losses (tax-loss harvesting).\n- **FIFO_IMPAIRMENT** — FIFO with impairment accounting support.\n\n---\n\n## C. Update cost basis strategy\n\nUse when the user wants to change the default strategy or set strategy periods.\n\n**Always confirm with the user before executing** — changing strategy affects all\nfuture cost basis calculations and requires a recalculation.\n\n```graphql\nmutation UpdateCostBasisStrategyByDate(\n  $defaultStrategy: CostBasisStrategy!,\n  $strategyPeriods: [CBStrategyPeriodInput]!\n) {\n  updateCostBasisStrategyByDate(\n    defaultStrategy: $defaultStrategy,\n    strategyPeriods: $strategyPeriods\n  ) {\n    success\n    message\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"defaultStrategy\": \"FIFO\",\n  \"strategyPeriods\": [\n    {\n      \"startDate\": \"2024-01-01T00:00:00Z\",\n      \"endDate\": \"2024-12-31T23:59:59Z\",\n      \"strategy\": \"LIFO\"\n    }\n  ]\n}\n```\n\n`CostBasisStrategy` enum values: `FIFO`, `FIFO_IMPAIRMENT`, `LIFO`, `AVG`, `MAX_GAINS`, `MAX_LOSSES`.\n\nIf updating to a period-based config, first fetch the existing periods (Section B)\nso you don't accidentally overwrite them — the mutation replaces ALL periods.\n\nAfter a successful strategy change, ask the user if they want to trigger a\ncost basis recalculation (Section D).\n\n---\n\n## D. Trigger cost basis calculation\n\n**Prerequisite**: Before triggering, run **Step 2** (strategy gate) to ensure a\nstrategy is defined. If none is set, the user must choose one first.\n\nStarts (or restarts) the cost basis calculation. Can target specific assets or\nrecalculate everything.\n\n```graphql\nmutation TriggerCostBasis($assetClassIds: [Int]) {\n  triggerCostBasis(assetClassIds: $assetClassIds) {\n    success\n  }\n}\n```\n\n- To recalculate **everything**: pass `assetClassIds: null` (or omit it).\n- To recalculate **specific assets**: pass an array of asset class IDs, e.g. `[42, 88]`.\n\nTo find asset class IDs, query `assetBalance` or `assetClass` first:\n```graphql\nquery AssetClasses($limit: Int) {\n  assetClass(limit: $limit) {\n    results { id symbol name }\n  }\n}\n```\n\n### After triggering — poll until completion\n\nAfter a successful trigger (`success: true`), **poll the status** using the\nquery from Section A. The calculation typically takes 10–60 seconds for small\norgs but can take minutes for large ones.\n\n```\n1. Trigger → success: true\n2. Poll costBasisGetStatus every ~10 seconds\n3. When status = \"DONE\" → proceed to show results (Section E)\n```\n\nDo NOT present results or offer report downloads until status is `DONE`.\nWhile `IN_PROGRESS`, show a brief wait message to the user.\n\n---\n\n## E. View cost basis results per asset\n\nShows the cost basis breakdown per asset-wallet pair — total cost, realized\ngains, COGS, running inventory, and more.\n\n**Important**: Use the `assetBalance` query (NOT `organizationBalance`). The\n`assetBalance` query returns per-wallet asset rows, each with a nested\n`costBasis` field from `FifoCostBasisQuery`.\n\n```graphql\nquery AssetBalanceWithCostBasis($limit: Int, $offset: Int) {\n  assetBalance(limit: $limit, offset: $offset) {\n    totalCount\n    results {\n      asset {\n        symbol\n        name\n      }\n      belongsTo {\n        name\n      }\n      calculatedBalance\n      assetFifoCostBasis\n      totalProfitLoss\n      costBasis {\n        costBasis\n        totalRealizedGains\n        totalShortTermRealizedGains\n        totalLongTermRealizedGains\n        totalCost\n        totalRunningInventoryQuantity\n        cogs\n        proceeds\n        runningBalance\n      }\n    }\n  }\n}\n```\n\nVariables: `{\"limit\": 50, \"offset\": 0}`\n\nPaginate if `totalCount` > 50 — increment `offset` by 50 and fetch again until\nall results are retrieved.\n\n### Key fields explained\n\n- `assetFifoCostBasis` — The total cost basis for this asset-wallet pair (top-level shortcut).\n- `totalProfitLoss` — Total realized P&L (top-level shortcut).\n- `costBasis` — Nested object with full detail (null if not calculated):\n  - `costBasis` \u002F `totalCost` — Total cost of current inventory.\n  - `totalRealizedGains` — Net realized gains\u002Flosses.\n  - `totalShortTermRealizedGains` \u002F `totalLongTermRealizedGains` — Split by holding period.\n  - `cogs` — Cost of goods sold for disposals.\n  - `proceeds` — Total proceeds from disposals.\n  - `totalRunningInventoryQuantity` — Current inventory quantity.\n  - `runningBalance` — Running token balance.\n\n### Presenting results — the full picture\n\nAfter fetching all pages, split the results into two groups:\n\n**Group 1 — Assets with cost basis data** (`costBasis` is not null):\nPresent as a table sorted by absolute realized P&L descending, with columns:\nAsset, Wallet, Holdings, Cost Basis ($), Realized P&L ($).\nUse color coding: green\u002F+ for gains, red\u002F- for losses.\n\n**Group 2 — Assets without cost basis** (`costBasis` is null AND `calculatedBalance` != 0):\nThese are assets where cost basis was NOT calculated — usually because of missing\nfiat values, no transactions, or unverified\u002Fspam assets. Present them separately\nunder a clear heading like:\n\n> **Assets without cost basis data:**\n> The following assets have balances but no cost basis calculated. This typically\n> means they have missing fiat prices that need to be resolved before cost basis\n> can be computed.\n\nShow: Asset, Wallet, Holdings, and a note about likely cause (spam token, NFT,\nmissing fiat, etc.).\n\n**Always show both groups** so the user sees the complete picture. If Group 2\ncontains any non-trivial assets (not spam\u002Fvirtual), also run the financial\nissues query (Section F) filtered to HIGH severity to check for `missing_fiat`\nissues, and report them alongside.\n\nWhen missing fiat issues are found, **automatically look up historical prices**\nusing the pricing query (Section G.1) for each affected asset at the transaction\ntimestamp. Present the looked-up prices to the user and offer to apply them\nusing bulk fiat edit (Section G.2).\n\n**Recommended**: Generate an HTML dashboard file with styled tables for both\ngroups plus a financial issues summary. Save it to the outputs folder and\nshare the link with the user.\n\nUse standard number formatting:\n- Fiat values >= $1M: \"$X.XXXM\", >= $1K: \"$X.XXK\", else \"$X.XX\"\n- Positive gains: \"+\" prefix, negative: \"-\" prefix\n\n---\n\n## F. View financial issues\n\nFinancial issues are problems detected during cost basis calculation — negative\nbalances, missing fiat values, circular transfers, etc.\n\n```graphql\nquery FinancialIssues($limit: Int, $offset: Int, $severity: String) {\n  financialIssue(limit: $limit, offset: $offset, severity: $severity) {\n    totalCount\n    results {\n      id\n      type\n      severity\n      message\n      balanceImpact\n      assetClass {\n        id\n        symbol\n        name\n      }\n      assetClassId\n      internalAccount {\n        name\n      }\n      internalAccountId\n      tx {\n        identifier\n        timestamp\n      }\n      subTx {\n        id\n        amount\n      }\n    }\n  }\n}\n```\n\n### Filter options\n\n**Important**: Filter values must be **lowercase** — the API uses DB-stored values.\n\n- `severity`: `\"high\"`, `\"medium\"`, `\"low\"`\n- Do **NOT** filter by `type` directly in the query — instead, fetch all issues\n  and filter\u002Fgroup in the presentation. The `type` filter uses internal DB values\n  that may not match the display names.\n\n### Actual issue types returned\n\nThe `type` field returns lowercase strings like:\n- `missing_fiat` — Sub-transaction has no fiat price. Affects cost basis accuracy.\n  Can be resolved with bulk fiat edit (Section G).\n- `negative_balance` — Inventory went below zero (more sold than acquired). Usually\n  means missing inflow transactions.\n- `result_was_rounded` — Minor rounding occurred during calculation. Low severity.\n- `ignored` — Sub-transaction was skipped (e.g. internal transfer to same account).\n- `no_opposite_tx` — Internal transfer has no matching counterpart.\n- `circular_internal_sbxs` — Circular dependency in internal transfer matching.\n\nGroup results by severity and present HIGH issues first. The most common pattern\nis a handful of HIGH severity `missing_fiat` issues plus many LOW severity\n`result_was_rounded` issues — summarize the LOW ones as a count rather than\nlisting each individually.\n\n---\n\n## G. Fix missing fiat values\n\nThis is a two-part flow: first look up historical prices, then apply them.\n\n### G.1 — Look up historical token prices\n\nUse the TRES MCP pricing queries to fetch historical prices for tokens with\nmissing fiat values. This uses the platform's pricing engine which aggregates\nfrom CoinGecko, CoinMarketCap, exchanges, and other sources.\n\n**For a single asset at a specific timestamp:**\n\n```graphql\nquery GetStatelessPricing(\n  $platform: Platform!,\n  $assetIdentifier: String!,\n  $currencies: [Currency]!,\n  $timestamp: DateTime\n) {\n  getStatelessPricing(\n    platform: $platform,\n    assetIdentifier: $assetIdentifier,\n    currencies: $currencies,\n    timestamp: $timestamp\n  ) {\n    prices\n    assetClassId\n    symbol\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"platform\": \"ETHEREUM\",\n  \"assetIdentifier\": \"0x...contractAddress\",\n  \"currencies\": [\"USD\"],\n  \"timestamp\": \"2020-11-24T09:01:26Z\"\n}\n```\n\n**For multiple assets at once (by asset class ID):**\n\n```graphql\nquery GetBatchPricing($requests: [GetBatchPricesByAssetClassRequest]!) {\n  getBatchStatelessPricingByAssetClass(requests: $requests) {\n    prices\n    assetClassId\n    symbol\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"requests\": [\n    {\n      \"assetClass\": \"4272\",\n      \"currencies\": [\"USD\"],\n      \"timestamp\": \"2018-06-18T19:13:45Z\"\n    },\n    {\n      \"assetClass\": \"4272\",\n      \"currencies\": [\"USD\"],\n      \"timestamp\": \"2020-11-24T09:01:26Z\"\n    },\n    {\n      \"assetClass\": \"9082\",\n      \"currencies\": [\"USD\"],\n      \"timestamp\": \"2020-11-27T20:06:54Z\"\n    }\n  ]\n}\n```\n\nThe `prices` field returns a JSON object like `{\"usd\": 0.015}`.\n\n**How to use this in the missing fiat flow:**\n\n1. From the financial issues (Section F), collect each `missing_fiat` issue's\n   `assetClass.id` and `tx.timestamp`.\n2. Call `getBatchStatelessPricingByAssetClass` with one request per issue.\n3. Present the results to the user:\n   > \"I found historical prices for the missing fiat transactions:\n   > - CHSB on 2018-06-18: $0.015 per token\n   > - CHSB on 2020-11-24: $0.085 per token\n   > - vBUSD on 2020-11-27: $0.021 per token\n   >\n   > Would you like me to apply these prices?\"\n4. If the user confirms, apply them using Section G.2 (bulk fiat edit).\n\n**Pricing sources to try**: If the default source returns empty, try these\n`apiSource` values in order: `COINMARKETCAP`, `CRYPTO_COMPARE`, `REGULAR_FLOW`,\n`COINBASE`, `BINANCE`, `KRAKEN`. Pass the `apiSource` field in the request:\n\n```json\n{\n  \"requests\": [\n    { \"assetClass\": \"4272\", \"currencies\": [\"USD\"], \"timestamp\": \"2020-11-24T09:01:26Z\", \"apiSource\": \"COINMARKETCAP\" }\n  ]\n}\n```\n\n**Important**: The pricing query returns `prices: {}` (empty object) when no\nprice data is available — this is common for obscure, delisted, or DeFi-wrapped\ntokens. Try multiple sources before giving up.\n\nIf ALL pricing sources return empty for a token, inform the user and ask them\nto provide a manual price. Suggest approximate values if you know the token\n(e.g. BUSD-pegged tokens ≈ $1.00).\n\n### G.2 — Bulk fiat value edit\n\nOverride fiat unit prices for an asset across a date range. Useful for fixing\nMISSING_FIAT issues or correcting OTC prices.\n\n**Always confirm parameters with the user before executing** — this writes\nfiat values to potentially many sub-transactions.\n\n```graphql\nmutation BulkFiatEdit(\n  $assetClassId: Int!,\n  $currency: Currency!,\n  $startDate: Date!,\n  $endDate: Date!,\n  $unitPrice: Float!,\n  $updateExistingFiat: Boolean\n) {\n  bulkFiatEdit(\n    assetClassId: $assetClassId,\n    currency: $currency,\n    startDate: $startDate,\n    endDate: $endDate,\n    unitPrice: $unitPrice,\n    updateExistingFiat: $updateExistingFiat\n  ) {\n    success\n    message\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"assetClassId\": 42,\n  \"currency\": \"USD\",\n  \"startDate\": \"2024-01-01\",\n  \"endDate\": \"2024-01-31\",\n  \"unitPrice\": 1.0,\n  \"updateExistingFiat\": false\n}\n```\n\n- `updateExistingFiat: false` (default) — only fills in missing fiat values.\n- `updateExistingFiat: true` — overwrites all fiat values in the range.\n\nTo find the `assetClassId`, query `assetClass` by symbol first.\n\nWhen applying prices from G.1, use the looked-up unit price and set the date\nrange tightly around the transaction date (same day for `startDate` and `endDate`)\nto avoid overwriting prices on other transactions.\n\nAfter bulk fiat edits, suggest the user trigger a cost basis recalculation (Section D).\n\n---\n\n## H. Reevaluations and impairments\n\nReevaluations adjust the fair market value (FMV) of inventory lots at a specific\npoint in time. Impairments are a special case where the FMV drops below cost.\n\n### H.1 — List reevaluations\n\n```graphql\nquery GetReevaluations($limit: Int, $offset: Int, $assetClassId_In: [ID]) {\n  reevaluation(\n    limit: $limit,\n    offset: $offset,\n    assetClassId_In: $assetClassId_In,\n    ordering: \"-timestamp\"\n  ) {\n    totalCount\n    results {\n      id\n      timestamp\n      unitPrice\n      currency\n      isImpairment\n      assetClass {\n        id\n        symbol\n      }\n      appliedCostBasis {\n        id\n        totalCost\n        revaluedCostAdjustment\n        internalAccount {\n          id\n          name\n        }\n      }\n    }\n  }\n}\n```\n\n### H.2 — Create reevaluation\n\n**Always confirm with the user before executing.**\n\n```graphql\nmutation CreateReevaluation($reevaluations: [ReevaluationObjectType]!) {\n  createReevaluation(reevaluations: $reevaluations) {\n    reevaluationIds\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"reevaluations\": [\n    {\n      \"unitPrice\": \"45000.00\",\n      \"timestamp\": \"2024-12-31T23:59:59Z\",\n      \"assetClassId\": 1,\n      \"currency\": \"USD\",\n      \"isImpairment\": false\n    }\n  ]\n}\n```\n\n- `isImpairment: false` — standard reevaluation (mark-to-market).\n- `isImpairment: true` — impairment write-down.\n\nCreating a reevaluation also creates a manual transaction to represent the\nadjustment in the ledger. Inform the user of this side effect.\n\nAfter creating, suggest triggering cost basis recalculation (Section D).\n\n### H.3 — Update reevaluation\n\n```graphql\nmutation UpdateReevaluation(\n  $reevaluationId: Int!,\n  $unitPrice: Decimal!,\n  $timestamp: DateTime!,\n  $assetClassId: Int!,\n  $currency: Currency!\n) {\n  updateReevaluation(\n    reevaluationId: $reevaluationId,\n    unitPrice: $unitPrice,\n    timestamp: $timestamp,\n    assetClassId: $assetClassId,\n    currency: $currency\n  ) {\n    status\n  }\n}\n```\n\n### H.4 — Delete reevaluation\n\n```graphql\nmutation DeleteReevaluation($reevaluationId: Int!) {\n  deleteReevaluation(reevaluationId: $reevaluationId) {\n    status\n  }\n}\n```\n\nDeleting also removes the associated manual transaction from the ledger.\n\n---\n\n## I. Spec-ID rules (specific lot disposal)\n\nSpec-ID rules let the user specify exactly which acquisition lot to use when\ndisposing of an asset — overriding the default strategy (e.g. FIFO) for\nspecific transactions.\n\n### I.1 — View spec-ID rules\n\n```graphql\nquery CostBasisSpecIdRules(\n  $limit: Int,\n  $offset: Int,\n  $outflowSubTransaction_In: [String]\n) {\n  costBasisSpecIdRule(\n    limit: $limit,\n    offset: $offset,\n    outflowSubTransaction_In: $outflowSubTransaction_In\n  ) {\n    totalCount\n    results {\n      id\n      outflowSubTransaction {\n        id\n        amount\n        timestamp\n        asset { symbol }\n        belongsTo { name }\n      }\n      disposedLotSubTransaction {\n        id\n        amount\n        timestamp\n      }\n      amountToDispose\n      priority\n    }\n  }\n}\n```\n\n### I.2 — Set spec-ID rules\n\n**Always confirm with the user before executing.** This replaces all existing\nrules for the given outflow sub-transaction.\n\n```graphql\nmutation SetSpecIdRules(\n  $subTransactionId: ID!,\n  $specIdRules: [SpecIdRuleInput]!\n) {\n  setSpecIdRules(\n    subTransactionId: $subTransactionId,\n    specIdRules: $specIdRules\n  ) {\n    success\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"subTransactionId\": \"12345\",\n  \"specIdRules\": [\n    {\n      \"disposedLotSubTransactionId\": \"67890\",\n      \"amount\": 1.5,\n      \"priority\": 1\n    },\n    {\n      \"disposedLotSubTransactionId\": \"67891\",\n      \"amount\": 0.5,\n      \"priority\": 2\n    }\n  ]\n}\n```\n\n- `subTransactionId` — the outflow (disposal) sub-transaction\n- `disposedLotSubTransactionId` — the inflow (acquisition) sub-transaction to use as the cost lot\n- `amount` — how much of that lot to dispose\n- `priority` — processing order (1 = first)\n\nAfter setting rules, suggest triggering cost basis recalculation (Section D).\n\n### I.3 — Delete spec-ID rules\n\n```graphql\nmutation DeleteSpecIdRules($subTransactionId: ID!) {\n  deleteSpecIdRules(subTransactionId: $subTransactionId) {\n    success\n  }\n}\n```\n\n---\n\n## J. Full inventory configuration\n\nBy default, TRES trims old inventory lots to reduce storage. For specific\ntransactions where the user needs the complete inventory queue visible, toggle\nfull inventory saving.\n\n```graphql\nmutation SetFullCostBasisInventoryConfiguration(\n  $subTransactionId: ID,\n  $enableFullInventory: Boolean\n) {\n  setFullCostBasisInventoryConfiguration(\n    subTransactionId: $subTransactionId,\n    enableFullInventory: $enableFullInventory\n  ) {\n    success\n  }\n}\n```\n\nThis deletes existing cost basis records for the affected asset and triggers\na recalculation automatically.\n\n---\n\n## K. Export cost basis reports\n\nTRES offers several cost basis report types. Use the `availableReportTypes` query\nto find available exports, then trigger via `organizationBalance`:\n\n```graphql\nquery AvailableReports {\n  availableReportTypes {\n    name\n    exportType\n    entitiesType\n    llmDescription\n  }\n}\n```\n\nCost-basis-related report types include:\n- `COST_BASIS_STACK_PER_ACCOUNT` — Inventory lots grouped by wallet\n- `COST_BASIS_STACK_PER_ASSET` — Inventory lots grouped by asset\n- `COST_BASIS_INVENTORY` — Full inventory detail\n- `COST_BASIS_ROLL_FORWARD` — Period-over-period roll forward\n- `REEVALUATION` — Reevaluation records\n\nTo export, use `organizationBalance` with export parameters:\n```graphql\nquery ExportCostBasisReport(\n  $exportName: String,\n  $exportFormat: String,\n  $currency: String,\n  $outputFormat: ReportOutputFormat\n) {\n  organizationBalance(\n    exportName: $exportName,\n    exportFormat: $exportFormat,\n    currency: $currency,\n    outputFormat: $outputFormat\n  ) {\n    totalCount\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"exportName\": \"Cost Basis Stack Per Asset - April 2024\",\n  \"exportFormat\": \"COST_BASIS_STACK_PER_ASSET\",\n  \"currency\": \"usd\",\n  \"outputFormat\": \"XLSX\"\n}\n```\n\nThen poll the `report` query until `status = \"DONE\"` and provide the download link:\n\n```graphql\nquery Reports($limit: Int, $offset: Int) {\n  report(limit: $limit, offset: $offset, ordering: \"-created_at\") {\n    totalCount\n    results {\n      id\n      name\n      status\n      downloadUrl\n      createdAt\n    }\n  }\n}\n```\n\n**Critical**: Do NOT present the download link while status is `IN_PROGRESS` —\nthe file has not been written to S3 yet and the link will return a NoSuchKey\nerror. Poll every ~10 seconds until status = `\"DONE\"`, then present the\n`downloadUrl` to the user.\n\n---\n\n## Guardrails\n\n- **Confirm before writes**: Always confirm with the user before executing any\n  mutation (strategy change, reevaluation, spec-ID rules, bulk fiat edit, trigger calc).\n- **Recalculation reminder**: After any configuration change (strategy, reevaluation,\n  spec-ID, fiat edit), remind the user that cost basis needs to be recalculated for\n  changes to take effect.\n- **Locked periods**: If a mutation fails with a \"locked period\" error, inform the\n  user that the timestamp falls within a locked accounting period and they may need\n  to unlock it first.\n- **Status check before trigger**: Before triggering a recalculation, check the\n  current status — if already `IN_PROGRESS`, let the user know it's still running.\n\n---\n\n## Limitations — not available via MCP\n\nThe following cost basis features exist in the backend but are NOT exposed through\nthe MCP GraphQL API, so this skill cannot perform them:\n\n1. **Per-wallet reallocation flow** — The two-phase reallocation process\n   (unified inventory -> per-wallet split) is an internal backend operation\n   triggered by org settings, not directly callable via API.\n\n2. **Viewing raw inventory queue details** — The `assetRunningQueueFifo` field\n   is available on `FifoCostBasisQuery` but returns large JSON blobs. The queue\n   data is best viewed through the TRES dashboard or via exported reports\n   (COST_BASIS_STACK_PER_ACCOUNT \u002F COST_BASIS_STACK_PER_ASSET).\n\n3. **Short position \u002F loan queue management** — Short position tracking (loan\n   queue) is configured at the org-settings level and computed automatically.\n   There is no direct API to view or manipulate the loan queue.\n\n4. **Cost basis calculation internals** — The actual calculation engine\n   (CostBasisCalculator, CostBasisManager) runs server-side. We can trigger it\n   and read results, but cannot control the internal calculation flow, caching,\n   or S3 queue persistence.\n\n5. **Internal transfer cost basis mapping** — How cost basis is carried over\n   between wallets in internal transfers is automatic and not configurable\n   per-transaction via the API.\n\nFor any of these, direct the user to the TRES Finance dashboard or suggest\nexporting the relevant cost basis report for offline analysis.\n","# TRES Finance — Cost Basis Management\n\nEnd-to-end skill for managing cost basis calculation, strategy configuration,\nreevaluations, financial issue review, and related operations in TRES Finance.\n\n---\n\n## MCP Server\n\nAll calls use the `user-tres-finance` MCP server (the TRES Finance MCP connector).\n\nAll variable keys and nested input fields MUST use **camelCase** (e.g. `assetClassId`, not `asset_class_id`).\n\n---\n\n## Step 1 — Authenticate and confirm org\n\nCall `get_viewer` with no arguments. Confirm the org name with the user if there\nis any ambiguity.\n\n---\n\n## Step 2 — Ensure a cost basis strategy is defined (gate before calculation)\n\nBefore any cost basis calculation can run, the organization must have a strategy\ndefined. This step is a **prerequisite gate** — run it automatically whenever the\nuser wants to calculate cost basis (Section D), or when they first ask for help\nwith cost basis.\n\n1. Fetch the current strategy using the query in Section B.\n2. If `defaultStrategy` is returned (any valid value like FIFO, LIFO, etc.),\n   the strategy is already set — **skip ahead** and inform the user:\n   > \"Your cost basis strategy is set to [STRATEGY]. Proceeding.\"\n3. If no strategy is configured (the query returns null or an error), present\n   the user with all available methods and ask them to choose:\n\n   > \"Before calculating cost basis, you need to choose a costing method.\n   > Here are the available strategies:\n   >\n   > 1. **FIFO** — First-in, first-out. Earliest acquired lots are disposed first. The most common method.\n   > 2. **LIFO** — Last-in, first-out. Most recently acquired lots are disposed first.\n   > 3. **AVG** — Weighted average cost across all lots.\n   > 4. **MAX_GAINS** — Disposes lowest-cost lots first, maximizing realized gains.\n   > 5. **MAX_LOSSES** — Disposes highest-cost lots first, maximizing realized losses (useful for tax-loss harvesting).\n   > 6. **FIFO_IMPAIRMENT** — FIFO with impairment accounting support (for orgs using impairment write-downs).\n   >\n   > Which method would you like to use?\"\n\n4. Once the user picks a strategy, set it using the mutation in Section C\n   (with an empty `strategyPeriods` array if they just want a single default).\n5. Then proceed to the requested operation (typically Section D — trigger calculation).\n\nThis gate ensures no calculation runs without an explicit strategy choice.\n\n---\n\n## Step 3 — Run cost basis calculation\n\nAfter confirming strategy, check the current calculation status (Section A) and\noffer to run or re-run the calculation:\n\n1. Fetch status using the query in Section A.\n2. If `status` is `IN_PROGRESS`, inform the user it's already running and offer\n   to wait:\n   > \"Cost basis calculation is currently in progress (started at [time]). Would you like me to wait for it to finish?\"\n3. If `status` is `DONE`, show when it last ran and ask:\n   > \"Cost basis was last calculated on [lastFinishedAt]. Would you like to\n   > recalculate now, or view the existing results?\"\n4. If `status` is `ITEM_NOT_FOUND`, this org has never calculated — proceed\n   directly to trigger.\n5. When the user confirms (or on first-time run), trigger the calculation\n   using the mutation in Section D.\n6. **Poll status** every ~10 seconds until `status = \"DONE\"`.\n7. Once done, automatically proceed to show results per asset (Section E)\n   and financial issues (Section F).\n\nThis step ensures the user always has fresh results and understands the\ncalculation state before viewing data.\n\n---\n\n## Available operations\n\nBased on the user's request, follow the appropriate section below.\nMany users will come in with a general question like \"help me with cost basis\" —\nin that case, run Steps 1–3 (authenticate, check strategy, run calculation),\nthen show results.\n\n---\n\n## A. Check cost basis calculation status\n\nUse this when the user asks whether cost basis is running, done, or when it last ran.\n\n```graphql\nquery CostBasisGetStatus {\n  costBasisGetStatus {\n    status\n    firstStartedAt\n    lastFinishedAt\n    updatedAt\n  }\n}\n```\n\n`status` values: `DONE`, `IN_PROGRESS`, `ITEM_NOT_FOUND` (never calculated).\n\nReport the status clearly. If `IN_PROGRESS`, let the user know it's still running\nand they should wait. If `DONE`, report when it last finished.\n\n---\n\n## B. View current cost basis strategy\n\nFetches the default strategy and any date-specific strategy overrides.\n\n```graphql\nquery GetCostBasisStrategyByDate {\n  getCostBasisStrategyByDate {\n    response {\n      strategyPeriods {\n        startDate\n        endDate\n        strategy\n      }\n      defaultStrategy\n    }\n  }\n}\n```\n\nPresent the default strategy and any period overrides clearly. Strategies:\n`FIFO`, `LIFO`, `AVG`, `MAX_GAINS`, `MAX_LOSSES`, `FIFO_IMPAIRMENT`.\n\nExplain what each means if the user asks:\n- **FIFO** — First-in, first-out. Earliest acquired lots are sold first.\n- **LIFO** — Last-in, first-out. Most recently acquired lots are sold first.\n- **AVG** — Weighted average cost across all lots.\n- **MAX_GAINS** — Sells lowest-cost lots first, maximizing realized gains.\n- **MAX_LOSSES** — Sells highest-cost lots first, maximizing realized losses (tax-loss harvesting).\n- **FIFO_IMPAIRMENT** — FIFO with impairment accounting support.\n\n---\n\n## C. Update cost basis strategy\n\nUse when the user wants to change the default strategy or set strategy periods.\n\n**Always confirm with the user before executing** — changing strategy affects all\nfuture cost basis calculations and requires a recalculation.\n\n```graphql\nmutation UpdateCostBasisStrategyByDate(\n  $defaultStrategy: CostBasisStrategy!,\n  $strategyPeriods: [CBStrategyPeriodInput]!\n) {\n  updateCostBasisStrategyByDate(\n    defaultStrategy: $defaultStrategy,\n    strategyPeriods: $strategyPeriods\n  ) {\n    success\n    message\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"defaultStrategy\": \"FIFO\",\n  \"strategyPeriods\": [\n    {\n      \"startDate\": \"2024-01-01T00:00:00Z\",\n      \"endDate\": \"2024-12-31T23:59:59Z\",\n      \"strategy\": \"LIFO\"\n    }\n  ]\n}\n```\n\n`CostBasisStrategy` enum values: `FIFO`, `FIFO_IMPAIRMENT`, `LIFO`, `AVG`, `MAX_GAINS`, `MAX_LOSSES`.\n\nIf updating to a period-based config, first fetch the existing periods (Section B)\nso you don't accidentally overwrite them — the mutation replaces ALL periods.\n\nAfter a successful strategy change, ask the user if they want to trigger a\ncost basis recalculation (Section D).\n\n---\n\n## D. Trigger cost basis calculation\n\n**Prerequisite**: Before triggering, run **Step 2** (strategy gate) to ensure a\nstrategy is defined. If none is set, the user must choose one first.\n\nStarts (or restarts) the cost basis calculation. Can target specific assets or\nrecalculate everything.\n\n```graphql\nmutation TriggerCostBasis($assetClassIds: [Int]) {\n  triggerCostBasis(assetClassIds: $assetClassIds) {\n    success\n  }\n}\n```\n\n- To recalculate **everything**: pass `assetClassIds: null` (or omit it).\n- To recalculate **specific assets**: pass an array of asset class IDs, e.g. `[42, 88]`.\n\nTo find asset class IDs, query `assetBalance` or `assetClass` first:\n```graphql\nquery AssetClasses($limit: Int) {\n  assetClass(limit: $limit) {\n    results { id symbol name }\n  }\n}\n```\n\n### After triggering — poll until completion\n\nAfter a successful trigger (`success: true`), **poll the status** using the\nquery from Section A. The calculation typically takes 10–60 seconds for small\norgs but can take minutes for large ones.\n\n```\n1. Trigger → success: true\n2. Poll costBasisGetStatus every ~10 seconds\n3. When status = \"DONE\" → proceed to show results (Section E)\n```\n\nDo NOT present results or offer report downloads until status is `DONE`.\nWhile `IN_PROGRESS`, show a brief wait message to the user.\n\n---\n\n## E. View cost basis results per asset\n\nShows the cost basis breakdown per asset-wallet pair — total cost, realized\ngains, COGS, running inventory, and more.\n\n**Important**: Use the `assetBalance` query (NOT `organizationBalance`). The\n`assetBalance` query returns per-wallet asset rows, each with a nested\n`costBasis` field from `FifoCostBasisQuery`.\n\n```graphql\nquery AssetBalanceWithCostBasis($limit: Int, $offset: Int) {\n  assetBalance(limit: $limit, offset: $offset) {\n    totalCount\n    results {\n      asset {\n        symbol\n        name\n      }\n      belongsTo {\n        name\n      }\n      calculatedBalance\n      assetFifoCostBasis\n      totalProfitLoss\n      costBasis {\n        costBasis\n        totalRealizedGains\n        totalShortTermRealizedGains\n        totalLongTermRealizedGains\n        totalCost\n        totalRunningInventoryQuantity\n        cogs\n        proceeds\n        runningBalance\n      }\n    }\n  }\n}\n```\n\nVariables: `{\"limit\": 50, \"offset\": 0}`\n\nPaginate if `totalCount` > 50 — increment `offset` by 50 and fetch again until\nall results are retrieved.\n\n### Key fields explained\n\n- `assetFifoCostBasis` — The total cost basis for this asset-wallet pair (top-level shortcut).\n- `totalProfitLoss` — Total realized P&L (top-level shortcut).\n- `costBasis` — Nested object with full detail (null if not calculated):\n  - `costBasis` \u002F `totalCost` — Total cost of current inventory.\n  - `totalRealizedGains` — Net realized gains\u002Flosses.\n  - `totalShortTermRealizedGains` \u002F `totalLongTermRealizedGains` — Split by holding period.\n  - `cogs` — Cost of goods sold for disposals.\n  - `proceeds` — Total proceeds from disposals.\n  - `totalRunningInventoryQuantity` — Current inventory quantity.\n  - `runningBalance` — Running token balance.\n\n### Presenting results — the full picture\n\nAfter fetching all pages, split the results into two groups:\n\n**Group 1 — Assets with cost basis data** (`costBasis` is not null):\nPresent as a table sorted by absolute realized P&L descending, with columns:\nAsset, Wallet, Holdings, Cost Basis ($), Realized P&L ($).\nUse color coding: green\u002F+ for gains, red\u002F- for losses.\n\n**Group 2 — Assets without cost basis** (`costBasis` is null AND `calculatedBalance` != 0):\nThese are assets where cost basis was NOT calculated — usually because of missing\nfiat values, no transactions, or unverified\u002Fspam assets. Present them separately\nunder a clear heading like:\n\n> **Assets without cost basis data:**\n> The following assets have balances but no cost basis calculated. This typically\n> means they have missing fiat prices that need to be resolved before cost basis\n> can be computed.\n\nShow: Asset, Wallet, Holdings, and a note about likely cause (spam token, NFT,\nmissing fiat, etc.).\n\n**Always show both groups** so the user sees the complete picture. If Group 2\ncontains any non-trivial assets (not spam\u002Fvirtual), also run the financial\nissues query (Section F) filtered to HIGH severity to check for `missing_fiat`\nissues, and report them alongside.\n\nWhen missing fiat issues are found, **automatically look up historical prices**\nusing the pricing query (Section G.1) for each affected asset at the transaction\ntimestamp. Present the looked-up prices to the user and offer to apply them\nusing bulk fiat edit (Section G.2).\n\n**Recommended**: Generate an HTML dashboard file with styled tables for both\ngroups plus a financial issues summary. Save it to the outputs folder and\nshare the link with the user.\n\nUse standard number formatting:\n- Fiat values >= $1M: \"$X.XXXM\", >= $1K: \"$X.XXK\", else \"$X.XX\"\n- Positive gains: \"+\" prefix, negative: \"-\" prefix\n\n---\n\n## F. View financial issues\n\nFinancial issues are problems detected during cost basis calculation — negative\nbalances, missing fiat values, circular transfers, etc.\n\n```graphql\nquery FinancialIssues($limit: Int, $offset: Int, $severity: String) {\n  financialIssue(limit: $limit, offset: $offset, severity: $severity) {\n    totalCount\n    results {\n      id\n      type\n      severity\n      message\n      balanceImpact\n      assetClass {\n        id\n        symbol\n        name\n      }\n      assetClassId\n      internalAccount {\n        name\n      }\n      internalAccountId\n      tx {\n        identifier\n        timestamp\n      }\n      subTx {\n        id\n        amount\n      }\n    }\n  }\n}\n```\n\n### Filter options\n\n**Important**: Filter values must be **lowercase** — the API uses DB-stored values.\n\n- `severity`: `\"high\"`, `\"medium\"`, `\"low\"`\n- Do **NOT** filter by `type` directly in the query — instead, fetch all issues\n  and filter\u002Fgroup in the presentation. The `type` filter uses internal DB values\n  that may not match the display names.\n\n### Actual issue types returned\n\nThe `type` field returns lowercase strings like:\n- `missing_fiat` — Sub-transaction has no fiat price. Affects cost basis accuracy.\n  Can be resolved with bulk fiat edit (Section G).\n- `negative_balance` — Inventory went below zero (more sold than acquired). Usually\n  means missing inflow transactions.\n- `result_was_rounded` — Minor rounding occurred during calculation. Low severity.\n- `ignored` — Sub-transaction was skipped (e.g. internal transfer to same account).\n- `no_opposite_tx` — Internal transfer has no matching counterpart.\n- `circular_internal_sbxs` — Circular dependency in internal transfer matching.\n\nGroup results by severity and present HIGH issues first. The most common pattern\nis a handful of HIGH severity `missing_fiat` issues plus many LOW severity\n`result_was_rounded` issues — summarize the LOW ones as a count rather than\nlisting each individually.\n\n---\n\n## G. Fix missing fiat values\n\nThis is a two-part flow: first look up historical prices, then apply them.\n\n### G.1 — Look up historical token prices\n\nUse the TRES MCP pricing queries to fetch historical prices for tokens with\nmissing fiat values. This uses the platform's pricing engine which aggregates\nfrom CoinGecko, CoinMarketCap, exchanges, and other sources.\n\n**For a single asset at a specific timestamp:**\n\n```graphql\nquery GetStatelessPricing(\n  $platform: Platform!,\n  $assetIdentifier: String!,\n  $currencies: [Currency]!,\n  $timestamp: DateTime\n) {\n  getStatelessPricing(\n    platform: $platform,\n    assetIdentifier: $assetIdentifier,\n    currencies: $currencies,\n    timestamp: $timestamp\n  ) {\n    prices\n    assetClassId\n    symbol\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"platform\": \"ETHEREUM\",\n  \"assetIdentifier\": \"0x...contractAddress\",\n  \"currencies\": [\"USD\"],\n  \"timestamp\": \"2020-11-24T09:01:26Z\"\n}\n```\n\n**For multiple assets at once (by asset class ID):**\n\n```graphql\nquery GetBatchPricing($requests: [GetBatchPricesByAssetClassRequest]!) {\n  getBatchStatelessPricingByAssetClass(requests: $requests) {\n    prices\n    assetClassId\n    symbol\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"requests\": [\n    {\n      \"assetClass\": \"4272\",\n      \"currencies\": [\"USD\"],\n      \"timestamp\": \"2018-06-18T19:13:45Z\"\n    },\n    {\n      \"assetClass\": \"4272\",\n      \"currencies\": [\"USD\"],\n      \"timestamp\": \"2020-11-24T09:01:26Z\"\n    },\n    {\n      \"assetClass\": \"9082\",\n      \"currencies\": [\"USD\"],\n      \"timestamp\": \"2020-11-27T20:06:54Z\"\n    }\n  ]\n}\n```\n\nThe `prices` field returns a JSON object like `{\"usd\": 0.015}`.\n\n**How to use this in the missing fiat flow:**\n\n1. From the financial issues (Section F), collect each `missing_fiat` issue's\n   `assetClass.id` and `tx.timestamp`.\n2. Call `getBatchStatelessPricingByAssetClass` with one request per issue.\n3. Present the results to the user:\n   > \"I found historical prices for the missing fiat transactions:\n   > - CHSB on 2018-06-18: $0.015 per token\n   > - CHSB on 2020-11-24: $0.085 per token\n   > - vBUSD on 2020-11-27: $0.021 per token\n   >\n   > Would you like me to apply these prices?\"\n4. If the user confirms, apply them using Section G.2 (bulk fiat edit).\n\n**Pricing sources to try**: If the default source returns empty, try these\n`apiSource` values in order: `COINMARKETCAP`, `CRYPTO_COMPARE`, `REGULAR_FLOW`,\n`COINBASE`, `BINANCE`, `KRAKEN`. Pass the `apiSource` field in the request:\n\n```json\n{\n  \"requests\": [\n    { \"assetClass\": \"4272\", \"currencies\": [\"USD\"], \"timestamp\": \"2020-11-24T09:01:26Z\", \"apiSource\": \"COINMARKETCAP\" }\n  ]\n}\n```\n\n**Important**: The pricing query returns `prices: {}` (empty object) when no\nprice data is available — this is common for obscure, delisted, or DeFi-wrapped\ntokens. Try multiple sources before giving up.\n\nIf ALL pricing sources return empty for a token, inform the user and ask them\nto provide a manual price. Suggest approximate values if you know the token\n(e.g. BUSD-pegged tokens ≈ $1.00).\n\n### G.2 — Bulk fiat value edit\n\nOverride fiat unit prices for an asset across a date range. Useful for fixing\nMISSING_FIAT issues or correcting OTC prices.\n\n**Always confirm parameters with the user before executing** — this writes\nfiat values to potentially many sub-transactions.\n\n```graphql\nmutation BulkFiatEdit(\n  $assetClassId: Int!,\n  $currency: Currency!,\n  $startDate: Date!,\n  $endDate: Date!,\n  $unitPrice: Float!,\n  $updateExistingFiat: Boolean\n) {\n  bulkFiatEdit(\n    assetClassId: $assetClassId,\n    currency: $currency,\n    startDate: $startDate,\n    endDate: $endDate,\n    unitPrice: $unitPrice,\n    updateExistingFiat: $updateExistingFiat\n  ) {\n    success\n    message\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"assetClassId\": 42,\n  \"currency\": \"USD\",\n  \"startDate\": \"2024-01-01\",\n  \"endDate\": \"2024-01-31\",\n  \"unitPrice\": 1.0,\n  \"updateExistingFiat\": false\n}\n```\n\n- `updateExistingFiat: false` (default) — only fills in missing fiat values.\n- `updateExistingFiat: true` — overwrites all fiat values in the range.\n\nTo find the `assetClassId`, query `assetClass` by symbol first.\n\nWhen applying prices from G.1, use the looked-up unit price and set the date\nrange tightly around the transaction date (same day for `startDate` and `endDate`)\nto avoid overwriting prices on other transactions.\n\nAfter bulk fiat edits, suggest the user trigger a cost basis recalculation (Section D).\n\n---\n\n## H. Reevaluations and impairments\n\nReevaluations adjust the fair market value (FMV) of inventory lots at a specific\npoint in time. Impairments are a special case where the FMV drops below cost.\n\n### H.1 — List reevaluations\n\n```graphql\nquery GetReevaluations($limit: Int, $offset: Int, $assetClassId_In: [ID]) {\n  reevaluation(\n    limit: $limit,\n    offset: $offset,\n    assetClassId_In: $assetClassId_In,\n    ordering: \"-timestamp\"\n  ) {\n    totalCount\n    results {\n      id\n      timestamp\n      unitPrice\n      currency\n      isImpairment\n      assetClass {\n        id\n        symbol\n      }\n      appliedCostBasis {\n        id\n        totalCost\n        revaluedCostAdjustment\n        internalAccount {\n          id\n          name\n        }\n      }\n    }\n  }\n}\n```\n\n### H.2 — Create reevaluation\n\n**Always confirm with the user before executing.**\n\n```graphql\nmutation CreateReevaluation($reevaluations: [ReevaluationObjectType]!) {\n  createReevaluation(reevaluations: $reevaluations) {\n    reevaluationIds\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"reevaluations\": [\n    {\n      \"unitPrice\": \"45000.00\",\n      \"timestamp\": \"2024-12-31T23:59:59Z\",\n      \"assetClassId\": 1,\n      \"currency\": \"USD\",\n      \"isImpairment\": false\n    }\n  ]\n}\n```\n\n- `isImpairment: false` — standard reevaluation (mark-to-market).\n- `isImpairment: true` — impairment write-down.\n\nCreating a reevaluation also creates a manual transaction to represent the\nadjustment in the ledger. Inform the user of this side effect.\n\nAfter creating, suggest triggering cost basis recalculation (Section D).\n\n### H.3 — Update reevaluation\n\n```graphql\nmutation UpdateReevaluation(\n  $reevaluationId: Int!,\n  $unitPrice: Decimal!,\n  $timestamp: DateTime!,\n  $assetClassId: Int!,\n  $currency: Currency!\n) {\n  updateReevaluation(\n    reevaluationId: $reevaluationId,\n    unitPrice: $unitPrice,\n    timestamp: $timestamp,\n    assetClassId: $assetClassId,\n    currency: $currency\n  ) {\n    status\n  }\n}\n```\n\n### H.4 — Delete reevaluation\n\n```graphql\nmutation DeleteReevaluation($reevaluationId: Int!) {\n  deleteReevaluation(reevaluationId: $reevaluationId) {\n    status\n  }\n}\n```\n\nDeleting also removes the associated manual transaction from the ledger.\n\n---\n\n## I. Spec-ID rules (specific lot disposal)\n\nSpec-ID rules let the user specify exactly which acquisition lot to use when\ndisposing of an asset — overriding the default strategy (e.g. FIFO) for\nspecific transactions.\n\n### I.1 — View spec-ID rules\n\n```graphql\nquery CostBasisSpecIdRules(\n  $limit: Int,\n  $offset: Int,\n  $outflowSubTransaction_In: [String]\n) {\n  costBasisSpecIdRule(\n    limit: $limit,\n    offset: $offset,\n    outflowSubTransaction_In: $outflowSubTransaction_In\n  ) {\n    totalCount\n    results {\n      id\n      outflowSubTransaction {\n        id\n        amount\n        timestamp\n        asset { symbol }\n        belongsTo { name }\n      }\n      disposedLotSubTransaction {\n        id\n        amount\n        timestamp\n      }\n      amountToDispose\n      priority\n    }\n  }\n}\n```\n\n### I.2 — Set spec-ID rules\n\n**Always confirm with the user before executing.** This replaces all existing\nrules for the given outflow sub-transaction.\n\n```graphql\nmutation SetSpecIdRules(\n  $subTransactionId: ID!,\n  $specIdRules: [SpecIdRuleInput]!\n) {\n  setSpecIdRules(\n    subTransactionId: $subTransactionId,\n    specIdRules: $specIdRules\n  ) {\n    success\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"subTransactionId\": \"12345\",\n  \"specIdRules\": [\n    {\n      \"disposedLotSubTransactionId\": \"67890\",\n      \"amount\": 1.5,\n      \"priority\": 1\n    },\n    {\n      \"disposedLotSubTransactionId\": \"67891\",\n      \"amount\": 0.5,\n      \"priority\": 2\n    }\n  ]\n}\n```\n\n- `subTransactionId` — the outflow (disposal) sub-transaction\n- `disposedLotSubTransactionId` — the inflow (acquisition) sub-transaction to use as the cost lot\n- `amount` — how much of that lot to dispose\n- `priority` — processing order (1 = first)\n\nAfter setting rules, suggest triggering cost basis recalculation (Section D).\n\n### I.3 — Delete spec-ID rules\n\n```graphql\nmutation DeleteSpecIdRules($subTransactionId: ID!) {\n  deleteSpecIdRules(subTransactionId: $subTransactionId) {\n    success\n  }\n}\n```\n\n---\n\n## J. Full inventory configuration\n\nBy default, TRES trims old inventory lots to reduce storage. For specific\ntransactions where the user needs the complete inventory queue visible, toggle\nfull inventory saving.\n\n```graphql\nmutation SetFullCostBasisInventoryConfiguration(\n  $subTransactionId: ID,\n  $enableFullInventory: Boolean\n) {\n  setFullCostBasisInventoryConfiguration(\n    subTransactionId: $subTransactionId,\n    enableFullInventory: $enableFullInventory\n  ) {\n    success\n  }\n}\n```\n\nThis deletes existing cost basis records for the affected asset and triggers\na recalculation automatically.\n\n---\n\n## K. Export cost basis reports\n\nTRES offers several cost basis report types. Use the `availableReportTypes` query\nto find available exports, then trigger via `organizationBalance`:\n\n```graphql\nquery AvailableReports {\n  availableReportTypes {\n    name\n    exportType\n    entitiesType\n    llmDescription\n  }\n}\n```\n\nCost-basis-related report types include:\n- `COST_BASIS_STACK_PER_ACCOUNT` — Inventory lots grouped by wallet\n- `COST_BASIS_STACK_PER_ASSET` — Inventory lots grouped by asset\n- `COST_BASIS_INVENTORY` — Full inventory detail\n- `COST_BASIS_ROLL_FORWARD` — Period-over-period roll forward\n- `REEVALUATION` — Reevaluation records\n\nTo export, use `organizationBalance` with export parameters:\n```graphql\nquery ExportCostBasisReport(\n  $exportName: String,\n  $exportFormat: String,\n  $currency: String,\n  $outputFormat: ReportOutputFormat\n) {\n  organizationBalance(\n    exportName: $exportName,\n    exportFormat: $exportFormat,\n    currency: $currency,\n    outputFormat: $outputFormat\n  ) {\n    totalCount\n  }\n}\n```\n\nVariables example:\n```json\n{\n  \"exportName\": \"Cost Basis Stack Per Asset - April 2024\",\n  \"exportFormat\": \"COST_BASIS_STACK_PER_ASSET\",\n  \"currency\": \"usd\",\n  \"outputFormat\": \"XLSX\"\n}\n```\n\nThen poll the `report` query until `status = \"DONE\"` and provide the download link:\n\n```graphql\nquery Reports($limit: Int, $offset: Int) {\n  report(limit: $limit, offset: $offset, ordering: \"-created_at\") {\n    totalCount\n    results {\n      id\n      name\n      status\n      downloadUrl\n      createdAt\n    }\n  }\n}\n```\n\n**Critical**: Do NOT present the download link while status is `IN_PROGRESS` —\nthe file has not been written to S3 yet and the link will return a NoSuchKey\nerror. Poll every ~10 seconds until status = `\"DONE\"`, then present the\n`downloadUrl` to the user.\n\n---\n\n## Guardrails\n\n- **Confirm before writes**: Always confirm with the user before executing any\n  mutation (strategy change, reevaluation, spec-ID rules, bulk fiat edit, trigger calc).\n- **Recalculation reminder**: After any configuration change (strategy, reevaluation,\n  spec-ID, fiat edit), remind the user that cost basis needs to be recalculated for\n  changes to take effect.\n- **Locked periods**: If a mutation fails with a \"locked period\" error, inform the\n  user that the timestamp falls within a locked accounting period and they may need\n  to unlock it first.\n- **Status check before trigger**: Before triggering a recalculation, check the\n  current status — if already `IN_PROGRESS`, let the user know it's still running.\n\n---\n\n## Limitations — not available via MCP\n\nThe following cost basis features exist in the backend but are NOT exposed through\nthe MCP GraphQL API, so this skill cannot perform them:\n\n1. **Per-wallet reallocation flow** — The two-phase reallocation process\n   (unified inventory -> per-wallet split) is an internal backend operation\n   triggered by org settings, not directly callable via API.\n\n2. **Viewing raw inventory queue details** — The `assetRunningQueueFifo` field\n   is available on `FifoCostBasisQuery` but returns large JSON blobs. The queue\n   data is best viewed through the TRES dashboard or via exported reports\n   (COST_BASIS_STACK_PER_ACCOUNT \u002F COST_BASIS_STACK_PER_ASSET).\n\n3. **Short position \u002F loan queue management** — Short position tracking (loan\n   queue) is configured at the org-settings level and computed automatically.\n   There is no direct API to view or manipulate the loan queue.\n\n4. **Cost basis calculation internals** — The actual calculation engine\n   (CostBasisCalculator, CostBasisManager) runs server-side. We can trigger it\n   and read results, but cannot control the internal calculation flow, caching,\n   or S3 queue persistence.\n\n5. **Internal transfer cost basis mapping** — How cost basis is carried over\n   between wallets in internal transfers is automatic and not configurable\n   per-transaction via the API.\n\nFor any of these, direct the user to the TRES Finance dashboard or suggest\nexporting the relevant cost basis report for offline analysis.\n",{"name":5,"description":54,"compatibility":55},"Manage cost basis calculation in TRES Finance: check status, view\u002Fchange strategy (FIFO, LIFO, AVG, MAX_GAINS, MAX_LOSSES, FIFO_IMPAIRMENT), trigger recalculation, review financial issues, manage reevaluations\u002Fimpairments, set bulk fiat prices, configure spec-ID lot disposal rules, view per-asset cost basis results, and export cost basis reports. Trigger this skill whenever the user asks about cost basis, gains\u002Flosses, realized gains, unrealized gains, COGS, inventory lots, tax lots, cost basis strategy, reevaluation, impairment, fiat value override, spec-ID rules, financial issues (negative balance, missing fiat), or anything related to how their crypto assets are costed. Also trigger when the user says \"calculate cost basis\", \"what is my cost basis strategy\", \"show me financial issues\", \"create a reevaluation\", \"run cost basis\", \"change strategy to LIFO\", or similar.\n","Requires TRES Finance MCP connector","main","163301d1904c0a994539f5226ce0fcd65b8652bf","tres-finance-plugin\u002Fskills\u002Ftres-cost-basis",360,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community","https:\u002F\u002Fgithub.com\u002Fanthropics","https:\u002F\u002Fanthropic.com","2026-11-12 15:56:31",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add anthropics\u002Fclaude-plugins-community --skill tres-cost-basis",{"tool":70,"command":71},"bunx","bunx skills add anthropics\u002Fclaude-plugins-community --skill tres-cost-basis",{"tool":73,"command":74},"pnpm","pnpm dlx skills add anthropics\u002Fclaude-plugins-community --skill tres-cost-basis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-cost-basis\u002FSKILL.md",true,[],[79,110,134,155,176,197],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":90,"publishedAt":49},"01M718G9QZ4B2DJVEB3MAW5ZB1","tres-wallets-upload","Upload and onboard multiple on-chain wallets or exchange accounts into Tres Finance. Use this skill whenever the user wants to add wallets, onboard wallets, import wallets, upload wallet addresses, ingest wallets, or connect exchanges into Tres — whether from a file (CSV\u002FExcel) or by typing them manually. This skill guides Claude through the full flow: wallet type selection → input collection → validation → preview with editable HTML table → exchange credential collection (if exchange) → user confirmation → batch creation via the TRES MCP API. Always trigger this skill for wallet onboarding, wallet data ingestion, or any request to \"add wallets to Tres\".","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-wallets-upload\u002FSKILL.md",[85,88,89],{"categoryNo":86,"categoryName":87,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[91,92,93,94,95,96,97,98,99,100,41,101,102,103,104,105,106,107,108,109],"wallets","tres wallets upload","upload","typing","ingestion","Wallet","chain","creation","xlsx","selection","confirmation","connect","collection","preview","api","batch","guides","on-chain","request",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":49},"01M718G5RD9064Z574RQ4SEY38","tres-upload-tx-header-validation","The exact column header names required by the TRES Finance bulk transaction CSV upload. Use whenever building, fixing, or validating the header row of a TRES manual transaction or sub-transaction upload CSV — especially after an upload fails with \"Missing required column(s): ...\". Trigger phrases include: 'fix my CSV headers', 'bulk transaction upload failed', 'missing required columns', 'validate TRES upload CSV', 'transaction CSV template headers'. This skill is ONLY about the header naming convention; it does not cover row values or upload workflow. Do NOT trigger for contacts import CSV (use tres-import-contacts), wallet upload CSV (use tres-wallets-upload), or general CSV parsing unrelated to bulk TX upload headers.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-upload-tx-header-validation\u002FSKILL.md",[],[117,93,118,47,119,120,96,121,122,123,124,125,126,127,128,129,130,131,132,133],"tres upload tx header validation","validation","do","import","parsing","for","manual","trigger","fix","missing","general","only","use","workflow","csv","contacts","with",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":141,"publishedAt":49},"01M718G1F3DBWTX5H9RWPHHB4F","tres-tx-story","Analyze a blockchain transaction by its hash using TRES Finance MCP and generate a visual flow diagram showing all asset movements, followed by a plain-language explanation of what happened. Use this skill whenever the user provides a transaction hash and asks to \"analyze\", \"explain\", \"visualize\", \"diagram\", \"show me what happened in\", or \"tell the story of\" a transaction. Also trigger when the user pastes a tx hash (long hex string starting with 0x) and asks anything about it. Always use this skill for transaction hash analysis — do not attempt to answer from memory alone.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-tx-story\u002FSKILL.md",[140],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[142,143,46,144,145,41,40,38,146,147,31,148,149,150,151,152,153,119,154,122],"tres tx story","Story","memory","hex","analysis","analyze","diagram","generate","flow","asset","blockchain","STRING","visualize",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":162,"publishedAt":49},"01M718FW5ST9J56WY4TJ5G5A7X","tres-settings-management","Manage Organization Settings and Platform Settings via the TRES MCP GraphQL API. Use when users ask about org settings, platform settings, configuration, feature flags, enable\u002Fdisable platforms, balance diff, commit strategy, cost basis, ERP, pricing, sync boundaries, or any setting read\u002Fwrite operation. Trigger phrases include \"get settings\", \"show settings\", \"update settings\", \"change settings\", \"enable platform\", \"disable platform\", \"balance diff\", \"commit strategy\", \"cost basis strategy\", \"set min sync date\", \"configure\", \"turn on\", \"turn off\".","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-settings-management\u002FSKILL.md",[161],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[163,164,165,48,46,166,41,40,39,167,168,105,32,169,170,171,172,173,174,175],"tres settings management","settings","management","get","ask","commit","organization","update","read","write","sync","mcp graphql","flags",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":184,"publishedAt":49},"01M718FND35X9DPTNR7JTX2YX8","tres-rollup-rules","Analyze an organization's sub-transaction patterns in TRES Finance, identify groups of repetitive transactions, and propose data-driven rollup rules that consolidate them into one aggregated entry per interval (daily or monthly) for cleaner ERP integration. Also lists and deletes rollup rules. Trigger this skill whenever the user asks about rollup rules, transaction aggregation, consolidating transactions, reducing transaction noise, rolling up gas fees, rolling up staking rewards, rolling up micro-transactions, or collapsing many small ledger entries into fewer summary entries. Also trigger on \"create a rollup rule\", \"suggest rollup rules\", \"what should I roll up\", \"show my rollup rules\", \"delete a rollup rule\", \"aggregate transactions\", \"too many transactions\", \"reduce transaction count\", \"roll up fees\", \"daily rollup\", \"monthly rollup\". If a wallet has too many transactions, high-frequency activity, or noisy ledger entries, proactively suggest rollup rules. For computing the EXACT impact of a single already-specified rule or reviewing submitted\u002Fpending rules, use the tres-rollup-review skill instead.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-rollup-rules\u002FSKILL.md",[182,183],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[185,186,187,46,188,96,189,41,190,191,36,35,192,147,33,193,194,195,169,196],"tres rollup rules","Rules","rollup","gas","up","impact","reduce","consolidate","transactions","delete","data-driven","activity",{"skillNo":198,"name":199,"nameZh":6,"description":200,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":201,"categories":202,"keywords":205,"publishedAt":49},"01M718FFX3KV2JRFVS2RCM719D","tres-rollup-review","Compute the EXACT sub-transaction impact of a rollup rule in TRES Finance — every filter applied — and flag genuine problems (zero matches, overlap, config mistakes) before the rule is created. Two modes. Mode A: a pre-create quality gate invoked by the tres-rollup-rules skill to vet proposed candidate rules. Mode B: standalone review of a rule someone submitted or of existing PENDING rules. Trigger this skill when the user says \"review this rollup rule\", \"what would this rollup rule actually match\", \"preview the rollup impact\", \"how many transactions would this rule catch\", \"is this rollup rule valid\", \"validate my rollup rule\", \"check my pending rollup rules\", or \"review the rollup requests\". Do NOT use this to design or propose new rollups — that is tres-rollup-rules. This skill only measures impact and flags issues; it never executes mutations.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-community\u002Fblob\u002Fmain\u002Ftres-finance-plugin\u002Fskills\u002Ftres-rollup-review\u002FSKILL.md",[203,204],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[35,206,187,207,208,209,43,210,128,211,41,190,40,104,212,36,213,214,33,215],"tres rollup review","standalone","never","mode","design","new","candidate","filter","valid","catch"]