[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FFFF0B27QTF28N978PR7B2":3,"skill-same:01M7FFFF0B27QTF28N978PR7B2":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7FFFF0B27QTF28N978PR7B2","nx-workspace-patterns",null,"Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns-agents-main\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: nx-workspace-patterns\ndescription: Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.\n---\n\n# Nx Workspace Patterns\n\nProduction patterns for Nx monorepo management.\n\n## When to Use This Skill\n\n- Setting up new Nx workspaces\n- Configuring project boundaries\n- Optimizing CI with affected commands\n- Implementing remote caching\n- Managing dependencies between projects\n- Migrating to Nx\n\n## Core Concepts\n\n### 1. Nx Architecture\n\n```\nworkspace\u002F\n├── apps\u002F              # Deployable applications\n│   ├── web\u002F\n│   └── api\u002F\n├── libs\u002F              # Shared libraries\n│   ├── shared\u002F\n│   │   ├── ui\u002F\n│   │   └── utils\u002F\n│   └── feature\u002F\n│       ├── auth\u002F\n│       └── dashboard\u002F\n├── tools\u002F             # Custom executors\u002Fgenerators\n├── nx.json            # Nx configuration\n└── workspace.json     # Project configuration\n```\n\n### 2. Library Types\n\n| Type            | Purpose                          | Example             |\n| --------------- | -------------------------------- | ------------------- |\n| **feature**     | Smart components, business logic | `feature-auth`      |\n| **ui**          | Presentational components        | `ui-buttons`        |\n| **data-access** | API calls, state management      | `data-access-users` |\n| **util**        | Pure functions, helpers          | `util-formatting`   |\n| **shell**       | App bootstrapping                | `shell-web`         |\n\n## Templates\n\n### Template 1: nx.json Configuration\n\n```json\n{\n  \"$schema\": \".\u002Fnode_modules\u002Fnx\u002Fschemas\u002Fnx-schema.json\",\n  \"npmScope\": \"myorg\",\n  \"affected\": {\n    \"defaultBase\": \"main\"\n  },\n  \"tasksRunnerOptions\": {\n    \"default\": {\n      \"runner\": \"nx\u002Ftasks-runners\u002Fdefault\",\n      \"options\": {\n        \"cacheableOperations\": [\n          \"build\",\n          \"lint\",\n          \"test\",\n          \"e2e\",\n          \"build-storybook\"\n        ],\n        \"parallel\": 3\n      }\n    }\n  },\n  \"targetDefaults\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"inputs\": [\"production\", \"^production\"],\n      \"cache\": true\n    },\n    \"test\": {\n      \"inputs\": [\"default\", \"^production\", \"{workspaceRoot}\u002Fjest.preset.js\"],\n      \"cache\": true\n    },\n    \"lint\": {\n      \"inputs\": [\"default\", \"{workspaceRoot}\u002F.eslintrc.json\"],\n      \"cache\": true\n    },\n    \"e2e\": {\n      \"inputs\": [\"default\", \"^production\"],\n      \"cache\": true\n    }\n  },\n  \"namedInputs\": {\n    \"default\": [\"{projectRoot}\u002F**\u002F*\", \"sharedGlobals\"],\n    \"production\": [\n      \"default\",\n      \"!{projectRoot}\u002F**\u002F?(*.)+(spec|test).[jt]s?(x)?(.snap)\",\n      \"!{projectRoot}\u002Ftsconfig.spec.json\",\n      \"!{projectRoot}\u002Fjest.config.[jt]s\",\n      \"!{projectRoot}\u002F.eslintrc.json\"\n    ],\n    \"sharedGlobals\": [\n      \"{workspaceRoot}\u002Fbabel.config.json\",\n      \"{workspaceRoot}\u002Ftsconfig.base.json\"\n    ]\n  },\n  \"generators\": {\n    \"@nx\u002Freact\": {\n      \"application\": {\n        \"style\": \"css\",\n        \"linter\": \"eslint\",\n        \"bundler\": \"webpack\"\n      },\n      \"library\": {\n        \"style\": \"css\",\n        \"linter\": \"eslint\"\n      },\n      \"component\": {\n        \"style\": \"css\"\n      }\n    }\n  }\n}\n```\n\n### Template 2: Project Configuration\n\n```json\n\u002F\u002F apps\u002Fweb\u002Fproject.json\n{\n  \"name\": \"web\",\n  \"$schema\": \"..\u002F..\u002Fnode_modules\u002Fnx\u002Fschemas\u002Fproject-schema.json\",\n  \"sourceRoot\": \"apps\u002Fweb\u002Fsrc\",\n  \"projectType\": \"application\",\n  \"tags\": [\"type:app\", \"scope:web\"],\n  \"targets\": {\n    \"build\": {\n      \"executor\": \"@nx\u002Fwebpack:webpack\",\n      \"outputs\": [\"{options.outputPath}\"],\n      \"defaultConfiguration\": \"production\",\n      \"options\": {\n        \"compiler\": \"babel\",\n        \"outputPath\": \"dist\u002Fapps\u002Fweb\",\n        \"index\": \"apps\u002Fweb\u002Fsrc\u002Findex.html\",\n        \"main\": \"apps\u002Fweb\u002Fsrc\u002Fmain.tsx\",\n        \"tsConfig\": \"apps\u002Fweb\u002Ftsconfig.app.json\",\n        \"assets\": [\"apps\u002Fweb\u002Fsrc\u002Fassets\"],\n        \"styles\": [\"apps\u002Fweb\u002Fsrc\u002Fstyles.css\"]\n      },\n      \"configurations\": {\n        \"development\": {\n          \"extractLicenses\": false,\n          \"optimization\": false,\n          \"sourceMap\": true\n        },\n        \"production\": {\n          \"optimization\": true,\n          \"outputHashing\": \"all\",\n          \"sourceMap\": false,\n          \"extractLicenses\": true\n        }\n      }\n    },\n    \"serve\": {\n      \"executor\": \"@nx\u002Fwebpack:dev-server\",\n      \"defaultConfiguration\": \"development\",\n      \"options\": {\n        \"buildTarget\": \"web:build\"\n      },\n      \"configurations\": {\n        \"development\": {\n          \"buildTarget\": \"web:build:development\"\n        },\n        \"production\": {\n          \"buildTarget\": \"web:build:production\"\n        }\n      }\n    },\n    \"test\": {\n      \"executor\": \"@nx\u002Fjest:jest\",\n      \"outputs\": [\"{workspaceRoot}\u002Fcoverage\u002F{projectRoot}\"],\n      \"options\": {\n        \"jestConfig\": \"apps\u002Fweb\u002Fjest.config.ts\",\n        \"passWithNoTests\": true\n      }\n    },\n    \"lint\": {\n      \"executor\": \"@nx\u002Feslint:lint\",\n      \"outputs\": [\"{options.outputFile}\"],\n      \"options\": {\n        \"lintFilePatterns\": [\"apps\u002Fweb\u002F**\u002F*.{ts,tsx,js,jsx}\"]\n      }\n    }\n  }\n}\n```\n\n### Template 3: Module Boundary Rules\n\n```json\n\u002F\u002F .eslintrc.json\n{\n  \"root\": true,\n  \"ignorePatterns\": [\"**\u002F*\"],\n  \"plugins\": [\"@nx\"],\n  \"overrides\": [\n    {\n      \"files\": [\"*.ts\", \"*.tsx\", \"*.js\", \"*.jsx\"],\n      \"rules\": {\n        \"@nx\u002Fenforce-module-boundaries\": [\n          \"error\",\n          {\n            \"enforceBuildableLibDependency\": true,\n            \"allow\": [],\n            \"depConstraints\": [\n              {\n                \"sourceTag\": \"type:app\",\n                \"onlyDependOnLibsWithTags\": [\n                  \"type:feature\",\n                  \"type:ui\",\n                  \"type:data-access\",\n                  \"type:util\"\n                ]\n              },\n              {\n                \"sourceTag\": \"type:feature\",\n                \"onlyDependOnLibsWithTags\": [\n                  \"type:ui\",\n                  \"type:data-access\",\n                  \"type:util\"\n                ]\n              },\n              {\n                \"sourceTag\": \"type:ui\",\n                \"onlyDependOnLibsWithTags\": [\"type:ui\", \"type:util\"]\n              },\n              {\n                \"sourceTag\": \"type:data-access\",\n                \"onlyDependOnLibsWithTags\": [\"type:data-access\", \"type:util\"]\n              },\n              {\n                \"sourceTag\": \"type:util\",\n                \"onlyDependOnLibsWithTags\": [\"type:util\"]\n              },\n              {\n                \"sourceTag\": \"scope:web\",\n                \"onlyDependOnLibsWithTags\": [\"scope:web\", \"scope:shared\"]\n              },\n              {\n                \"sourceTag\": \"scope:api\",\n                \"onlyDependOnLibsWithTags\": [\"scope:api\", \"scope:shared\"]\n              },\n              {\n                \"sourceTag\": \"scope:shared\",\n                \"onlyDependOnLibsWithTags\": [\"scope:shared\"]\n              }\n            ]\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n### Template 4: Custom Generator\n\n```typescript\n\u002F\u002F tools\u002Fgenerators\u002Ffeature-lib\u002Findex.ts\nimport {\n  Tree,\n  formatFiles,\n  generateFiles,\n  joinPathFragments,\n  names,\n  readProjectConfiguration,\n} from \"@nx\u002Fdevkit\";\nimport { libraryGenerator } from \"@nx\u002Freact\";\n\ninterface FeatureLibraryGeneratorSchema {\n  name: string;\n  scope: string;\n  directory?: string;\n}\n\nexport default async function featureLibraryGenerator(\n  tree: Tree,\n  options: FeatureLibraryGeneratorSchema,\n) {\n  const { name, scope, directory } = options;\n  const projectDirectory = directory\n    ? `${directory}\u002F${name}`\n    : `libs\u002F${scope}\u002Ffeature-${name}`;\n\n  \u002F\u002F Generate base library\n  await libraryGenerator(tree, {\n    name: `feature-${name}`,\n    directory: projectDirectory,\n    tags: `type:feature,scope:${scope}`,\n    style: \"css\",\n    skipTsConfig: false,\n    skipFormat: true,\n    unitTestRunner: \"jest\",\n    linter: \"eslint\",\n  });\n\n  \u002F\u002F Add custom files\n  const projectConfig = readProjectConfiguration(\n    tree,\n    `${scope}-feature-${name}`,\n  );\n  const projectNames = names(name);\n\n  generateFiles(\n    tree,\n    joinPathFragments(__dirname, \"files\"),\n    projectConfig.sourceRoot,\n    {\n      ...projectNames,\n      scope,\n      tmpl: \"\",\n    },\n  );\n\n  await formatFiles(tree);\n}\n```\n\n### Template 5: CI Configuration with Affected\n\n```yaml\n# .github\u002Fworkflows\u002Fci.yml\nname: CI\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\nenv:\n  NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}\n\njobs:\n  main:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: 20\n          cache: \"npm\"\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Derive SHAs for affected commands\n        uses: nrwl\u002Fnx-set-shas@v4\n\n      - name: Run affected lint\n        run: npx nx affected -t lint --parallel=3\n\n      - name: Run affected test\n        run: npx nx affected -t test --parallel=3 --configuration=ci\n\n      - name: Run affected build\n        run: npx nx affected -t build --parallel=3\n\n      - name: Run affected e2e\n        run: npx nx affected -t e2e --parallel=1\n```\n\n### Template 6: Remote Caching Setup\n\n```typescript\n\u002F\u002F nx.json with Nx Cloud\n{\n  \"tasksRunnerOptions\": {\n    \"default\": {\n      \"runner\": \"nx-cloud\",\n      \"options\": {\n        \"cacheableOperations\": [\"build\", \"lint\", \"test\", \"e2e\"],\n        \"accessToken\": \"your-nx-cloud-token\",\n        \"parallel\": 3,\n        \"cacheDirectory\": \".nx\u002Fcache\"\n      }\n    }\n  },\n  \"nxCloudAccessToken\": \"your-nx-cloud-token\"\n}\n\n\u002F\u002F Self-hosted cache with S3\n{\n  \"tasksRunnerOptions\": {\n    \"default\": {\n      \"runner\": \"@nx-aws-cache\u002Fnx-aws-cache\",\n      \"options\": {\n        \"cacheableOperations\": [\"build\", \"lint\", \"test\"],\n        \"awsRegion\": \"us-east-1\",\n        \"awsBucket\": \"my-nx-cache-bucket\",\n        \"awsProfile\": \"default\"\n      }\n    }\n  }\n}\n```\n\n## Common Commands\n\n```bash\n# Generate new library\nnx g @nx\u002Freact:lib feature-auth --directory=libs\u002Fweb --tags=type:feature,scope:web\n\n# Run affected tests\nnx affected -t test --base=main\n\n# View dependency graph\nnx graph\n\n# Run specific project\nnx build web --configuration=production\n\n# Reset cache\nnx reset\n\n# Run migrations\nnx migrate latest\nnx migrate --run-migrations\n```\n\n## Best Practices\n\n### Do's\n\n- **Use tags consistently** - Enforce with module boundaries\n- **Enable caching early** - Significant CI savings\n- **Keep libs focused** - Single responsibility\n- **Use generators** - Ensure consistency\n- **Document boundaries** - Help new developers\n\n### Don'ts\n\n- **Don't create circular deps** - Graph should be acyclic\n- **Don't skip affected** - Test only what changed\n- **Don't ignore boundaries** - Tech debt accumulates\n- **Don't over-granularize** - Balance lib count\n","# Nx Workspace Patterns\n\nProduction patterns for Nx monorepo management.\n\n## When to Use This Skill\n\n- Setting up new Nx workspaces\n- Configuring project boundaries\n- Optimizing CI with affected commands\n- Implementing remote caching\n- Managing dependencies between projects\n- Migrating to Nx\n\n## Core Concepts\n\n### 1. Nx Architecture\n\n```\nworkspace\u002F\n├── apps\u002F              # Deployable applications\n│   ├── web\u002F\n│   └── api\u002F\n├── libs\u002F              # Shared libraries\n│   ├── shared\u002F\n│   │   ├── ui\u002F\n│   │   └── utils\u002F\n│   └── feature\u002F\n│       ├── auth\u002F\n│       └── dashboard\u002F\n├── tools\u002F             # Custom executors\u002Fgenerators\n├── nx.json            # Nx configuration\n└── workspace.json     # Project configuration\n```\n\n### 2. Library Types\n\n| Type            | Purpose                          | Example             |\n| --------------- | -------------------------------- | ------------------- |\n| **feature**     | Smart components, business logic | `feature-auth`      |\n| **ui**          | Presentational components        | `ui-buttons`        |\n| **data-access** | API calls, state management      | `data-access-users` |\n| **util**        | Pure functions, helpers          | `util-formatting`   |\n| **shell**       | App bootstrapping                | `shell-web`         |\n\n## Templates\n\n### Template 1: nx.json Configuration\n\n```json\n{\n  \"$schema\": \".\u002Fnode_modules\u002Fnx\u002Fschemas\u002Fnx-schema.json\",\n  \"npmScope\": \"myorg\",\n  \"affected\": {\n    \"defaultBase\": \"main\"\n  },\n  \"tasksRunnerOptions\": {\n    \"default\": {\n      \"runner\": \"nx\u002Ftasks-runners\u002Fdefault\",\n      \"options\": {\n        \"cacheableOperations\": [\n          \"build\",\n          \"lint\",\n          \"test\",\n          \"e2e\",\n          \"build-storybook\"\n        ],\n        \"parallel\": 3\n      }\n    }\n  },\n  \"targetDefaults\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"inputs\": [\"production\", \"^production\"],\n      \"cache\": true\n    },\n    \"test\": {\n      \"inputs\": [\"default\", \"^production\", \"{workspaceRoot}\u002Fjest.preset.js\"],\n      \"cache\": true\n    },\n    \"lint\": {\n      \"inputs\": [\"default\", \"{workspaceRoot}\u002F.eslintrc.json\"],\n      \"cache\": true\n    },\n    \"e2e\": {\n      \"inputs\": [\"default\", \"^production\"],\n      \"cache\": true\n    }\n  },\n  \"namedInputs\": {\n    \"default\": [\"{projectRoot}\u002F**\u002F*\", \"sharedGlobals\"],\n    \"production\": [\n      \"default\",\n      \"!{projectRoot}\u002F**\u002F?(*.)+(spec|test).[jt]s?(x)?(.snap)\",\n      \"!{projectRoot}\u002Ftsconfig.spec.json\",\n      \"!{projectRoot}\u002Fjest.config.[jt]s\",\n      \"!{projectRoot}\u002F.eslintrc.json\"\n    ],\n    \"sharedGlobals\": [\n      \"{workspaceRoot}\u002Fbabel.config.json\",\n      \"{workspaceRoot}\u002Ftsconfig.base.json\"\n    ]\n  },\n  \"generators\": {\n    \"@nx\u002Freact\": {\n      \"application\": {\n        \"style\": \"css\",\n        \"linter\": \"eslint\",\n        \"bundler\": \"webpack\"\n      },\n      \"library\": {\n        \"style\": \"css\",\n        \"linter\": \"eslint\"\n      },\n      \"component\": {\n        \"style\": \"css\"\n      }\n    }\n  }\n}\n```\n\n### Template 2: Project Configuration\n\n```json\n\u002F\u002F apps\u002Fweb\u002Fproject.json\n{\n  \"name\": \"web\",\n  \"$schema\": \"..\u002F..\u002Fnode_modules\u002Fnx\u002Fschemas\u002Fproject-schema.json\",\n  \"sourceRoot\": \"apps\u002Fweb\u002Fsrc\",\n  \"projectType\": \"application\",\n  \"tags\": [\"type:app\", \"scope:web\"],\n  \"targets\": {\n    \"build\": {\n      \"executor\": \"@nx\u002Fwebpack:webpack\",\n      \"outputs\": [\"{options.outputPath}\"],\n      \"defaultConfiguration\": \"production\",\n      \"options\": {\n        \"compiler\": \"babel\",\n        \"outputPath\": \"dist\u002Fapps\u002Fweb\",\n        \"index\": \"apps\u002Fweb\u002Fsrc\u002Findex.html\",\n        \"main\": \"apps\u002Fweb\u002Fsrc\u002Fmain.tsx\",\n        \"tsConfig\": \"apps\u002Fweb\u002Ftsconfig.app.json\",\n        \"assets\": [\"apps\u002Fweb\u002Fsrc\u002Fassets\"],\n        \"styles\": [\"apps\u002Fweb\u002Fsrc\u002Fstyles.css\"]\n      },\n      \"configurations\": {\n        \"development\": {\n          \"extractLicenses\": false,\n          \"optimization\": false,\n          \"sourceMap\": true\n        },\n        \"production\": {\n          \"optimization\": true,\n          \"outputHashing\": \"all\",\n          \"sourceMap\": false,\n          \"extractLicenses\": true\n        }\n      }\n    },\n    \"serve\": {\n      \"executor\": \"@nx\u002Fwebpack:dev-server\",\n      \"defaultConfiguration\": \"development\",\n      \"options\": {\n        \"buildTarget\": \"web:build\"\n      },\n      \"configurations\": {\n        \"development\": {\n          \"buildTarget\": \"web:build:development\"\n        },\n        \"production\": {\n          \"buildTarget\": \"web:build:production\"\n        }\n      }\n    },\n    \"test\": {\n      \"executor\": \"@nx\u002Fjest:jest\",\n      \"outputs\": [\"{workspaceRoot}\u002Fcoverage\u002F{projectRoot}\"],\n      \"options\": {\n        \"jestConfig\": \"apps\u002Fweb\u002Fjest.config.ts\",\n        \"passWithNoTests\": true\n      }\n    },\n    \"lint\": {\n      \"executor\": \"@nx\u002Feslint:lint\",\n      \"outputs\": [\"{options.outputFile}\"],\n      \"options\": {\n        \"lintFilePatterns\": [\"apps\u002Fweb\u002F**\u002F*.{ts,tsx,js,jsx}\"]\n      }\n    }\n  }\n}\n```\n\n### Template 3: Module Boundary Rules\n\n```json\n\u002F\u002F .eslintrc.json\n{\n  \"root\": true,\n  \"ignorePatterns\": [\"**\u002F*\"],\n  \"plugins\": [\"@nx\"],\n  \"overrides\": [\n    {\n      \"files\": [\"*.ts\", \"*.tsx\", \"*.js\", \"*.jsx\"],\n      \"rules\": {\n        \"@nx\u002Fenforce-module-boundaries\": [\n          \"error\",\n          {\n            \"enforceBuildableLibDependency\": true,\n            \"allow\": [],\n            \"depConstraints\": [\n              {\n                \"sourceTag\": \"type:app\",\n                \"onlyDependOnLibsWithTags\": [\n                  \"type:feature\",\n                  \"type:ui\",\n                  \"type:data-access\",\n                  \"type:util\"\n                ]\n              },\n              {\n                \"sourceTag\": \"type:feature\",\n                \"onlyDependOnLibsWithTags\": [\n                  \"type:ui\",\n                  \"type:data-access\",\n                  \"type:util\"\n                ]\n              },\n              {\n                \"sourceTag\": \"type:ui\",\n                \"onlyDependOnLibsWithTags\": [\"type:ui\", \"type:util\"]\n              },\n              {\n                \"sourceTag\": \"type:data-access\",\n                \"onlyDependOnLibsWithTags\": [\"type:data-access\", \"type:util\"]\n              },\n              {\n                \"sourceTag\": \"type:util\",\n                \"onlyDependOnLibsWithTags\": [\"type:util\"]\n              },\n              {\n                \"sourceTag\": \"scope:web\",\n                \"onlyDependOnLibsWithTags\": [\"scope:web\", \"scope:shared\"]\n              },\n              {\n                \"sourceTag\": \"scope:api\",\n                \"onlyDependOnLibsWithTags\": [\"scope:api\", \"scope:shared\"]\n              },\n              {\n                \"sourceTag\": \"scope:shared\",\n                \"onlyDependOnLibsWithTags\": [\"scope:shared\"]\n              }\n            ]\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n### Template 4: Custom Generator\n\n```typescript\n\u002F\u002F tools\u002Fgenerators\u002Ffeature-lib\u002Findex.ts\nimport {\n  Tree,\n  formatFiles,\n  generateFiles,\n  joinPathFragments,\n  names,\n  readProjectConfiguration,\n} from \"@nx\u002Fdevkit\";\nimport { libraryGenerator } from \"@nx\u002Freact\";\n\ninterface FeatureLibraryGeneratorSchema {\n  name: string;\n  scope: string;\n  directory?: string;\n}\n\nexport default async function featureLibraryGenerator(\n  tree: Tree,\n  options: FeatureLibraryGeneratorSchema,\n) {\n  const { name, scope, directory } = options;\n  const projectDirectory = directory\n    ? `${directory}\u002F${name}`\n    : `libs\u002F${scope}\u002Ffeature-${name}`;\n\n  \u002F\u002F Generate base library\n  await libraryGenerator(tree, {\n    name: `feature-${name}`,\n    directory: projectDirectory,\n    tags: `type:feature,scope:${scope}`,\n    style: \"css\",\n    skipTsConfig: false,\n    skipFormat: true,\n    unitTestRunner: \"jest\",\n    linter: \"eslint\",\n  });\n\n  \u002F\u002F Add custom files\n  const projectConfig = readProjectConfiguration(\n    tree,\n    `${scope}-feature-${name}`,\n  );\n  const projectNames = names(name);\n\n  generateFiles(\n    tree,\n    joinPathFragments(__dirname, \"files\"),\n    projectConfig.sourceRoot,\n    {\n      ...projectNames,\n      scope,\n      tmpl: \"\",\n    },\n  );\n\n  await formatFiles(tree);\n}\n```\n\n### Template 5: CI Configuration with Affected\n\n```yaml\n# .github\u002Fworkflows\u002Fci.yml\nname: CI\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\nenv:\n  NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}\n\njobs:\n  main:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: 20\n          cache: \"npm\"\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Derive SHAs for affected commands\n        uses: nrwl\u002Fnx-set-shas@v4\n\n      - name: Run affected lint\n        run: npx nx affected -t lint --parallel=3\n\n      - name: Run affected test\n        run: npx nx affected -t test --parallel=3 --configuration=ci\n\n      - name: Run affected build\n        run: npx nx affected -t build --parallel=3\n\n      - name: Run affected e2e\n        run: npx nx affected -t e2e --parallel=1\n```\n\n### Template 6: Remote Caching Setup\n\n```typescript\n\u002F\u002F nx.json with Nx Cloud\n{\n  \"tasksRunnerOptions\": {\n    \"default\": {\n      \"runner\": \"nx-cloud\",\n      \"options\": {\n        \"cacheableOperations\": [\"build\", \"lint\", \"test\", \"e2e\"],\n        \"accessToken\": \"your-nx-cloud-token\",\n        \"parallel\": 3,\n        \"cacheDirectory\": \".nx\u002Fcache\"\n      }\n    }\n  },\n  \"nxCloudAccessToken\": \"your-nx-cloud-token\"\n}\n\n\u002F\u002F Self-hosted cache with S3\n{\n  \"tasksRunnerOptions\": {\n    \"default\": {\n      \"runner\": \"@nx-aws-cache\u002Fnx-aws-cache\",\n      \"options\": {\n        \"cacheableOperations\": [\"build\", \"lint\", \"test\"],\n        \"awsRegion\": \"us-east-1\",\n        \"awsBucket\": \"my-nx-cache-bucket\",\n        \"awsProfile\": \"default\"\n      }\n    }\n  }\n}\n```\n\n## Common Commands\n\n```bash\n# Generate new library\nnx g @nx\u002Freact:lib feature-auth --directory=libs\u002Fweb --tags=type:feature,scope:web\n\n# Run affected tests\nnx affected -t test --base=main\n\n# View dependency graph\nnx graph\n\n# Run specific project\nnx build web --configuration=production\n\n# Reset cache\nnx reset\n\n# Run migrations\nnx migrate latest\nnx migrate --run-migrations\n```\n\n## Best Practices\n\n### Do's\n\n- **Use tags consistently** - Enforce with module boundaries\n- **Enable caching early** - Significant CI savings\n- **Keep libs focused** - Single responsibility\n- **Use generators** - Ensure consistency\n- **Document boundaries** - Help new developers\n\n### Don'ts\n\n- **Don't create circular deps** - Graph should be acyclic\n- **Don't skip affected** - Test only what changed\n- **Don't ignore boundaries** - Tech debt accumulates\n- **Don't over-granularize** - Balance lib count\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","07-后端与架构\u002Fnx-workspace-patterns-agents-main",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill nx-workspace-patterns",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill nx-workspace-patterns",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill nx-workspace-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns-agents-main\u002FSKILL.md",true,[],[47,54,59,66,73,80],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":55,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":81,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]