Run a full project audit covering type checking, code quality, dead code, dependency security, duplicates, and structural issues. Use when asked to audit, lint, check quality, or clean up the project.
Run all checks below in order. Collect all findings, then present a summary table at the end with pass/fail/warn status for each category and actionable fixes for any failures.
Run npx tsc --noEmit and report any type errors.
Run cd JarvisApp && xcodebuild -scheme JarvisApp -configuration Debug build 2>&1 | grep -E "error:|BUILD" and report any Swift compile errors.
Run npx knip --no-exit-code to detect:
If knip is not installed, run it via npx knip (zero-install). Review results and flag anything that should be cleaned up vs. intentional stubs (files with Phase 2+ TODOs are expected to have unused exports).
Run npm audit to check for known vulnerabilities. If fixable, run npm audit fix and report what changed. Do NOT run npm audit fix --force without listing the breaking changes first.
Run npx jscpd --pattern "**/*.ts" --ignore "node_modules,dist,data" --min-lines 5 --min-tokens 50 --reporters consoleFull to find copy-pasted code blocks. Flag any duplicates that should be extracted into shared helpers.
Use Grep to check for common import issues:
.js extension on relative imports (required for ESM): search for from '\./ and from '\.\./ patterns missing .jsCompare the tool registrations in jarvis.ts and jarvis-server.ts. They must register the exact same set of tools. Any mismatch means the CLI and native app have different capabilities. Flag discrepancies.
Verify the project conventions from CLAUDE.md:
Tool interface (not a class)process.env via dotenvawait on better-sqlite3 calls)@MainActor on UI classesos.Logger not print() for debug outputCheck for:
engines field (node version requirement)npm outdated and flag major version bumpsCheck for:
.env, data/, .DS_Store, xcuserdata/)Scan for common security issues:
child_process.exec() usage (should be execFile to prevent shell injection)Present results as:
| Check | Status | Details |
|--------------------------|--------|-----------------------------------|
| TypeScript | PASS | |
| Swift Build | PASS | |
| Dead Code (knip) | WARN | 3 unused exports (Phase 2 stubs) |
| Dependency Security | PASS | |
| Duplicate Code | PASS | |
| Import Hygiene | PASS | |
| Tool Registration Parity | PASS | |
| Convention Compliance | PASS | |
| Package.json Health | WARN | 2 outdated deps |
| Git Hygiene | PASS | |
| Security Patterns | PASS | |
Then list actionable fixes grouped by severity (error > warning > info). Apply trivial fixes automatically (unused imports, missing .js extensions). Ask before making structural changes.