Sync Conventions
Audit all projects for convention drift and optionally fix issues found.
This skill is about patterns, not versions. Which tools are used, how scripts are named, what tsconfig settings are set, whether stale eslint/prettier config lingers. It does not touch package versions — bumping or aligning dependency versions belongs to update-all.
Context
- Projects list from zsh: !
grep -A20 'pupa()' ~/.zshrc | grep -oP '(?<= )[\w/\-]+' - Current working directory: !
pwd
Convention Checks
Run each check across ALL projects from the pupa() list (resolve paths as ~/Documents/Projects/{project}). For each check, report a table of project -> status (pass/drift).
1. Tooling Alignment
- All projects must use
oxlintandoxfmt(not eslint/prettier) for lint/format - Check root
package.jsondevDependencies for oxlint, oxfmt - Flag any eslint, prettier, @kyh/eslint-config, @kyh/prettier-config in deps or catalogs
- Flag any
eslint.config.*or.eslintrc.*or.prettierrc.*files - This is about tool choice, not tool version (versions →
update-all)
2. Script Consistency
Root package.json scripts should include:
"lint": should useoxlint"lint:fix": should useoxlint --fix"format": should useoxfmt"format:fix": should useoxfmt --write
3. TypeScript Config Health
- No
ignoreDeprecationsin any tsconfig.json - No
baseUrlwithout path aliases (deprecated in TS6) libshould use ES2023+ (not ES2022 or older)- Internal workspace packages (
exports→./src/*.ts, not published) must extend@kyh/tsconfig/base.jsonand have NObuildscript and nodev: tsc. Theirtypecheckis plaintsc --noEmit. Emitting.d.tsfor them is dead work —exportspoints at source, so nothing ever resolves thedist, andturbo's^buildmakes every app build wait on it. - Packages published to npm (
exports/publishConfig→./dist/*.d.ts) inline their own tsconfig — noextends, no@kyh/tsconfigdevDependency — so they build standalone. They are the only packages that keep abuildscript. @kyh/tsconfigshipsbase.jsononly. Any reference tointernal-package.jsonis stale.
4. Stale References
- No
"prettier": "@kyh/prettier-config"in any package.json - No eslint/prettier in pnpm-workspace.yaml catalogs
- No unused
@kyh/eslint-configor@kyh/prettier-configin catalogs or deps
5. oxlint Rule Config
The type-safety guardrails must be enforced in .oxlintrc.json (mirrors the CLAUDE.md "never compromise type safety" standard — it's the tool config, not a version):
typescript/no-explicit-any: errortypescript/no-non-null-assertion: errortypescript/consistent-type-assertions:["error", { "assertionStyle": "never" }]jsx-a11ypresent inplugins(for repos with a web/JSX app)
6. Database Tooling Convention
For any repo with a database (drizzle + Turso / Postgres / D1). The db scripts live in the db-owning package — packages/db normally, or the DB-owning app (e.g. apps/cloud) for D1-bound-to-a-worker setups. Both use the SAME convention; the only difference is a db: script prefix when the scripts share a multi-purpose app's package.json.
Canonical scripts (relative ../../.env* paths resolve to repo root):
with-env:dotenv -e ../../.env --push(ordb:push):pnpm with-env drizzle-kit pushpush:remote(ordb:push:remote):dotenv -e ../../.env.production.local -- drizzle-kit push— never a baredrizzle-kit pushrelying on loose shell envstudio(ordb:studio):pnpm with-env drizzle-kit studio- D1 repos also keep
push:local(ordb:push:local):drizzle-kit push --config drizzle.config.local.ts --force
Env files:
- Every repo with a remote DB must have
.env.production.local(gitignored) sopush:remoteworks. Flag if missing. - Turso split:
.env= local dev DB,.env.production.local= prod. D1: both hold the sameCLOUDFLARE_ACCOUNT_ID/CLOUDFLARE_DATABASE_ID/CLOUDFLARE_D1_TOKEN(single CF account across projects — onlyDATABASE_IDdiffers).
Schema is source of truth, push-based, no migration files:
- Flag any committed
packages/db/drizzle/(ormigrations/) dir — it drifts from the push-managed live DB. Delete it and any wrangler D1"migrations_dir"that points at it. (Durable-Object"migrations"blocks in wrangler.jsonc are unrelated class migrations — leave them.)
7. Secret Hygiene
- No real env file is git-tracked.
git ls-files | grep -iE '(^|/)\.env(\.|$)|\.dev\.vars$'must return nothing but.example/.sample/.template. .env,.env.local,.env.production.local,.dev.varsmust all be gitignored (git check-ignore).
8. Shared UI + Config Drift
packages/ui/src/styles/globals.cssmust NOT contain@source "../../../../apps/**/*.{ts,tsx}"(or acomponents/**cross-scan). Each app auto-detects its own Tailwind sources; the cross-app glob makes every app ship every other app's classes. Keep only the local@source "../**/*.{ts,tsx}".next.configis typed.ts(not.js) and has notypescript: { ignoreBuildErrors: true }.turbo.jsonbuild/typecheck edges use^topo(not^build) and dropdist/**outputs when no package actually emits a dist (ties into the internal-package rule in check 3).
Output Format
After running all checks, output a summary table (columns map to checks 1–8; - = N/A, e.g. no DB or no web app):
Project | Tool | Scripts | TSConfig | Stale | oxlint | DB | Secrets | UI/Cfg
------------+------+---------+----------+-------+--------+----+---------+-------
kyh.io | pass | pass | pass | pass | pass | - | pass | pass
dataembed | pass | pass | pass | pass | pass |dft | pass | pass
...
Then list each drift issue with the specific file and what needs to change.
Fixing
After showing the audit results, ask: "Fix all drift issues? (y/n)"
If yes, fix each issue:
- Remove stale references (eslint/prettier configs, dead catalog entries)
- Fix scripts to the canonical oxlint/oxfmt form
- Fix tsconfig settings
- Add missing oxlint type-safety rules (check 5) — then fix every violation the new rules surface; adding a rule that leaves lint red is not a fix. Repo-wide violation counts can be large; if you can't get to error-level cleanly, ratchet (error in shared packages,
warnelsewhere viaoverrides) andlog()what was deferred. - Align DB scripts to the canonical form (check 6); create any missing
.env.production.local(gitignored) from the repo's own prod creds — never commit it, and never copy a token between repos (the harness blocks cross-repo cred movement; hand that step to the user). Delete staledrizzle/migration dirs + their wranglermigrations_dirrefs. - Fix ui source-glob / next.config / turbo edges (check 8).
- Run
pnpm installper project (only if deps/catalogs changed) - Verify
pnpm typecheck+pnpm lintpass per project (run a realnext buildtoo when you touched next.config or app render code — typecheck alone misses prerender/client-boundary breaks). - Commit per project with message:
chore: sync conventions
Use parallel agents per project when possible to speed things up.
Out of scope — do NOT do these here:
- Running
push:remoteagainst a live DB. Convention-syncing the DB means the scripts, env files, and migration-dir cleanup — not applying schema to prod. A live push can hit drift (drizzle tries to recreate tables) and is a data operation. If a live DB has drifted fromschema.ts, note it and leave it for a deliberate, separately-confirmed reconciliation (throwaway data → drop-all + fresh push; real data → verify the push is additive-only first). - Secret remediation is urgent, not optional: if check 7 finds a tracked real env file, that's a leaked secret —
git rm --cachedit, confirm it's gitignored, and tell the user to rotate the exposed credentials. Don't bury it in the convention summary.
Rules
- Never bump or align package versions here — that's
update-all's job. If a project is on an old oxlint/typescript version, that's not drift for this skill; flag it only if the tool is missing or the wrong tool entirely.