{"owner":"sindresorhus","repo":"type-fest","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# type-fest\n\nTypeScript utility types library. Pure type-level programming—no runtime code.\n\n**Read `.github/contributing.md` for complete guidelines.**\n\n## Commands\n\n```bash\nnpm test         # MUST pass before committing (runs all below)\nnpm run test:tsc # TypeScript compiler\nnpm run test:tsd # Type tests (tsd)\nnpm run test:xo  # Linter\n```\n\n## File Structure\n\n```\nsource/type-name.d.ts → Type definition (.d.ts REQUIRED)\ntest-d/type-name.ts   → Tests (tsd)\nindex.d.ts            → Export (MUST add, lint enforces)\nreadme.md             → API docs (add to category)\nsource/internal/      → Shared helpers (not exported)\n```\n\n## Code Patterns\n\n```ts\n// ✅ CORRECT\nimport type {IsNever} from './is-never.d.ts';  // Include .d.ts\nexport type MyType<Value extends string> = ... // Descriptive names (not T/U)\nexport {};                                      // REQUIRED at end\n\n// ❌ WRONG\nimport type {IsNever} from './is-never';       // Missing .d.ts\nexport type MyType<T> = ...;                   // Single-letter\n\n/**\nCreates a tuple type of specified length with elements of specified type.\n\nUse-cases:\n- Define fixed-length arrays with specific types\n\n@example\n```\nimport type {TupleOf} from 'type-fest';\ntype RGB = TupleOf<3, number>; //=> [number, number, number]\n```\n\n@category Array\n*/\nexport type TupleOf<Length extends number, Fill = unknown> = ...;\nexport {};\n```\n\nType params: `Value`, `Target`, `Item`, `Length`, `Element`, `Key` (not `T`, `U`, `V`, `K`)\nDocs: No `*` prefix. First line → readme. Include use-cases, examples, `@category`.\n\n## Testing\n\n**ALWAYS test edge cases** (`any`, `never`, `unknown`).\n\n```ts\nexpectType<string>('' as MyType<'foo'>);           // Basic\nexpectType<any>('' as MyType<any>);                // any/never/unknown\nexpectNotAssignable<MyType<'foo'>>({wrong: true}); // Negative\nexpectError<MyType<number>>();                     // Should error\n```\n\nStudy: `source/tuple-of.d.ts`, `is-equal.d.ts`, `literal-union.d.ts`, `internal/*.d.ts`\n\n## Workflow\n\n1. Research - Study `source/` similar types + online research\n2. Define - `source/type-name.d.ts` with docs\n3. Test - `test-d/type-name.ts` with edge cases\n4. Export - Add to `index.d.ts` + readme.md\n5. Verify - `npm test` must pass\n6. Commit - ``Add `TypeName` type`` or ``  `TypeName`: Fix description``\n\n## Critical Rules\n\n1. Import paths MUST include `.d.ts` extension\n2. Files MUST end with `export {};`\n3. Types MUST be exported from `index.d.ts`\n4. Type params MUST use descriptive names (not `T`/`U`)\n5. MUST test `any`, `never`, `unknown` edge cases\n6. First doc line MUST be concise (goes in readme)\n7. Use realistic examples with `//=>` comments\n8. Include `@category` tags\n9. Fix lint issues, don't disable rules\n\n## Type Programming\n\n- Conditionals: `T extends U ? X : Y`\n- Recursion: `type Loop<T, Acc> = ... Loop<...> ...`\n- Extract: `infer Item`\n- Distribute: `T extends any ? ... : never`\n- Count via tuple `['length']`\n- Union distribution is tricky—test it\n\n## Philosophy\n\n- Correctness > cleverness\n- Real problems only\n- Docs teach how, not what\n- Edge cases mandatory\n- One concept per PR\n- Descriptive names > brevity\n- No unrelated changes\n\n## Troubleshooting\n\n- Tests fail? Check `.d.ts` imports, `export {};`, edge cases (`any`, `never`, `unknown`)\n- Lint errors? Add to `index.d.ts`, fix issues (don't disable rules)\n"},"files":{"CLAUDE.md":"# type-fest\n\nTypeScript utility types library. Pure type-level programming—no runtime code.\n\n**Read `.github/contributing.md` for complete guidelines.**\n\n## Commands\n\n```bash\nnpm test         # MUST pass before committing (runs all below)\nnpm run test:tsc # TypeScript compiler\nnpm run test:tsd # Type tests (tsd)\nnpm run test:xo  # Linter\n```\n\n## File Structure\n\n```\nsource/type-name.d.ts → Type definition (.d.ts REQUIRED)\ntest-d/type-name.ts   → Tests (tsd)\nindex.d.ts            → Export (MUST add, lint enforces)\nreadme.md             → API docs (add to category)\nsource/internal/      → Shared helpers (not exported)\n```\n\n## Code Patterns\n\n```ts\n// ✅ CORRECT\nimport type {IsNever} from './is-never.d.ts';  // Include .d.ts\nexport type MyType<Value extends string> = ... // Descriptive names (not T/U)\nexport {};                                      // REQUIRED at end\n\n// ❌ WRONG\nimport type {IsNever} from './is-never';       // Missing .d.ts\nexport type MyType<T> = ...;                   // Single-letter\n\n/**\nCreates a tuple type of specified length with elements of specified type.\n\nUse-cases:\n- Define fixed-length arrays with specific types\n\n@example\n```\nimport type {TupleOf} from 'type-fest';\ntype RGB = TupleOf<3, number>; //=> [number, number, number]\n```\n\n@category Array\n*/\nexport type TupleOf<Length extends number, Fill = unknown> = ...;\nexport {};\n```\n\nType params: `Value`, `Target`, `Item`, `Length`, `Element`, `Key` (not `T`, `U`, `V`, `K`)\nDocs: No `*` prefix. First line → readme. Include use-cases, examples, `@category`.\n\n## Testing\n\n**ALWAYS test edge cases** (`any`, `never`, `unknown`).\n\n```ts\nexpectType<string>('' as MyType<'foo'>);           // Basic\nexpectType<any>('' as MyType<any>);                // any/never/unknown\nexpectNotAssignable<MyType<'foo'>>({wrong: true}); // Negative\nexpectError<MyType<number>>();                     // Should error\n```\n\nStudy: `source/tuple-of.d.ts`, `is-equal.d.ts`, `literal-union.d.ts`, `internal/*.d.ts`\n\n## Workflow\n\n1. Research - Study `source/` similar types + online research\n2. Define - `source/type-name.d.ts` with docs\n3. Test - `test-d/type-name.ts` with edge cases\n4. Export - Add to `index.d.ts` + readme.md\n5. Verify - `npm test` must pass\n6. Commit - ``Add `TypeName` type`` or ``  `TypeName`: Fix description``\n\n## Critical Rules\n\n1. Import paths MUST include `.d.ts` extension\n2. Files MUST end with `export {};`\n3. Types MUST be exported from `index.d.ts`\n4. Type params MUST use descriptive names (not `T`/`U`)\n5. MUST test `any`, `never`, `unknown` edge cases\n6. First doc line MUST be concise (goes in readme)\n7. Use realistic examples with `//=>` comments\n8. Include `@category` tags\n9. Fix lint issues, don't disable rules\n\n## Type Programming\n\n- Conditionals: `T extends U ? X : Y`\n- Recursion: `type Loop<T, Acc> = ... Loop<...> ...`\n- Extract: `infer Item`\n- Distribute: `T extends any ? ... : never`\n- Count via tuple `['length']`\n- Union distribution is tricky—test it\n\n## Philosophy\n\n- Correctness > cleverness\n- Real problems only\n- Docs teach how, not what\n- Edge cases mandatory\n- One concept per PR\n- Descriptive names > brevity\n- No unrelated changes\n\n## Troubleshooting\n\n- Tests fail? Check `.d.ts` imports, `export {};`, edge cases (`any`, `never`, `unknown`)\n- Lint errors? Add to `index.d.ts`, fix issues (don't disable rules)\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# type-fest\n\nTypeScript utility types library. Pure type-level programming—no runtime code.\n\n**Read `.github/contributing.md` for complete guidelines.**\n\n## Commands\n\n```bash\nnpm test         # MUST pass before committing (runs all below)\nnpm run test:tsc # TypeScript compiler\nnpm run test:tsd # Type tests (tsd)\nnpm run test:xo  # Linter\n```\n\n## File Structure\n\n```\nsource/type-name.d.ts → Type definition (.d.ts REQUIRED)\ntest-d/type-name.ts   → Tests (tsd)\nindex.d.ts            → Export (MUST add, lint enforces)\nreadme.md             → API docs (add to category)\nsource/internal/      → Shared helpers (not exported)\n```\n\n## Code Patterns\n\n```ts\n// ✅ CORRECT\nimport type {IsNever} from './is-never.d.ts';  // Include .d.ts\nexport type MyType<Value extends string> = ... // Descriptive names (not T/U)\nexport {};                                      // REQUIRED at end\n\n// ❌ WRONG\nimport type {IsNever} from './is-never';       // Missing .d.ts\nexport type MyType<T> = ...;                   // Single-letter\n\n/**\nCreates a tuple type of specified length with elements of specified type.\n\nUse-cases:\n- Define fixed-length arrays with specific types\n\n@example\n```\nimport type {TupleOf} from 'type-fest';\ntype RGB = TupleOf<3, number>; //=> [number, number, number]\n```\n\n@category Array\n*/\nexport type TupleOf<Length extends number, Fill = unknown> = ...;\nexport {};\n```\n\nType params: `Value`, `Target`, `Item`, `Length`, `Element`, `Key` (not `T`, `U`, `V`, `K`)\nDocs: No `*` prefix. First line → readme. Include use-cases, examples, `@category`.\n\n## Testing\n\n**ALWAYS test edge cases** (`any`, `never`, `unknown`).\n\n```ts\nexpectType<string>('' as MyType<'foo'>);           // Basic\nexpectType<any>('' as MyType<any>);                // any/never/unknown\nexpectNotAssignable<MyType<'foo'>>({wrong: true}); // Negative\nexpectError<MyType<number>>();                     // Should error\n```\n\nStudy: `source/tuple-of.d.ts`, `is-equal.d.ts`, `literal-union.d.ts`, `internal/*.d.ts`\n\n## Workflow\n\n1. Research - Study `source/` similar types + online research\n2. Define - `source/type-name.d.ts` with docs\n3. Test - `test-d/type-name.ts` with edge cases\n4. Export - Add to `index.d.ts` + readme.md\n5. Verify - `npm test` must pass\n6. Commit - ``Add `TypeName` type`` or ``  `TypeName`: Fix description``\n\n## Critical Rules\n\n1. Import paths MUST include `.d.ts` extension\n2. Files MUST end with `export {};`\n3. Types MUST be exported from `index.d.ts`\n4. Type params MUST use descriptive names (not `T`/`U`)\n5. MUST test `any`, `never`, `unknown` edge cases\n6. First doc line MUST be concise (goes in readme)\n7. Use realistic examples with `//=>` comments\n8. Include `@category` tags\n9. Fix lint issues, don't disable rules\n\n## Type Programming\n\n- Conditionals: `T extends U ? X : Y`\n- Recursion: `type Loop<T, Acc> = ... Loop<...> ...`\n- Extract: `infer Item`\n- Distribute: `T extends any ? ... : never`\n- Count via tuple `['length']`\n- Union distribution is tricky—test it\n\n## Philosophy\n\n- Correctness > cleverness\n- Real problems only\n- Docs teach how, not what\n- Edge cases mandatory\n- One concept per PR\n- Descriptive names > brevity\n- No unrelated changes\n\n## Troubleshooting\n\n- Tests fail? Check `.d.ts` imports, `export {};`, edge cases (`any`, `never`, `unknown`)\n- Lint errors? Add to `index.d.ts`, fix issues (don't disable rules)\n","category":"root","tokens":835}]}