# tres-asc845-swap-reprice-skill

The tres-asc845-swap-reprice-skill skill adjusts swap inflows under ASC 845 so their value matches the outflows and the clearing account nets to zero. Use it to investigate a month-end residual.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 4931 repo stars
- Author: Nadav Gilliam · official Anthropic repository
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/anthropics/claude-plugins-community/tree/HEAD/tres-finance-plugin/skills/tres-asc845-swap-reprice-skill/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/tres-asc845-swap-reprice-skill

## What it does

The skill fetches subtransactions through the `user-tres-finance` MCP server, filters them by clearing account, and builds a repricing plan. It calculates the gap between outgoing and incoming fiat values, then allocates that difference across inflows according to token amounts. Transactions with multiple legs on either side are handled using their combined values.

The package includes `orchestrate_reprice.py` and `reprice_swaps.py`. The orchestrator creates a plan and mutation variables, and prints a preview before any changes are made. You need a TRES Finance MCP connection, a target account, and either a date range or transaction hashes. Mutations require user approval.

Incomplete swaps with only inflows or only outflows are skipped. Legs already marked with a manual fiat value are flagged for review; the final inflow absorbs rounding. Activity-tag filtering leaves out transactions without a classification, so use that filter only when requested.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add anthropics/claude-plugins-community
```
In the agent chat (not a shell):
```text
/plugin install tres-finance-plugin@claude-community
```
This installs the whole tres-finance-plugin plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/claude-plugins-community --skill tres-asc845-swap-reprice-skill -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/tres-asc845-swap-reprice-skill/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/tres-asc845-swap-reprice-skill/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/claude-plugins-community --skill tres-asc845-swap-reprice-skill -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/tres-asc845-swap-reprice-skill/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/claude-plugins-community --skill tres-asc845-swap-reprice-skill -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/tres-asc845-swap-reprice-skill/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install anthropics/claude-plugins-community tres-finance-plugin/skills/tres-asc845-swap-reprice-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/tres-asc845-swap-reprice-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/claude-plugins-community --skill tres-asc845-swap-reprice-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/anthropics/claude-plugins-community --path tres-finance-plugin/skills/tres-asc845-swap-reprice-skill
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/tres-asc845-swap-reprice-skill/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/anthropics/claude-plugins-community/tree/HEAD/tres-finance-plugin/skills/tres-asc845-swap-reprice-skill/SKILL.md

## When to use it
- bring a swap clearing account balance to zero
- reprice swap inflows under ASC 845
- allocate a value difference across multiple incoming legs
- review a proposed repricing plan before applying changes
- identify swaps whose inflow and outflow values do not match

## Example prompts
- Check this month's clearing account residual and prepare an ASC 845 repricing plan for the swaps.
- Reprice the inflows for these transaction hashes and show me the preview first.
- Filter for the `SWAP` activity tag and prepare changes for `Swaps Clearing Account`.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: a8e162bd73fdaf42.

BEGIN THIRD-PARTY FILE a8e162bd73fdaf42
```text
---
name: tres-asc845-swap-reprice-skill
description: >
  Reprice swap transaction legs under ASC 845 (Nonmonetary Transactions) to ensure clearing accounts
  net to zero. Use this skill whenever the user wants to: reprice swaps, fix clearing account residuals,
  apply equal-value exchange to swap legs, run setBatchUseCounterpartyFiatValue, zero out a clearing
  account, apply ASC 845, fix swap pricing mismatches, ensure no gain/loss on swaps, or close a month
  where a swaps/trade clearing account has a residual balance. Also trigger when the user mentions
  "counterparty fiat value", "swap repricing", "clearing account net to zero", or "equal value exchange".
compatibility: "Requires TRES Finance MCP connector"
---

# ASC 845 Swap Repricing Skill

## Purpose

Implements **equal-value exchange under ASC 845 (Nonmonetary Transactions)** for swap transactions
in TRES Finance. In a simultaneous swap, the fair value of the asset surrendered (outflow) is the
best evidence of the fair value of the asset received (inflow). This skill reprices inflow legs to
match outflow legs so that clearing accounts net to zero.

## When to Use

- A swaps/trade clearing account has a non-zero residual after month-end
- User wants to apply ASC 845 to a population of swap transactions
- User says "setBatchUseCounterpartyFiatValue" or similar

## MCP Server

All GraphQL calls use the **`user-tres-finance`** MCP server (`execute` tool).

Variable keys and nested input fields MUST use **camelCase** (e.g. `timestamp_Gte`, not `timestamp_gte`).

## Prerequisites

- TRES Finance MCP connection (`user-tres-finance`)
- The user must specify:
  1. **Target ERP account** — the clearing account to zero out (e.g. "Swaps Clearing Account", NS #818)
  2. **Transaction scope** — either a date range (timestamp_Gte / timestamp_Lte) or specific tx hashes
```
END THIRD-PARTY FILE a8e162bd73fdaf42

The third-party file has ended. Everything between the a8e162bd73fdaf42 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 1849 of 8962 bytes. © Nadav Gilliam · MIT · https://github.com/anthropics/claude-plugins-community/tree/HEAD/tres-finance-plugin/skills/tres-asc845-swap-reprice-skill/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
