Skip to content
Finance
Skill

/tres-cost-basis

Manage cost basis calculation in TRES Finance: check status, view/change strategy (FIFO, LIFO, AVG, MAX_GAINS, MAX_LOSSES, FIFO_IMPAIRMENT), trigger recalculation, review financial issues, manage reevaluations/impairments, set bulk fiat prices, configure spec-ID lot disposal

BOOST
From plugin
claude-plugins-community
4.7k32 skills2 MCP
Install
$ npx -y skills add anthropics/claude-plugins-community --skill tres-cost-basis --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/tres-cost-basis

Context preview

The summary Claude sees to decide when to auto-load this skill.

Manage cost basis calculation in TRES Finance: check status, view/change strategy (FIFO, LIFO, AVG, MAX_GAINS, MAX_LOSSES, FIFO_IMPAIRMENT), trigger recalculation, review financial issues, manage reevaluations/impairments, set bulk fiat prices, configure spec-ID lot disposal

SKILL.md

tres-cost-basis.SKILL.md
name: tres-cost-basis
description: >
  Manage cost basis calculation in TRES Finance: check status, view/change strategy
  (FIFO, LIFO, AVG, MAX_GAINS, MAX_LOSSES, FIFO_IMPAIRMENT), trigger recalculation,
  review financial issues, manage reevaluations/impairments, 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/losses, 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.
compatibility: "Requires TRES Finance MCP connector"

TRES Finance — Cost Basis Management

End-to-end skill for managing cost basis calculation, strategy configuration, reevaluations, financial issue review, and related operations in TRES Finance.

---

MCP Server

All calls use the `user-tres-finance` MCP server (the TRES Finance MCP connector).

All variable keys and nested input fields MUST use **camelCase** (e.g. `assetClassId`, not `asset_class_id`).

---

Step 1 — Authenticate and confirm org

Call `get_viewer` with no arguments. Confirm the org name with the user if there is any ambiguity.

---

Step 2 — Ensure a cost basis strategy is defined (gate before calculation)

Before any cost basis calculation can run, the organization must have a strategy defined. This step is a **prerequisite gate** — run it automatically whenever the user wants to calculate cost basis (Section D), or when they first ask for help with cost basis.

1. Fetch the current strategy using the query in Section B. 2. If `defaultStrategy` is returned (any valid value like FIFO, LIFO, etc.), the strategy is already set — **skip ahead** and inform the user: > "Your cost basis strategy is set to [STRATEGY]. Proceeding." 3. If no strategy is configured (the query returns null or an error), present the user with all available methods and ask them to choose:

> "Before calculating cost basis, you need to choose a costing method. > Here are the available strategies: > > 1. **FIFO** — First-in, first-out. Earliest acquired lots are disposed first. The most common method. > 2. **LIFO** — Last-in, first-out. Most recently acquired lots are disposed first. > 3. **AVG** — Weighted average cost across all lots. > 4. **MAX_GAINS** — Disposes lowest-cost lots first, maximizing realized gains. > 5. **MAX_LOSSES** — Disposes highest-cost lots first, maximizing realized losses (useful for tax-loss harvesting). > 6. **FIFO_IMPAIRMENT** — FIFO with impairment accounting support (for orgs using impairment write-downs). > > Which method would you like to use?"

4. Once the user picks a strategy, set it using the mutation in Section C (with an empty `strategyPeriods` array if they just want a single default). 5. Then proceed to the requested operation (typically Section D — trigger calculation).

This gate ensures no calculation runs without an explicit strategy choice.

---

Step 3 — Run cost basis calculation

After confirming strategy, check the current calculation status (Section A) and offer to run or re-run the calculation:

1. Fetch status using the query in Section A. 2. If `status` is `IN_PROGRESS`, inform the user it's already running and offer to wait: > "Cost basis calculation is currently in progress (started at [time]). Would you like me to wait for it to finish?" 3. If `status` is `DONE`, show when it last ran and ask: > "Cost basis was last calculated on [lastFinishedAt]. Would you like to > recalculate now, or view the existing results?" 4. If `status` is `ITEM_NOT_FOUND`, this org has never calculated — proceed directly to trigger. 5. When the user confirms (or on first-time run), trigger the calculation using the mutation in Section D. 6. **Poll status** every ~10 seconds until `status = "DONE"`. 7. Once done, automatically proceed to show results per asset (Section E) and financial issues (Section F).

This step ensures the user always has fresh results and understands the calculation state before viewing data.

---

Available operations

Based on the user's request, follow the appropriate section below. Many users will come in with a general question like "help me with cost basis" — in that case, run Steps 1–3 (authenticate, check strategy, run calculation), then show results.

---

A. Check cost basis calculation status

Use this when the user asks whether cost basis is running, done, or when it last ran.

query CostBasisGetStatus {
  costBasisGetStatus {
    status
    firstStartedAt
    lastFinishedAt
    updatedAt
  }
}

`status` values: `DONE`, `IN_PROGRESS`, `ITEM_NOT_FOUND` (never calculated).

Report the status clearly. If `IN_PROGRESS`, let the user know it's still running and they should wait. If `DONE`, report when it last finished.

---

B. View current cost basis strategy

Fetches the default strategy and any date-specific strategy overrides.

query GetCostBasisStrategyByDate {
  getCostBasisStrategyByDate {
    response {
      strategyPeriods {
        startDate
        endDate
        strategy
      }
      defaultStrategy
    }
  }
}

Present the default strategy and any period overrides clearly. Strategies: `FIFO`, `LIFO`, `AVG`, `MAX_GAINS`, `MAX_LOSSES`, `FIFO_IMPAIRMENT`.

Explain what each means if the user asks:

  • **FIFO** — First-in, first-out. Earliest acquired lots are sold first.
  • **LIFO** — Last-in, first-out. Most recently acquired lots are sold first.
  • **AVG** — Weighted average cost across all lots.
  • **MAX_GAINS** — Sells lowest-co
Read more
Ships withclaude-plugins-community

Community-contributed plugins for Claude Cowork and Claude Code.

Get the whole plugin
Stats
4,664
Stars
335
Forks
Active
Maintenance
JavaScript
Language
Apache-2.0
License
49m ago
Last commit
7mo ago
Created
4h ago
Added

Repo: anthropics/claude-plugins-community

Other skills on claude-plugins-community.