Track Prices Over Time
Build a price tracker that records the price of one or more products/SKUs each time it runs, appending a timestamped history so you can see trends, drops, and the lowest price seen. Scopes the SKUs, the price-extraction rule, and the history-file schema FIRST, then builds the fetch-and-append routine that is idempotent per day and computes drop-from-previous and all-time-low. Schema-before-build keeps the history a clean append-only time series instead of a pile of inconsistent snapshots — the foundation any later chart or alert reads from.
Steps
Entry step: scope. Each step names the specialist role it wants; the full working prompt is expandable.
- Scope the trackerplannerentry
SKUs, price-extraction rule, and history schema
Show working prompt
Define the tracker before fetching. Step 1: list each product to track — a stable id/SKU, a label, and its URL or API. Step 2: define the price-extraction rule per source (which element/field holds the price) and the currency, and decide how to normalize (numeric, two decimals). Step 3: define the append-only history schema (e.g. CSV columns: timestamp, sku, label, price, currency, source_url) and the file path. Step 4: decide the run cadence and the idempotency rule (at most one row per sku per day — a re-run the same day updates rather than duplicates). Step 5: write an acceptance-criteria checklist ('every tracked SKU gets a row per run', 'prices are numeric and normalized', 'history is append-only and de-duplicated per day', 'drop-from-previous and all-time-low are computed', 'a failed fetch is logged, not silently dropped'). Call write_task_note with the SKU list + schema + checklist and write it to notes/scope.md. No code yet. - Build the trackerdeveloper
fetch each SKU, append a row, compute drop + low
Show working prompt
Implement the tracker to the locked schema. Step 1: load the existing history file (or create it with the header). Step 2: for each SKU, fetch the source and extract the price with the scoped rule, normalizing to a number; on a fetch error, log it and continue (do not write a fake price). Step 3: enforce idempotency — if a row already exists for this SKU today, update it; otherwise append a new timestamped row. Step 4: for each SKU compute drop-from-previous (this price vs the prior recorded price) and the all-time-low across history, and surface those in a small summary. Step 5: write the runnable script (cron-friendly) and ensure the history file stays valid and append-only. Call write_task_note with the script path, the history path, and the per-SKU current/low summary.
- Evaluatereviewer
Grade the deliverable against every acceptance criterion. All pass → finish; any fail → loop back and fix the gap.
Show working prompt
Run price_tracker.py (or trace it) and verify every criterion from notes/scope.md against the produced history file. Confirm: each tracked SKU has a row this run, prices are numeric and normalized, the history is append-only with at most one row per SKU per day (a same-day re-run does not duplicate), drop-from-previous and all-time-low are computed correctly, and a simulated fetch failure is logged rather than written as a bogus price. Write PASS/FAIL per criterion; on any failure, name it and loop back to build. Then route — this is the whole point of the loop: - **Every criterion PASSES →** call `advance_task_step({ ref, stepId: "evaluate", next: "finish" })`. - **Any criterion FAILS →** write the specific gaps to notes, then call `advance_task_step({ ref, stepId: "evaluate", next: "build" })` to loop back. The builder fixes exactly those gaps. Never route to `finish` while any criterion is unmet. The build phase's completion gate already blocked a grossly-incomplete deliverable; your job is the judgment an automated check cannot make (does it actually work, read well, look right). After ~3 unproductive loops, stop and report DONE_WITH_CONCERNS so the user can step in. - Finishdeveloper
All acceptance criteria met. Stamp a short summary and report DONE.
Show working prompt
Every acceptance criterion passed. Write a one-paragraph DONE summary to task notes via `write_task_note`: what was built, the deliverable path(s), and a one-line confirmation that each criterion is met. Then report DONE.
Triggers
Phrases that suggest this craftbook to a crew.
- track a price
- price history tracker
- watch product prices
- log prices over time
- price drop history
Source
View this craftbook on GitHub · MIT license