Atris

Summarize why deals were won and lost.
Done by an agent. Checked twice.

Every closed deal gets one reason backed by a quote from its own notes, with counts and amounts that add up.

Have Atris do this for you›

1

Real files in

  • closed_deals.csv
    Forty-six rows of closed deals from one quarter with the seller's notes, including two deals exported twice, outcomes and names typed several ways and three deals with no reason given. 47 lines, 8 KB.
  • reason_guide.md
    One sales team's guide for reviewing closed deals: how to clean the export and the nine reasons a deal can be given. 36 lines, 2 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read the guide and clean the export
  2. 2.Give every deal its reason
  3. 3.Count it up and write the summary

Claude Sonnet 5.5, 1 min 22 s. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 44 of 44 closed deals appear once, with the 2 repeated rows left out
  • ✓Passed: 44 of 44 deals have the account from the export and the outcome, amount and competitor name the guide's cleaning rules give
  • ✓Passed: 44 of 44 reasons are the one the deal's own notes say decided it
  • ✓Passed: 41 of 41 quotes are word for word from the notes of their own deal and 3 of 3 deals with no reason given have no quote
  • ✓Passed: 4 of 4 competitor rows have the right deal counts and win rate
  • ✓Passed: 15 of 15 reason rows have the right deal count and amount
  • ✓Passed: win_loss_summary.md states the win rate 45.5% from 20 won and 24 lost, with 523,600.00 won and 1,020,200.00 lost
  • ✓Passed: win_loss_summary.md gives the right count and amount for 15 of 15 reasons and the right win rate against 4 of 4 competitors
  • ✓Passed: 83 of 83 numbers and dates in win_loss_summary.md are a count, amount or win rate for a group of deals worked out again, or a value from a deal named on that line

Second review by Claude Opus 5.5: pass.

Then we broke a copy of the output 12 ways on purpose. The check caught 12.

What it wrote. Lines 1 to 10 of deal_reasons.csv, copied from the file.
deal_id,account,outcome,amount,competitor,reason,quote
W-3100,Abbey Lane Plumbing,lost,8400.00,Rotawise,price,our quote was nearly double theirs and that decided it
W-3101,Barrowfield Electrical,won,26000.00,ShiftKeep,ease_of_use,Dispatchers had ours working in an afternoon and never finished setting up ShiftKeep
W-3102,Carrick Lifts,lost,118000.00,Plannery,features,We have no offline mode for engineers in lift shafts with no signal and they would not move without it
W-3105,Fenwick Pest Control,won,6800.00,Rotawise,support,They picked us because our onboarding person answered every question the same day during the trial
W-3103,Dunholme Heating,won,7200.00,none,relationship,Owner's brother in law uses us and told him to buy it
W-3104,Easby Fire Safety,lost,31500.00,Rotawise,timing,Budget was frozen by the new finance director the week we sent the contract
W-3106,Garsdale Glazing,lost,22000.00,ShiftKeep,integration,"ShiftKeep connects to their accounts package, Ledgerline, and we do not"
W-3107,Hexham Roofing,won,9600.00,none,ease_of_use,ours was the only one he could work in the demo himself
W-3108,Ingleby Security Systems,lost,96000.00,Plannery,security,They need data held in the UK and we could not offer that

How this was run

An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.

Run 1 of 1 on 1 December 2026. The agent took 1 min 22 s.

What the second review verified

  • Deduplication and cleaning: the export has 46 rows and 44 distinct deals. W-3105 keeps the 2026-07-17 'won' row and W-3119 keeps the lower of its two identical rows. deal_reasons.csv has 44 unique rows. Amounts such as '18k'→18000.00, '$118,000'→118000.00 and blank W-3116→0.00 are correct, and competitor spellings such as 'Rota Wise', 'Shift Keep', 'ShiftKeep Inc' and blank→none are normalised correctly.
  • Every non-blank quote appears exactly in its own deal's notes, for example W-3109 'Lost on price. Rotawise came in 30% under us'. The quote is blank exactly where the reason is not_stated (W-3111, W-3128, W-3138).
  • Totals recomputed from deal_reasons.csv: 20 won, 24 lost, win rate 45.5%, won 523,600.00, lost 1,020,200.00. All 15 outcome/reason rows match by_reason.csv and the summary, for example lost price 7 / 236,600.00 and won ease_of_use 5 / 85,600.00.
  • Competitor win rates match: Rotawise 5/13 = 38.5%, ShiftKeep 6/12 = 50.0%, Plannery 4/12 = 33.3%, none 5/7 = 71.4%. The claim that 5 of the 7 price losses went to Rotawise is right (W-3100, W-3109, W-3114, W-3135, W-3142). Mixed-note calls follow the guide's 'decided by' rule, for example W-3123 → ease_of_use and W-3118 → features ('Price was fine').

