
Let the script do the maths
Which sums AI agent skills in AWS Quick should hand to a script.
Series: Skills you can trust (3 articles)
- 2Let the script do the maths This article
By Mrunal Shridhar and Jed Lechner. Part 2 of 3 in the series "Skills you can trust".
About this series. This series builds on work Jed Lechner started. Jed wrote How skills and agents work in AWS Quick and the AWS Quick catalog's guide Build skills with software engineering practices , and he built the Skill Architect skill these articles use. I'm picking up those topics and building on them with my own tests, examples and input. Full credit to Jed for kicking this off. Mrunal
AWS Quick in 30 seconds
AWS Quick is "the AI workspace built only for work". It helps you create, review, and automate work across the tools you and your agents already use ( AWS Quick ). With AWS Quick, teams use AI agents to research, analyze, and act across the data and applications they already use, and anyone can build agents, apps, and automations in plain language that the whole team can share ( AWS What's New ).
A skill is a reusable set of instructions that teaches an agent in AWS Quick how to do a specific task, such as preparing a weekly status update from your template. You capture it once, and AWS Quick applies those instructions whenever the task comes up. You can create your own skills, publish and share them, and install skills that other people share with you ( AWS Quick User Guide ).
Think of a skill as the handover notes you'd leave for a colleague who covers your job while you're away.

AWS Quick picks a skill by its name and description, then follows its steps.
You wouldn't ask the colleague covering for you to add up the budget in their head. This article is about what to hand to a calculator.
Which number would you sign off?
Imagine your team runs a "Monthly budget check" skill in AWS Quick. On 24 November it tells you:
Travel is 14.1% over budget. The team is £4,980.90 under budget overall.
This is a made-up example. Suppose a small program in the skill worked out the first number, and AWS Quick worked out the second one itself, in the chat. Could you tell which one to trust? Nothing in the sentence says.
Here the second one is wrong: two digits swapped, and the team is £4,908.90 under. That's the right sum, but not the whole story, as you'll see below.

Both numbers sound equally sure. Only the tag tells you which one you can check.
Every number has a source you can check

The dotted line is where AWS Quick stops. Above it, numbers. Below it, words.
AI is good at working out what you're asking and explaining the answer. It isn't a dependable calculator, even when it's checking work. In the test in article 1, AWS Quick without the skill passed 15 of 29 checks. The marker, a separate run of AWS Quick that checks each answer, set aside 5 checks those answers could never pass. All 5 were fails, which leaves 15 passes out of 24. The marker's note said 10 of 24. So even the checker shouldn't do the maths.
Skill Architect, a skill in the AWS Quick official catalog that builds, tests and reviews skills, has a rule for this ( rule 26 ). Arithmetic, reading files, and anything that must give the same result every run go in a tested script, "because a model can make arithmetic mistakes and can answer the same request differently, and a script does neither." Anthropic, which makes Claude, gives the same advice in its guide to writing skills .
A script is a small program that does the same steps every time. AWS Quick can write one for you, so you don't need to write it yourself. A skill can carry scripts with its instructions ( user guide ) and run calculations in them ( AWS blog ).
Every number in an answer comes from something you can check. The script reads your data, works out every figure, and writes them on a result sheet. AWS Quick reads the sheet, copies the numbers, and writes the words around them. If you doubt a number, you find it on the sheet.
What goes to the calculator

Two yes-or-no questions decide who does each part of the job.
The script does:
- adding up, percentages and averages
- rounding, and writing money amounts
- dates, weeks and month-ends
- sorting, ranking and "over the limit"
AWS Quick does:
- working out what you're asking
- deciding what to point out
- explaining the result in plain words
- asking you when something is unclear
The script writes each number exactly as it should appear, such as £4,908.90 or 14.1%, so it gets copied, never retyped. Retyping is one more place digits get swapped.
Test the script too

The same two charges, added two ways. Only one passes the test.
Computers store some decimals oddly. Ask most programs to add 0.1 and 0.2 and you get 0.30000000000000004. Spreadsheets round what they show, which is why 0.1 + 0.2 looks normal there. Our spending file has two PaperCo charges of £0.10 and £0.20. Added that way, they fail a check that they make £0.30. The Office supplies line comes to 96.64999999999999 instead of £96.65. The gap is tiny, but a budget that's out by any amount doesn't add up.
The fix: count money in whole pence, which gives £0.30 and £96.65 exactly.
A mistake in a script happens the same way every time, so a test catches it. Each script comes with its own small tests (sums, not article 1's test questions) whose answers someone worked out by hand, such as "£0.10 plus £0.20 is £0.30" and "Travel is £564.45 over". Skill Architect gives every script it writes a test ( rule 23 ), and our budget check's script came with 6, all passing. If AWS Quick wrote the tests too, check two or three of their answers yourself with a calculator. After every change, ask Skill Architect to run the tests again.
Bad data comes before the maths

Same data, same sums. The only difference is what a blank means.
A perfect calculator still gives the wrong answer if it misreads what the data means.
Our spending file has three rows dated 22 November with no amount, one each for Software, Training and Contractors. Each is marked "awaiting invoice": something was bought, and the bill hasn't arrived. Here is our result sheet for November so far:

Three lines have money left, but each is waiting for an invoice.
Count those blanks as zero, and the team looks £4,908.90 under budget, all green. Keep them as unknown, and the honest answer is "£4,908.90 under so far, with 3 invoices not in yet". Contractors has £1,200.00 left, and its supplier's last two invoices were £5,400.00 each. If the next one is the same, Contractors ends the month £4,200.00 over. The answer should name the lines still waiting, and how much room each has left, without guessing the bills.
The traps we look for in every source of data:
- Missing isn't zero. Decide what a blank means for each source, and never fill it with zero by default. The same goes for a whole month: for October, which isn't in the file, the script came back with £0.00 spent. The skill now says "no data for October" instead.
- Late data. The newest row in our file is from 22 November, two days before the check runs, and November has six days to go. The answer should say "figures to 22 Nov, month not final yet".
- Together isn't cause. If Travel and Events both went up this month, that doesn't mean one caused the other. The answer can say they moved together, nothing more.
- An estimate isn't the bill. In our file, the spending export holds estimates. The finance system holds the real numbers, and the answer should say so.
- Cut-off times. A hotel booked at 11:30 pm on 30 November could count in November or December. Decide which, write it in the skill, and stick to it.
Every step says how it can fail

Every step carries its own check and its own plan B.
Each step ends with two short lines, in Skill Architect's words. Validate: how the skill knows the step worked. If fails: what to do when it didn't. Without them, AWS Quick fills the gap with a guess, and you never know.
Skill Architect makes this a rule: every step needs a validation condition and an "If fails:" line, "or the agent cannot tell a step failed and cannot recover" ( rule 10 ).
On 24 November the newest row is from 22 November, so the step in the picture passes. If the export had stopped on 15 November, the skill would stop and say so, instead of reporting a half-empty month as good news.
In your work
- Finance: variance against budget, worked out by the script.
- HR: headcount and leave balances, with "not recorded yet" kept apart from zero.
- Sales: pipeline totals and win rates, with the cut-off date stated.
- Operations: response times and missed targets, marked "not final" while data is still arriving.
How to do it in AWS Quick
1. List every number before you build. Write down each figure the answer will show, and where it comes from. For the budget check: budgets from the budget file, spending from the spending file, everything else from the script.
2. Build the skill with Skill Architect. In AWS Quick on desktop, choose Customize, Skills, Browse all, then Official, search for "skill architect", and choose Install ( Install a skill ). Then type, for example, "Use Skill Architect to build a skill that checks our monthly spending against budget. Put every calculation in a tested script." Give it your list. It puts the sums in tested scripts, and gives every step Validate and If fails lines.
3. Ask your question, and check where the numbers came from. We asked our budget check "Are we over budget this month?". A good answer gives the date of its newest figures, says whether the month is over, and names anything it can't confirm.

Our budget check's real answer: dated, marked not final, with three lines unconfirmed.
4. Test it. Type "Use Skill Architect to test my Monthly budget check skill." Add one check of your own: every number in the answer matches the result sheet. Article 1 shows how to read the results.
Try it this week
Take a report you get from AWS Quick. Circle every number. For each one, ask: did it come from the data, from a script, or from AWS Quick's own maths? If you can't tell, assume the last. If the skill is yours, ask Skill Architect to move one of those sums into a tested script. If it isn't, send the number to the skill's owner.
Copy this

Print it, or copy the text below into your own notes.
Step card. Use one for every step in your skill.
Step: <what it does, in one line>Validate: <how it knows it worked>If fails: <what it does instead, and what it tells you>Bad data checklist. Fill one in for each source of data before you build.
Source of data: ______________
[ ] Missing: what does a blank mean? Not spent, not known yet, or truly zero?[ ] Late: how old is the newest row? Does every answer give that date?[ ] Not final: is the period over? If not, does the answer say "not final yet"?[ ] Estimate or bill: is this the final figure? Where are the real numbers?[ ] Cut-off: which day or month does a late-night entry belong to? Is it written in the skill?[ ] Together isn't cause: does any answer claim one number caused another?[ ] Every number: does each figure in the answer appear on the result sheet?Learn more from Jed
- How skills and agents work in AWS Quick : Jed's AWS blog post on how agents, skills and your data fit together, and how to build and share a skill.
- Build skills with software engineering practices : Jed's guide in the AWS Quick catalog to the practices Skill Architect applies for you.
- Skill Architect : the skill Jed built to plan, build, test and review skills in AWS Quick.
- "Encode Your Enterprise with Agents & Skills on Amazon Quick" : Jed's talk on the AWS Quick YouTube channel about getting started with agents and skills, recorded before the product was renamed AWS Quick.
- Jed on AWS Builder Center : follow him for what he publishes next.
About the authors
Mrunal Shridhar is a Sr. Worldwide Specialist Solutions Architect at Amazon Web Services specialising in agentic AI with AWS Quick. Prior to his current role, he led Solution Engineering for EMEA at Tableau (part of Salesforce), and has spent close to 20 years in data, analytics and business intelligence.
Jed Lechner is a Sr. Specialist Solutions Architect at Amazon Web Services specializing in agentic AI. Prior to his current role, he was a Software Engineer at AWS and other companies, with a focus on energy and sustainability.
Series: Skills you can trust (3 articles)
- 2Let the script do the maths This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article