# Compute Real Margin

> Compute reimbursement minus acquisition cost minus DIR fees per script and flag negative-margin scripts the sticker hid. Reach for this on a margin question.

- Skill: `mcorbett51090/compute-real-margin` (Agent Skill)
- Install (CLI): `npx get-skill add mcorbett51090/compute-real-margin`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mcorbett51090/compute-real-margin/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mcorbett51090 (https://skillmd.com/u/mcorbett51090)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/mcorbett51090/compute-real-margin

---


# Skill: Compute real margin after DIR

The sticker reimbursement overstates margin; DIR can flip a script negative (§3 #3).

## Step 1 — Pull the per-script data
Reimbursement, acquisition cost, and DIR/clawback fee per script.

## Step 2 — Compute real margin
Reimbursement − acquisition − DIR via `pharmacy_operations_calc.py margin` (§3 #3).

## Step 3 — Flag the negatives
Scripts negative after DIR and the classes driving them (§3 #3).

## Step 4 — Handle specialty distinctly
Specialty/340B/refrigerated priced separately (§3 #6).

## Output
A per-script real-margin read net of DIR with negative-margin scripts flagged. Traverse Tree 2 in the decision-trees file.