What this run does not show

  • The check holds the reason for each of the 44 deals, marked by hand before the run. The notes were written so that one reason clearly decides each deal. Real notes are often unclear.
  • The three recommended next steps are tested only for their numbers. Whether they are good advice is not tested.
  • A number in the summary changed to another true count or total from the same export would not be caught.

Would the check catch a wrong answer?

A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 12 of 12. The check was made stricter after the first try at this, and the same untouched output was graded again.

Open every file

flow.md · the three steps the agent followed
# Summarize why deals were won and lost

function: sales
for: the sales leader preparing the quarterly win and loss review
goal: Every closed deal has one reason backed by a quote from its own notes. The counts and amounts in the summary add up to the export.

## 1. Read the guide and clean the export
Read input/reason_guide.md, then input/closed_deals.csv. The guide says how to handle a deal that
appears twice, how to read outcomes, amounts and competitor names typed in different ways, which
reasons exist and how to pick one. Follow it exactly. Parse the file and do the sums with python3.

## 2. Give every deal its reason
Read the notes on each deal and pick the one reason from the guide that the notes say decided it.

Write output/deal_reasons.csv with columns deal_id,account,outcome,amount,competitor,reason,quote.
One row per deal, each deal once. outcome, competitor and reason are written the way the guide writes
them. amount is a plain number with two decimals. quote is the words in the notes that show the
reason, copied exactly from one place in that deal's notes. Leave quote blank when the reason is
not_stated.

## 3. Count it up and write the summary
Write output/by_reason.csv with columns outcome,reason,deals,amount. One row for each outcome and
reason that has at least one deal.

Write output/by_competitor.csv with columns competitor,deals,won,lost,win_rate_pct. One row per
competitor, including none.

Write output/win_loss_summary.md for the sales leader: the number won and lost and the overall win
rate, the total amount won and the total amount lost, the reasons for losses from most deals to
fewest with the count and amount for each, the same for wins, the win rate against each competitor
and three things to do next, each resting on a count above. End with what the export could not tell
you, such as deals with no notes or no amount. Write amounts like 12,345.00.

