agentleFS
ldaumeldaume/agentic-engineering-harness/skills/engineering/scaffold-monorepo/SKILL.md

scaffold-monorepo

Skill3 starsChanged 3 months agoMITView on GitHub

Scaffolds a pnpm TypeScript monorepo with verify gates, knip, pre-commit hooks, pinned CI, and Renovate using current toolchain versions at scaffold time. Use when creating a new monorepo, bootstrapping apps/packages layout, or aligning a greenfield repo with progressive-pragmatic craftsmanship golden paths for GitHub Actions or Gitea Actions.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is 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.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the repo already has agent docs, update them in place.

    line 23
  2. Distinctive:

    Ask only when a consequential choice or the authority for structural change remains unresolved.

    line 26
  3. Very specific:

    Run scripts/print-toolchain-hints.sh and follow the Version resolution section in REFERENCE.md:

    line 33
  4. Distinctive:

    If the next major is an announced future LTS candidate, decide whether a separate non-production preview lane buys useful compatibility …

    line 37
  5. Distinctive:

    Use completion-gate before first commit.

    line 112

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Scaffold Monorepo

Golden-path bootstrap for pnpm workspaces + Node Active LTS + verify CI + Renovate. Versions are resolved at scaffold time, not copied from memory.

Pair with scaffold-harness after the toolchain exists, or adapt to the repo's existing agent docs.

Project Fit Check

Before scaffolding:

  1. Confirm this is greenfield, an explicit re-scaffold, or a repo where the user accepted structural changes.
  2. Scan for existing package manager, workspace layout, CI host, Renovate config, hooks, formatter, linter, and agent docs.
  3. Preserve existing choices unless the user asks to replace them or they block the requested scaffold.
  4. If the repo already has agent docs, update them in place. If not, offer scaffold-harness or create only the minimal documented bridge.
  5. Resolve routine choices from repository evidence and the defaults below. Ask only when a consequential choice or the authority for structural change remains unresolved.

Before writing files

1. Resolve current versions (required)

Run scripts/print-toolchain-hints.sh and follow the Version resolution section in REFERENCE.md:

  • Node Active LTS major -> engines, .node-version, .nvmrc, CI node -e guard
  • If the next major is an announced future LTS candidate, decide whether a separate non-production preview lane buys useful compatibility evidence. Do not make it the package, build, deployment, or production default before upstream marks it LTS.
  • Latest pnpm -> packageManager, corepack prepare, Renovate regex manager
  • Latest knip, prettier, typescript, lint-staged, simple-git-hooks
  • Pin container digests for node:*, Playwright image (if E2E), renovatebot/renovate, actions/checkout, actions/upload-artifact
  • Replace both __ACTIONS_CHECKOUT_SHA__ and __ACTIONS_CHECKOUT_VERSION__ from the same current stable release after the configured cooldown; do not leave a stale version comment beside a new digest.
  • @types/node major must match Node LTS (not npm's latest major)

2. Resolve once

QuestionDefault
CI hostgitea -> .gitea/workflows/; github -> .github/workflows/
Layoutapps/*, packages/*
E2E in CIyes if Playwright app exists
Framework groups in Renovateadd only stacks present (Astro, React, Tailwind, etc.); Astro -> defer vite major until framework adopts it
Root package.json namefor renovate.json ignoreDeps

3. Plan output

Record the file list and resolved versions. Write without another confirmation when the requested scaffold and repository evidence provide authority. Stop for the human only when the plan would replace an owned choice, widen scope, or cross another consequential boundary.

Scaffold checklist

Copy templates from templates/, substitute placeholders (__NODE_MAJOR__, __PNPM_VERSION__, __CI_DIR__, __RENOVATE_PLATFORM__, digests, repo name).

Root toolchain

  • package.json - scripts from templates/package.root.json
  • pnpm-workspace.yaml - allowBuilds.simple-git-hooks: true (+ native deps as needed)
  • .node-version, .nvmrc - Active LTS major only
  • .prettierrc.json, .prettierignore
  • knip.jsonc - start minimal; tune per workspace (see templates/knip.jsonc)
  • scripts/pre-commit.sh - lint-staged then pnpm verify
  • simple-git-hooks + lint-staged in root package.json
  • pnpm install at root

CI (__CI_DIR__/ci.yml)

  • preflight - skip stale main pushes
  • verify - pnpm verify + pnpm build
  • compatibility-preview - optional non-blocking verification on the announced future LTS candidate; pin its image digest and report failures without weakening the LTS gate
  • e2e - optional; Playwright image pinned
  • Path filters include __CI_DIR__/, lockfile, workspaces

Renovate

  • renovate.json - supply-chain cooldowns, groups for your stack, pnpm regex for package.json + __CI_DIR__/*.yml
  • __CI_DIR__/renovate.yml - platform env (gitea vs github), RENOVATE_ALLOWED_COMMANDS (Gitea self-hosted), token validation
  • Gitea only: create repo labels dependencies, major, security (Renovate config references them)
  • Document secrets in AGENTS.md (see templates/agents-ci.snippet.md)

Agent docs

  • Run scaffold-harness or update the existing agent docs - wire pnpm verify, pnpm precommit, CI/Renovate notes into the local source of truth

Verify before done

pnpm verify
pnpm build
# if E2E: pnpm test:e2e
pnpm precommit   # dry-run hook path

Use completion-gate before first commit.

Templates

FilePurpose
templates/package.root.jsonRoot scripts, engines, hooks
templates/pre-commit.shHook entrypoint
templates/ci.ymlPreflight + verify + e2e
templates/renovate.ymlScheduled Renovate job
templates/renovate.jsonBase Renovate policy
templates/knip.jsoncMinimal knip baseline
templates/pnpm-workspace.yamlWorkspace + allowBuilds
templates/agents-ci.snippet.mdPaste into AGENTS.md

Details: REFERENCE.md - GitHub vs Gitea matrix, secrets, digest pinning, framework-specific Renovate groups.

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.