claude-toolkit 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.0 (2026-08-08)
4
+
5
+ `ct-typescript-conventions` now selects a compiler as well as types: prefer the TypeScript 7 native compiler where a project already ships it, fall back cleanly where it does not, and never upgrade a project unprompted. Availability-aware in the same spirit as `ct-esnext-idioms`.
6
+
7
+ - feat: prioritise the TypeScript 7 native compiler in `ct-typescript-conventions` — TS7 reached GA on 2026-07-08 as `typescript@7.0.2`, with Microsoft reporting 8x–12x faster full builds. The skill detects the *installed* version (`require('typescript/package.json').version`) rather than the declared semver range, which `overrides`/`resolutions`/catalogs routinely defeat, and names the three detection traps: the binary is `tsc` not `tsgo` (that was the pre-GA `@typescript/native-preview` name), range-sniffing is unreliable, and an API probe gives a false negative because TS7 exposes only `version`/`versionMajorMinor`.
8
+ - feat: document when *not* to switch — TS7.0 ships no stable programmatic API, so `typescript-eslint`, `ts-jest`, `ts-node`, `vue-tsc`, `svelte-check`, `@astrojs/check` and `@angular/compiler-cli` break at install or lint time rather than at `tsc --noEmit`, which means a green type-check proves nothing. The skill prescribes the documented side-by-side alias install instead of a downgrade.
9
+ - feat: add the TS7 `tsconfig.json` deltas — the options TS7 rejects outright (`ignoreDeprecations` no longer silences them), plus the two changed defaults behind most real breakage. Verified empirically against 5.9.3 / 6.0.3 / 7.0.2: both defaults land in 6.0 and carry forward, `types` fails `TS2591` even with `@types/node` installed, `rootDir` only bites when an `outDir` is set, and `types: ["*"]` is `TS2688` on 5.x — so no literal value is safe across majors.
10
+ - feat: skill triggers now fire on typecheck, tsconfig, and compiler work — added the `tsc`, `tsgo`, `tsconfig`, `typecheck` and `compiler` keywords, the `**/tsconfig*.json` path pattern, and intents for running a typecheck or upgrading TypeScript.
11
+ - docs: TSConfig cheat sheet gains a TypeScript 7 delta section; the skill's new remit is reflected in the generated skills index, README, and docs index.
12
+
3
13
  ## 0.15.0 (2026-07-04)
4
14
 
5
15
  Two new authoring-convention assets — an opt-in `esnext` stack and an always-on `ct-code-style` core skill — plus Biome enforcement of the mechanically-checkable style rules.
package/README.md CHANGED
@@ -121,7 +121,7 @@ Stacks in your config that are no longer detected are reported but left unchange
121
121
 
122
122
  - `ct-systematic-debugging` — Four-phase debugging methodology
123
123
  - `ct-testing-patterns` — TDD workflow and patterns
124
- - `ct-typescript-conventions` — TypeScript strict mode best practices
124
+ - `ct-typescript-conventions` — TypeScript strict mode best practices, and preferring the TS7 native compiler where available
125
125
  - `ct-verification-before-completion` — Evidence-based completion claims
126
126
  - `ct-code-style` — Code structure & style: guard clauses, lookup tables, no magic values
127
127
 
@@ -1,12 +1,70 @@
1
1
  ---
2
2
  name: ct-typescript-conventions
3
- description: Strict TypeScript patterns for type safety, readability, and maintainable codebases. Use when writing or reviewing TypeScript, adding or tightening types, or deciding between type and interface
3
+ description: Strict TypeScript patterns and compiler selection -- prefer the TypeScript 7 native compiler when a project ships it. Use when writing or reviewing TypeScript, running a typecheck, adding or tightening types, or deciding between type and interface
4
4
  ---
5
5
 
6
6
  # TypeScript Conventions
7
7
 
8
8
  Strict mode enabled. Catch errors at compile time, not runtime.
9
9
 
