The Lead Time Watchboard
What you'll learn
~45 min- Model procurement timelines with backward propagation from milestone dates
- Calculate order-by deadlines accounting for lead time, submittal review, and shipping
- Visualize procurement windows with ASCII Gantt charts and status indicators
- Export closing-window alerts to ICS calendar files for proactive scheduling
What you’re building
Your VP just grabbed you in the hallway: “Noah, are we going to have the SV9 chillers on site by September?” You know the chillers have a 20-week lead time. You know the site needs them by September 15. But can you instantly tell him when the PO needs to be issued? Did you account for the 4-week submittal review cycle? The 2 weeks for shipping from the factory? The fact that you haven’t even awarded the vendor yet?
If you try to do the math in your head — September 15 minus 20 weeks manufacturing minus 4 weeks submittal review minus 2 weeks shipping minus 2 weeks vendor selection — you need to issue the PO by… early March? But it’s already mid-March. The window might be closing. Or it might already be closed. And now you’re standing in a hallway doing calendar math while your VP stares at you.
That’s a terrible position to be in. This is the tool that makes sure you never stand in that hallway doing subtraction again. It answers the question instantly, for every piece of equipment across every project, with a color-coded dashboard that shows exactly how much time you have left — or how much time you already don’t have.
You know what “the drop” means. It’s when the allocated bottles hit the shelf — and if you show up 30 minutes late, you’re watching someone else walk out with the last EHT SiB while 119 tells you they never had any. Procurement works the same way — every piece of equipment has a drop date (need-by date on site), and if you haven’t ordered by the order-by date, you’re not getting it on time. Period. This tool is your drop-date radar. It watches every window across every project and yells at you before one closes.
By the end of this lesson you’ll have a Node.js CLI tool that does the calendar math you’re sick of doing by hand. It models procurement timelines for every piece of equipment across every project, works backward from milestone dates to calculate the exact date you need to have a PO issued, paints a visual dashboard so you can see the whole portfolio at a glance, and exports calendar alerts so your phone yells at you before a window closes. No more hallway math. No more “let me get back to you.”
Need-by date - manufacturing lead time - submittal review - shipping = order-by date. This backward-propagation pattern works for any deadline-driven scheduling: event planning, product launches, regulatory filings, construction phasing. Anywhere you need to work backward from a fixed date through multiple sequential activities.
Here’s what it does
- Input: CSV with equipment items, need-by dates, lead times, and current procurement status — basically the “when do we need it and how long does it take to get it” spreadsheet you already maintain, minus the emotional damage
- Timeline calculation: Backward propagation from need-by date through manufacturing, submittal review, vendor selection, and shipping phases. It does the subtraction chain you keep doing on napkins
- Window status: Green (>30 days to order-by) means breathe. Yellow (15-30 days) means start moving. Red (<15 days) means move faster. Black (past order-by date) means you should’ve been moving two weeks ago
- ASCII Gantt: Visual timeline showing each equipment item’s procurement phases against a calendar. It’s not pretty, but it’s right — and it prints in your terminal without needing Excel to render it
- Calendar export: ICS file with order-by date reminders for each equipment item, because the best dashboard in the world is useless if you forget to open it
The prompt
Build a Node.js CLI tool called lead-time-watchboard that calculates andvisualizes procurement windows for data center MEP equipment.
PROJECT STRUCTURE:lead-time-watchboard/ package.json src/ index.js (CLI entry point using Commander.js) csv-loader.js (load equipment schedule from CSV) calculator.js (backward date propagation engine) gantt.js (ASCII Gantt chart renderer) alerts.js (window-closing alert generator) ics-export.js (ICS calendar file generator) data/ sv9-equipment.csv (sample equipment schedule) ch2-equipment.csv den3-equipment.csv
REQUIREMENTS:
1. CLI INTERFACE (src/index.js) Subcommands: node src/index.js dashboard [--project <code>] (show full watchboard) node src/index.js alerts [--days <n>] (items with order-by within N days, default 30) node src/index.js timeline <equipment-id> (detailed timeline for one item) node src/index.js export-ics [--project <code>] (export calendar reminders) Options: --data-dir <path> (directory with equipment CSVs, default: ./data) --output <path> (output directory, default: ./output)
2. CSV FORMAT (data/*.csv) Columns: equipment_id, project, equipment_type, description, vendor, need_by_date, lead_time_weeks, submittal_weeks, shipping_weeks, vendor_selection_weeks, status, po_date, notes
Status values: not-started, vendor-selection, po-issued, submittals, manufacturing, shipping, delivered
Sample data (10-12 items per project with realistic lead times): - Generators: 24-36 week lead time, 4 week submittal, 2 week shipping - Switchgear: 20-30 weeks, 4 weeks, 2 weeks - Chillers: 16-24 weeks, 3 weeks, 2 weeks - CRAHs: 12-18 weeks, 3 weeks, 1 week - UPS: 16-24 weeks, 3 weeks, 2 weeks - PDUs: 8-14 weeks, 2 weeks, 1 week
3. BACKWARD PROPAGATION (src/calculator.js) From need_by_date, subtract phases in reverse order: - Phase 5: Shipping (shipping_weeks) - Phase 4: Manufacturing (lead_time_weeks) - Phase 3: Submittal review (submittal_weeks) - Phase 2: Vendor selection / PO process (vendor_selection_weeks) - Phase 1: RFP period (default 3 weeks if status is not-started)
Calculate: - order_by_date: the latest date a PO can be issued and still meet need_by_date - days_remaining: calendar days from today to order_by_date (negative = past due) - window_status: green (>30 days), yellow (15-30), red (1-14), black (<=0) - If status is beyond a phase (e.g., po-issued), skip earlier phases in the calculation
4. DASHBOARD VIEW (dashboard subcommand) Display a table with columns: - Project | Equipment | Vendor | Need-By | Order-By | Days Left | Status | Window Sort by days_remaining ascending (most urgent first) Color-code the Window column: green/yellow/red/black Group by project with subtotals
5. ASCII GANTT (src/gantt.js) For the timeline subcommand, render an ASCII timeline showing: - Calendar months across the top axis - Phases as labeled bars: [RFP---][Vendor][Submit][===Manufacturing===][Ship] - Today marker with a vertical line - Need-by date marker - Color the current phase differently from completed and future phases
6. ICS CALENDAR EXPORT (src/ics-export.js) Generate an ICS file with: - An all-day event for each order-by date (with 7-day and 14-day reminders) - An all-day event for each need-by date - Event title format: "[PROJECT] Order-By: Equipment Type - Vendor" - Event description includes lead time, current status, and contact info
DEPENDENCIES: commander, csv-parse, chalk, cli-table3
SAMPLE RUN:node src/index.js dashboard# Shows all equipment across all projects sorted by urgency
node src/index.js alerts --days 14# Shows only items with order-by dates within 14 days
node src/index.js timeline SV9-CHILL-001# Shows detailed Gantt for SV9 chiller procurement
node src/index.js export-ics --project SV9# Exports SV9 procurement calendar to output/sv9-calendar.icsWhat you get
Fire it up
cd lead-time-watchboardnpm installnode src/index.js dashboardnode src/index.js alerts --days 14node src/index.js timeline SV9-GEN-001The dashboard shows everything sorted by how screwed you are. Red means call someone. Black means you should’ve called someone two weeks ago. Green means pour yourself a drink and enjoy the rare feeling of being ahead of schedule. The timeline command zooms in on a single piece of equipment and draws out the full procurement Gantt — RFP, vendor selection, submittals, manufacturing, shipping — so you can see exactly where you are in the process and how much runway is left.
If something is off
| Problem | Follow-up prompt |
|---|---|
| Dates calculating incorrectly | The order-by dates are wrong. Make sure date subtraction uses weeks (7 days per week) and accounts for the correct phase order. Use Date objects, not string manipulation. Subtract from need_by_date in this order: shipping, then manufacturing, then submittal, then vendor selection, then RFP. |
| All items show as “black” (past due) | Every item shows as past the order-by date. Check that the sample CSV data has need_by_dates in the future (at least 6 months out from today) and that the date parsing uses the correct format (YYYY-MM-DD). |
| ICS file not recognized by calendar apps | The .ics file doesn't import into Google Calendar or Outlook. Make sure the ICS format follows the RFC 5545 standard: BEGIN:VCALENDAR, VERSION:2.0, PRODID, then BEGIN:VEVENT / END:VEVENT blocks with DTSTART, DTEND, SUMMARY, DESCRIPTION, and UID fields. Use DTSTART;VALUE=DATE for all-day events. |
When Things Go Wrong
Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.
How it works (the 2-minute version)
This is basically a reverse calendar calculator with a nice paint job. Here’s the logic:
- CSV loader — reads your equipment schedules from each project’s CSV and merges them into one list. Same pattern as the submittal tracker. Nothing fancy, just “give me everything in one place.”
- Backward propagation — this is the engine. It starts at the need-by date and walks backward: subtract shipping time, then manufacturing lead time, then submittal review, then vendor selection, then RFP period. What falls out the back end is the latest possible date you can issue a PO and still make the deadline. It’s the math you do in your head during hallway ambushes, except it’s right every time and it doesn’t forget the submittal cycle.
- Window status — compares today against the calculated order-by date and assigns a color. Green means you’ve got more than 30 days of breathing room. Yellow means you’ve got 15-30 days and should be actively working it. Red means you’ve got less than two weeks and someone needs to be making phone calls today. Black means the window already closed and you’re into “how do we expedite this” territory.
- ICS export — takes all those dates and converts them into calendar events with built-in reminders. Because let’s be honest, you’re not going to remember to check a CLI dashboard every morning. But when your phone buzzes with “SV9 chiller order-by in 14 days,” you’ll actually do something about it.
Customize it
The base tool handles the “am I on time?” question. These extensions handle the “what if I’m not?” question. Paste either one after your initial build is working.
Add “what-if” scenario modeling
Add a "whatif" subcommand that lets you test scenarios:node src/index.js whatif SV9-CHILL-001 --lead-time 28This should show how the timeline changes if the chiller lead time increasesfrom 20 to 28 weeks. Show the old and new order-by dates side by side, andwhether the window status changes. Useful for evaluating vendor quotes withdifferent lead times.Add portfolio risk score
Add a --risk-score flag to the dashboard that calculates a portfolio riskscore (0-100) based on the percentage of items in red/black status weightedby equipment criticality. Generators and switchgear are critical (3x weight),chillers and UPS are major (2x weight), CRAHs and PDUs are standard (1x weight).Show the score prominently at the top of the dashboard.Key takeaways
- The math is the easy part — doing it consistently is the hard part — you can subtract 20 weeks from a date in your head. But doing it for 30 equipment items across three projects while accounting for submittals, shipping, and vendor selection? That’s where things fall through the cracks. The tool doesn’t do anything you can’t do. It just does it every time, for everything, without forgetting the shipping phase because you were distracted by a vendor call.
- Four colors beat forty columns of dates — green, yellow, red, black. That’s all your VP needs to see. That’s all you need to see at 7 AM when you’re scanning the portfolio with coffee in hand. The detailed timelines are there when you need them, but the color is the signal.
- Calendar alerts close the “I forgot to check” gap — the best tracking tool in the world is worthless if it lives in a terminal you open once a week. ICS export puts the deadlines where you already live: your calendar. When Outlook pings you “SV9 switchgear order-by in 7 days,” you don’t need discipline — you just need to not ignore your phone.
- Phase-aware math handles the real world — equipment that already has a PO doesn’t get penalized for “vendor selection time.” Items in manufacturing only count remaining manufacturing plus shipping. The calculator is smart enough to know where you actually are, not where you theoretically started.
You check the watchboard and see that SV9-SW-001 (main switchgear) has a need-by date of October 1, a 26-week manufacturing lead time, 4-week submittal review, 2-week shipping, and 2-week vendor selection. Status is 'not-started'. The order-by date shows as March 5 and it's currently March 19. What does this mean?
What’s next
Next up is The Budget Hound — because knowing your equipment is on time doesn’t help when you blow the budget getting it there. That tool tracks procurement costs across all your projects, calculates the variance between what you estimated and what you’re actually spending, generates waterfall charts that show where the money went, and produces the kind of narrative summaries that make finance people nod instead of frown. The equipment data from this watchboard feeds directly into budget tracking, because every line item here has a dollar sign attached to it whether you’re looking at it or not.