name: cleanup description: Run kunji's production-readiness hygiene sweep — no junk tracked, gates green, .gitignore coverage, no secrets/PII, no debug/dead code. Use when the user asks to clean up the repo, make it production/ship/publish ready, or tidy before a release. Applies unambiguous fixes and flags judgment calls; it does NOT hunt bugs (security-audit) or maintainability issues (code-audit), and does NOT version/deploy (release/deploy).
Cleanup — production readiness (kunji)
A repeatable "is this repo ready to ship" sweep. Apply the safe, unambiguous fixes; flag anything
judgment-dependent. This is hygiene only — defer bugs to security-audit, maintainability to
code-audit, and versioning/deploy to release/deploy.
Know the intentional exceptions (do NOT delete or "fix" these)
landing/rp.js+landing/rp.v1.js— the built widget (source inwidget/), committed on purpose.examples/*/package-lock.json— committed deliberately for reproducible installs..firebaserc(root + examples) — holds only public project IDs.- The Firebase web
apiKeyin client config /landing/rp.jsis public — never a finding. examples/**console.logs are intentional demo output — leave them.reports/is git-ignored audit ledgers — must never be staged.
Checklist
- Tree & tracked artifacts.
git ls-filesshows nothing junk tracked: nodist/,node_modules/,.env*,*.pem,serviceAccount.json,.agent-key,.mcp-state.json, scratch dirs.git statusclean of stray files. (Cross-check against the exceptions above.) .gitignorecoverage. Root ignoresnode_modules,dist,.env*,.firebase/,reports/. Safe-fix: root currently lacks.agent-key/.mcp-state.json— add them as a fallback. Eachexamples/*/.gitignoreshould covernode_modules,*.pem,serviceAccount.json, and (agent/relay demos).agent-key/.mcp-state.json.- Debug / dead code — production paths only. Grep
src/ widget/ functions/forconsole.log|console.debug|debugger|TODO|FIXME|XXX|HACK→ must be zero. Exclude lockfiles (':!*package-lock.json') — base64integrityhashes contain substrings likeXXXand false-match. (console.error/warnare legitimate;examples/**demo logs are fine.) - Dependency hygiene. No reintroduced unused deps (the removed set:
dexie,uuid,@yudiel/react-qr-scanner,tailwindcss-animate). Lockfile in sync. Optional:npx depcheck. - Gate green.
npm run lint && npm test && npm run build(lint is--max-warnings 0), plusnpx prettier --check .— theformatscript is write-only, so check formatting non-mutating. - Secrets / PII. No private keys, tokens, service-account JSON, or PII in tracked code, logs, or
the built bundle (
dist/,landing/rp.js).git ls-files | grep -iE 'secret|credential|serviceAccount|\.pem|\.key'. - Docs coherence.
AGENTS.mdrepo map +README.mdexample list match what's on disk (e.g. allexamples/*present). Defer the version bump / tag torelease.
Method & output
- Walk the checklist read-only first; apply only unambiguous hygiene fixes (e.g. a missing
.gitignoreline). Anything judgment-dependent (delete a file? change lockfile strategy?) → flag, don't do. - Re-run the gate after any fix.
- Summarize as a short pass/fail per item: what was applied, what's flagged for the user, and what
was checked clean. Never stage
reports/.