Repo Standards
Use this skill to make changes that are consistent with the repo's established standards, and to review changes for “PR-ready” quality.
If the repo has a monorepo toolchain (pnpm workspaces, Turborepo), use it rather than running package-level commands ad hoc.
Quick Start (When You Need A Tight Answer)
- Identify package manager + orchestrator.
- Find the repo’s actual quality gates (
lint, typecheck, test, format, ci).
- Run the gates (preferred) or do a best-effort static review (fallback).
- Report issues with file references + exact commands to reproduce.
Workflow (Concrete)
- Discover what the repo enforces (source-of-truth first).
- Read root
package.json.
- Determine package manager:
package.json:packageManager if present.
- Else lockfile:
pnpm-lock.yaml > yarn.lock > package-lock.json.
- Identify orchestrator:
turbo.json and/or pnpm-workspace.yaml implies monorepo orchestration.
- If neither exists, assume single-package scripts in root
package.json.
- Identify “quality gate” scripts:
- Look for
lint, typecheck, test, format, ci in package.json:scripts.
- If a root
ci exists, prefer that (it usually reflects production gates).
- Identify tooling config files (read them, don’t guess):
- ESLint:
eslint.config.*, .eslintrc*
- Prettier:
prettier.config.*, .prettierrc*
- TS:
tsconfig*.json
- commitlint:
commitlint.config.*
- editor:
.editorconfig
- pre-commit:
.husky/, lint-staged.config.*
- Determine the scope you are enforcing.
- If reviewing a PR: scope is changed files only.
- If implementing: scope is “new/modified files + touched neighbors” (imports, types, tests).
- Identify whether changes are web (Next.js), mobile (React Native), or shared packages.
- Infer conventions from code (only when configs don’t fully specify).
- Look at 2-3 existing modules similar to the target area.
- Record conventions that are clearly consistent in the repo:
- file names (
kebab-case vs PascalCase)
- exports (default vs named exports)
- hooks naming (
useX)
- folders (e.g.,
app/ vs pages/, screens/, features/, components/)
- test placement and naming (
*.test.ts, __tests__/, etc.)
- Run the repo’s quality gates (preferred).
- Prefer the highest-level orchestrator the repo uses:
- If
turbo.json exists and there are scripts like turbo lint / turbo typecheck, use them.
- If pnpm workspaces are used, prefer
pnpm -r <script> or a repo-provided wrapper script.
- If you cannot run commands (or user didn’t ask), do a best-effort static check, but clearly label it as such.
- Enforce the “PR-ready” checklist (concrete checks).
- Formatting:
- No mixed quote/spacing style within a file.
- No manual alignment whitespace.
- Lint/TS:
- No new lint suppressions unless justified and localized.
- No new
any unless it’s the established repo approach.
- No unsafe non-null assertions unless a guard exists.
- React:
- Hooks rules respected; dependencies correct.
- No
useEffect that should be derived state.
- Next.js:
- Server/client boundary respected (no secrets in client bundles, no server-only imports in client components).
- Route conventions align with existing usage (
app/ vs pages/).
- React Native:
- Avoid inline anonymous components in render paths if it causes re-renders.
- Avoid expensive list item renders (FlatList) without memoization if the repo uses it.
- Tests:
- If similar code has tests, add/update tests following the same harness.
- If no tests exist, note the gap and propose the minimal test that would catch regressions.
- Report findings with evidence.
- Every finding must include:
- The file path(s)
- Why it violates the repo’s standard (config or observed pattern)
- Minimal fix guidance
- The command(s) that would fail (if applicable)
What to Avoid
- Do not add new tooling or configs unless the user asks.
- Do not change existing conventions to match personal preferences.
- Do not run heavy scripts unless requested.
Output Format
Provide:
- Summary (pass/fail status)
- Checks Run (if any)
- Findings (ordered by severity)
- Suggested Fixes (minimal, aligned to existing standards)
- “How to Verify” (exact script(s) to run)
Optional Helpers
- Use
scripts/discover_quality_gates.py to identify likely lint/typecheck/test commands without guessing.
Example Commands (only when asked to run)
# Prefer the repo's actual scripts; these are examples only.
# pnpm (single package)
pnpm run lint
pnpm run format
pnpm run typecheck
pnpm run test
# pnpm (workspace/monorepo common patterns)
pnpm -r run lint
pnpm -r run typecheck
pnpm -r run test
# yarn
yarn lint
yarn format
yarn typecheck
yarn test
# npm
npm run lint
npm run format
npm run typecheck
npm test
Review Checklist (PR-Ready)
- No new lint/type errors.
- No hard-coded secrets, tokens, or API keys.
- New code matches existing naming + folder patterns.
- If behavior changes, tests updated/added accordingly.
- No dead code, unused exports, or commented-out blocks.
1---2name: repo-standards3description: Enforce formatting, lint rules, naming conventions, and review checklist items for this repo's stack (React Native + Next.js). Use for linting/typechecking/formatting consistency and PR review readiness.4---56# Repo Standards78Use this skill to make changes that are consistent with the repo's established standards, and to review changes for “PR-ready” quality.910If the repo has a monorepo toolchain (pnpm workspaces, Turborepo), use it rather than running package-level commands ad hoc.1112## Quick Start (When You Need A Tight Answer)13141. Identify package manager + orchestrator.152. Find the repo’s actual quality gates (`lint`, `typecheck`, `test`, `format`, `ci`).163. Run the gates (preferred) or do a best-effort static review (fallback).174. Report issues with file references + exact commands to reproduce.1819## Workflow (Concrete)20211. Discover what the repo enforces (source-of-truth first).22- Read root `package.json`.23- Determine package manager:24 - `package.json:packageManager` if present.25 - Else lockfile: `pnpm-lock.yaml` > `yarn.lock` > `package-lock.json`.26- Identify orchestrator:27 - `turbo.json` and/or `pnpm-workspace.yaml` implies monorepo orchestration.28 - If neither exists, assume single-package scripts in root `package.json`.29- Identify “quality gate” scripts:30 - Look for `lint`, `typecheck`, `test`, `format`, `ci` in `package.json:scripts`.31 - If a root `ci` exists, prefer that (it usually reflects production gates).32- Identify tooling config files (read them, don’t guess):33 - ESLint: `eslint.config.*`, `.eslintrc*`34 - Prettier: `prettier.config.*`, `.prettierrc*`35 - TS: `tsconfig*.json`36 - commitlint: `commitlint.config.*`37 - editor: `.editorconfig`38 - pre-commit: `.husky/`, `lint-staged.config.*`39402. Determine the scope you are enforcing.41- If reviewing a PR: scope is changed files only.42- If implementing: scope is “new/modified files + touched neighbors” (imports, types, tests).43- Identify whether changes are web (Next.js), mobile (React Native), or shared packages.44453. Infer conventions from code (only when configs don’t fully specify).46- Look at 2-3 existing modules similar to the target area.47- Record conventions that are clearly consistent in the repo:48 - file names (`kebab-case` vs `PascalCase`)49 - exports (default vs named exports)50 - hooks naming (`useX`)51 - folders (e.g., `app/` vs `pages/`, `screens/`, `features/`, `components/`)52 - test placement and naming (`*.test.ts`, `__tests__/`, etc.)53544. Run the repo’s quality gates (preferred).55- Prefer the highest-level orchestrator the repo uses:56 - If `turbo.json` exists and there are scripts like `turbo lint` / `turbo typecheck`, use them.57 - If pnpm workspaces are used, prefer `pnpm -r <script>` or a repo-provided wrapper script.58- If you cannot run commands (or user didn’t ask), do a best-effort static check, but clearly label it as such.59605. Enforce the “PR-ready” checklist (concrete checks).61- Formatting:62 - No mixed quote/spacing style within a file.63 - No manual alignment whitespace.64- Lint/TS:65 - No new lint suppressions unless justified and localized.66 - No new `any` unless it’s the established repo approach.67 - No unsafe non-null assertions unless a guard exists.68- React:69 - Hooks rules respected; dependencies correct.70 - No `useEffect` that should be derived state.71- Next.js:72 - Server/client boundary respected (no secrets in client bundles, no server-only imports in client components).73 - Route conventions align with existing usage (`app/` vs `pages/`).74- React Native:75 - Avoid inline anonymous components in render paths if it causes re-renders.76 - Avoid expensive list item renders (FlatList) without memoization if the repo uses it.77- Tests:78 - If similar code has tests, add/update tests following the same harness.79 - If no tests exist, note the gap and propose the minimal test that would catch regressions.80816. Report findings with evidence.82- Every finding must include:83 - The file path(s)84 - Why it violates the repo’s standard (config or observed pattern)85 - Minimal fix guidance86 - The command(s) that would fail (if applicable)8788## What to Avoid8990- Do not add new tooling or configs unless the user asks.91- Do not change existing conventions to match personal preferences.92- Do not run heavy scripts unless requested.9394## Output Format9596Provide:97- Summary (pass/fail status)98- Checks Run (if any)99- Findings (ordered by severity)100- Suggested Fixes (minimal, aligned to existing standards)101 - “How to Verify” (exact script(s) to run)102103## Optional Helpers104105- Use `scripts/discover_quality_gates.py` to identify likely lint/typecheck/test commands without guessing.106107## Example Commands (only when asked to run)108109```bash110# Prefer the repo's actual scripts; these are examples only.111112# pnpm (single package)113pnpm run lint114pnpm run format115pnpm run typecheck116pnpm run test117118# pnpm (workspace/monorepo common patterns)119pnpm -r run lint120pnpm -r run typecheck121pnpm -r run test122123# yarn124yarn lint125yarn format126yarn typecheck127yarn test128129# npm130npm run lint131npm run format132npm run typecheck133npm test134```135136## Review Checklist (PR-Ready)137138- No new lint/type errors.139- No hard-coded secrets, tokens, or API keys.140- New code matches existing naming + folder patterns.141- If behavior changes, tests updated/added accordingly.142- No dead code, unused exports, or commented-out blocks.