net-profit-pl-analyzer
Skill8 starsChanged 45 days agoMITView on GitHub
Break down your true Amazon net profit by SKU for any period - after Amazon fees, FBA, COGS and ad spend, not just top-line sales - ranking the real winners and surfacing the SKUs quietly losing money. Live from DataDoe. Use for "net profit", "profit by SKU", "am I making money", "which products are profitable", "profit report", "true margin", or "where am I losing money".
In this repository26 other files it gives its agents.
- amazon-asin-search-auditorSkill
- amazon-listing-optimizerSkill
- buy-box-loss-root-causeSkill
- create-amazon-reconciliation-dashboardSkill
- create-orders-managerSkill
- daily-account-health-checkSkill
- daily-performance-health-checkSkill
- fba-inventory-ledger-reportSkill
- fba-stock-restock-plannerSkill
- keyword-rank-sqp-trackerSkill
- ppc-asin-acos-alertSkill
- ppc-bid-optimizer-applySkill
- ppc-campaign-acos-alertSkill
- ppc-negative-keyword-applierSkill
- ppc-profit-bid-applySkill
- ppc-wasted-spend-watchdogSkill
- promotions-managerSkill
- restock-priority-alertSkill
- return-refund-analyzerSkill
- sales-movers-scannerSkill
- suppressed-inactive-listings-checkSkill
- vendor-inventory-reportSkill
- vendor-performance-dashboardSkill
- vendor-pnl-dashboardSkill
- weekly-business-reviewSkill
- weekly-sales-briefingSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
When sales look fine but the bank account doesn't.
- Very specific: line 36
COGS gate (check first): - if cogs_present is false on most of the sales in the window (step 7), COGS isn't configured.
- Very specific: line 73
If cost_currency is not the marketplace currency, convert cogs_total before you compare it with sales, and state the rate.
- Very specific: line 94
Do NOT sum acos / tacos / roi.
- Distinctive: line 105
Do not pull a top-N or bottom-N instead.
- Very specific: line 111
Do NOT sum acos / tacos / roi (they are ratios) - recompute them from the summed columns if needed (e.g.
- Very specific: line 113
If COGS looks wrong, exports_create on amazon_cogs and read cost_currency, cost_item_value, and cost_item_shipping_value for the SKUs in …
- Distinctive: line 225
Read-only. Never writes to the account.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Net-Profit P&L Analyzer
Your true profit by SKU for any period - after Amazon fees, FBA, COGS and ad spend, not just top-line sales. It ranks where you actually make money and where profit is leaking, live from DataDoe. Runs in chat, no spreadsheet.
When to use this
- Month-end / week-end: "how much did I actually make, and on what."
- When sales look fine but the bank account doesn't.
- To find the SKUs quietly losing money (negative profit, ad spend > margin).
- Trigger phrases: "profit", "net profit", "P&L", "margin by SKU", "am I making money", "which products are profitable", "profit report", "true profit".
The framework. Sales is vanity, profit is sanity
Work top-down, then find the leaks:
- COGS gate (check first) - if
cogs_presentis false on most of the sales in the window (step 7), COGS isn't configured; every profit/margin below is overstated (really just sales - fees - ad spend). Lead with a prominent warning (see workflow) before any number is trusted. - Headline - total sales, total profit, blended margin %, units.
- Winners - top SKUs by profit (not sales) - where the money really is.
- Leaks - SKUs with negative profit, margin below an absolute floor (~15% net) or far below the account average, or ad spend eating the whole margin - excluding settlement-lag artifacts (recent unsettled fees, see workflow).
- One action per leak - raise price, cut ad spend, fix COGS, or discontinue.
Configuration
- MCP base:
https://mcp.datadoe.com/mcp/v1 - Account P&L:
Profit by Date(amazon_profit_by_date). This is the account number. It includes every campaign type inad_spend, and unallocated fees (storage, inbound, subscription, and similar posted-date fees) land here. Trustprofit. Do not rebuild it fromamazon_settlements_with_cogs. - SKU P&L:
Profit by SKU & Date(amazon_profit_by_sku_and_date). Use it only for the per-SKU ranking. Itsad_spendis Sponsored Products and Sponsored Display, same-SKU attribution only. Do not sum this table'sprofitand call it account profit. That sum will not equalamazon_profit_by_date.profit. - Both tables are premium. Premium note: a premium export costs 5 AI Tokens instead of 2 - nothing else differs, and the table is part of the always-on default dataset, so it is never disabled. A 0-row export means no data in the window or an initial load still in progress - say which, and stop; never render zeros.
Filter on
date(marketplace-local profit date); the profit tables have noorder_datecolumn (FIELD_NOT_FOUND). Always group by at leastcurrency: an emptygroupByreturns one account-total row, which hides a multi-currency account. total_fees,fba_fees,total_selling_fees,cogs_total, andad_spendare positive costs.profitis alreadytotal_sales - sales_tax - total_fees - cogs_total - ad_spend + refund_cost, whererefund_costis signed (cash outflows negative, fee reversals positive - per the scheme'sprofitdescription) andsales_taxis subtracted once becausetotal_salesis VAT-inclusive on UK/EU marketplaces (~16.6% of sales on a UK account). Do not addtotal_selling_feesorfba_feeson top oftotal_fees.total_salesis shipped item price plus shipping, minus shipping promotions. It does not include item tax.- Currency: keep
currencyin everygroupByand report per currency. Never sum across currencies. COGS is the amount the seller entered onamazon_cogs(cost_item_value,cost_item_shipping_value,cost_currency). It is not converted. Ifcost_currencyis not the marketplace currency, convertcogs_totalbefore you compare it with sales, and state the rate. A margin near 100% usually means COGS was not uploaded - but it can also come from fee reversals / reimbursements posting without matching sales in the window (a negativefees_sum), so check the sign offees_sumbefore blaming COGS; a negative fee total is a timing artifact, not a margin. - Window: use a full month or longer. Fees post on settlement date, so a few days or one week can misstate margin. Flag a SKU whose margin looks extreme and check it is not a settlement-timing artifact.
- Query quirks: an aggregation
aliasmust NOT equal an existing column name -sum(profit) as profiterrors withALIAS_COLLISION; use a distinct alias (profit_sum). Profit exports can sitPENDINGfor minutes - poll patiently, do not give up early.
Step-by-step workflow (MCP-native)
sellers_and_vendors_list-> pick the seller, keepsellerOrVendorId.exports_sources_get(query "profit") -> confirmamazon_profit_by_dateandamazon_profit_by_sku_and_dateareenabled.- Account headline:
exports_createonamazon_profit_by_datefor the window:groupBy:["currency"]aggregations(sum):total_sales,profit,total_cost,ad_spend,total_fees,cogs_total,total_units_soldDo NOT sumacos/tacos/roi. Recompute margin as profit / sales.
- SKU ranking - one complete per-SKU aggregate:
exports_createonamazon_profit_by_sku_and_datefor the same window:groupBy:["sku","product_name","currency"]aggregations(sum):total_sales,profit,total_cost,ad_spend,total_fees,cogs_total,total_units_sold- give each a distinct alias (e.g.sum(profit) as profit_sum, neveras profit, which errorsALIAS_COLLISION).- CSV,
limit 5000,orderByColumn sku; page withskipuntil a page returns fewer rows (caps: JSON 1,000 rows, CSV 5,000). Drop rows whoseskuis null (account-only ad rows). Rank the winners and evaluate every leak rule (step 9) on this full set in code. - Do not pull a top-N or bottom-N instead. A DESC list cannot contain a loss on a large
account (2,932 SKUs in a month: the top 1,000 by profit had no negatives). A
having profit_sum < 0/ ASC list holds only losses, so it never shows a profitable SKU whose margin is under the floor or whose ad spend exceeds its profit - on one UK month that was 770 profitable SKUs under the 15% floor (153 of them with ad spend above profit), GBP 138k of sales, beside 999 loss-making SKUs. Do NOT sumacos/tacos/roi(they are ratios) - recompute them from the summed columns if needed (e.g. margin % = profit / sales).
- If COGS looks wrong,
exports_createonamazon_cogsand readcost_currency,cost_item_value, andcost_item_shipping_valuefor the SKUs in question. - Poll
exports_get(patiently - profit exports can stayPENDINGfor minutes), thenexports_raw_download. - COGS-config gate (before trusting any margin):
cogs_presentis a LOGIC column, so it cannot be aggregated (min/maxon it errorINVALID_AGGREGATE) and is not readable from the grouped step-4 exports. Run one small dedicatedexports_createonamazon_profit_by_sku_and_datefor the window:groupBy ["cogs_present","currency"],aggregationssum(total_sales) as sales_sum,count(sku) as row_count. Gate = share of sales on thecogs_present = truerow (observed: 98.6% true / 1.4% false;nullrows carry no shipped item and zero sales - ignore them). Ifcogs_present = falsecarries more than ~50% of sales, COGS is not loaded for this account - put a prominent warning at the top of the output ("COGS not configured; margins are overstated / not true net profit") and label margins accordingly; otherwise print[!] COGS present on {x}% of saleswhen the share is below ~95%. Profit ranking still works; the margin figures do not. Usecogs_present, notsum(cogs_total) = 0, for this gate. - Settlement-lag guard (recent windows): fees post on settlement cycles, so a fresh SKU can show fees > sales (or fees with ~no sales) - a timing artifact, not a real loss. Run this check over the leak candidates from the step-4 set and flag any SKU whose fee/sales ratio is implausible in a short window as "settlement lag - recheck after settlement" rather than a real leak.
- Headline numbers come from step 3 only. Flag SKU leaks from the full step-4 set,
profitable SKUs included:
profit < 0,ad_spendabove profit, or SKU margin < 0.5x the account margin. When the account margin is <= 0 or degenerate (COGS missing, loss-making window), use an absolute ~15% margin floor instead of the 0.5x multiple - a multiple of a negative baseline is meaningless. List leaks by money at stake - the loss for negative SKUs, the shortfall to the floor (floor x sales - profit) for thin ones - give the count per rule, and on a large catalog show the top ones and say how many more there are. Say that SKU ad spend omits Sponsored Brands and other campaign types that are in the accountad_spend. - Render the card.
Output format
Net Profit - {marketplace} - {from}..{to}
[!] COGS NOT CONFIGURED - margins below are overstated, NOT true net profit (only when cogs_present = false carries most of the sales, step 7)
[!] COGS present on {x}% of sales (when the step-7 share is below ~95%)
Sales {cur}{sales} Profit {cur}{profit} Margin {m}% Units {u}
Top profit SKUs
# SKU / product Sales Profit Margin Ad spend
1 {sku} {cur}.. {cur}.. {m}% {cur}..
...
Profit leaks (fix first) ({n} losses · {t} under the margin floor · {a} ad spend > profit - full SKU set; top {k} by money shown)
- {sku}: {why - negative profit / ad spend > margin / net margin < 15%}
-> {action: raise price / cut bid / check COGS / discontinue}
Settlement-lag (recheck, not real losses): {sku(s) with fees > sales in an unsettled window}Lead with the three headline numbers. Money in the marketplace currency.
Worked example (illustrative)
A hero SKU might show, say, ~€17k sales / ~€11.9k profit (~68% margin) over the
month - healthy. Contrast a bundle SKU showing ~99% margin: that is almost always a
sign COGS was not uploaded for it, not a real 99% - the skill flags it to check COGS
completeness rather than celebrating a fake margin. And if every SKU shows no COGS
(cogs_total = 0 account-wide), the skill leads with a prominent "COGS not configured"
warning - the whole P&L is overstated until COGS is loaded. Surfacing that data-quality
leak, alongside genuinely thin/negative-profit SKUs (and separating true losses from
settlement-lag timing artifacts), is the point.
Quality self-check
- Did the headline come from
amazon_profit_by_date, not a sum of SKU profit? - Did I rank SKUs by profit, not sales?
- Did I recompute margin/ACoS from summed columns (never sum a ratio)?
- Did I evaluate every leak rule on the complete, paged per-SKU aggregate, so profitable SKUs under the margin floor or with ad spend above profit are flagged too, not only losses?
- Did I sanity-check suspiciously high margins for missing COGS - and check the sign of
fees_sumfirst (negative = fee reversals / reimbursements, not missing COGS)? - Did I run the dedicated
cogs_presentexport (share of sales with COGS) and lead with a prominent warning when COGS is absent - not just a per-SKU footnote? - Did I flag settlement-lag SKUs (fees > sales in a recent window) as timing artifacts, not real losses?
- Did I apply an absolute margin floor (~15%) so the leak flag still works when blended margin is negative/degenerate?
- Did I give aggregations distinct aliases (no
as profit) to avoid ALIAS_COLLISION? - Is money in the right currency?
Common mistakes
- Summing
amazon_profit_by_sku_and_date.profitand presenting it as account profit. - Summing
acos/tacos/roicolumns - they are per-row ratios, meaningless summed. - Adding
total_selling_feesorfba_feeson top oftotal_fees. - Filtering posted fees away with
order_date, or sendinggroupBy: []. - Reporting sales as "profit". Use the
profitcolumn fromamazon_profit_by_date. - Treating a 99% margin as real - usually COGS was not uploaded, or
cost_currencyis not the marketplace currency, orfees_sumis negative (fee reversals posted without matching sales). - Reading leaks off a top-N or bottom-N export - a DESC list holds no loss on a large
account, and a
having profit_sum < 0/ ASC list holds only losses, missing every profitable SKU under the margin floor (770 on one UK month, GBP 138k of sales). Evaluate the rules on the full paged SKU set. - Trying to aggregate
cogs_presentin the grouped SKU export - it is a LOGIC column (INVALID_AGGREGATE); use the dedicatedgroupBy [cogs_present, currency]export. - Ignoring ad spend - a SKU can be profitable before ads and a loss after. SKU
ad_spendstill misses Sponsored Brands; the account figure does not. - Burying account-wide missing COGS in a footnote - if
cogs_presentis false the whole P&L is overstated; lead with it. - Reporting a fresh SKU with fees > sales as a real loss - usually settlement lag; flag it to recheck after settlement.
- Using "< 0.5x account margin" when the account margin is negative - use the absolute ~15% floor instead.
- Aliasing
sum(profit) as profit-ALIAS_COLLISION; use a distinct alias.
Notes
- Read-only. Never writes to the account.
- Account profit is
amazon_profit_by_date. SKU profit isamazon_profit_by_sku_and_date. Do not rebuild the P&L from settlements. - A DataDoe skill, built on the DataDoe profit tables.
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.

