agentleFS
ScaleDockHQScaleDockHQ/scaledock-skills/skills/scaledock-repo-standard/SKILL.md

scaledock-repo-standard

Skill1 starsChanged 2 months agoMITView on GitHub

Create a new repo or bring an existing one up to the ScaleDock standard (latest Node supported by Vercel, latest pnpm and TypeScript, Next.js or Expo, Supabase with better-supabase, PermDock, oRPC, MCP, CLI, Fumadocs, Vercel). Use when scaffolding a new monorepo, product, library or tooling repo, adding an iOS and Android app with Expo, auditing a repo against the ScaleDock standard into a gap table, upgrading this repo to the standard, or aligning several repos.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never discard uncommitted work.

    line 37
  2. Distinctive:

    New majors first: When a newer major is in alpha, beta or rc, adopt it now, absorb its migration guide, and note the API changes in the …

    line 41
  3. Very specific:

    One branch and one PR for this whole run: Follow the agent workflow in references/git-workflow.md.

    line 47
  4. Distinctive:

    Run these steps in order. Each step names the references to load and the check it must pass.

    line 51
  5. Distinctive:

    Repo hygiene: Write the AI files, repo files, VS Code settings, CI, Dependabot and tests.

    line 76
  6. Very specific:

    Verify and finish: Run pnpm install, pnpm format and pnpm verify.

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Repo standard

A workflow for creating, upgrading or aligning repos so every ScaleDock repo has the same toolchain, layout, surfaces, guardrails and delivery pipeline.

Follow the workflow below step by step. Load a reference when its step names it, and only for the repo kind and surfaces the inputs select.

Inputs (fill in, or ask the user before starting)

  • Mode: new, upgrade (this repo) or align (several repos).
  • Repo kind: product (default; apps and surfaces), library (publishes npm packages) or tooling (toolchain, hooks, CI and repo files only). references/audit.md lists which references apply to each kind.
  • Product in one sentence: {{PRODUCT_ONE_LINER}}
  • Surfaces: app, api, mcp, docs, marketing, mobile, cli. The default for a product is app, api, mcp and docs. mobile adds a native-only Expo app beside a Next.js app.
  • Framework for app: next (default) or expo (one universal Expo app for iOS, Android and web). docs and marketing always use Next.js. Use another framework only when the user names it, with an ADR.
  • Offline: yes or no, only with Expo (yes means PowerSync on native).
  • CLI kind: none (default), product (end users call the API), library (ships with an npm package) or tooling (private repo scripts).
  • Database: yes or no (yes means Supabase with better-supabase).
  • Roles and permissions: yes or no (yes means PermDock).
  • Multi-tenant: yes (default) or no.
  • Publishes npm packages: yes or no (always yes for a library).
  • npm scope @{{SCOPE}}, GitHub owner {{GITHUB_OWNER}}, Vercel team {{VERCEL_TEAM}}, issue prefix {{ISSUE_PREFIX}} (optional).

Resolve the placeholders listed in references/audit.md from these inputs before you write any file.

Ground rules

  1. Upgrade and align modes audit first.
    • Fill the gap table from references/audit.md, then apply the changes as small conventional commits on one branch (rule 5).
    • Never discard uncommitted work. For unshipped code, prefer one breaking cutover over shims.
    • A deliberate deviation is an ADR in docs/decisions/ (assets/adr-template.md) plus a line in the AGENTS.md "Deviations" list. Never change a deviation silently, and never add one without asking.
  2. Always the latest, including new majors in pre-release.
    • This skill names no versions. Look up the latest release of every runtime, package, SDK, action, skill and spec when you run (pnpm view <pkg> dist-tags, GitHub releases, vendor docs), never from memory or another repo.
    • New majors first. When a newer major is in alpha, beta or rc, adopt it now, absorb its migration guide, and note the API changes in the commit. Otherwise use the latest stable; never a pre-release of a minor or patch.
    • Exceptions. Stay on the current major only when the pre-release fails minimumReleaseAge or breaks a peer with no compatible release. Record the blocker in the gap table.
    • Tracking. List every pre-release pin under "Pre-release pins" in AGENTS.md (package, version, why), and move it to stable when the major ships.
    • Pin exactly in the catalog. Never bypass minimumReleaseAge; use the newest release that passes, and add a commented exclude only when a fix needs it.
  3. Read installed docs before configuring. For Next.js, ask the running dev server's /_next/mcp first, then read the bundled node_modules/next/dist/docs. Read node_modules/turbo/docs, the Expo, oxlint, oxfmt, Fumadocs, AI SDK and MCP SDK docs, and the matching skill. Flag and option names in the references drift; check each against the installed version.
  4. Done means pnpm verify passes. Report with assets/report.md.
  5. One branch and one PR for this whole run. Follow the agent workflow in references/git-workflow.md.