## Done looks like
- Every deal in the export appears once in deal_reasons.csv.
- Every quote can be found in the notes of its own deal.
- The counts and amounts in the two count files and the summary equal the sums of deal_reasons.csv.
input/closed_deals.csv · 47 lines, 8 KB
deal_id,account,segment,outcome,amount,competitor,close_date,owner,notes
W-3100,Abbey Lane Plumbing,Small,Lost,"8,400",Rotawise,2026-07-06,Hale,Went with Rotawise. Owner said flat out our quote was nearly double theirs and that decided it. Liked the product.
W-3101,Barrowfield Electrical,Mid,Won,26000,ShiftKeep,2026-07-08,Imani,They ran both trials side by side. Dispatchers had ours working in an afternoon and never finished setting up ShiftKeep. That was the whole decision.
W-3102,Carrick Lifts,Large,Lost,"$118,000",Plannery,2026-07-10,Hale,Lost to Plannery. We have no offline mode for engineers in lift shafts with no signal and they would not move without it.
W-3105,Fenwick Pest Control,Small,Lost,6800,Rotawise,2026-06-30,Okoro,Marked lost when they went quiet in June.
W-3103,Dunholme Heating,Small,Won,7200,,2026-07-14,Okoro,No competitor. Owner's brother in law uses us and told him to buy it. Signed in a week.
W-3104,Easby Fire Safety,Mid,Lost,"31,500",Rota Wise,2026-07-15,Imani,Budget was frozen by the new finance director the week we sent the contract. Nobody won. They say maybe next year.
W-3105,Fenwick Pest Control,Small,won,6800,Rotawise,2026-07-17,Okoro,Price was about the same as Rotawise. They picked us because our onboarding person answered every question the same day during the trial.
W-3106,Garsdale Glazing,Mid,Lost,22000,ShiftKeep,2026-07-21,Hale,"ShiftKeep connects to their accounts package, Ledgerline, and we do not. They said that was the only reason."
W-3107,Hexham Roofing,Small,Closed Won,"9,600",,2026-07-22,Okoro,"Tiny team, no other vendor looked at. He wanted something his crew could use without training and ours was the only one he could work in the demo himself."
W-3108,Ingleby Security Systems,Large,Lost,96000,Plannery,2026-07-24,Imani,Failed their security review. They need data held in the UK and we could not offer that. Plannery could.
W-3109,Jarrow Drainage,Mid,Lost,18k,rotawise,2026-07-28,Hale,Lost on price. Rotawise came in 30% under us and the buyer said he could not justify the gap to his boss.
W-3110,Kelso Air Conditioning,Mid,Won,34000,Plannery,2026-07-30,Imani,"We won because we sync with their stock system, Partbin, out of the box. Plannery wanted a paid project to build it."
W-3111,Lanchester Locksmiths,Small,Lost,5400,,2026-08-03,Okoro,
W-3112,Morpeth Solar,Mid,Won,"41,000",ShiftKeep,2026-08-05,Hale,The ops lead used us at her last company and brought us in. ShiftKeep never really had a chance.
W-3113,Norham Lifts,Large,Lost,134000,Plannery,2026-08-07,Imani,Plannery has been their supplier for payroll for ten years and the group IT head would not look past them. Product was not really compared.
W-3114,Otterburn Cleaning,Small,Lost,"4,900",Rotawise,2026-08-11,Okoro,Too expensive for a five person firm. She said the monthly cost was more than her van payment. Went with Rotawise's free tier.
W-3115,Prudhoe Boilers,Mid,WON,27500,Rotawise,2026-08-13,Hale,"We were not the cheapest. They chose us for the parts tracking screen, which Rotawise does not have at all."
W-3116,Rothbury Tree Care,Small,Lost,,,2026-08-14,Okoro,"No decision. Owner went quiet after the demo, then said he is putting it off until after the winter season."
W-3117,Seahouses Marine Repair,Mid,Won,"23,000",ShiftKeep,2026-08-18,Imani,"Came down to price in the end. We matched ShiftKeep and threw in the first two months, and that settled it."
W-3118,Tynemouth Alarms,Large,Lost,88000,Shift Keep,2026-08-20,Hale,"They need customer facing booking pages and we do not have them. ShiftKeep does. Price was fine, they said so."
W-3119,Ulgham Fencing,Small,Won,5200,,2026-08-21,Okoro,Signed after one call. Said the trial was so simple he did not need the second demo.
W-3120,Wark Pumps,Mid,Lost,"29,000",Plannery,2026-08-25,Imani,Our champion left the company in August and the new manager had no interest. Deal died with her leaving.
W-3121,Yetholm Kitchens,Mid,Won,19500,Rotawise,2026-08-27,Hale,Their old system's support took days to reply. They met our support lead on the call and said that is why they are moving.
W-3122,Alnmouth Electrical,Large,Lost,"102,000",Plannery,2026-09-01,Imani,Lost on price at the last step. Procurement ran a reverse auction and Plannery undercut us by a wide margin.
W-3123,Belford Gas Services,Mid,Won,36000,ShiftKeep,2026-09-03,Okoro,"Passed their security questionnaire in three days, which helped. But the buyer said the decision was made when the engineers used the rota screen with no explaining at all."
W-3124,Craster Fire Doors,Small,Lost,"6,300",Rota Wise,2026-09-04,Hale,They wanted quoting built in so engineers can price a job on site. We do not do quotes. Rotawise does.
W-3125,Doddington Lifts,Large,Won,127000,Plannery,2026-09-08,Imani,"Big win. The deciding point was the link to their finance system, Ledgerline, which we already had live at two of their sister companies."
W-3126,Embleton Glass,Mid,Lost,24000,ShiftKeep,2026-09-10,Okoro,Project postponed. They are being bought by a larger firm and all new software spend is on hold until the sale completes.
W-3127,Felton Heating,Small,Won,"8,800",Rotawise,2026-09-11,Hale,Rotawise was cheaper. Owner said he would pay more for us because his office manager set up the whole trial herself in a morning.
W-3128,Glanton Drains,Small,Lost,"5,900",rotawise,2026-09-15,Okoro,Lost. Notes from the call are missing and the buyer has not replied to ask why.
W-3119,Ulgham Fencing,Small,Won,5200,,2026-08-21,Okoro,Signed after one call. Said the trial was so simple he did not need the second demo.
W-3129,Harbottle Security,Mid,Lost,"33,000",Plannery,2026-09-17,Imani,Their IT team would not approve us without a penetration test report less than six months old. Ours was older. Security sign off failed.
W-3130,Ilderton Roofing,Mid,Won,21000,ShiftKeep,2026-09-18,Hale,Referred by Morpeth Solar. They trusted the referral and barely looked at ShiftKeep.
W-3131,Kirknewton Lifts,Large,Lost,"91,000",Plannery,2026-09-22,Imani,"We lost on price. Plannery bundled scheduling into a group deal they already had, which made it close to free for them."
W-3132,Lowick Pest Control,Small,Won,"6,100",,2026-09-24,Okoro,No one else in the running. She bought because our support team rebuilt her job list for her during the trial.
W-3133,Milfield Solar,Mid,Lost,38000,ShiftKeep,2026-09-25,Hale,"Engineers need to capture customer signatures on a tablet. We cannot do it yet. ShiftKeep can, and that was that."
W-3134,Netherton Boilers,Mid,Won,"28,000",Rotawise,2026-09-29,Imani,"Won on price. Three year term got them 15% off, which put us under Rotawise."
W-3135,Ord Plumbing,Small,Lost,"7,700",Rotawise,2026-10-01,Okoro,Said our price per engineer was too high for a seasonal business that drops to three staff in winter.
W-3136,Powburn Electrical,Mid,Won,"32,500",Plannery,2026-10-02,Hale,"They liked that we connect to Partbin, the stock system they already run. Plannery could not."
W-3137,Rennington Alarms,Mid,Lost,"26,000",ShiftKeep,2026-10-06,Imani,They went with ShiftKeep after their rep flew in twice and ours took four days to send a revised quote. Buyer said we were slow and hard to reach.
W-3138,Shilbottle Kitchens,Small,Won,"9,900",,2026-10-08,Okoro,
W-3139,Thropton Fire Safety,Large,Lost,"109,000",Plannery,2026-10-09,Hale,No decision this year. The board cut the whole operations budget in October.
W-3140,Ulgham Fencing Depot,Mid,Lost,"17,500",ShiftKeep Inc,2026-10-13,Imani,"We do not connect to their route planner, Wayfarer. ShiftKeep does. That was the reason they gave."
W-3141,Warenford Glazing,Mid,Won,"24,500",ShiftKeep,2026-10-15,Okoro,The recurring maintenance contracts feature won it. ShiftKeep handles one off jobs only.
W-3142,Yeavering Tree Surgeons,Small,Lost,"4,600",Rotawise,2026-10-16,Hale,Cheaper option won. Rotawise was a third of our price and he said nothing else mattered.
W-3143,Acklington Heating,Mid,Won,"30,000",Plannery,2026-10-20,Imani,Their finance lead said our support hours were the reason. Plannery only offers email support and they run weekend call outs.
input/reason_guide.md · 36 lines, 2 KB
# Win and loss review guide

