bmrc-statpack-flows

Guides checkout, check-in, and audit flows for BMRC statpack inventory in Next.js.

2|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/iv-zhang/BMRC-Logistics --skill bmrc-statpack-flows-iv-zhang
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bmrc-statpack-flows
Source: https://github.com/iv-zhang/BMRC-Logistics/tree/main/.claude/skills/bmrc-statpack-flows
Command: npx skills add https://github.com/iv-zhang/BMRC-Logistics --skill bmrc-statpack-flows-iv-zhang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Medical crews risk deploying with depleted or expired packs when checkout, check-in, and audit logic is implemented inconsistently. This Skill documents the unified check-off page, the transactional write behavior of logStatpackCheckOff, and the derived pack status rules so changes to the statpack lifecycle stay correct. ## Core Features & Use Cases - Unified check-off flow: Explains the single static page (app/statpacks/check-off/page.tsx) serving checkout, check-in, and audit modes via query params under Next.js static export. - Transactional write semantics: Details how logStatpackCheckOff updates pack contents, writes statpack_logs rows, derives pack status, handles restock, expirations, sharps, oxygen/AED checks, and issue reports. - Extension checklist: Provides steps for adding new per-item checks, updating status derivation, stripping undefined Firestore values, and verifying with the emulator suite. - Use Case: When adding a new per-item field (e.g., a battery check) to the check-off flow, follow the Skill to wire it through the entry mapping, pack contents persistence, and all three modes without breaking stats derivations. ## Quick Start Use the bmrc-statpack-flows skill to add a new per-item check field to the statpack check-off page and persist it through logStatpackCheckOff.

Frequently Asked Questions about bmrc-statpack-flows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new per-item check to the statpack check-off flow?▼

Add the field to the checkEntries element type in logStatpackCheckOff params, persist it in the entry mapping and onto pack contents if it is state, then wire the UI into the check-off page for every mode that needs it. Verify with npm run dev:emulator and npm run test:emulator.

Why can't I use a dynamic [id] route for the statpack check-off page?▼

The app builds with output: 'export' in next.config.ts, and pack IDs are Firestore runtime IDs unknown at build time. The required pattern is a static route with query params: /statpacks/check-off?id=<packId>&mode=<checkout|checkin|audit>.

How is statpack status derived after check-in or audit?▼

Status is derived inside logStatpackCheckOff, never set from the UI. Expired or reported items yield Expired Items, short-not-restocked items or a full sharps container yield Restock Needed, otherwise Ready; checkout always sets In Use.

Does restocking a statpack decrement shelf inventory counts?▼

No. Consumables have no linked shelf inventory count; restock only sets the item's currentQuantity back to par and updates status. Back-room replenishment is a human process, and discrepancies surface at the next checkout or admin audit.

What is the difference between audit mode and checkout in statpack logs?▼

Audit logs action: 'audit' and stamps lastAuditAt and lastAuditBy on the pack without taking ownership, while checkout sets status to In Use. Audit cadence is biweekly via getThresholds().statpackAuditIntervalDays, with overdue packs surfaced on the /audit Statpacks tab.