agentsclimarketplace

Workspace patterns

Skill pantheon-org/tekhne/skills/repository-mgmt/nx/workspace-patterns

Configure and optimize Nx monorepo workspaces with deterministic project-graph structure, boundary enforcement, cache-aware pipelines, and affected-command CI workflows; use when designing workspace architecture, tightening dependency rules, or reducing CI cost through Nx task orchestration.From its SKILL.md

Install
npx -y skills add pantheon-org/tekhne --skill workspace-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.3 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Nx Workspace Patterns

Navigation hub for Nx workspace architecture and operations.

When to Use

  • You are structuring or refactoring an Nx monorepo.
  • You need dependency boundaries enforced by tags and lint rules.
  • You need reliable affected-command CI and caching performance.

When Not to Use

  • The repository is single-project with no monorepo coordination needs.
  • The task is framework-specific build setup unrelated to Nx graph and task orchestration.

Workflow

  1. Structure workspace domains (apps/, libs/, tools/).
  2. Define tags and project graph conventions.
  3. Configure target pipelines and caching defaults.
  4. Enforce module boundaries and verify violations fail with nx lint --skip-nx-cache.
  5. Integrate affected commands in CI with explicit base/head strategy.

Constraint Guidelines

Hard Constraints

  • MUST tag projects consistently for scope/type-based constraints.
  • MUST configure targetDefaults for build/test/lint dependency flow.
  • MUST use affected commands in CI for scalable execution.

Flexible Choices

  • CAN choose tag vocabulary (scope:*, type:*, platform:*) if consistent.
  • CAN choose cache backend (Nx Cloud or self-hosted) by org constraints.
  • CAN choose library granularity based on team ownership and release cadence.

Fallback Behaviors

Missing ConfigFallback
no explicit tagsallow broad deps temporarily with warning and migration plan
no target defaultstasks run independently with reduced optimization
no CI base/headdefault to main branch and document tradeoff

Quick Commands

nx graph
nx affected -t lint,test,build --base=origin/main --parallel=3
nx show project my-app --web
nx reset
rg -n "@nx/enforce-module-boundaries|depConstraints" .

Configuration Examples

nx.json targetDefaults

{
  "targetDefaults": {
    "build": {
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"],
      "cache": true
    },
    "test": {
      "dependsOn": ["build"],
      "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
      "cache": true
    },
    "lint": {
      "inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
      "cache": true
    }
  }
}

ESLint depConstraints (tag-based boundaries)

{
  "overrides": [
    {
      "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
      "rules": {
        "@nx/enforce-module-boundaries": [
          "error",
          {
            "enforceBuildableLibDependency": true,
            "allow": [],
            "depConstraints": [
              {
                "sourceTag": "scope:web",
                "onlyDependOnLibsWithTags": ["scope:web", "scope:shared"]
              },
              {
                "sourceTag": "type:feature",
                "onlyDependOnLibsWithTags": ["type:feature", "type:ui", "type:data-access", "type:util"]
              },
              {
                "sourceTag": "type:ui",
                "onlyDependOnLibsWithTags": ["type:ui", "type:util"]
              }
            ]
          }
        ]
      }
    }
  ]
}

Anti-Patterns

NEVER create circular dependencies between projects

  • WHY: cycles degrade graph clarity and destabilize build ordering.
  • BAD: libs/ui depends on libs/data while libs/data depends on libs/ui.
  • GOOD: extract shared contracts to a lower-level library.

NEVER run run-many --all in CI as the default verification path

  • WHY: full-workspace execution wastes CI budget and slows feedback loops.
  • BAD: always build/test every project on each PR.
  • GOOD: use nx affected with explicit base/head.

NEVER tag projects inconsistently

  • WHY: boundary rules are only as strong as tag consistency.
  • BAD: mixed ad hoc tags with no vocabulary.
  • GOOD: defined tag taxonomy with lint enforcement.

NEVER skip target pipeline dependencies in targetDefaults

  • WHY: missing dependsOn prevents optimal scheduling and can hide ordering bugs.
  • BAD: implicit task order assumptions.
  • GOOD: explicit dependsOn for build/test/lint behavior.

NEVER ignore cache inputs and outputs for critical targets

  • WHY: incomplete cache metadata causes stale hits or unnecessary misses.
  • BAD: cache enabled but no stable inputs/outputs.
  • GOOD: declare outputs and relevant named inputs per target.

References

TopicReference
Project graph and nx.json patternsreferences/project-graph-configuration.md
Caching and optimizationreferences/caching-strategies.md
Boundaries and tagsreferences/project-boundaries.md
Affected commands and CIreferences/affected-commands.md

What ships with it: 10 files

16.9 KB alongside SKILL.md

.tessl-plugin/

Keep looking

Skills are one crate of 326,835. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.