Corbel Field Software, sales operations. Used for the quarterly review of closed deals.

## Cleaning the export

- The same deal can be in the export twice. If two rows share a deal_id, keep the one with the later
  close_date. If the dates are the same, keep the one lower down the file.
- Outcome is typed many ways. Anything containing the word won, in any letters, is `won`. Anything
  else is `lost`.
- Amounts are typed many ways: $118,000 and 118,000 and 118000 are the same, and 18k is 18000. A
  blank amount counts as 0. Say in the summary which deals have no amount.
- Competitor names: Rota Wise and rotawise are Rotawise. Shift Keep and ShiftKeep Inc are ShiftKeep.
  A blank competitor is written `none`.

## Reasons

Give each deal one reason: the one the notes say decided it. If the notes mention other things, ignore
them unless the notes say they decided the deal. If the notes are blank or give no reason, the reason
is `not_stated`.

| Reason | Use it when the deal was decided by |
|---|---|
| price | What we cost against the other choice, including discounts, bundles and free offers. |
| features | Something our product does or does not do. |
| ease_of_use | How quickly people could set it up or use it, in a trial or a demo. |
| integration | Whether we connect to another named system the customer runs. |
| support | How fast and helpful our people were, in sales, onboarding or support. |
| security | A security review, a compliance demand or where data is held. |
| relationship | Who knew whom: a referral, a supplier already in place, a champion arriving or leaving. |
| timing | Budget frozen or cut, the project postponed or no decision made. |
| not_stated | The notes are blank or do not say. |

## Win rate

