fx-revaluation
Skill8 starsChanged 4 months agoMITView on GitHub
Revalues monetary GL accounts at period-end FX rates, computes realized and unrealized gain/loss, proposes a balanced revaluation JE, and rolls the cumulative translation adjustment (CTA) forward — refusing to deliver when a monetary account has no period-end rate, the monetary/nonmonetary flag is unstated, or the proposed JE doesn't balance. Use this whenever the user mentions FX revaluation, period-end currency revaluation, unrealized FX gain or loss, remeasurement of foreign-currency balances, CTA rollforward, or multi-currency close. Also trigger on "revalue our foreign currency accounts," "what's our unrealized FX gain/loss," "roll the CTA forward," "propose the FX revaluation JE," or when GL detail by currency and a period-end rate table are supplied together. Ships alongside `consolidation-rollup`, and shares the recompute-and-tie shape of `depreciation-tie-out` applied to monetary balances. Runs fully local — no GL or currency data leaves the machine.
- Installs packages
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accrual-proposalsSkill
- ar-aging-tie-outSkill
- arr-waterfallSkill
- audit-samplingSkill
- audit-workpaperSkill
- balance-sheet-recon-packSkill
- bank-rec-reviewSkill
- bank-rec-to-glSkill
- bank-statement-to-excelSkill
- board-package-builderSkill
- budget-vs-actualSkill
- cash-applicationSkill
- cash-flow-tieoutSkill
- commission-recalcSkill
- consolidation-rollupSkill
- cutoff-and-unrecorded-liabilitiesSkill
- debt-covenant-checkSkill
- deferred-revenue-waterfallSkill
- depreciation-tie-outSkill
- dunning-draftsSkill
- duplicate-payment-scanSkill
- expense-policy-testingSkill
- filing-diffSkill
- flux-narrativeSkill
- intercompany-reconSkill
- invoice-codingSkill
- journal-entry-anomaly-scanSkill
- k1-extract-summarizeSkill
- lease-schedule-tie-outSkill
- month-end-close-checklistSkill
- payroll-tax-reconciliationSkill
- pbc-assemblerSkill
- prepaid-amortizationSkill
- receipts-to-expenseSkill
- return-yoy-varianceSkill
- revenue-trace-to-sourceSkill
- sales-tax-reconciliationSkill
- tax-return-reviewSkill
- thirteen-week-cash-forecastSkill
- three-way-matchSkill
- trial-balance-integritySkill
- vendor-statement-reconSkill
The file
Files
FX Revaluation
The gate
The script refuses to produce a clean revaluation workbook when:
- A row has no explicit monetary flag.
monetarymust beyornper row, stated by the client. A blank is an exception, never assumed to be "no" — guessing wrong here means a real monetary balance never gets revalued. - A row flagged
monetary=yhas no period-end rate for its currency. The rate table is client-supplied; a missing currency is a visible exception, never defaulted to 1.00 and never interpolated from a nearby currency or period. - The proposed revaluation JE doesn't balance. Each row's entry — the account moving to its new functional-currency value, offset by FX Gain/(Loss) — is self-balancing by construction; a failure here means something upstream is broken and the workbook should not go out.
Nonmonetary accounts (monetary=n) are never silently dropped. They're logged to their own tab so
a reviewer can see exactly what was excluded and why, rather than wondering whether an account was
missed.
Inputs
- GL detail by currency — account, currency, the foreign-currency amount, the functional- currency amount currently recorded, and an explicit monetary/nonmonetary flag per row.
- Period-end spot rates by currency.
- Settlement detail (optional) — foreign-currency items that settled during the period, so their gain/loss is classified realized rather than unrealized.
- The beginning CTA balance, to roll forward.
Step 1 — Build the worksheet
python3 scripts/fx_revaluation.py --gl gl_detail.csv --template --out gl_worksheet.csvStep 2 — Run the revaluation
python3 scripts/fx_revaluation.py --gl gl_worksheet.csv --rates rates.csv \
--beginning-cta -42500.00 --settlements settlements.csv \
--client "Northwind Systems Inc" --period-end 2025-12-31 \
--out "Northwind - Q4 2025 FX Revaluation.xlsx"Deliver
Workbook tabs:
- Workpaper Summary — unrealized and realized gain/loss totals, the CTA rollforward, whether the proposed JE balances, and the conclusion.
- Revaluation Workbook — every monetary row with its FC amount, old and new functional equivalents, the period-end rate applied, the gain/loss, and realized/unrealized status.
- Proposed JEs — the balanced two-line entry per account with a nonzero revaluation effect: the account itself moving to its new value, offset by FX Gain/(Loss).
- CTA Rollforward — beginning CTA, the period's unrealized translation adjustment, ending CTA.
- Nonmonetary Accounts Excluded — the transparency log of every account flagged
monetary=n. - Exceptions — every missing rate, unstated flag, or unparseable amount.
Then, in chat: total unrealized and realized gain/loss first, then the CTA rollforward, then any account whose gain/loss is unusually large relative to its balance.
What to escalate
- A large gain/loss relative to the account's recorded balance — the script flags these as judgment items; confirm the rate, the FC amount, and whether the account was already partially revalued elsewhere before accepting the figure.
- An account the client flagged
monetary=nthat functions like a monetary balance (an intercompany loan booked to a balance-sheet-only account, for instance) — report what the flag says and what the account appears to be, and let the engagement decide the classification. - A settlement whose settlement_rate differs sharply from the nearby spot rate, which can indicate a forward contract, a hedge, or a data entry error — not something this skill resolves.
- Any currency with a rate the engagement hasn't independently verified for the period — this skill applies whatever rate you give it and recomputes faithfully; it does not validate the rate itself.
Report each as a fact with the account and currency. Do not characterize intent.
Security posture
Fully local: standard library plus openpyxl. No network calls, no uploads, no telemetry. GL and
currency data never leave the machine.
Dependencies
pip install openpyxlBuilt by Adopt AI — free to use and modify.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

