diff --git a/CLAUDE.md b/CLAUDE.md index 1ddc338..27c8329 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,6 +77,12 @@ cd client && npm run test:watch - Export pure functions (validators, formatters, etc.) for direct testing - Run `npm test` in both `server/` and `client/` before committing +**Doc drift check:** +```bash +node scripts/doc-drift.js +``` +Scans `CLAUDE.md` and `PRD.md` for verifiable code references (file paths, API routes, component names) and cross-checks each against the filesystem and source tree. Prints a PASS/FAIL report with doc name and line number. Exits non-zero on any failure — suitable for CI gating. + ## Application Structure The default route `/` renders the paycheck-centric main view (`client/src/pages/PaycheckView.jsx`). It shows the current month's two paychecks side-by-side with bills, paid status, one-time expenses, and remaining balance. Month navigation (prev/next) fetches data via `GET /api/paychecks?year=&month=`. diff --git a/scripts/doc-drift.js b/scripts/doc-drift.js index 369fd6f..9db41b1 100644 --- a/scripts/doc-drift.js +++ b/scripts/doc-drift.js @@ -79,7 +79,7 @@ function apiRouteExists(routePath) { const fragment = clean.replace(/^\/api/, ''); try { const out = execSync( - `grep -r --include="*.js" -l "${clean}\\|${fragment}" "${path.join(ROOT, 'server/src/routes')}"`, + `grep -rE --include="*.js" -l "${clean}|${fragment}" "${path.join(ROOT, 'server/src/routes')}"`, { stdio: ['pipe', 'pipe', 'pipe'] } ).toString().trim(); return out.length > 0;