Win rate is deals won divided by all closed deals, as a percentage with one decimal.
output/by_competitor.csv · written by the agent, 5 lines
competitor,deals,won,lost,win_rate_pct
Rotawise,13,5,8,38.5
ShiftKeep,12,6,6,50.0
Plannery,12,4,8,33.3
none,7,5,2,71.4
output/by_reason.csv · written by the agent, 16 lines
outcome,reason,deals,amount
lost,price,7,236600.00
lost,features,4,250300.00
lost,timing,4,164500.00
lost,integration,2,39500.00
lost,not_stated,2,11300.00
lost,relationship,2,163000.00
lost,security,2,129000.00
lost,support,1,26000.00
won,ease_of_use,5,85600.00
won,support,4,62400.00
won,integration,3,193500.00
won,relationship,3,69200.00
won,features,2,52000.00
won,price,2,51000.00
won,not_stated,1,9900.00
output/deal_reasons.csv · written by the agent, 45 lines
deal_id,account,outcome,amount,competitor,reason,quote
W-3100,Abbey Lane Plumbing,lost,8400.00,Rotawise,price,our quote was nearly double theirs and that decided it
W-3101,Barrowfield Electrical,won,26000.00,ShiftKeep,ease_of_use,Dispatchers had ours working in an afternoon and never finished setting up ShiftKeep
W-3102,Carrick Lifts,lost,118000.00,Plannery,features,We have no offline mode for engineers in lift shafts with no signal and they would not move without it
W-3105,Fenwick Pest Control,won,6800.00,Rotawise,support,They picked us because our onboarding person answered every question the same day during the trial
W-3103,Dunholme Heating,won,7200.00,none,relationship,Owner's brother in law uses us and told him to buy it
W-3104,Easby Fire Safety,lost,31500.00,Rotawise,timing,Budget was frozen by the new finance director the week we sent the contract
W-3106,Garsdale Glazing,lost,22000.00,ShiftKeep,integration,"ShiftKeep connects to their accounts package, Ledgerline, and we do not"
W-3107,Hexham Roofing,won,9600.00,none,ease_of_use,ours was the only one he could work in the demo himself
W-3108,Ingleby Security Systems,lost,96000.00,Plannery,security,They need data held in the UK and we could not offer that
W-3109,Jarrow Drainage,lost,18000.00,Rotawise,price,Lost on price. Rotawise came in 30% under us
W-3110,Kelso Air Conditioning,won,34000.00,Plannery,integration,"We won because we sync with their stock system, Partbin, out of the box"
W-3111,Lanchester Locksmiths,lost,5400.00,none,not_stated,
W-3112,Morpeth Solar,won,41000.00,ShiftKeep,relationship,The ops lead used us at her last company and brought us in
W-3113,Norham Lifts,lost,134000.00,Plannery,relationship,Plannery has been their supplier for payroll for ten years and the group IT head would not look past them
W-3114,Otterburn Cleaning,lost,4900.00,Rotawise,price,Too expensive for a five person firm
W-3115,Prudhoe Boilers,won,27500.00,Rotawise,features,"They chose us for the parts tracking screen, which Rotawise does not have at all"
W-3116,Rothbury Tree Care,lost,0.00,none,timing,"No decision. Owner went quiet after the demo, then said he is putting it off until after the winter season"
W-3117,Seahouses Marine Repair,won,23000.00,ShiftKeep,price,"We matched ShiftKeep and threw in the first two months, and that settled it"
W-3118,Tynemouth Alarms,lost,88000.00,ShiftKeep,features,They need customer facing booking pages and we do not have them
W-3119,Ulgham Fencing,won,5200.00,none,ease_of_use,Said the trial was so simple he did not need the second demo
W-3120,Wark Pumps,lost,29000.00,Plannery,relationship,Our champion left the company in August and the new manager had no interest
W-3121,Yetholm Kitchens,won,19500.00,Rotawise,support,They met our support lead on the call and said that is why they are moving
W-3122,Alnmouth Electrical,lost,102000.00,Plannery,price,Lost on price at the last step
W-3123,Belford Gas Services,won,36000.00,ShiftKeep,ease_of_use,the decision was made when the engineers used the rota screen with no explaining at all
W-3124,Craster Fire Doors,lost,6300.00,Rotawise,features,They wanted quoting built in so engineers can price a job on site. We do not do quotes
W-3125,Doddington Lifts,won,127000.00,Plannery,integration,"The deciding point was the link to their finance system, Ledgerline"
W-3126,Embleton Glass,lost,24000.00,ShiftKeep,timing,Project postponed
W-3127,Felton Heating,won,8800.00,Rotawise,ease_of_use,his office manager set up the whole trial herself in a morning
W-3128,Glanton Drains,lost,5900.00,Rotawise,not_stated,
W-3129,Harbottle Security,lost,33000.00,Plannery,security,Security sign off failed
W-3130,Ilderton Roofing,won,21000.00,ShiftKeep,relationship,Referred by Morpeth Solar. They trusted the referral
W-3131,Kirknewton Lifts,lost,91000.00,Plannery,price,We lost on price
W-3132,Lowick Pest Control,won,6100.00,none,support,our support team rebuilt her job list for her during the trial
W-3133,Milfield Solar,lost,38000.00,ShiftKeep,features,Engineers need to capture customer signatures on a tablet. We cannot do it yet
W-3134,Netherton Boilers,won,28000.00,Rotawise,price,Won on price
W-3135,Ord Plumbing,lost,7700.00,Rotawise,price,our price per engineer was too high for a seasonal business
W-3136,Powburn Electrical,won,32500.00,Plannery,integration,"They liked that we connect to Partbin, the stock system they already run"
W-3137,Rennington Alarms,lost,26000.00,ShiftKeep,support,ours took four days to send a revised quote. Buyer said we were slow and hard to reach
W-3138,Shilbottle Kitchens,won,9900.00,none,not_stated,
W-3139,Thropton Fire Safety,lost,109000.00,Plannery,timing,No decision this year. The board cut the whole operations budget in October
W-3140,Ulgham Fencing Depot,lost,17500.00,ShiftKeep,integration,"We do not connect to their route planner, Wayfarer"
W-3141,Warenford Glazing,won,24500.00,ShiftKeep,features,The recurring maintenance contracts feature won it
W-3142,Yeavering Tree Surgeons,lost,4600.00,Rotawise,price,Cheaper option won
W-3143,Acklington Heating,won,30000.00,Plannery,support,our support hours were the reason
output/win_loss_summary.md · written by the agent, 70 lines
# Win and loss review

Source: `input/closed_deals.csv`, cleaned with `input/reason_guide.md`. The export has 46 rows. It holds 44 distinct deals, because two deal_ids appear twice.

## Headline

- Closed deals: 44. Won: 20. Lost: 24.
- Overall win rate: 45.5% (20 of 44).
- Total amount won: 523,600.00
- Total amount lost: 1,020,200.00

