ts-procedures 8.2.0 → 8.3.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.
Files changed (40) hide show
  1. package/agent_config/bin/setup.mjs +2 -2
  2. package/agent_config/claude-code/.claude-plugin/plugin.json +1 -1
  3. package/agent_config/claude-code/agents/ts-procedures-architect.md +1 -1
  4. package/agent_config/claude-code/skills/ts-procedures/SKILL.md +353 -6
  5. package/agent_config/claude-code/skills/ts-procedures/api-reference.md +4 -2
  6. package/agent_config/claude-code/skills/ts-procedures/patterns.md +30 -6
  7. package/agent_config/copilot/copilot-instructions.md +10 -6
  8. package/agent_config/cursor/cursorrules +10 -6
  9. package/agent_config/lib/install-claude.mjs +4 -4
  10. package/build/codegen/emit-errors.integration.test.js +22 -0
  11. package/build/codegen/emit-errors.integration.test.js.map +1 -1
  12. package/build/implementations/http/error-taxonomy.d.ts +40 -0
  13. package/build/implementations/http/error-taxonomy.js +57 -5
  14. package/build/implementations/http/error-taxonomy.js.map +1 -1
  15. package/build/implementations/http/error-taxonomy.test.js +95 -1
  16. package/build/implementations/http/error-taxonomy.test.js.map +1 -1
  17. package/build/implementations/http/hono/handlers/http.js +19 -24
  18. package/build/implementations/http/hono/handlers/http.js.map +1 -1
  19. package/build/implementations/http/hono/handlers/http.test.js +64 -1
  20. package/build/implementations/http/hono/handlers/http.test.js.map +1 -1
  21. package/docs/ai-agent-setup.md +5 -6
  22. package/docs/client-and-codegen.md +8 -0
  23. package/docs/core.md +2 -0
  24. package/docs/http-integrations.md +4 -0
  25. package/package.json +1 -1
  26. package/src/codegen/emit-errors.integration.test.ts +26 -0
  27. package/src/implementations/http/error-taxonomy.test.ts +111 -0
  28. package/src/implementations/http/error-taxonomy.ts +60 -5
  29. package/src/implementations/http/hono/handlers/http.test.ts +69 -1
  30. package/src/implementations/http/hono/handlers/http.ts +19 -21
  31. package/agent_config/claude-code/skills/ts-procedures-kotlin/SKILL.md +0 -106
  32. package/agent_config/claude-code/skills/ts-procedures-review/SKILL.md +0 -48
  33. package/agent_config/claude-code/skills/ts-procedures-scaffold/SKILL.md +0 -50
  34. package/agent_config/claude-code/skills/ts-procedures-swift/SKILL.md +0 -119
  35. /package/agent_config/claude-code/skills/{ts-procedures-review → ts-procedures}/checklist.md +0 -0
  36. /package/agent_config/claude-code/skills/{ts-procedures-scaffold → ts-procedures}/templates/astro-catchall.md +0 -0
  37. /package/agent_config/claude-code/skills/{ts-procedures-scaffold → ts-procedures}/templates/client.md +0 -0
  38. /package/agent_config/claude-code/skills/{ts-procedures-scaffold → ts-procedures}/templates/hono.md +0 -0
  39. /package/agent_config/claude-code/skills/{ts-procedures-scaffold → ts-procedures}/templates/procedure.md +0 -0
  40. /package/agent_config/claude-code/skills/{ts-procedures-scaffold → ts-procedures}/templates/stream-procedure.md +0 -0
