bmrc-org-config

Reads and manages runtime organization configuration stored in Firestore for a Next.js logistics app.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Org settings like thresholds, locations, categories, and vehicles are data in Firestore, not code. Reading them incorrectly (frozen constants, module-scope snapshots) silently ignores admin edits made in the /settings page, causing stale or wrong behavior across the app. ## Core Features & Use Cases - Correct config access patterns: Use the useOrgConfig() hook in React components and store getters like getThresholds() in pure lib code, never the frozen THRESHOLDS/LOCATIONS constants. - Merge semantics guidance: Explains shallow-merge behavior, per-key merging for org/thresholds, and the pickArray fallback where empty arrays revert to defaults. - Recipe for new settings: Step-by-step process to add an admin-editable setting across types, defaults, merge logic, hook, settings UI, and consumers. - Use Case: When adding a new expiration threshold, follow the recipe to update org-config.ts, the settings tab UI, and consume it via the hook so admin edits apply live without redeploys. ## Quick Start Use the bmrc-org-config skill to add a new admin-editable threshold setting and wire it through the settings page and consuming components.

Frequently Asked Questions about bmrc-org-config

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

FAQPage Schema
How do I read org config values in a React component?▼

Use the useOrgConfig hook to access live merged config values like thresholds and locations inside components. The OrgConfigProvider subscribes to the Firestore doc and falls back to defaults if no provider is present, so it never throws.

How do I access thresholds in pure library code without React?▼

Call the store getters from org-config-store.ts, such as getThresholds() or getLocationsRuntime(), in pure lib code like item-status.ts or inventory.ts. These read the runtime singleton merged from Firestore, not the frozen defaults.

Why are my admin settings changes being ignored in the app?▼

Admin edits are ignored when code imports frozen constants like THRESHOLDS or LOCATIONS, or reads config at module scope before Firestore loads. Move config access inside render functions or useMemo keyed on hook values to stay reactive.

What happens if an admin deletes all locations in settings?▼

The pickArray merge logic falls back to default values when an array is empty or missing, so deleting the last location resurrects the default set. You cannot configure an empty list; this protects against partial or corrupt documents.

How do I add a new admin-editable setting to the settings page?▼

Add the field to the type interface and DEFAULT_ORG_CONFIG, update applyOrgConfigDoc for new top-level keys, extend buildResult in the hook if needed, add a form control in the matching settings tab, and consume it via the hook or getter.

Does renaming a category update existing inventory records?▼

No, renaming a category or site does not relabel already-saved records. Old documents keep their original strings, so display code must tolerate unknown values.