Workflow

Run these steps in order. Each step names the references to load and the check it must pass. Skip a reference when the repo kind or inputs exclude it.

  1. Start the run. Settle the mode and every input; ask for anything missing. Resolve the placeholders. Check the working tree, then create or reuse the branch. -> references/audit.md (placeholders), references/git-workflow.md (agent workflow). ✓ All inputs are known, the tree is clean or yours, and you are on a <type>/<short-topic> branch.
  2. Audit or sketch.
    • New: sketch the tree from the selected surfaces and packages.
    • Upgrade: walk the audit.md checklist row by row, opening a row's reference only to judge that row.
    • Align: audit each repo the same way, one column per repo. -> references/audit.md, references/architecture.md for the target tree, and the Baselines section of references/performance.md when the repo ships code. ✓ Every row has an audit.md status, every dependency behind latest is listed, and the starting baselines are recorded.
  3. Foundation. Install the skills, set up the toolchain, workspace, TypeScript, Knip, lint and format, and lay out the folders and boundaries. -> references/skills.md, references/toolchain.md, references/lint-format.md, references/architecture.md. ✓ pnpm install passes under the strict workspace settings, every workspace has a boundary tag, and pnpm check runs.
  4. Platform. Configure Vercel, Turborepo, Remote Cache, local dev with Portless, and env and secrets. -> references/vercel.md, references/local-dev-env.md. ✓ Each need maps to the Vercel-first table or an ADR, turbo.json uses strict env mode, and every web app has a dev:portless script.
  5. Surfaces. Build or upgrade only the selected ones.
    • Web (Next.js): references/nextjs.md, references/i18n.md, references/ui.md, references/app-shell.md.
    • Expo (mobile, or app on Expo): references/expo.md, references/i18n.md, and references/offline-sync.md when Offline is yes.
    • Data and identity: references/data-permissions.md, references/data-conventions.md, references/auth.md.
    • Programmatic: references/api.md, references/mcp.md, references/cli.md.
    • Docs and AI: references/docs-site.md, references/ai.md.
    • Performance, for every kind that ships code: references/performance.md. ✓ Apps stay thin adapters over services, every procedure is contract first, every surface acts as the signed-in user, and names follow the naming rules.
  6. Repo hygiene. Write the AI files, repo files, VS Code settings, CI, Dependabot and tests. -> references/agent-files.md, references/repo-files.md, references/ci.md, references/tests.md. ✓ AGENTS.md is at most 12 KB and lists the deviations and pre-release pins, and CI runs the same gates as pnpm verify.
  7. Verify and finish. Run pnpm install, pnpm format and pnpm verify; fix code, not tests. Add a changeset, push, mark the one PR ready, and put the report in its body. -> assets/report.md, references/git-workflow.md (Changesets, PR), the Baselines section of references/performance.md, the checklist below. ✓ pnpm verify passes, the final baselines are recorded, and the report is complete.

Verify before done