## Why we lost (24 deals, most to fewest)

| Reason | Deals | Amount |
|---|---|---|
| price | 7 | 236,600.00 |
| features | 4 | 250,300.00 |
| timing | 4 | 164,500.00 |
| relationship | 2 | 163,000.00 |
| security | 2 | 129,000.00 |
| integration | 2 | 39,500.00 |
| not_stated | 2 | 11,300.00 |
| support | 1 | 26,000.00 |
| **Total** | **24** | **1,020,200.00** |

Reasons with the same count are listed with the larger amount first.

## Why we won (20 deals, most to fewest)

| Reason | Deals | Amount |
|---|---|---|
| ease_of_use | 5 | 85,600.00 |
| support | 4 | 62,400.00 |
| integration | 3 | 193,500.00 |
| relationship | 3 | 69,200.00 |
| features | 2 | 52,000.00 |
| price | 2 | 51,000.00 |
| not_stated | 1 | 9,900.00 |
| **Total** | **20** | **523,600.00** |

## Win rate against each competitor

| Competitor | Deals | Won | Lost | Win rate |
|---|---|---|---|---|
| Rotawise | 13 | 5 | 8 | 38.5% |
| ShiftKeep | 12 | 6 | 6 | 50.0% |
| Plannery | 12 | 4 | 8 | 33.3% |
| none | 7 | 5 | 2 | 71.4% |

## Three things to do next

1. **Review pricing against Rotawise and for small seasonal firms.** Price is the top loss reason: 7 of 24 losses, 236,600.00. Five of those 7 were to Rotawise (W-3100, W-3109, W-3114, W-3135, W-3142). We win only 38.5% of Rotawise deals. Two wins (51,000.00) came from a bundle and a multi-year discount, so discounting does work when we use it.
2. **Take the four feature gaps to product.** Features is 4 losses worth 250,300.00, the largest amount of any loss reason. The gaps are offline mode, customer booking pages, quoting and tablet signatures. Two more losses (39,500.00) were missing integrations (Ledgerline, Wayfarer). Integration also won 3 deals worth 193,500.00, so it pays when we have the connector.
3. **Follow up the timing losses.** Four deals worth 164,500.00 were lost to frozen budgets, postponements or no decision (W-3104, W-3116, W-3126, W-3139). No competitor won these. Set a re-contact date for each. W-3116 has no amount in the export, so confirm its value first.

## What the export could not tell us

- **Missing amount:** W-3116 (Rothbury Tree Care, lost) has a blank amount and is counted as 0.00. The lost total is therefore understated by whatever that deal was worth.
- **Notes with no reason (not_stated):**
  - W-3111 Lanchester Locksmiths (lost) has blank notes.
  - W-3138 Shilbottle Kitchens (won) has blank notes.
  - W-3128 Glanton Drains (lost) has notes saying the call notes are missing and the buyer has not replied.
  - Together they total 21,200.00 (lost 11,300.00, won 9,900.00).
- **Duplicates removed:**
  - W-3105 Fenwick Pest Control appears twice. I kept the 2026-07-17 row (won) over the 2026-06-30 row (lost).
  - W-3119 Ulgham Fencing appears twice with the same date and content. I kept the lower row.
  - Both choices follow the guide. W-3105 would be a loss if the earlier row were the right one.
- **Competitor field:** 7 deals have no competitor listed (shown as `none`), including 2 of the 3 not_stated deals (W-3111, W-3138). I took a blank to mean no competitor, as the guide says.
- **Unrecorded:** The export has no lost-deal reasons from the customer beyond the free-text notes, and no deal stage or sales cycle length. I did not estimate any of these.
- **Judgement calls on mixed notes:** I used the factor the notes name as decisive. W-3123 mentions a security questionnaire but the buyer said ease of use decided it. W-3127 and W-3115 mention price but give another reason as the decider.
check.py · the check, written before the run
"""Cleans the export again, recounts everything and checks each reason against the deal's own notes.

The list below gives, for each deal, the reason its notes say decided it and the words in the notes
that say so. The check first confirms those words are in that deal's notes in the input file.
"""
import csv, re, sys
from pathlib import Path
root = Path(sys.argv[1]); ok = True
def say(passed, text):
    global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