@@ -92,7 +92,7 @@ function setupClaude({ dryRun, check } = {}) {
92
92
  // Mirror install-claude.mjs: copy every file under each source skill dir, plus the agent.
93
93
  const claudeFiles = [];
94
94
  const skillsSrc = join(AGENT_CONFIG_DIR, 'claude-code', 'skills');
95
- for (const skill of ['ts-procedures', 'ts-procedures-review', 'ts-procedures-scaffold', 'ts-procedures-kotlin', 'ts-procedures-swift']) {
95
+ for (const skill of ['ts-procedures']) {
96
96
  const walk = (dir, prefix) => {
97
97
  for (const entry of readdirSync(dir)) {
98
98
  const full = join(dir, entry);
@@ -128,7 +128,7 @@ function setupClaude({ dryRun, check } = {}) {
128
128
  console.log(` ${f}`);
129
129
  }
130
130
  console.log('');
131
- console.log(' Skills: ts-procedures, ts-procedures-scaffold, ts-procedures-review, ts-procedures-kotlin, ts-procedures-swift');
131
+ console.log(' Skills: ts-procedures (use `/ts-procedures review <path>` and `/ts-procedures scaffold <type> <Name>`; Kotlin/Swift codegen reference included)');
132
132
  console.log(' Agent: ts-procedures-architect (architecture planning)\n');
133
133
  return false;
134
134
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ts-procedures",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "AI coding assistant plugin for ts-procedures — a TypeScript RPC framework for type-safe, schema-validated procedure calls with automatic validation, streaming support, and HTTP framework integrations."
5
5
  }
@@ -134,4 +134,4 @@ type AuthContext = { userId: string; requestId: string; db: Database }
134
134
 
135
135
  ## Next Steps
136
136
 
137
- After planning, use `/ts-procedures:scaffold <type> <Name>` to generate each procedure with correct patterns and tests.
137
+ After planning, use `/ts-procedures scaffold <type> <Name>` to generate each procedure with correct patterns and tests.
@@ -1,13 +1,39 @@
1
1
  ---
2
2
  name: ts-procedures
3
- description: "TypeScript RPC framework reference for ts-procedures — schema validation, error handling, HTTP builders, streaming, and code generation. Use when writing, reviewing, or debugging procedures, configuring HTTP builders, or designing schemas."
4
- user-invocable: false
3
+ description: "TypeScript RPC framework reference for ts-procedures — type-safe schema-validated procedures (TypeBox, AJV), error classes and taxonomy, HonoAppBuilder, SSE/streaming, and client code generation for TypeScript, Kotlin (Android/JVM, kotlinx-serialization), and Swift (iOS/macOS/Apple, Codable). Use when writing, reviewing, scaffolding, or debugging ts-procedures procedures, HTTP builders, schemas, error handling, or generated clients."
4
+ argument-hint: "[review <path> | scaffold <type> <Name>]"
5
+ allowed-tools: Read, Write, Edit, Grep, Glob
5
6
  ---
6
7
 
8
+ <!-- MAINTAINER NOTES (not part of the skill content):
9
+ 1. Write/Edit are granted skill-wide because Scaffold Mode generates files. Claude Code
10
+ cannot scope allowed-tools per-mode within a single SKILL.md, so the write capability is
11
+ kept dormant by the File-write guard below — writes happen only when the literal first
12
+ word of $ARGUMENTS is `scaffold`. If the modes are ever split back into separate skills,
13
+ re-scope tools per skill accordingly.
14
+ 2. The former standalone `ts-procedures-review` skill ran with `context: fork` and
15
+ `effort: high`. Those are skill-level settings that cannot be scoped to one mode, so
16
+ Review Mode now runs inline in the main context instead of a forked one. Review Mode
17
+ recovers isolation by suggesting a subagent for large reviews (see that section). -->
18
+
7
19
  # ts-procedures Framework Reference
8
20
 
9
21
  You are assisting a developer using **ts-procedures**, a TypeScript RPC framework that creates type-safe, schema-validated procedure calls with a single function definition. Always follow these rules when writing or reviewing code.
10
22
 
23
+ > **ESM-only.** All ts-procedures packages ship ESM only — the consuming project needs `"type": "module"` in `package.json` and `moduleResolution` set to `"Bundler"` or `"NodeNext"` in `tsconfig.json`. (The full setup guide lives in the package `docs/`.)
24
+
25
+ ## Modes
26
+
27
+ This skill has three modes, selected by the **first whitespace-delimited word of `$ARGUMENTS`**:
28
+
29
+ | First word of `$ARGUMENTS` | Mode | What happens |
30
+ |----------------------------|------|--------------|
31
+ | *(empty)* | **Reference** | The framework knowledge below auto-loads. Read [patterns.md](patterns.md), [anti-patterns.md](anti-patterns.md), or [api-reference.md](api-reference.md) as needed. Kotlin/Swift client codegen have dedicated reference sections lower down. |
32
+ | `review` | **Review Mode** | Audit the file/dir at the path argument against [checklist.md](checklist.md). Read-only. See the **Review Mode** section below. |
33
+ | `scaffold` | **Scaffold Mode** | Generate implementation + test files from [templates/](templates). **Writes files.** See the **Scaffold Mode** section below. |
34
+
35
+ **File-write guard.** This skill writes files in **Scaffold Mode only**. Scaffold Mode is entered **if and only if** the literal first word of `$ARGUMENTS` is `scaffold`. In every other case — empty `$ARGUMENTS` (reference), `review`, or any reference/codegen question (including Kotlin and Swift) — operate strictly read-only: use Read/Grep/Glob, never Write or Edit. Do **not** infer write permission from the surrounding task ("the user is obviously building an API, so I'll scaffold") — during an active build that reasoning is always pre-satisfied and is exactly the trap to avoid. Only the literal `scaffold` first word unlocks file writes. If you are unsure which mode you are in, you are not in Scaffold Mode.
36
+
11
37
  ## What Are You Trying to Do?
12
38
 
13
39
  Load the right reference for your task:
@@ -15,8 +41,8 @@ Load the right reference for your task:
15
41
  - **Writing new procedures or HTTP routes?** Read [patterns.md](patterns.md) — prescribed code examples for every procedure type and HTTP integration
16
42
  - **Reviewing or debugging existing code?** Read [anti-patterns.md](anti-patterns.md) — 20 common mistakes with before/after fixes and severity ratings
17
43
  - **Need exact API signatures or type definitions?** Read [api-reference.md](api-reference.md) — complete API documentation with type signatures for every export
18
- - **Generating a Kotlin client for Android/JVM consumers?** Use the separate `ts-procedures-kotlin` skill — it covers `--target kotlin` end-to-end and won't load unless the user mentions Kotlin/Android.
19
- - **Generating a Swift client for iOS/macOS/Apple-platform consumers?** Use the separate `ts-procedures-swift` skill — it covers `--target swift` end-to-end and won't load unless the user mentions Swift/iOS/Apple platforms.
44
+ - **Generating a Kotlin client for Android/JVM consumers?** See the **Kotlin Client Codegen** section below — it covers `--target kotlin` end-to-end.
45
+ - **Generating a Swift client for iOS/macOS/Apple-platform consumers?** See the **Swift Client Codegen** section below — it covers `--target swift` end-to-end.
20
46
 
21
47
  ## Core Flow
22
48
 
@@ -70,6 +96,8 @@ Uses **TypeBox** for schema definitions (`import { Type } from 'typebox'`):
70
96
 
71
97
  AJV config: `allErrors: true`, `coerceTypes: true`, `removeAdditional: true`
72
98
 
99
+ > **Composing schemas:** the bundled TypeBox does **not** export `Type.Composite`. Extend a schema with a flat property spread — `Type.Object({ ...Base.properties, name: Type.String() })` — which also keeps the generated JSON Schema a single `object` instead of an `allOf`.
100
+
73
101
  ## Error Classes
74
102
 
75
103
  | Error Class | Trigger | Key Properties |
@@ -97,7 +125,7 @@ const appErrors = defineErrorTaxonomy({
97
125
  new HonoAppBuilder({ errors: appErrors, unknownError: { toResponse: () => ({ error: '...' }) } })
98
126
  ```
99
127
 
100
- Per-route narrowing: `APIConfig<keyof typeof appErrors & string>` / `RPCConfig<keyof typeof appErrors & string>` with a `errors: [...]` array on the config. Generated `_errors.ts` emits runtime classes — clients catch with `instanceof ${Service}Errors.${Name}` when using `create${Service}Client`.
128
+ Per-route narrowing: add an `errors: [...]` array on the config. For `RPCConfig` routes narrow the factory via `RPCConfig<keyof typeof appErrors & string>`. For `CreateHttp` routes do **not** pass an explicit generic (that binds `TName` and breaks `schema.req`/`schema.res` inference) — instead attach `satisfies (keyof typeof appErrors & string)[]` to the `errors` array. Generated `_errors.ts` emits runtime classes — clients catch with `instanceof ${Service}Errors.${Name}` when using `create${Service}Client`.
101
129
 
102
130
  Full contract: `docs/http-integrations.md § Error Handling` (canonical) and `api-reference.md § Error Taxonomy API`.
103
131
 
@@ -173,8 +201,327 @@ The npm package ships user-facing documentation with narrative explanations and
173
201
  | `docs/http-integrations.md` | Hono unified builder (`HonoAppBuilder` — RPC + HTTP + streaming with stratified config), **error taxonomy (canonical)**, DocRegistry (unified constructor, `.documentError()`) |
174
202
  | `docs/client-and-codegen.md` | Client code generation, `createApiClient`/`createClient`, typed error dispatch, per-route `Errors` unions, per-call options, client-level defaults, typed RequestMeta augmentation, CLI options |
175
203
  | `docs/client-error-handling.md` | **Canonical guide** for 7.0+ client error surface: normalized error classes, `.safe()` Result API, `ClientErrorMap` augmentation, custom `ErrorClassifier`, migration from `ClientRequestError`. |
204
+ | `docs/codegen-kotlin.md` | Kotlin target consumer setup (Gradle deps, contextual serializers, sealed interfaces) |
205
+ | `docs/codegen-swift.md` | Swift target consumer setup (SPM/Xcode integration, JSONDecoder config, discriminated unions, error dispatch patterns) |
176
206
  | `CHANGELOG.md` | Release notes — see `[7.0.0]` for the safe-result API, new error classes, and `ClientRequestError` → `ClientHttpError` rename. See `[6.0.0]` for the peer error-handling model (taxonomy + `onError` + `onRequestError`). |
177
207
 
178
208
  ## Workflow
179
209
 
180
- After planning with the **ts-procedures-architect** agent, use `/ts-procedures:scaffold <type> <Name>` to generate implementations. Use `/ts-procedures:review <path>` to validate existing code.
210
+ After planning with the **ts-procedures-architect** agent, use `/ts-procedures scaffold <type> <Name>` to generate implementations. Use `/ts-procedures review <path>` to validate existing code.
211
+
212
+ ---
213
+
214
+ ## Review Mode
215
+
216
+ *Entered when the first word of `$ARGUMENTS` is `review`. Read-only — never Write or Edit in this mode. Run thoroughly and at high effort.*
217
+
218
+ > **Isolation note:** as a standalone skill this review ran in a forked context. Folded into one skill it runs inline. For a large review where you want isolation (so the audit doesn't pollute the main conversation), dispatch this review to a subagent and relay its findings.
219
+
220
+ Parse the remainder of `$ARGUMENTS` (everything after `review`) as a file or directory path. If a directory, review all `.ts` and `.tsx` files within it.
221
+
222
+ ### Instructions
223
+
224
+ 1. Read the target file(s).
225
+ 2. Identify ts-procedures imports (`ts-procedures`, `ts-procedures/hono`, `ts-procedures/http`, `ts-procedures/http-docs`, `ts-procedures/http-errors`, `ts-procedures/client`, `ts-procedures/codegen`) to determine file types.
226
+ 3. Check each file against the categorized checklist in [checklist.md](checklist.md).
227
+ 4. For detailed code examples of each violation pattern, reference [anti-patterns.md](anti-patterns.md) — it shows 20 common mistakes with before/after code fixes and severity ratings.
228
+ 5. Output findings grouped by severity.
229
+
230
+ ### Output Format
231
+
232
+ For each finding:
233
+
234
+ ```
235
+ [SEVERITY] file:line — Violation
236
+ Problem: What's wrong
237
+ Fix: Concrete before/after code
238
+ ```
239
+
240
+ Severity levels:
241
+ - **CRITICAL** — Will cause bugs, silent failures, resource leaks, or runtime errors. Must fix.
242
+ - **WARNING** — Anti-pattern that hurts maintainability or correctness. Should fix.
243
+ - **SUGGESTION** — Improvement for readability, type safety, or DX. Nice to have.
244
+
245
+ ### Summary
246
+
247
+ After individual findings, provide:
248
+ - Total findings by severity
249
+ - Overall assessment (healthy / needs attention / significant issues)
250
+ - Top 3 priorities to address
251
+ - If structural issues found, suggest `/ts-procedures scaffold <type> <Name>` to generate correct implementations
252
+
253
+ ### Reference
254
+
255
+ See [checklist.md](checklist.md) for the complete categorized checklist by file type.
256
+ See [anti-patterns.md](anti-patterns.md) for detailed code examples of each violation.
257
+
258
+ ---
259
+
260
+ ## Scaffold Mode
261
+
262
+ *Entered when the first word of `$ARGUMENTS` is `scaffold`. This is the only mode that writes files (see the File-write guard above).*
263
+
264
+ Parse `$ARGUMENTS` as `scaffold <type> <Name>`. The first word (`scaffold`) is the mode selector; `<type>` is the second word, `<Name>` is the third.
265
+
266
+ If `<type>` or `<Name>` is missing, ask the user for them before writing anything.
267
+
268
+ ### Instructions
269
+
270
+ 1. Validate `<type>` is a recognized type (see table below). Case-insensitive. **If it is not an exact match for one of the valid types, do not improvise or guess a template — list the valid types and ask the user to pick one.**
271
+ 2. Validate `<Name>` is PascalCase (e.g., `UserProfile`).
272
+ 3. Derive placeholder variants from the provided PascalCase Name:
273
+ - `{{Name}}` — PascalCase as given (e.g., `UserProfile`)
274
+ - `{{name}}` — camelCase (e.g., `userProfile`)
275
+ - `{{kebab}}` — kebab-case (e.g., `user-profile`)
276
+ 4. Read the template file from `templates/<type>.md` (relative to this skill directory).
277
+ 5. Replace all `{{Name}}`, `{{name}}`, and `{{kebab}}` placeholders with the appropriate variants.
278
+ 6. Generate the implementation file(s) following the template exactly.
279
+ 7. Also generate a colocated test file following ts-procedures test conventions.
280
+
281
+ ### Valid Types
282
+
283
+ | Type | Template | Files Generated |
284
+ |------|----------|----------------|
285
+ | `procedure` | `templates/procedure.md` | `{{Name}}.procedure.ts`, `{{Name}}.procedure.test.ts` |
286
+ | `stream-procedure` | `templates/stream-procedure.md` | `{{Name}}.stream.ts`, `{{Name}}.stream.test.ts` |
287
+ | `hono` | `templates/hono.md` | `{{Name}}.hono.ts`, `{{Name}}.hono.test.ts` |
288
+ | `client` | `templates/client.md` | `{{Name}}.client.ts`, `{{Name}}.client.test.ts` |
289
+ | `astro-catchall` | `templates/astro-catchall.md` | `src/pages/api/[...rest].ts` |
290
+
291
+ ### Rules
292
+
293
+ - Use `ctx.error()` for ad-hoc business errors; for structured errors with status codes and typed client dispatch, throw custom error classes and register them via `defineErrorTaxonomy` in the builder's `errors` config (see the HTTP builder templates).
294
+ - Never throw raw `Error` — either use `ctx.error()` or a typed class registered in the taxonomy.
295
+ - `schema.params` is validated at runtime; `schema.returnType` is documentation only.
296
+ - Pass `ctx.signal` to all downstream async calls.
297
+ - Stream handlers always have `ctx.signal` (guaranteed `AbortSignal`).
298
+ - Use TypeBox for schema definitions (`import { Type } from 'typebox'`).
299
+ - AJV config: `allErrors: true`, `coerceTypes: true`, `removeAdditional: true`.
300
+ - Test files use `describe`/`test` from vitest.
301
+
302
+ ### Workflow
303
+
304
+ Use the **ts-procedures-architect** agent to plan your API structure first, then scaffold each procedure. After scaffolding, use `/ts-procedures review <path>` to validate the implementation.
305
+
306
+ ---
307
+
308
+ ## Kotlin Client Codegen
309
+
310
+ *Reference section — read-only. The Kotlin target is **types-only**: no runtime, no adapter, no error registry. Mobile/Android consumers own the HTTP layer.*
311
+
312
+ You are assisting a developer who needs to generate Kotlin types from a `ts-procedures` server's `DocEnvelope`.
313
+
314
+ ### When this section applies
315
+
316
+ - The user mentions Kotlin, Android, kotlinx-serialization, mobile client, or `--target kotlin`.
317
+ - The user wants to share API types between a `ts-procedures` server and a Kotlin/JVM consumer.
318
+ - The user is debugging Kotlin codegen output, Gradle setup, or contextual serializer registration.
319
+
320
+ If the user is generating a **TypeScript** client, use the main reference above. For **Swift / iOS / macOS / Apple-platform** consumers, see the **Swift Client Codegen** section below.
321
+
322
+ ### Quickstart
323
+
324
+ ```bash
325
+ npx ts-procedures-codegen \
326
+ --target kotlin \
327
+ --kotlin-package com.example.api \
328
+ --url https://api.example.com/_ts-procedures.json \
329
+ --out ./src/main/kotlin/com/example/api
330
+ ```
331
+
332
+ One `.kt` file per scope. Types accessed as `Users.GetUser.Response`, `Users.GetUser.Body.Address` (nested classes via `inlineTypes: true`), `Users.GetUser.Errors.NotFound`.
333
+
334
+ ### CLI flags (Kotlin-specific)
335
+
336
+ | Flag | Default | Purpose |
337
+ |---|---|---|
338
+ | `--target kotlin` | `ts` | Switch to the Kotlin codegen path |
339
+ | `--kotlin-package <com.example.api>` | required | Sets the `package` declaration on every emitted `.kt` file |
340
+ | `--kotlin-serializer <kotlinx\|none>` | `kotlinx` | `kotlinx` emits `@Serializable`; `none` emits plain data classes for Moshi/Gson/hand-written serialization |
341
+ | `--unsupported-unions <throw\|fallback>` | `throw` | **Currently a no-op for Kotlin** — ajsc v7.2 silently emits an empty `data class` for untagged `oneOf` regardless. CLI warns when set |
342
+
343
+ `--array-item-naming`, `--depluralize`, `--uncountable-words` also apply to the Kotlin target.
344
+
345
+ ### Output shape (what consumers see)
346
+
347
+ ```kotlin
348
+ package com.example.api
349
+
350
+ import kotlinx.serialization.Serializable
351
+ import kotlinx.serialization.SerialName
352
+ import kotlinx.serialization.Contextual
353
+ import kotlinx.serialization.json.JsonClassDiscriminator
354
+
355
+ object Users {
356
+ object GetUser {
357
+ const val method = "GET"
358
+ const val pathTemplate = "/users/{id}"
359
+ fun path(p: PathParams): String = "/users/${p.id}"
360
+
361
+ @Serializable data class PathParams(val id: String)
362
+
363
+ @Serializable
364
+ data class Response(
365
+ val id: String,
366
+ @SerialName("created-at") @Contextual val createdAt: java.time.Instant,
367
+ val address: Address,
368
+ ) {
369
+ @Serializable data class Address(val street: String, val city: String)
370
+ }
371
+
372
+ object Errors {
373
+ @Serializable
374
+ data class NotFound(val name: String = "NotFound", val message: String)
375
+ }
376
+ }
377
+ }
378
+ ```
379
+
380
+ For routes without path params, `path` is a `const val`, not a function.
381
+
382
+ ### Consumer-side setup the dev MUST do
383
+
384
+ The generated code requires these on the Android/JVM side. **Don't let the user assume the codegen handles them.**
385
+
386
+ 1. **Gradle:** `kotlin("plugin.serialization")` plugin + `org.jetbrains.kotlinx:kotlinx-serialization-json` dependency. (`kotlinx-serialization-core` is a transitive dep; no need to declare it explicitly.)
387
+
388
+ 2. **Contextual serializers:** `format: date-time`/`uuid`/`uri`/`date`/`time` map to JVM stdlib types annotated with `@Contextual`. The consumer's `Json` configuration MUST register `contextual(java.time.Instant::class, ...)` etc., otherwise decoding fails. We don't ship the serializers — choice between ISO-8601 and epoch ms is application-specific.
389
+
390
+ 3. **Discriminated unions:** `@JsonClassDiscriminator` is read automatically by `kotlinx-serialization-json` — no extra config needed.
391
+
392
+ 4. **No runtime dispatch:** error types are emitted as nested data classes (`Users.GetUser.Errors.NotFound`), but there's no `instanceof`-style registry, no `dispatchTypedError`. Consumers catch HTTP failures themselves and inspect `body.name` (a regular `String` field, not a type-system discriminator) to decide which error data class to deserialize against. This is by design; don't suggest implementing it.
393
+
394
+ The full setup guide lives at `docs/codegen-kotlin.md` in the `ts-procedures` repo.
395
+
396
+ ### Documented limitations to flag during reviews
397
+
398
+ - **Untagged `oneOf` produces an empty `data class`.** Won't round-trip. Add a server-side discriminator, hand-write a `KSerializer`, or pre-process the envelope.
399
+ - **Tuples > 3 elements throw** at codegen time. Refactor to a struct schema upstream.
400
+ - **`additionalProperties: { type: T }` is silently dropped** with a KDoc note. Add a sibling `Map<String, T>` field by hand if your contract uses extra keys.
401
+ - **Schema-level `examples` are not modeled.** They're documentation-only on the server side; consumers don't see them.
402
+
403
+ ### Anti-patterns (Kotlin)
404
+
405
+ - Suggesting the Kotlin target ships an HTTP adapter or error registry.
406
+ - Recommending `--kotlin-serializer none` without noting the consumer is responsible for adapter setup.
407
+ - Treating `--unsupported-unions fallback` as functional for Kotlin — it's a no-op (the CLI itself warns when set).
408
+ - Saying KMP (Kotlin Multiplatform) is supported — JVM only for now.
409
+ - Mixing `--target kotlin` flags into a TypeScript-target invocation; some flags are silently ignored, others (like `--kotlin-package`) are required only for kotlin.
410
+
411
+ ---
412
+
413
+ ## Swift Client Codegen
414
+
415
+ *Reference section — read-only. The Swift target is **types-only**: no runtime, no adapter, no error registry. iOS / macOS / Apple-platform consumers own the HTTP layer.*
416
+
417
+ You are assisting a developer who needs to generate Swift types from a `ts-procedures` server's `DocEnvelope`.
418
+
419
+ ### When this section applies
420
+
421
+ - The user mentions Swift, iOS, macOS, watchOS, tvOS, visionOS, Apple platforms, `Codable`, `URLSession`, or `--target swift`.
422
+ - The user wants to share API types between a `ts-procedures` server and a Swift consumer.
423
+ - The user is debugging Swift codegen output, SPM/Xcode integration, `JSONDecoder` configuration, or `Codable` conformance issues.
424
+
425
+ If the user is generating a **TypeScript** client, use the main reference above. For **Kotlin/Android** consumers, see the **Kotlin Client Codegen** section above.
426
+
427
+ ### Quickstart
428
+
429
+ ```bash
430
+ npx ts-procedures-codegen \
431
+ --target swift \
432
+ --url https://api.example.com/_ts-procedures.json \
433
+ --out ./Sources/MyApp/Generated
434
+ ```
435
+
436
+ One `.swift` file per scope. Types accessed as `Users.GetUser.Response`, `Users.GetUser.PathParams`, `Users.GetUser.Response.Address` (nested structs via `inlineTypes: true`), `Users.GetUser.Errors.NotFound`.
437
+
438
+ **Note:** unlike the Kotlin target, no `--swift-package` flag exists or is required. Swift modules are defined by Xcode/SPM targets.
439
+
440
+ ### CLI flags (Swift-specific)
441
+
442
+ | Flag | Default | Purpose |
443
+ |---|---|---|
444
+ | `--target swift` | `ts` | Switch to the Swift codegen path |
445
+ | `--swift-serializer <codable\|none>` | `codable` | `codable` emits `: Codable` + `CodingKeys`; `none` emits plain structs (consumer handles serialization) |
446
+ | `--swift-access-level <public\|internal>` | `public` | Threads through to ajsc's `accessLevel`; use `internal` when generated types shouldn't appear in module ABI |
447
+ | `--unsupported-unions <throw\|fallback>` | `throw` | **Functional for Swift** (unlike Kotlin where it's a no-op) — `fallback` emits a self-contained `AnyCodable` helper for untagged `anyOf`/`oneOf` |
448
+
449
+ `--array-item-naming`, `--depluralize`, `--uncountable-words` also apply to the Swift target.
450
+
451
+ ### Output shape (what consumers see)
452
+
453
+ ```swift
454
+ import Foundation
455
+
456
+ public enum Users {
457
+ public enum GetUser {
458
+ public static let method = "GET"
459
+ public static let pathTemplate = "/users/{id}"
460
+ public static func path(_ p: PathParams) -> String { return "/users/\(p.id)" }
461
+
462
+ public struct PathParams: Codable {
463
+ public let id: String
464
+ }
465
+
466
+ public struct Response: Codable {
467
+ public let id: String
468
+ public let createdAt: Date
469
+ public let address: Address
470
+
471
+ enum CodingKeys: String, CodingKey {
472
+ case id
473
+ case createdAt = "created-at"
474
+ case address
475
+ }
476
+
477
+ public struct Address: Codable {
478
+ public let street: String
479
+ public let city: String
480
+ }
481
+ }
482
+
483
+ public enum Errors {
484
+ public struct NotFound: Codable {
485
+ public let name: String
486
+ public let message: String
487
+ }
488
+ }
489
+ }
490
+ }
491
+ ```
492
+
493
+ For routes without path params, `path` is a `static let`, not a function. Namespaces are caseless `enum`s (the standard Swift idiom — uninstantiable, zero runtime cost).
494
+
495
+ ### Consumer-side setup the dev MUST do
496
+
497
+ The generated code requires these on the Apple-platform side. **Don't let the user assume the codegen handles them.**
498
+
499
+ 1. **Drop generated files into your SPM target or Xcode source group.** Any target containing the generated dir picks them up — no special build config. SPM globs sources recursively; for Xcode, use **File → Add Files to "<TargetName>"…** and ensure target membership is checked.
500
+
501
+ 2. **Configure `JSONDecoder.dateDecodingStrategy = .iso8601`.** **Required** if the schema uses any `format: date-time` field (which become `Foundation.Date`). Without this, decoding fails with `DecodingError.typeMismatch`. Symmetric: set `JSONEncoder.dateEncodingStrategy = .iso8601` for request bodies.
502
+
503
+ 3. **HTTP transport is the consumer's choice.** `URLSession` (with `async/await`) is the default recommendation — it's built-in and works on all Apple platforms with no dependencies. Alamofire / other libraries are fine but never required.
504
+
505
+ 4. **No runtime dispatch.** Error types are emitted as nested structs (`Users.GetUser.Errors.NotFound`), but there's no registry, no `instanceof`-style lookup, no `dispatchTypedError`. Consumers catch HTTP failures themselves and dispatch on status code or `body.name` (a regular `String` field, not a type-system discriminator) to decide which error struct to decode against. To make error structs throwable, declare a one-line `extension X.Errors.NotFound: Error {}` in user code (keep it out of the generated file so re-runs don't clobber it). This is by design; don't suggest implementing a registry.
506
+
507
+ The full setup guide lives at `docs/codegen-swift.md` in the `ts-procedures` repo.
508
+
509
+ ### Documented limitations to flag during reviews
510
+
511
+ - **`format: date` and `format: time` map to `String`.** Foundation has no native date-only or time-only type. Parse with `DateFormatter` if a typed value is needed.
512
+ - **`type: integer` maps to `Int64`** (not `Int`). 32-bit Apple platforms exist; `Int64` guarantees range parity.
513
+ - **`type: number` maps to `Double`.** For monetary values, convert to `Decimal` at the parse boundary.
514
+ - **Heterogeneous tuples throw under `Codable`.** Swift tuples aren't `Codable`. Schemas with positional-tuple `items: [...]` arrays throw at codegen time. Refactor to a struct schema upstream.
515
+ - **`additionalProperties: { type: T }` is silently dropped** with a doc-comment. Add a sibling `[String: T]` field by hand if your contract uses extra keys.
516
+ - **`not` and `patternProperties` throw at codegen time.** Simplify the schema upstream.
517
+ - **Untagged `oneOf` throws by default.** Add a discriminator, or pass `--unsupported-unions fallback` to emit `AnyCodable`-typed values (loses static typing).
518
+
519
+ ### Anti-patterns (Swift)
520
+
521
+ - **Suggesting the Swift target ships a networking layer or HTTP adapter.** It does not — consumers own `URLSession`/etc. entirely.
522
+ - **Recommending Alamofire as required.** `URLSession` + `async/await` is fine and ships with the OS. Alamofire is a personal-preference choice, not a dependency of the generated code.
523
+ - **Conflating `--swift-serializer none` with "no setup needed".** `none` removes `Codable` conformance and `CodingKeys` — the consumer then needs their own serialization plan (hand-rolled, SwiftyJSON, etc.). It's strictly *more* setup, not less.
524
+ - **Treating `--unsupported-unions fallback` as a no-op for Swift.** Unlike Kotlin (where it's silently dropped), the Swift target actually emits an `AnyCodable` helper that round-trips correctly. Use it when needed.
525
+ - **Suggesting backwards compatibility with Swift 4 / pre-async-await.** Assume Swift 5.5+ (the async/await era). Sample dispatch code in docs uses `async throws`.
526
+ - **Suggesting the codegen emits `: Error` conformance on error structs.** It doesn't (`Codable` only) — consumers add a one-line extension. Don't ask for this to be added to the codegen; it would force users into a particular error model.
527
+ - **Mixing `--target swift` flags into a TypeScript-target invocation.** The flags are silently ignored; no harm, but the user is probably running the wrong target.
@@ -222,7 +222,9 @@ function CreateHttp<
222
222
 
223
223
  ### Return Shape
224
224
 
225
- - **No `schema.res.headers`:** handler returns body bare (`T`).
225
+ The `{ body, headers }` envelope is **opt-in**, gated entirely on `schema.res.headers`. The framework never duck-types the return value for a `body` key, so a domain model may safely carry its own `body` / `headers` fields.
226
+
227
+ - **No `schema.res.headers`:** handler returns the body bare (`T`) — serialized verbatim.
226
228
  - **`schema.res.headers` declared:** handler returns `{ body: B, headers: H }`.
227
229
 
228
230
  ### Throws
@@ -1222,7 +1224,7 @@ const adapter = createFetchAdapter({ fetch: customFetch })
1222
1224
 
1223
1225
  ## generateClient(options)
1224
1226
 
1225
- > For **Kotlin** client codegen (Android/JVM, types-only output), see the dedicated `ts-procedures-kotlin` skill. For **Swift** client codegen (iOS/macOS/Apple platforms, types-only output), see the dedicated `ts-procedures-swift` skill. The reference below covers TypeScript codegen only.
1227
+ > For **Kotlin** client codegen (Android/JVM, types-only output), see the *Kotlin Client Codegen* section in `SKILL.md`. For **Swift** client codegen (iOS/macOS/Apple platforms, types-only output), see the *Swift Client Codegen* section in `SKILL.md`. The reference below covers TypeScript codegen only.
1226
1228
 
1227
1229
  Build-time CLI and programmatic API for generating typed client files from a `DocEnvelope`.
1228
1230
 
@@ -65,6 +65,22 @@ const { GetUser } = Create(
65
65
 
66
66
  ---
67
67
 
68
+ ## Composing / Extending Schemas
69
+
70
+ The TypeBox build bundled with ts-procedures does **not** export `Type.Composite`. Compose schemas with a flat object spread of the source `.properties` instead. This also keeps the generated JSON Schema a single `object` rather than an `allOf` (which codegen and AJV handle more cleanly).
71
+
72
+ ```typescript
73
+ // DON'T: Type.Composite is not available in the bundled TypeBox
74
+ // const User = Type.Composite([Base, Type.Object({ name: Type.String() })])
75
+
76
+ // DO: flat spread of the base schema's properties
77
+ const Base = Type.Object({ id: Type.String() })
78
+ const User = Type.Object({ ...Base.properties, name: Type.String() })
79
+ // User → a single { type: 'object', properties: { id, name } } JSON Schema
80
+ ```
81
+
82
+ ---
83
+
68
84
  ## Error Handling in Handlers
69
85
 
70
86
  Use `ctx.error()` for business logic errors. Never throw raw Error instances.
@@ -160,22 +176,28 @@ Key rules:
160
176
  - The core wraps any non-`ProcedureError` thrown from a handler into a `ProcedureError` with `.cause` set. The resolver unwraps this automatically so your taxonomy sees the real class.
161
177
  - Two peer modes: declarative (`errors` + `unknownError`) or imperative (`onError`). Both are first-class. When neither is configured, the builder falls through to a hard default (`{ error: message }`, 500).
162
178
  - `onCatch`'s `raw` is the framework request object (Hono `Context`) typed as `unknown` — cast at the use site.
179
+ - **Typed client classes are automatic for `{ class, statusCode }`-only entries** (their default `{ name, message }` body is self-describing). You only need to add an explicit `schema` when you (a) supply a custom `toResponse` — the framework won't guess the shape — or (b) document a raw `ErrorDoc` (via `documentError(...)` / a `config.errors` array). Without a schema those fall back to the untyped `ClientHttpError` on the client.
163
180
 
164
181
  ### Per-route error declaration (typed)
165
182
 
166
- Declare which errors each procedure may emit via the `errors` field on `CreateHttp` / `Create` config. These populate the DocEnvelope per-route so generated clients can type `catch` blocks precisely. For compile-time typo protection, pass the taxonomy key type as the `TErrorKey` generic on `CreateHttp`.
183
+ Declare which errors each procedure may emit via the `errors` field on `CreateHttp` / `Create` config. These populate the DocEnvelope per-route so generated clients can type `catch` blocks precisely. For compile-time typo protection, attach a `satisfies` clause to the `errors` array rather than supplying an explicit generic.
184
+
185
+ > Do **not** write `CreateHttp<keyof typeof appErrors & string>(...)`. `CreateHttp` is generic over `<TName, TReq, TRes, TErrorKey>` (see api-reference.md and `TCreateHttpConfig`), so a single explicit type argument binds `TName` and breaks inference of the `schema.req` / `schema.res` channels. Let all four type parameters infer, and use `satisfies` to keep the `errors` keys typo-safe.
167
186
 
168
187
  ```typescript
169
188
  import { appErrors } from './errors/taxonomy'
170
189
 
171
190
  const API = Procedures<Ctx>()
172
191
 
173
- // CreateHttp accepts TErrorKey as a generic for compile-time protection
174
- API.CreateHttp<keyof typeof appErrors & string>('GetUser', {
192
+ API.CreateHttp('GetUser', {
175
193
  path: '/users/:id',
176
194
  method: 'get',
177
- errors: ['UseCaseError', 'AuthError'], // typed against taxonomy keys; typos are TS errors
178
- schema: { req: { /* ... */ } },
195
+ // typed against taxonomy keys; typos are TS errors — without binding TName/TReq/TRes
196
+ errors: ['UseCaseError', 'AuthError'] satisfies (keyof typeof appErrors & string)[],
197
+ schema: {
198
+ req: { /* ... */ },
199
+ res: { /* ... */ },
200
+ },
179
201
  }, async (ctx, params) => { /* ... */ })
180
202
  ```
181
203
 
@@ -669,7 +691,9 @@ API.CreateHttp('UpdateUserField', {
669
691
 
670
692
  ## Response Headers (v8 `CreateHttp`)
671
693
 
672
- When `schema.res.headers` is declared, the handler must return `{ body, headers }` instead of the body bare. The client surfaces initial response headers on `TypedStream.headers` for streaming routes.
694
+ The `{ body, headers }` envelope is strictly **opt-in**. By default the handler's return value is serialized verbatim as the response body — the framework does **not** duck-type the result looking for a `body` key. The envelope is only expected when `schema.res.headers` is declared; in that case (and only then) the handler must return `{ body, headers }` instead of the body bare. The client surfaces initial response headers on `TypedStream.headers` for streaming routes.
695
+
696
+ > Because the envelope is opt-in, a domain model may safely have its own `body` or `headers` field — without `schema.res.headers` declared, `{ id, body: '...' }` is serialized as-is, never reinterpreted as an envelope.
673
697
 
674
698
  ```typescript
675
699
  API.CreateHttp('DownloadReport', {
@@ -51,7 +51,7 @@ import type { DocEnvelope, HeaderDoc, ErrorDoc } from 'ts-procedures/http-docs'
51
51
 
52
52
  4. **Stream handlers always have ctx.signal (guaranteed AbortSignal).** Standard handlers get it when HTTP implementations provide it. Check `signal.reason === 'stream-completed'` to distinguish normal completion from client disconnect.
53
53
 
54
- 5. **Use TypeBox for schemas** (`import { Type } from 'typebox'`). Plain JSON Schema objects are not recognized. AJV config: `allErrors: true`, `coerceTypes: true`, `removeAdditional: true`.
54
+ 5. **Use TypeBox for schemas** (`import { Type } from 'typebox'`). Plain JSON Schema objects are not recognized. AJV config: `allErrors: true`, `coerceTypes: true`, `removeAdditional: true`. The bundled TypeBox does **not** export `Type.Composite` — compose schemas with a flat property spread (`Type.Object({ ...Base.properties, name: Type.String() })`), which also keeps the generated JSON Schema a single `object` instead of an `allOf`.
55
55
 
56
56
  6. **One factory per access level.** Separate `Procedures()` factories for public, authenticated, admin contexts.
57
57
 
@@ -237,16 +237,18 @@ Handlers throw the error classes directly — the builder auto-serializes. `onEr
237
237
 
238
238
  ### Per-route errors (typed)
239
239
 
240
- `APIConfig` and `RPCConfig` are generic over `TErrorKey extends string = string`. Narrow to your taxonomy for compile-time typo protection and route-level error doc entries:
240
+ Declare a route's errors via the `errors` field on the `CreateHttp` config. For compile-time typo protection, attach a `satisfies` clause to the array do NOT pass an explicit generic. `CreateHttp` is generic over `<TName, TReq, TRes, TErrorKey>`, so a single type argument binds `TName` and breaks `schema.req` / `schema.res` inference:
241
241
 
242
242
  ```typescript
243
- import { APIConfig } from 'ts-procedures/http'
244
243
  import { DocRegistry } from 'ts-procedures/http-docs'
245
244
 
246
- type MyAPIConfig = APIConfig<keyof typeof appErrors & string>
247
- const API = Procedures<Ctx, MyAPIConfig>()
245
+ const API = Procedures<Ctx>()
248
246
 
249
- API.Create('GetUser', { path: '/users/:id', method: 'get', errors: ['UseCaseError'], /* ... */ }, ...)
247
+ API.CreateHttp('GetUser', {
248
+ path: '/users/:id', method: 'get',
249
+ errors: ['UseCaseError'] satisfies (keyof typeof appErrors & string)[],
250
+ schema: { req: { pathParams: Type.Object({ id: Type.String() }) } },
251
+ }, async (ctx, { pathParams }) => fetchUser(pathParams.id))
250
252
 
251
253
  // Seed envelope errors from the taxonomy + framework defaults in one call
252
254
  const envelope = new DocRegistry({ errors: appErrors, basePath: '/api' }).from(apiApp).toJSON()
@@ -272,6 +274,8 @@ try {
272
274
  }
273
275
  ```
274
276
 
277
+ Typed classes are generated automatically for taxonomy entries declared with just `{ class, statusCode }` (their default `{ name, message }` body is self-describing). Add an explicit `schema` only when you give an entry a custom `toResponse` (shape can't be inferred) or document a raw `ErrorDoc` (via `documentError(...)` / a `config.errors` array) — without a schema those dispatch as the untyped `ClientHttpError`.
278
+
275
279
  Per-route error unions: routes with `errors: [...]` get an `Errors` type in their namespace (e.g. `Users.GetUser.Errors = ApiErrors.UseCaseError | ApiErrors.AuthError`).
276
280
 
277
281
  - Generated client error handling: catch the framework classes (`ClientHttpError`, `ClientNetworkError`, `ClientTimeoutError`, `ClientAbortError`), not raw `DOMException`/`TypeError` — the framework normalizes platform errors at the `executeCall` boundary, so raw platform errors no longer reach `catch` blocks after 7.0.0 (original is on `error.cause`). Use the `.safe()` sibling on RPC/API callables for an exhaustive `Result<T, E>` switch (`ok`, `typed`, `http`, `network`, `timeout`, `aborted`, `parse`, `usage`, `unknown`). Streams keep the throwing form — no `.safe()`.
@@ -51,7 +51,7 @@ import type { DocEnvelope, HeaderDoc, ErrorDoc } from 'ts-procedures/http-docs'
51
51
 
52
52
  4. **Stream handlers always have ctx.signal (guaranteed AbortSignal).** Standard handlers get it when HTTP implementations provide it. Check `signal.reason === 'stream-completed'` to distinguish normal completion from client disconnect.
53
53
 
54
- 5. **Use TypeBox for schemas** (`import { Type } from 'typebox'`). Plain JSON Schema objects are not recognized. AJV config: `allErrors: true`, `coerceTypes: true`, `removeAdditional: true`.
54
+ 5. **Use TypeBox for schemas** (`import { Type } from 'typebox'`). Plain JSON Schema objects are not recognized. AJV config: `allErrors: true`, `coerceTypes: true`, `removeAdditional: true`. The bundled TypeBox does **not** export `Type.Composite` — compose schemas with a flat property spread (`Type.Object({ ...Base.properties, name: Type.String() })`), which also keeps the generated JSON Schema a single `object` instead of an `allOf`.
55
55
 
56
56
  6. **One factory per access level.** Separate `Procedures()` factories for public, authenticated, admin contexts.
57
57
 
@@ -237,16 +237,18 @@ Handlers throw the error classes directly — the builder auto-serializes. `onEr
237
237
 
238
238
  ### Per-route errors (typed)
239
239
 
240
- `APIConfig` and `RPCConfig` are generic over `TErrorKey extends string = string`. Narrow to your taxonomy for compile-time typo protection and route-level error doc entries:
240
+ Declare a route's errors via the `errors` field on the `CreateHttp` config. For compile-time typo protection, attach a `satisfies` clause to the array do NOT pass an explicit generic. `CreateHttp` is generic over `<TName, TReq, TRes, TErrorKey>`, so a single type argument binds `TName` and breaks `schema.req` / `schema.res` inference:
241
241
 
242
242
  ```typescript
243
- import { APIConfig } from 'ts-procedures/http'
244
243
  import { DocRegistry } from 'ts-procedures/http-docs'
245
244
 
246
- type MyAPIConfig = APIConfig<keyof typeof appErrors & string>
247
- const API = Procedures<Ctx, MyAPIConfig>()
245
+ const API = Procedures<Ctx>()
248
246
 
249
- API.Create('GetUser', { path: '/users/:id', method: 'get', errors: ['UseCaseError'], /* ... */ }, ...)
247
+ API.CreateHttp('GetUser', {
248
+ path: '/users/:id', method: 'get',
249
+ errors: ['UseCaseError'] satisfies (keyof typeof appErrors & string)[],
250
+ schema: { req: { pathParams: Type.Object({ id: Type.String() }) } },
251
+ }, async (ctx, { pathParams }) => fetchUser(pathParams.id))
250
252
 
251
253
  // Seed envelope errors from the taxonomy + framework defaults in one call
252
254
  const envelope = new DocRegistry({ errors: appErrors, basePath: '/api' }).from(apiApp).toJSON()
@@ -272,6 +274,8 @@ try {
272
274
  }
273
275
  ```
274
276
 
277
+ Typed classes are generated automatically for taxonomy entries declared with just `{ class, statusCode }` (their default `{ name, message }` body is self-describing). Add an explicit `schema` only when you give an entry a custom `toResponse` (shape can't be inferred) or document a raw `ErrorDoc` (via `documentError(...)` / a `config.errors` array) — without a schema those dispatch as the untyped `ClientHttpError`.
278
+
275
279
  Per-route error unions: routes with `errors: [...]` get an `Errors` type in their namespace (e.g. `Users.GetUser.Errors = ApiErrors.UseCaseError | ApiErrors.AuthError`).
276
280
 
277
281
  - Generated client error handling: catch the framework classes (`ClientHttpError`, `ClientNetworkError`, `ClientTimeoutError`, `ClientAbortError`), not raw `DOMException`/`TypeError` — the framework normalizes platform errors at the `executeCall` boundary, so raw platform errors no longer reach `catch` blocks after 7.0.0 (original is on `error.cause`). Use the `.safe()` sibling on RPC/API callables for an exhaustive `Result<T, E>` switch (`ok`, `typed`, `http`, `network`, `timeout`, `aborted`, `parse`, `usage`, `unknown`). Streams keep the throwing form — no `.safe()`.
@@ -6,7 +6,7 @@ const __filename = fileURLToPath(import.meta.url);
6
6
  const __dirname = dirname(__filename);
7
7
  const SOURCE_DIR = join(__dirname, '..', 'claude-code');
8
8
 
9
- const SKILL_NAMES = ['ts-procedures', 'ts-procedures-review', 'ts-procedures-scaffold', 'ts-procedures-kotlin', 'ts-procedures-swift'];
9
+ const SKILL_NAMES = ['ts-procedures'];
10
10
  const AGENT_FILES = ['ts-procedures-architect.md'];
11
11
 
12
12
  function listFilesRecursive(dir) {
@@ -26,9 +26,9 @@ function listFilesRecursive(dir) {
26
26
  * Install Claude Code integration files into a project's .claude/ directory.
27
27
  *
28
28
  * Creates:
29
- * .claude/skills/ts-procedures/ — Framework reference skill
30
- * .claude/skills/ts-procedures-scaffold/ — Scaffold skill (templates included)
31
- * .claude/skills/ts-procedures-review/ — Review skill
29
+ * .claude/skills/ts-procedures/ — Unified skill: framework reference plus
30
+ * `review`/`scaffold` $ARGUMENTS modes (checklist +
31
+ * templates bundled) and Kotlin/Swift codegen reference
32
32
  * .claude/agents/ts-procedures-architect.md — Architecture planning agent
33
33
  *
34
34
  * @param {string} projectRoot — Absolute path to the consuming project's root