The tag in brackets names the input that switches an item on; untagged items always apply.

  • pnpm verify passes locally (rule 4).
  • [Turbo] verify is one cached, parallel turbo run of tasks with inputs, and no check runs twice.
  • Coverage autoUpdate is off in CI, and thresholds come from the test set CI runs.
  • The naming rules hold, and the docs:drift naming check passes.
  • The baselines from before and after the run are in the report.
  • Every dependency is catalog: or workspace:* at the latest release that passes minimumReleaseAge; every override, exclude, allowBuilds entry and patch has a comment.
  • Every pre-release pin is in AGENTS.md (rule 2).
  • pnpm-workspace.yaml has no key the installed pnpm rejects, and TypeScript is the stable native compiler with no preview package.
  • Every deviation has an ADR in docs/decisions/ and a line in the AGENTS.md "Deviations" list.
  • [workspaces] Every workspace has a Turbo boundary tag, apps never import each other, and pnpm boundaries passes.
  • No Zod in our code, no @radix-ui/* or vaul, and each concern uses its one library.
  • Dates use Temporal through the one temporal.ts module; no other date library is installed.
  • Every tsgolint type-aware rule is on, or listed as off with a reason.
  • The managed AGENTS.md blocks (Next.js, Turborepo) are committed as the tools wrote them.
  • Installed skills and skills-lock.json are committed, and the lock tracks every skill in .agents/skills; in a repo that publishes skills, pnpm dlx skills add . --list offers only its own.
  • [apps] Each app has one env.ts, the only file that reads process.env; every env key is in t3-env, turbo.json, .env.example and all three Vercel environments.
  • [docs, web] Agent routes send Cache-Control, no proxy.ts lacks a matcher, and no experimental flag or twoslash is installed without a use.
  • [api] Every procedure lives in packages/contract with openapi() meta, and the committed OpenAPI snapshot matches.
  • [api, mcp, cli] Errors are RFC 9457 Problem Details on every surface.
  • [Database] Every table has RLS and pgTAP tests; every domain table has the audit trigger.
  • [Database] Timestamps are timestamptz, money is integer minor units plus a currency, and public IDs are UUIDs (v7 when the Postgres major provides it).
  • [Database] Every foreign key is indexed and has an explicit on delete.
  • [Database] The only keys in use are sb_publishable_ and sb_secret_, and sb_secret_ appears only in createAdminContext().
  • [Expo] expo-doctor passes, ios/ and android/ are gitignored, and each APP_VARIANT has its own name, bundle ID and scheme.
  • [Offline] Every synced table is in the PowerSync publication and a sync stream, and web never opens a PowerSync database.
  • The whole run is on one branch and one PR, with conventional commits (and a changeset when Changesets apply).
  • The report follows assets/report.md, including its manual steps.

Reference index

  • Run: audit.md (placeholders, repo kinds, gap checklist), report.md (final report, manual steps), adr-template.md.
  • Foundation: skills.md (agent skills), toolchain.md (Node, pnpm, TypeScript, workspace, Knip, root scripts), architecture.md (tree, boundaries, contract, errors, one library per concern, env, naming and layout), performance.md (baselines, agent-route caching, client bundle, library runtime, generated code), lint-format.md (oxlint, anti-slop, oxfmt).
  • Platform: vercel.md (Vercel first, Services, turbo.json, Remote Cache), local-dev-env.md (Portless, native toolchain, env and secrets).
  • Web: nextjs.md, i18n.md (next-intl, and i18next for Expo), ui.md (shadcn, ReUI Pro), app-shell.md (auth pages, shell, page templates, screens).
  • Expo: expo.md (shapes, app config, EAS, dev client, native UI, Uniwind, push, universal web), offline-sync.md (PowerSync).
  • Data and identity: data-permissions.md (tenancy, Supabase, better-supabase, audit log, PermDock), data-conventions.md (UTC timestamps and Temporal, money, IDs, naming, pagination, deletion), auth.md (OAuth 2.1 server, sign-in per surface).
  • Programmatic: api.md (Hono, oRPC, Scalar), mcp.md (MCP SDK, tools from the contract, docs MCP), cli.md (CLI kinds, OAuth login).
  • Docs and AI: docs-site.md (Fumadocs for people and agents), ai.md (AI SDK through AI Gateway).
  • Delivery: git-workflow.md (branches, agent workflow, commitlint, lefthook, Changesets), ci.md (Actions, EAS builds, Dependabot), tests.md, agent-files.md (AGENTS.md, rules, "also update" table), repo-files.md (README, standard files, VS Code).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.