quality-check
Run ESLint and TypeScript type-checking on changed or specified files, grouped by package. Required by CLAUDE.md before completing any code change.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run ESLint and TypeScript type-checking on changed or specified files, grouped by package. Required by CLAUDE.md before completing any code change.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Audit changed TherrMobile files for the React Native failure classes that crash at runtime rather than at build time — native modules touched at import time, missing effect cleanup, unguarded navigation params and API responses, and system-bar/safe-area regressions. Fixes the safe ones, reports the rest, then verifies with the mobile tsc baseline and Jest.
Verify the full wiring matrix when a TherrMobile dependency is added, upgraded, or removed — which package.json owns it, Metro resolution and singleton blocking, Babel and tsconfig aliases, Jest mocks and transform patterns, patch-package version drift, and whether a native rebuild or pod install is required. Catches the module-resolution failures that only surface at runtime on device.
Go/no-go gate before cutting an Android or iOS build of a Therr mobile app. Verifies brand and branch agree, versionCode/versionName were bumped, patch-package patches match installed versions, no deprecated Android 15 APIs are referenced, locales are in parity, and the tsc baseline, lint, and Jest suites are green — then checks Play release notes and records post-release follow-ups.
Peer review the diff between general and stage branches. Implements low-risk improvements, fixes bugs, adds regression tests for bugfixes where valuable, resolves quality issues, and notes deployment steps. Runs local integration tests when the diff touches backend services (requires Docker Compose infrastructure for that case only).
Generate Knex migration files in the correct service and schema per docs/NICHE_APP_DATABASE_GUIDELINES.md. Enforces schema isolation (main.* core, habits.* / <niche>.* for niche features), correct naming convention, and up/down symmetry. Prevents the highest-cost mistake class in the backend — putting niche-specific tables on the main schema.
Check whether recent commits have made the root CLAUDE.md, docs/README.md, or key docs stale — new packages not listed, changed build commands, dependency version drift, new brand variants, or product changes that invalidate documented strategy. Run deliberately after a batch of work or before a release, not on every session.
| name | quality-check |
| description | Run ESLint and TypeScript type-checking on changed or specified files, grouped by package. Required by CLAUDE.md before completing any code change. |
Run lint and type-checking on modified files in this monorepo. This satisfies the code quality requirements in CLAUDE.md: ESLint must pass and TypeScript must have zero errors before any change is complete.
If --package <name> is given, target that package only. Package names match directory names:
therr-client-web, therr-client-web-dashboard, TherrMobiletherr-api-gatewaytherr-services/users-service, therr-services/maps-service, therr-services/messages-service, therr-services/reactions-service, therr-services/push-notifications-service, therr-services/websocket-servicetherr-public-library/therr-js-utilities, therr-public-library/therr-react, therr-public-library/therr-stylesOtherwise, get changed files:
git diff --name-only HEAD 2>/dev/null
git status --short 2>/dev/null
Combine staged, unstaged, and untracked .ts/.tsx/.js/.jsx files. Deduplicate. Skip deleted files.
Map each file path to its package using this prefix table:
| File prefix | Package dir | ESLint config | tsconfig |
|---|---|---|---|
TherrMobile/ | TherrMobile | TherrMobile/.eslintrc.js | TherrMobile/tsconfig.json |
therr-client-web/ | therr-client-web | therr-client-web/.eslintrc.js | therr-client-web/tsconfig.json |
therr-client-web-dashboard/ | therr-client-web-dashboard | therr-client-web-dashboard/.eslintrc.js | therr-client-web-dashboard/tsconfig.json |
therr-api-gateway/ | therr-api-gateway | therr-api-gateway/.eslintrc.js | therr-api-gateway/tsconfig.json |
therr-services/users-service/ | therr-services/users-service | therr-services/users-service/.eslintrc.js | therr-services/users-service/tsconfig.json |
therr-services/maps-service/ | therr-services/maps-service | therr-services/maps-service/.eslintrc.js | therr-services/maps-service/tsconfig.json |
therr-services/messages-service/ | therr-services/messages-service | therr-services/messages-service/.eslintrc.js | therr-services/messages-service/tsconfig.json |
therr-services/reactions-service/ | therr-services/reactions-service | therr-services/reactions-service/.eslintrc.js | therr-services/reactions-service/tsconfig.json |
therr-services/push-notifications-service/ | therr-services/push-notifications-service | therr-services/push-notifications-service/.eslintrc.js | therr-services/push-notifications-service/tsconfig.json |
therr-services/websocket-service/ | therr-services/websocket-service | therr-services/websocket-service/.eslintrc.js | therr-services/websocket-service/tsconfig.json |
therr-public-library/therr-js-utilities/ | therr-public-library/therr-js-utilities | therr-public-library/therr-js-utilities/.eslintrc.js | therr-public-library/therr-js-utilities/tsconfig.json |
therr-public-library/therr-react/ | therr-public-library/therr-react | therr-public-library/therr-react/.eslintrc.js | therr-public-library/therr-react/tsconfig.json |
Files outside these prefixes (shell scripts, markdown, JSON config) are skipped — no lint needed.
For each package that has changed .ts/.tsx files, run ESLint. Always run from the repo root.
Without --fix:
npx eslint <file1> <file2> ... --no-error-on-unmatched-pattern
With --fix:
npx eslint <file1> <file2> ... --fix --no-error-on-unmatched-pattern
Pass all changed files for that package in a single invocation. If the package has no .eslintrc.js (e.g., therr-styles), skip ESLint for that package.
For each package that was touched, run:
npx tsc --noEmit -p <package>/tsconfig.json 2>&1
Run from the repo root. Capture stdout+stderr together. A zero exit code means no errors.
Skip tsc for: therr-public-library/therr-styles (no TypeScript). Also skip if no tsconfig.json exists in the package.
If all checks pass: Print a single summary line:
✓ Quality check passed — <N> package(s) checked, 0 errors
No further output. Don't list every file or package when everything is green.
If any checks fail: Print a grouped report:
Quality check failed
ESLint errors:
therr-client-web/src/routes/Foo.tsx
Line 42: 'bar' is assigned a value but never used (no-unused-vars)
Line 58: Missing semicolon (semi)
TypeScript errors:
therr-services/users-service
src/handlers/users.ts(31,5): error TS2322: Type 'string' is not assignable to type 'number'
Packages checked: therr-client-web, therr-services/users-service
Then list specific action items needed to fix each error. If --fix was used, note which ESLint issues were auto-fixed and which remain.
--package is specified, always check it fullynpx is not found or a config file is missing, report that clearly rather than silently skipping