Why Docs Automation May Miss Updates
The pre-commit doc automation in scripts/docs/pre-commit-doc-update.mjs uses documentation-types.rules.json to map staged file patterns to doc types. If a new feature module is added that doesn't match any trigger pattern, the automation will not block the commit or prompt for doc updates.
Root Cause (LED-113 Example)
The LED-113 PR added src/data/user-settings/ and src/data/user-theme/. The customer-admin trigger pattern at the time was:
^src/data/(order|inventory|product|discount|customer|user|payment|shipment|bot-config|alert|audit-log|feature-flag|entitlement|tenant|address)/
Neither user-settings nor user-theme was in that list, so:
- Customer-admin docs were not triggered (admin panel themes/settings UI).
- API and reference docs were triggered (
.endpoint.ts,.service.ts,.repository.tsmatch).
The fix: add new feature folder names to the regex when introducing new src/data/<feature>/ modules.
Keeping Rules Up to Date
When you add a new feature under src/data/<feature>/:
- Add
<feature>to the customer-admintriggerPatternsregex indocumentation-types.rules.jsonif it has admin panel UI or admin-facing behavior. - Add
<feature>to the customer-guild-member pattern if it affects Discord ordering/checkout flows. - Run
pnpm docs:pre-commit-update(or commit) to verify the mapping works.
See Documentation Types and Rules for the full rules source of truth.