[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75NDPWWN4ZZ8TXGEF3TMRHM":3,"skill-same:01M75NDPWWN4ZZ8TXGEF3TMRHM":49},{"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":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M75NDPWWN4ZZ8TXGEF3TMRHM","nestjs-dependency-injection",null,"Use NestJS providers and injection tokens for testable, decoupled services","linktogo\u002Fmaggie","linktogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F29751338?v=4","01M75NBAKP44KV5ND0WEE3H87P","Fabien Brunet","01M75NBAMC2TEQQ8FMTBA23MET",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fnestjs\u002Fdependency-injection\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: nestjs-dependency-injection\ndescription: Use NestJS providers and injection tokens for testable, decoupled services\nglobs: [\"**\u002F*.service.ts\", \"**\u002F*.module.ts\"]\n---\n\n# NestJS dependency injection\n\nLet Nest wire dependencies. Never `new` a service that has its own\ndependencies — inject it so it can be swapped in tests.\n\n## Rules\n\n- Constructor injection with `private readonly`:\n  ```ts\n  constructor(private readonly users: UsersService) {}\n  ```\n- Depend on an interface via an injection token when you need multiple\n  implementations or want to fake I\u002FO in tests:\n  ```ts\n  export const MAILER = Symbol('MAILER');\n  \u002F\u002F provider: { provide: MAILER, useClass: SmtpMailer }\n  constructor(@Inject(MAILER) private readonly mailer: Mailer) {}\n  ```\n- Default to the singleton scope. Reach for `Scope.REQUEST` only when a provider\n  genuinely needs per-request state — it is slower and taints everything that\n  injects it.\n- Configuration comes from `ConfigService`, not `process.env` read inline.\n\n## Testing\n\n- In unit tests, build a module with `Test.createTestingModule` and override\n  providers (`.overrideProvider(MAILER).useValue(fakeMailer)`).\n- If a class is hard to test because of its dependencies, that is a design\n  signal — inject a narrower abstraction rather than mocking the world.\n","# NestJS dependency injection\n\nLet Nest wire dependencies. Never `new` a service that has its own\ndependencies — inject it so it can be swapped in tests.\n\n## Rules\n\n- Constructor injection with `private readonly`:\n  ```ts\n  constructor(private readonly users: UsersService) {}\n  ```\n- Depend on an interface via an injection token when you need multiple\n  implementations or want to fake I\u002FO in tests:\n  ```ts\n  export const MAILER = Symbol('MAILER');\n  \u002F\u002F provider: { provide: MAILER, useClass: SmtpMailer }\n  constructor(@Inject(MAILER) private readonly mailer: Mailer) {}\n  ```\n- Default to the singleton scope. Reach for `Scope.REQUEST` only when a provider\n  genuinely needs per-request state — it is slower and taints everything that\n  injects it.\n- Configuration comes from `ConfigService`, not `process.env` read inline.\n\n## Testing\n\n- In unit tests, build a module with `Test.createTestingModule` and override\n  providers (`.overrideProvider(MAILER).useValue(fakeMailer)`).\n- If a class is hard to test because of its dependencies, that is a design\n  signal — inject a narrower abstraction rather than mocking the world.\n",{"name":5,"globs":24,"description":7},[25,26],"**\u002F*.service.ts","**\u002F*.module.ts","main","d884e3c730aa8243273458fa6d7de64bfd3b8bba","skills\u002Fnestjs\u002Fdependency-injection","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie","https:\u002F\u002Fgithub.com\u002Flinktogo","http:\u002F\u002Ffabien-brunet.fr\u002F","Software Architect @Capgemini","2026-11-14 21:45:09",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add linktogo\u002Fmaggie --skill nestjs-dependency-injection",{"tool":41,"command":42},"bunx","bunx skills add linktogo\u002Fmaggie --skill nestjs-dependency-injection",{"tool":44,"command":45},"pnpm","pnpm dlx skills add linktogo\u002Fmaggie --skill nestjs-dependency-injection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fnestjs\u002Fdependency-injection\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M75NEGXZPJFCHAE5P31CQX94","vuejs-state-management","Manage Vue application state with Pinia and the right state locality","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs\u002Fstate-management\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M75NEEHT92D2SPZFEWBMSVX9","vuejs-composition-api","Write Vue 3 components with the Composition API, script setup, and composables","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs\u002Fcomposition-api\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M75NEBQJKWVJG8CYZQQB4BFQ","reactjs-hooks","Use React hooks correctly — dependencies, effects, and custom hooks","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Freactjs\u002Fhooks\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M75NE9V7AYPA9QF9H21TKC08","reactjs-component-design","Write small, composable React components with clean props and no needless state","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Freactjs\u002Fcomponent-design\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"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},"01M75NE64WGJTNTKW3RYVC7394","postgres-query-performance","Diagnose and fix slow PostgreSQL queries with indexes and EXPLAIN","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fpostgres\u002Fquery-performance\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M75NE3KGES659BWDAZDM6YQ5","postgres-migrations","Write safe, reversible, zero-downtime PostgreSQL schema migrations","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fpostgres\u002Fmigrations\u002FSKILL.md",[],[]]