10
+ ## Compiler -- prefer TypeScript 7 when the project has it
11
+
12
+ TypeScript 7 (GA 2026-07-08, `typescript@7.0.2`) is the Go-native compiler; Microsoft reports **8x--12x faster full builds**. In a project that already ships it, use it for every type-check and build. Never install or bump it unprompted.
13
+
14
+ **Detect the installed version, not the declared range:**
15
+
16
+ ```bash
17
+ node -p "require('typescript/package.json').version" # major >= 7 -> TS7
18
+ ```
19
+
20
+ Resolve from the directory you are editing -- monorepo workspaces can pin different majors. Three traps:
21
+
22
+ - The TS7 binary is **`tsc`**. `tsgo` was the pre-GA `@typescript/native-preview` name -- never put it in a script.
23
+ - `package.json` ranges lie: `overrides`, `resolutions`, catalogs, and stale lockfiles all win, and `*` / `latest` / `>=5` resolve to 7.x today.
24
+ - Don't probe the API -- on TS7 `require("typescript")` exposes only `version` and `versionMajorMinor`, so a `ts.createProgram` check gives a false negative.
25
+
26
+ **Using it** -- same flags as 6.x:
27
+
28
+ ```bash
29
+ tsc --noEmit # type-check
30
+ tsc -b # build mode / project references
31
+ tsc --checkers 1 --noEmit # CI: pin the worker count
32
+ ```
33
+
34
+ `--checkers` defaults to 4. Pin it in CI -- Microsoft warns that varying it can surface order-dependent results.
35
+
36
+ **Stay on 6.x when a tool embeds the compiler.** TS7.0 ships no stable programmatic API (7.1 targets a new one), so `typescript-eslint`, `ts-jest`, `ts-node`, `vue-tsc`, `svelte-check`, `@astrojs/check`, and `@angular/compiler-cli` all break -- at install or lint time, *not* at `tsc --noEmit`. A green type-check proves nothing here. Vite, Bun, `tsx`, Vitest, and Biome are unaffected. Run both rather than downgrading:
37
+
38
+ ```json
39
+ {
40
+ "devDependencies": {
41
+ "@typescript/native": "npm:typescript@^7.0.2",
42
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
43
+ }
44
+ }
45
+ ```
46
+
47
+ Keep `typescript` pointed at the 6.0 package -- blocked tools import it by peer dependency. Where TS7 is absent, the floor is `typescript@6.0.3`, the bridge release; its readiness gate is a clean build with `"stableTypeOrdering": true` and no `ignoreDeprecations`.
48
+
49
+ **`tsconfig.json` rules TS7 enforces** -- `ignoreDeprecations` no longer silences any of them:
50
+
51
+ | Now rejected | Fix |
52
+ |---|---|
53
+ | `baseUrl` | project-root-relative `paths` |
54
+ | `outFile`, `downlevelIteration` | remove |
55
+ | `target: "es5"` | `"es2015"` or later |
56
+ | `module: "amd" \| "umd" \| "system" \| "none" \| "systemjs"` | `"esnext"`, `"preserve"`, or `"nodenext"` |
57
+ | `moduleResolution: "node" \| "node10" \| "classic"` | `"bundler"`, `"node16"`, or `"nodenext"` |
58
+ | `esModuleInterop` / `allowSyntheticDefaultImports` / `alwaysStrict` set to `false` | drop the override |
59
+ | `out`, `charset`, `keyofStringsOnly`, `importsNotUsedAsValues`, `preserveValueImports`, `suppressImplicitAnyIndexErrors`, `suppressExcessPropertyErrors`, `noStrictGenericChecks`, `noImplicitUseStrict` | gone -- `TS5023: Unknown compiler option` |
60
+
61
+ Two changed defaults cause most real-world breakage. Both arrived in 6.0 and carry forward, so they bite on either major -- verified identical on 6.0.3 and 7.0.2:
62
+
63
+ - **`types` defaults to `[]`** -- `process`, `Bun` and friends disappear (`TS2591`) *even with `@types/node` installed*. Set `"types": ["node"]` / `["bun"]` explicitly, naming only packages that are actually installed (a missing one is `TS2688`). `"types": ["*"]` restores the old catch-all on 6.x/7.x but is itself `TS2688` on 5.x.
64
+ - **`rootDir` defaults to `./`** -- with sources in `src/` and an `outDir`, emit fails `TS5011`. Set `"rootDir": "./src"`. `--noEmit` does *not* surface this, so type-check CI stays green while the build breaks.
65
+
66
+ `strict` and `stableTypeOrdering` are on by default; `stableTypeOrdering` cannot be turned off.
67
+
10
68
  ## Rules
11
69
 
12
70
  - **No `any`** -- Use `unknown` + narrowing, generics, or specific types.
package/docs/README.md CHANGED
@@ -14,7 +14,7 @@ Skills that are always included regardless of stack configuration.
14
14
  | -------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
15
15
  | [ct-systematic-debugging](skills/systematic-debugging.md) | Four-phase methodology for diagnosing and fixing bugs without guesswork |
16
16
  | [ct-testing-patterns](skills/testing-patterns.md) | Framework-agnostic TDD practices, mocking strategies, and test organization |
