Specs First, Code Second: Building Sheep Ledger with Kiro
This post was written as part of the Kiroween 2026 hackathon. The problem I kept hitting I lose free-tier offers in a very specific way. Not by forgetting they exist β by forgetting they require three sequent
This post was written as part of the Kiroween 2026 hackathon.
The problem I kept hitting
I lose free-tier offers in a very specific way. Not by forgetting they exist β by forgetting they require three sequential steps, each with its own cut-off. Sign up for a cloud trial, miss the "redeem your code" window that opened two weeks later, and the credit evaporates. VPS allocations, API free tiers, hackathon prize credits, subscription trials: the pattern is always a chain, and reminder tools only model single deadlines.
Sheep Ledger is my answer: a local-first web app where every offer is an ordered chain of stages, and the app continuously answers one question β what is the last day I can still start acting and win? It finds the next pending stage, subtracts its lead time in business days from the deadline, and surfaces that "last safe action date" with a risk level: Overdue, Urgent, Watch, Safe, Complete, or Missed.
Writing the contract before the code
I built this with the Kiro CLI, and the workflow was deliberately spec-first. Three documents came before any implementation:
- Requirements β 14 user stories with acceptance criteria, covering ledger management, risk computation, the dashboard, and import/export.
- Design β the data model, the business-day subtraction algorithm worked through four concrete examples, the six risk levels with exact thresholds, and the UI layout.
- Tasks β 42 small, verifiable steps in nine dependency-ordered groups.
The design doc earned its keep immediately. Business-day subtraction sounds trivial until you ask: deadline Monday, lead time one business day β is the answer Sunday or Friday? And what does zero lead time mean? Working those cases on paper meant the implementation had a specification to be checked against, not a vibe to be argued with.
Steering files: the feature I now consider essential
Three steering files constrained every agent response for the whole project:
-
tech.mdβ vanilla JS (ES2020), no build step, no frameworks,localStorageonly, plus rules for ID generation, date handling, and DOM manipulation. -
structure.mdβ exact file responsibilities, section order insideapp.js, a DOM ID registry, naming conventions. -
product.mdβ what the app is, who it is for, and an explicit out-of-scope list: no server, no notifications, no calendar sync.
The effect was not subtle. The agent never had to infer the architecture from context, so it never got the architecture wrong. Constraints stated once, up front, replaced dozens of corrections I would otherwise have made mid-flight. If you take one thing from this post: write the steering files before the first prompt, not after the first drift.
A hook as a compile step
Sheep Ledger has no build step, which means no compiler to catch a typo. A PostFileSave Kiro hook runs node --check on both JavaScript files after every save. It takes under a second and turns every save into a syntax sanity check. Two minutes to set up, and it quietly removed an entire class of "why is the page blank" debugging.
The bug my own test caught
The sample data ships six entries, one per risk level, with dates computed relative to today so the tiers stay correct whenever you open the app. Or so I claimed. During a final QA pass I wrote a sweep test that simulates opening the app on each of the seven weekdays β and the Urgent sample collapsed into Overdue on Thursdays, Fridays, and Saturdays. Its deadline was "today + 4 days" with a 3-business-day lead time; on a Thursday start, stepping backwards over the weekend lands the last safe date in the past. The fix was a different offset pair (+5 days, 2 business days) whose last safe date lands 1β3 days out on every weekday. That is exactly the kind of bug a spec-driven workflow is supposed to make cheap to find: the requirement said "stable across any starting weekday," so the test wrote itself.
What I learned
- Specs are cheapest where ambiguity is most expensive. The algorithm section needed precision; the UI layout section needed room. Knowing which is which is the actual skill.
- Steering beats prompting. A durable contract file outperforms re-explaining constraints in every message.
-
Small tasks verify well. "Implement
subtractBusinessDays" is checkable in a way "build the app" never is.
Sheep Ledger is live and open source (MIT): try the demo at https://xmsu7m-art.github.io/sheep-ledger/ , read the .kiro specs in the repo at https://github.com/xmsu7m-art/sheep-ledger , and steal the workflow. The last safe day to start was probably today.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.