← Browse

@neverinfamous/monorepo

A

Monorepo architecture and configuration standards. Use when working with Turborepo, pnpm workspaces, npm workspaces, or configuring shared packages, tsconfig bases, and internal dependencies. NOT for generic package management or single-package repositories. Require explicit monorepo context.

skillclaude

Install

agr install @neverinfamous/monorepo --target claude

Writes 1 file into .claude/skills/, pinned to git-1ba94431.

  • .claude/skills/monorepo/SKILL.md

Document


name: monorepo description: | Monorepo architecture and configuration standards. Use when working with Turborepo, pnpm workspaces, npm workspaces, or configuring shared packages, tsconfig bases, and internal dependencies. NOT for generic package management or single-package repositories. Require explicit monorepo context.

Monorepo Standards

Monorepos organize multiple applications and packages in a single repository, but require strict configuration to avoid dependency hell and build-time bottlenecks.

1. Workspace Configuration (pnpm workspaces)

  • Root Definition: Define the pnpm-workspace.yaml explicitly at the root, separating applications (apps/*) from internal libraries (packages/*).
  • Internal Dependencies: Link internal packages using the workspace:* protocol. This ensures that the package manager resolves to the local source rather than attempting to fetch from the npm registry.
{
  "dependencies": {
    "@my-org/ui": "workspace:*",
    "@my-org/tsconfig": "workspace:*"
  }
}

2. Turborepo Configuration

  • Pipeline Definition: Define dependencies in turbo.json. Ensure build depends on ^build (meaning a package's build step waits for its dependencies to build first).
  • Caching: Ensure outputs are correctly defined for cache hits (e.g., .next/**, dist/**).
  • Dev Tasks: The dev task should typically be configured as persistent: true since it starts a long-running server.
{
  "$schema": "https://turbo.build/schema.json",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

3. Shared Configurations

  • Shared TSConfig: Create a packages/tsconfig containing base.json, nextjs.json, and react-library.json. Applications should extend these rather than duplicating compiler options.
  • Shared ESLint/Prettier: Centralize linting rules in a packages/eslint-config workspace to guarantee consistency across all apps.
  • Entrypoints: Use "main", "module", and "types" fields in package.json correctly for shared packages. Alternatively, rely on modern bundlers and Next.js transpile packages to consume raw TypeScript (src/index.ts).

4. CI/CD Integration

  • Remote Caching: Always enable Vercel Remote Caching or an equivalent remote cache in CI to drastically reduce build times for unmodified packages.
  • Affected Builds: Use --filter commands (turbo run build --filter=...[origin/main]) to only test and build packages that changed in the current PR.

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-1ba9443114292026-07-31