KEY = {
 "W-3100": ("price", "nearly double"),
 "W-3101": ("ease_of_use", "working in an afternoon"),
 "W-3102": ("features", "no offline mode"),
 "W-3103": ("relationship", "brother in law uses us"),
 "W-3104": ("timing", "Budget was frozen"),
 "W-3105": ("support", "answered every question the same day"),
 "W-3106": ("integration", "connects to their accounts package"),
 "W-3107": ("ease_of_use", "without training"),
 "W-3108": ("security", "data held in the UK"),
 "W-3109": ("price", "30% under us"),
 "W-3110": ("integration", "sync with their stock system"),
 "W-3111": ("not_stated", ""),
 "W-3112": ("relationship", "used us at her last company"),
 "W-3113": ("relationship", "their supplier for payroll for ten years"),
 "W-3114": ("price", "Too expensive"),
 "W-3115": ("features", "parts tracking screen"),
 "W-3116": ("timing", "putting it off until after the winter"),
 "W-3117": ("price", "Came down to price"),
 "W-3118": ("features", "customer facing booking pages"),
 "W-3119": ("ease_of_use", "so simple"),
 "W-3120": ("relationship", "champion left the company"),
 "W-3121": ("support", "met our support lead"),
 "W-3122": ("price", "undercut us"),
 "W-3123": ("ease_of_use", "with no explaining"),
 "W-3124": ("features", "quoting built in"),
 "W-3125": ("integration", "link to their finance system"),
 "W-3126": ("timing", "Project postponed"),
 "W-3127": ("ease_of_use", "set up the whole trial herself"),
 "W-3128": ("not_stated", "Notes from the call are missing"),
 "W-3129": ("security", "Security sign off failed"),
 "W-3130": ("relationship", "trusted the referral"),
 "W-3131": ("price", "We lost on price"),
 "W-3132": ("support", "support team rebuilt her job list"),
 "W-3133": ("features", "customer signatures"),
 "W-3134": ("price", "Won on price"),
 "W-3135": ("price", "price per engineer was too high"),
 "W-3136": ("integration", "connect to Partbin"),
 "W-3137": ("support", "slow and hard to reach"),
 "W-3138": ("not_stated", ""),
 "W-3139": ("timing", "board cut the whole operations budget"),
 "W-3140": ("integration", "do not connect to their route planner"),
 "W-3141": ("features", "recurring maintenance contracts feature"),
 "W-3142": ("price", "a third of our price"),
 "W-3143": ("support", "support hours were the reason"),
}
NAMES = {"rotawise": "Rotawise", "shiftkeep": "ShiftKeep", "shiftkeepinc": "ShiftKeep", "plannery": "Plannery", "": "none"}
def flat(text): return re.sub(r"\s+", " ", text).strip().lower()
def money(text):
    t = text.replace("$", "").replace(",", "").replace(" ", "").lower()
    return 0.0 if not t else float(t[:-1]) * 1000 if t.endswith("k") else float(t)
keep, raw, typed = {}, 0, {}
for r in csv.DictReader((root/"input/closed_deals.csv").open()):
    raw += 1; old = keep.get(r["deal_id"]); typed[r["deal_id"]] = typed.get(r["deal_id"], "") + " " + " ".join(r.values())
    if old is None or r["close_date"] >= old["close_date"]: keep[r["deal_id"]] = r
assert set(keep) == set(KEY)
want = {}
for k, r in keep.items():
    assert flat(KEY[k][1]) in flat(r["notes"]), k
    want[k] = dict(outcome="won" if "won" in r["outcome"].lower() else "lost", amount=money(r["amount"]),
                   competitor=NAMES[re.sub(r"\s", "", r["competitor"]).lower()], reason=KEY[k][0], notes=flat(r["notes"]))
path = root/"output/deal_reasons.csv"
if not path.exists():
    say(False, "output/deal_reasons.csv was not written"); sys.exit(1)
rows = list(csv.DictReader(path.open())); got = {(r.get("deal_id") or "").strip(): r for r in rows}
def val(k, col): return (got.get(k, {}).get(col) or "").strip()
def num(text):
    try: return float(str(text).replace(",", "").replace("$", "").replace("%", "").strip())
    except ValueError: return None
def same(a, b): return a is not None and abs(a - b) < 0.005
n = len(want)
say(set(got) == set(want) and len(rows) == n, f"{len(set(got) & set(want))} of {n} closed deals appear once, with the {raw - n} repeated rows left out")
clean = sum(1 for k, w in want.items() if val(k, "outcome").lower() == w["outcome"] and same(num(val(k, "amount") or "0"), w["amount"]) and val(k, "competitor") == w["competitor"]
            and val(k, "account") == keep[k]["account"].strip())
say(clean == n, f"{clean} of {n} deals have the account from the export and the outcome, amount and competitor name the guide's cleaning rules give")
reasons = sum(1 for k, w in want.items() if val(k, "reason") == w["reason"])
say(reasons == n, f"{reasons} of {n} reasons are the one the deal's own notes say decided it")
with_reason = [k for k, w in want.items() if w["reason"] != "not_stated"]
quoted = sum(1 for k in with_reason if len(flat(val(k, "quote"))) >= 8 and flat(val(k, "quote")) in want[k]["notes"])
empty = sum(1 for k, w in want.items() if w["reason"] == "not_stated" and not val(k, "quote"))
say(quoted == len(with_reason) and empty == n - len(with_reason), f"{quoted} of {len(with_reason)} quotes are word for word from the notes of their own deal and {empty} of {n - len(with_reason)} deals with no reason given have no quote")
comp = {}
for w in want.values():
    c = comp.setdefault(w["competitor"], [0, 0]); c[0 if w["outcome"] == "won" else 1] += 1