17
- | [ct-typescript-conventions](skills/typescript-conventions.md) | Strict TypeScript patterns for type safety and maintainability |
17
+ | [ct-typescript-conventions](skills/typescript-conventions.md) | Strict TypeScript patterns, plus TS7 native-compiler selection |
18
18
  | [ct-verification-before-completion](skills/verification-before-completion.md) | Evidence-based completion claims with structured verification checklist |
19
19
  | [ct-code-style](skills/code-style.md) | Code structure & style: guard clauses, lookup tables, no magic values |
20
20
 
@@ -127,3 +127,34 @@ When a bundler (Vite, esbuild, etc.) handles transpilation:
127
127
  }
128
128
  }
129
129
  ```
130
+
131
+ ## TypeScript 7 Delta
132
+
133
+ > Not from the source cheat sheet — added for TypeScript 7 (GA 2026-07-08, `typescript@7.0.2`). See [ct-typescript-conventions](../../skills/typescript-conventions.md#tsconfigjson-under-ts7) for the full compiler-selection guidance.
134
+
135
+ Everything above is TS7-compatible as written, with **two additions** required when the native compiler is in use:
136
+
137
+ ```jsonc
138
+ {
139
+ "compilerOptions": {
140
+ // `types` defaults to [] from 6.0 onward. Without this, ambient
141
+ // globals (`process`, Bun's APIs) fail TS2591 even when
142
+ // @types/node IS installed. Name only packages you actually have —
143
+ // a missing one is TS2688.
144
+ "types": ["node"],
145
+
146
+ // `rootDir` defaults to "./" from 6.0 onward. With sources in src/
147
+ // AND an outDir set, emit fails TS5011 — and `--noEmit` will not
148
+ // warn you. Without an outDir it does not fire.
149
+ "rootDir": "./src"
150
+ }
151
+ }
152
+ ```
153
+
154
+ Both defaults changed in **6.0**, not 7.0 — verified identical on `typescript@6.0.3` and `7.0.2`. `rootDir` matters only when the project emits to an `outDir`; `types` matters always.
155
+
156
+ `"types": ["*"]` restores the pre-6.0 catch-all behaviour on 6.x and 7.x, but is `TS2688` on 5.x — so it is not a safe value for a config shared across majors.
157
+
158
+ TS7 also rejects options this sheet never recommends — `baseUrl`, `outFile`, `downlevelIteration`, `target: "es5"`, `module: "amd" | "umd" | "system"`, and `moduleResolution: "node" | "node10" | "classic"`. `ignoreDeprecations` does not silence them.
159
+
160
+ The TypeScript website's [tsconfig reference](https://www.typescriptlang.org/tsconfig/) has not been updated for TS7 and still documents removed options.
@@ -1,6 +1,6 @@
1
1
  # TypeScript Conventions
2
2
 
3
- > Strict TypeScript patterns for type safety, readability, and maintainable codebases. Use when writing or reviewing TypeScript, adding or tightening types, or deciding between type and interface
3
+ > Strict TypeScript patterns and compiler selection — prefer the TypeScript 7 native compiler when a project ships it. Use when writing or reviewing TypeScript, running a typecheck, adding or tightening types, or deciding between type and interface
4
4
 
5
5
  **Type:** Core Skill (always included)
6
6
  **Source:** [`core/skills/ct-typescript-conventions/SKILL.md`](../core/skills/ct-typescript-conventions/SKILL.md)
@@ -9,6 +9,98 @@
9
9
 
10
10
  Rules for writing TypeScript that leverages the type system fully. These assume strict mode is enabled and prioritize catching errors at compile time over runtime.
11
11
 
12
+ The skill also covers **which compiler to run**. TypeScript 7 — the Go-native port — reached GA on 2026-07-08 as `typescript@7.0.2`, with Microsoft reporting 8x–12x faster full builds. The guidance is availability-aware in the same spirit as [ct-esnext-idioms](../stacks/esnext-idioms.md): prefer TS7 where a project already has it, fall back cleanly where it doesn't, and never upgrade a project unprompted.
13
+
14
+ ## Compiler Selection
15
+
16
+ ### Detect before you assume
17
+
18
+ Read the **installed** version, resolved from the directory being edited (monorepo workspaces can pin different majors):
19
+
20
+ ```bash
21
+ node -p "require('typescript/package.json').version" # major >= 7 -> TS7
22
+ ```
23
+
24
+ `typescript@7.0.2` whitelists `./package.json` in its `exports` map, and 5.x/6.x have no `exports` map at all, so this subpath resolves on every major.
25
+
26
+ Three detection traps:
27
+
28
+ | Trap | Why it misleads |
29
+ |---|---|
30
+ | Looking for a `tsgo` binary | TS7's only CLI binary is `tsc`. `tsgo` belonged to the pre-GA `@typescript/native-preview` package, which is frozen at a `7.0.0-dev` nightly. |
31
+ | Reading the `package.json` semver range | `overrides`, `resolutions`, pnpm/bun catalogs and stale lockfiles all override it — and `*`, `latest`, `>=5` all resolve to 7.x today. |
32
+ | Probing the API (`ts.createProgram`) | On TS7 `require("typescript")` exposes only `version` and `versionMajorMinor`, so an API probe reports a false negative. |
33
+
34
+ ### When TS7 is available
35
+
36
+ Flags are unchanged from 6.x — `tsc --noEmit`, `tsc -p <path>`, `tsc -b`, `tsc --watch`. New in TS7:
37
+
38
+ | Flag | Meaning |
39
+ |---|---|
40
+ | `--checkers <n>` | Type-checking workers per project (default 4). Microsoft warns that varying it "may surface order-dependent results" — pin it in CI. |
41
+ | `--builders <n>` | Projects built concurrently in build mode (default 4). |
42
+ | `--singleThreaded` | Most deterministic setting. |
43
+ | `--lsp` | Language server over LSP (there is no `tsserver` binary). |
44
+
45
+ Note that watch mode is labelled a prototype at the GA tag: it rebuilds but does not incrementally recheck.
46
+
47
+ ### When a tool embeds the compiler — do not switch
48
+
49
+ TypeScript 7.0 ships **no stable programmatic API**; Microsoft targets 7.1 for "a new (and different) API" with no committed date. Anything that embeds the compiler is blocked:
50
+
51
+ | Tool | Status on TS7 |
52
+ |---|---|
53
+ | `typescript-eslint` | Peer range `<6.1.0`; install fails `ERESOLVE`, and a forced install crashes during lint |
54
+ | `vue-tsc`, `svelte-check`, `@astrojs/check` | Crash on `ERR_PACKAGE_PATH_NOT_EXPORTED` — TS7 has no `./lib/*` export |
55
+ | `ts-node` | Crashes in config load |
56
+ | `ts-jest` | Peer range `>=4.3 <7` |
57
+ | `@angular/compiler-cli` | Peer range `>=6.0 <6.1` (Microsoft suggests a hybrid: TS7 at the CLI, TS6 for editor support) |
58
+
59
+ Unaffected — these carry no `typescript` dependency at all: Vite, Bun, `tsx`, Vitest, Jest, Biome.
60
+
61
+ **A type-check smoke test will not catch these failures.** typescript-eslint's breakage surfaces at `npm ci` and at lint time while `tsc --noEmit` still passes. When a blocked tool is present, install both compilers side by side rather than downgrading — this is Microsoft's documented escape hatch:
62
+
63
+ ```json
64
+ {
65
+ "devDependencies": {
66
+ "@typescript/native": "npm:typescript@^7.0.2",
67
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
68
+ }
69
+ }
70
+ ```
71
+
72
+ The `typescript` key must stay pointed at the 6.0 compatibility package, because blocked tools import from `typescript` by peer dependency.
73
+
74
+ ### When TS7 is absent
75
+
76
+ The floor is `typescript@6.0.3` — the last 6.x release, and the bridge Microsoft designates between 5.9 and 7.0. It also sits inside every current ecosystem peer range. The readiness gate before moving a project to 7 is a clean 6.0 build with `"stableTypeOrdering": true` and no `ignoreDeprecations` set. That flag is a diagnostic aid only — Microsoft notes it can add up to 25% to type-checking time and is not meant to be left on.
77
+
78
+ ### `tsconfig.json` under TS7
79
+
80
+ These are rejected outright, and `ignoreDeprecations` no longer silences them (in 6.0 they were silenceable errors; in 7.0 there is no escape hatch):
81
+
82
+ | Rejected | Replacement |
83
+ |---|---|
84
+ | `baseUrl` | project-root-relative `paths` |
85
+ | `outFile`, `downlevelIteration` | remove |
86
+ | `target: "es5"` | `"es2015"` or later |
87
+ | `module: "amd" \| "umd" \| "system" \| "none" \| "systemjs"` | `"esnext"`, `"preserve"`, or `"nodenext"` |
88
+ | `moduleResolution: "node" \| "node10" \| "classic"` | `"bundler"`, `"node16"`, or `"nodenext"` |
89
+ | `esModuleInterop` / `allowSyntheticDefaultImports` / `alwaysStrict` set to `false` | drop the override |
90
+
91
+ These are gone entirely — `TS5023: Unknown compiler option`: `out`, `charset`, `keyofStringsOnly`, `suppressImplicitAnyIndexErrors`, `noImplicitUseStrict`, `importsNotUsedAsValues`, `preserveValueImports`, `suppressExcessPropertyErrors`, `noStrictGenericChecks`.
92
+
93
+ Two changed defaults account for most real-world breakage:
94
+
95
+ - **`types` defaults to `[]`.** Ambient globals like `process` vanish with `TS2591`. Set it explicitly: `"types": ["node"]`, or `["bun"]` for Bun projects.
96
+ - **`rootDir` defaults to `./`.** With sources under `src/` and an `outDir`, emit fails `TS5011`. Set `"rootDir": "./src"`. This fires **only when the program emits** — `tsc --noEmit` stays silent, so a type-check-only CI job can stay green while the build breaks.
97
+
98
+ `strict` defaults to `true`, and `stableTypeOrdering` is on and cannot be turned off. `experimentalDecorators` and `emitDecoratorMetadata` both survive.
99
+
100
+ Project references, `--build` mode, incremental builds, declaration emit, and CommonJS emit all work.
101
+
102
+ > Reference note: `typescriptlang.org/tsconfig` has not been updated for TS7 and still documents removed options, and there is no TS 7.0 handbook release-notes page. The [GA announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/) is the authoritative what's-new source.
103
+
12
104
  ## Key Patterns
13
105
 
14
106
  ### Strict Mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-toolkit",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Reusable Claude Code configuration toolkit with stack-specific connectors",
5
5
  "type": "module",
6
6
  "bin": {
package/src/generator.ts CHANGED
@@ -373,7 +373,8 @@ async function generateSkillsReadme(claudeDir: string, resolved: ResolvedConfig)
373
373
  content +=
374
374
  "| ct-systematic-debugging | Four-phase debugging methodology, root cause analysis |\n";
375
375
  content += "| ct-testing-patterns | Test-driven development workflow and patterns |\n";
376
- content += "| ct-typescript-conventions | TypeScript strict mode and conventions |\n";
376
+ content +=
377
+ "| ct-typescript-conventions | TypeScript strict mode, conventions, and TS7 compiler selection |\n";
377
378
  content += "| ct-verification-before-completion | Evidence-based completion claims protocol |\n";
378
379
  content +=
379
380
  "| ct-code-style | Code structure & style: guard clauses, lookup tables, no magic values |\n";
@@ -43,14 +43,37 @@
43
43
  }
44
44
  },
45
45
  "ct-typescript-conventions": {
46
- "description": "TypeScript strict mode and conventions",
46
+ "description": "TypeScript strict mode, conventions, and TS7 compiler selection",
47
47
  "priority": 5,
48
48
  "triggers": {
49
- "keywords": ["typescript", "type", "interface", "generic", "strict mode"],
50
- "keywordPatterns": ["\\btype\\b", "\\binterface\\b", "\\bgeneric\\b"],
51
- "pathPatterns": ["**/*.d.ts", "**/types/**", "**/types.ts"],
52
- "intentPatterns": ["(?:define|create).*(?:type|interface)", "(?:type).*(?:error|issue)"],
53
- "contentPatterns": ["interface ", "type ", ": unknown", "as const"]
49
+ "keywords": [
50
+ "typescript",
51
+ "type",
52
+ "interface",
53
+ "generic",
54
+ "strict mode",
55
+ "tsc",
56
+ "tsgo",
57
+ "tsconfig",
58
+ "typecheck",
59
+ "compiler"
60
+ ],
61
+ "keywordPatterns": [
62
+ "\\btype\\b",
63
+ "\\binterface\\b",
64
+ "\\bgeneric\\b",
65
+ "\\btsc\\b",
66
+ "\\btsconfig\\b",
67
+ "\\bts\\s?7\\b"
68
+ ],
69
+ "pathPatterns": ["**/*.d.ts", "**/types/**", "**/types.ts", "**/tsconfig*.json"],
70
+ "intentPatterns": [
71
+ "(?:define|create).*(?:type|interface)",
72
+ "(?:type).*(?:error|issue)",
73
+ "(?:run|fix).*type.?check",
74
+ "(?:upgrade|migrate|update).*typescript"
75
+ ],
76
+ "contentPatterns": ["interface ", "type ", ": unknown", "as const", "compilerOptions"]
54
77
  },
55
78
  "excludePatterns": ["issue type", "type of bug"]
56
79
  },