| name | pricing-data-integrity |
| description | Use for changes to pricing formulas, providers, historical data, exports, calculator logic, tracker data model, or anything that could affect the trust of the published price. |
| when_to_use | ["Editing `src/lib/price-calculator.js`, `src/config/karats.js`, `src/config/constants.js`","Adding / swapping a price provider adapter","Changing freshness thresholds or cache strategies","Editing historical data resolution / aggregation","Editing CSV / JSON export shape"] |
| related_files | ["src/lib/price-calculator.js","src/config/karats.js","src/config/constants.js","src/lib/formatter.js","src/lib/cache.js","src/lib/api.js","data/**","docs/data-source-methodology.md","docs/PRICE_API_AND_HISTORY.md"] |
| related_prompts | [".github/prompts/pricing-data-audit.prompt.md",".github/prompts/provider-bakeoff.prompt.md"] |
Skill: Pricing Data Integrity
Protects the single most reputationally important surface: the published price.
The non-negotiables
- Troy ounce constant:
31.1034768
- AED peg:
3.6725
- Karat factors sourced from
src/config/karats.js
- Non-UAE pages: USD → local FX directly
- Every visible price has a state label
- Reference price ≠ retail price (calculator output is reference + disclaimers)
Workflow
- Read
docs/data-source-methodology.md and docs/PRICE_API_AND_HISTORY.md.
- Map the change to formulas, providers, freshness, historical data, or exports.
- Identify affected surfaces (homepage ticker, tracker, calculator, country pages,
methodology copy, exports, X posts).
- Edit with the
formulas.md and
freshness.md checklists open.
- Test with unit tests (
tests/price-calculator.test.js style) — add new ones for any new
constant or branch.
- Verify with
npm test, npm run validate. Manual spot-check the affected pages.
Checklists in this skill
Common mistakes
- Using
31.1 instead of 31.1034768.
- Hard-coding karat factors outside
src/config/karats.js.
- Crossing AED ↔ local on country pages (double rounding).
- Caching a price and serving it as
live.
- Removing the state label / methodology link to "declutter".
- Calculator omitting VAT / making-charge disclaimers.
See .github/instructions/gold-pricing.instructions.md.