cgot = {(r.get("competitor") or "").strip(): r for r in csv.DictReader((root/"output/by_competitor.csv").open())} if (root/"output/by_competitor.csv").exists() else {}
cs = sum(1 for c, (won, lost) in comp.items() if c in cgot and num(cgot[c].get("won")) == won and num(cgot[c].get("lost")) == lost and num(cgot[c].get("deals")) == won + lost
         and abs((num(cgot[c].get("win_rate_pct")) or -9) - won / (won + lost) * 100) < 0.051)
say(cs == len(comp) and set(cgot) == set(comp), f"{cs} of {len(comp)} competitor rows have the right deal counts and win rate")
by = {}
for w in want.values():
    b = by.setdefault((w["outcome"], w["reason"]), [0, 0.0]); b[0] += 1; b[1] += w["amount"]
bgot = {((r.get("outcome") or "").strip().lower(), (r.get("reason") or "").strip()): r for r in csv.DictReader((root/"output/by_reason.csv").open())} if (root/"output/by_reason.csv").exists() else {}
bs = sum(1 for k, (c, a) in by.items() if k in bgot and num(bgot[k].get("deals")) == c and same(num(bgot[k].get("amount")), a))
say(bs == len(by) and set(bgot) == set(by), f"{bs} of {len(by)} reason rows have the right deal count and amount")
text = (root/"output/win_loss_summary.md").read_text() if (root/"output/win_loss_summary.md").exists() else ""
won = [w for w in want.values() if w["outcome"] == "won"]; lost = [w for w in want.values() if w["outcome"] == "lost"]
rate = f"{len(won) / n * 100:.1f}%"; nums = {float(x.replace(",", "")) for x in re.findall(r"\d[\d,]*\.\d{2}", text)}
wa, la = sum(w["amount"] for w in won), sum(w["amount"] for w in lost)
say(rate in text and wa in nums and la in nums, f"win_loss_summary.md states the win rate {rate} from {len(won)} won and {len(lost)} lost, with {wa:,.2f} won and {la:,.2f} lost")
DATE = r"\d{4}-\d\d-\d\d"
def figures(t):
    t = re.sub(r"\b[A-Za-z]+-\d+\b|" + DATE + r"|^\s*\d+\.\s", " ", t)
    return [float(x.rstrip(",").replace(",", "")) for x in re.findall(r"(?<![\w.])\d[\d,]*(?:\.\d+)?", t)]
def on_a_line(word, values):
    return any(re.search(r"\b" + re.escape(word.lower()) + r"\b", ln.lower()) and all(any(abs(x - v) < 0.005 for x in figures(ln)) for v in values) for ln in text.splitlines())
pairs = sum(1 for (o, r), (c, a) in by.items() if on_a_line(r, [c, a]))
rates = sum(1 for c, (w_, l_) in comp.items() if on_a_line(c, [round(w_ / (w_ + l_) * 100, 1)]))
say(pairs == len(by) and rates == len(comp), f"win_loss_summary.md gives the right count and amount for {pairs} of {len(by)} reasons and the right win rate against {rates} of {len(comp)} competitors")
groups = {}
for w in want.values():
    for o in (w["outcome"], None):
        for r in (w["reason"], None):
            for c in (w["competitor"], None):
                g = groups.setdefault((o, r, c), [0, 0.0, 0]); g[0] += 1; g[1] += w["amount"]; g[2] += w["outcome"] == "won"
base = {float(n), float(raw), float(raw - n), float(sum(1 for r in keep.values() if not r["notes"].strip())), float(sum(1 for r in keep.values() if not r["amount"].strip()))}
for c, a, won_ in groups.values(): base |= {float(c), a, round(won_ / c * 100, 1)}
claims = good = 0
for ln in text.splitlines():
    allowed = set(base); named = [k for k in re.findall(r"\b[A-Za-z]+-\d+\b", ln) if k in typed]
    for k in named: allowed |= set(figures(typed[k])) | {want[k]["amount"]}
    for x in figures(ln): claims += 1; good += any(abs(x - a) < 0.005 for a in allowed)
    for d in re.findall(DATE, ln): claims += 1; good += any(d in typed[k] for k in named)
say(claims > 0 and good == claims, f"{good} of {claims} numbers and dates in win_loss_summary.md are a count, amount or win rate for a group of deals worked out again, or a value from a deal named on that line")
sys.exit(0 if ok else 1)

closed_deals.csv: sample data written by Atris. Fingerprint 7fd7f0094c6b.

reason_guide.md: sample data written by Atris. Fingerprint 022dc039b193.

by_competitor.csv: written by the agent. Fingerprint e82dc334784d.

by_reason.csv: written by the agent. Fingerprint c3af6c232f3b.

deal_reasons.csv: written by the agent. Fingerprint bef8b3db704b.

win_loss_summary.md: written by the agent. Fingerprint f8ae40644b5a.


More sales work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms