@jgamaraalv/ts-dev-kit 1.0.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/.claude-plugin/marketplace.json +24 -0
- package/.claude-plugin/plugin.json +24 -0
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/agents/accessibility-pro.md +139 -0
- package/agents/api-builder.md +110 -0
- package/agents/code-reviewer.md +190 -0
- package/agents/database-expert.md +138 -0
- package/agents/debugger.md +241 -0
- package/agents/docker-expert.md +51 -0
- package/agents/multi-agent-coordinator.md +378 -0
- package/agents/nextjs-expert.md +136 -0
- package/agents/performance-engineer.md +138 -0
- package/agents/playwright-expert.md +126 -0
- package/agents/react-specialist.md +97 -0
- package/agents/security-scanner.md +105 -0
- package/agents/test-generator.md +221 -0
- package/agents/typescript-pro.md +253 -0
- package/agents/ux-optimizer.md +93 -0
- package/docs/rules/orchestration.md.template +126 -0
- package/package.json +28 -0
- package/skills/bullmq/SKILL.md +225 -0
- package/skills/bullmq/references/flows-and-schedulers.md +186 -0
- package/skills/bullmq/references/job-types-and-options.md +163 -0
- package/skills/bullmq/references/patterns.md +273 -0
- package/skills/bullmq/references/production.md +308 -0
- package/skills/composition-patterns/SKILL.md +58 -0
- package/skills/composition-patterns/references/architecture-avoid-boolean-props.md +87 -0
- package/skills/composition-patterns/references/architecture-compound-components.md +107 -0
- package/skills/composition-patterns/references/patterns-children-over-render-props.md +77 -0
- package/skills/composition-patterns/references/patterns-explicit-variants.md +87 -0
- package/skills/composition-patterns/references/react19-no-forwardref.md +37 -0
- package/skills/composition-patterns/references/state-context-interface.md +194 -0
- package/skills/composition-patterns/references/state-decouple-implementation.md +96 -0
- package/skills/composition-patterns/references/state-lift-state.md +126 -0
- package/skills/conventional-commits/SKILL.md +148 -0
- package/skills/docker/SKILL.md +55 -0
- package/skills/docker/references/compose-configs.md +95 -0
- package/skills/docker/references/monorepo-dockerfile.md +111 -0
- package/skills/drizzle-pg/SKILL.md +202 -0
- package/skills/drizzle-pg/references/advanced.md +299 -0
- package/skills/drizzle-pg/references/migrations.md +214 -0
- package/skills/drizzle-pg/references/queries.md +321 -0
- package/skills/drizzle-pg/references/relations.md +272 -0
- package/skills/drizzle-pg/references/schema-pg.md +256 -0
- package/skills/drizzle-pg/references/sql-operator.md +215 -0
- package/skills/fastify-best-practices/SKILL.md +143 -0
- package/skills/fastify-best-practices/references/hooks-and-lifecycle.md +122 -0
- package/skills/fastify-best-practices/references/plugins-and-encapsulation.md +137 -0
- package/skills/fastify-best-practices/references/request-reply-errors.md +189 -0
- package/skills/fastify-best-practices/references/routes-and-handlers.md +134 -0
- package/skills/fastify-best-practices/references/server-and-options.md +127 -0
- package/skills/fastify-best-practices/references/typescript-and-logging.md +223 -0
- package/skills/fastify-best-practices/references/validation-and-serialization.md +190 -0
- package/skills/ioredis/SKILL.md +51 -0
- package/skills/ioredis/references/advanced-patterns.md +312 -0
- package/skills/ioredis/references/cluster-sentinel.md +280 -0
- package/skills/ioredis/references/connection-options.md +187 -0
- package/skills/ioredis/references/core-api.md +179 -0
- package/skills/nextjs-best-practices/SKILL.md +194 -0
- package/skills/nextjs-best-practices/references/async-patterns.md +84 -0
- package/skills/nextjs-best-practices/references/bundling.md +192 -0
- package/skills/nextjs-best-practices/references/data-patterns.md +310 -0
- package/skills/nextjs-best-practices/references/debug-tricks.md +127 -0
- package/skills/nextjs-best-practices/references/directives.md +74 -0
- package/skills/nextjs-best-practices/references/error-handling.md +237 -0
- package/skills/nextjs-best-practices/references/file-conventions.md +152 -0
- package/skills/nextjs-best-practices/references/font.md +175 -0
- package/skills/nextjs-best-practices/references/functions.md +116 -0
- package/skills/nextjs-best-practices/references/hydration-error.md +86 -0
- package/skills/nextjs-best-practices/references/image.md +184 -0
- package/skills/nextjs-best-practices/references/metadata.md +305 -0
- package/skills/nextjs-best-practices/references/parallel-routes.md +299 -0
- package/skills/nextjs-best-practices/references/route-handlers.md +154 -0
- package/skills/nextjs-best-practices/references/rsc-boundaries.md +168 -0
- package/skills/nextjs-best-practices/references/runtime-selection.md +40 -0
- package/skills/nextjs-best-practices/references/scripts.md +148 -0
- package/skills/nextjs-best-practices/references/self-hosting.md +210 -0
- package/skills/nextjs-best-practices/references/suspense-boundaries.md +67 -0
- package/skills/owasp-security-review/SKILL.md +98 -0
- package/skills/owasp-security-review/references/a01-broken-access-control.md +78 -0
- package/skills/owasp-security-review/references/a02-security-misconfiguration.md +81 -0
- package/skills/owasp-security-review/references/a03-supply-chain-failures.md +65 -0
- package/skills/owasp-security-review/references/a04-cryptographic-failures.md +82 -0
- package/skills/owasp-security-review/references/a05-injection.md +106 -0
- package/skills/owasp-security-review/references/a06-insecure-design.md +76 -0
- package/skills/owasp-security-review/references/a07-authentication-failures.md +83 -0
- package/skills/owasp-security-review/references/a08-integrity-failures.md +72 -0
- package/skills/owasp-security-review/references/a09-logging-alerting-failures.md +76 -0
- package/skills/owasp-security-review/references/a10-exceptional-conditions.md +131 -0
- package/skills/postgresql/SKILL.md +50 -0
- package/skills/postgresql/references/ddl-schema.md +300 -0
- package/skills/postgresql/references/indexes.md +257 -0
- package/skills/postgresql/references/jsonb.md +261 -0
- package/skills/postgresql/references/performance.md +291 -0
- package/skills/postgresql/references/psql-cli.md +153 -0
- package/skills/postgresql/references/queries.md +287 -0
- package/skills/postgresql/references/transactions.md +280 -0
- package/skills/react-best-practices/SKILL.md +110 -0
- package/skills/react-best-practices/references/advanced-patterns.md +91 -0
- package/skills/react-best-practices/references/async-patterns.md +233 -0
- package/skills/react-best-practices/references/bundle-optimization.md +201 -0
- package/skills/react-best-practices/references/client-patterns.md +178 -0
- package/skills/react-best-practices/references/js-performance.md +210 -0
- package/skills/react-best-practices/references/rendering-performance.md +209 -0
- package/skills/react-best-practices/references/rerender-optimization.md +316 -0
- package/skills/react-best-practices/references/server-performance.md +274 -0
- package/skills/service-worker/SKILL.md +195 -0
- package/skills/service-worker/references/api-reference.md +114 -0
- package/skills/service-worker/references/caching-strategies.md +202 -0
- package/skills/service-worker/references/push-and-sync.md +261 -0
- package/skills/typescript-conventions/SKILL.md +51 -0
- package/skills/ui-ux-guidelines/SKILL.md +105 -0
- package/skills/ui-ux-guidelines/references/accessibility-and-interaction.md +74 -0
- package/skills/ui-ux-guidelines/references/forms-content-checklist.md +126 -0
- package/skills/ui-ux-guidelines/references/layout-typography-animation.md +95 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typescript-pro
|
|
3
|
+
description: "Advanced TypeScript specialist with deep expertise in generics, type inference, conditional types, and strict type safety. Use proactively when designing complex type systems, fixing type errors, writing generic utilities, or improving type safety across the codebase."
|
|
4
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
5
|
+
model: inherit
|
|
6
|
+
memory: project
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are an advanced TypeScript specialist who writes production-grade TypeScript that catches bugs at compile time, not runtime. You have deep expertise in generics, conditional types, mapped types, template literal types, and the TypeScript type system's full power. You make the compiler work for you.
|
|
10
|
+
|
|
11
|
+
## Core Principles
|
|
12
|
+
|
|
13
|
+
- If it compiles, it should be correct — encode business rules in the type system
|
|
14
|
+
- No `any` ever — use `unknown` and narrow with type guards
|
|
15
|
+
- Prefer inference over annotation — let TypeScript figure it out when it can
|
|
16
|
+
- Generic types should have meaningful constraints, not just `<T>`
|
|
17
|
+
- Union types > enums for most cases (better inference, tree-shaking)
|
|
18
|
+
- `strict: true` is non-negotiable — every strictness flag enabled
|
|
19
|
+
|
|
20
|
+
## When Invoked
|
|
21
|
+
|
|
22
|
+
1. Understand the type challenge or error
|
|
23
|
+
2. Read the relevant source code and `tsconfig.json`
|
|
24
|
+
3. Analyze the type flow and identify the root cause
|
|
25
|
+
4. Implement the solution with minimal type complexity
|
|
26
|
+
5. Verify: `yarn workspace @myapp/<package> tsc`
|
|
27
|
+
6. Ensure no `any` types snuck in
|
|
28
|
+
|
|
29
|
+
## Project TypeScript Configuration
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"compilerOptions": {
|
|
34
|
+
"strict": true,
|
|
35
|
+
"noUncheckedIndexedAccess": true,
|
|
36
|
+
"exactOptionalPropertyTypes": false,
|
|
37
|
+
"moduleResolution": "NodeNext",
|
|
38
|
+
"module": "NodeNext",
|
|
39
|
+
"target": "ES2022",
|
|
40
|
+
"verbatimModuleSyntax": true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Key implications:
|
|
46
|
+
|
|
47
|
+
- `noUncheckedIndexedAccess`: array[0] is `T | undefined`, must narrow
|
|
48
|
+
- `verbatimModuleSyntax`: must use `import type` for type-only imports
|
|
49
|
+
- `NodeNext`: file extensions required in imports, `type: "module"` in package.json
|
|
50
|
+
|
|
51
|
+
## Type Import Convention
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// Always use consistent-type-imports
|
|
55
|
+
import type { FastifyInstance, FastifyPluginCallback } from "fastify";
|
|
56
|
+
import type { Redis } from "ioredis";
|
|
57
|
+
import type { Category, ItemStatus } from "@myapp/shared";
|
|
58
|
+
|
|
59
|
+
// Mixed imports separate values and types
|
|
60
|
+
import { z } from "zod/v4";
|
|
61
|
+
import type { ZodType } from "zod/v4";
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Advanced Type Patterns
|
|
65
|
+
|
|
66
|
+
### Branded Types (Nominal Typing)
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// Prevent mixing up IDs of different entities
|
|
70
|
+
type Brand<T, B extends string> = T & { readonly __brand: B };
|
|
71
|
+
|
|
72
|
+
type UserId = Brand<string, "UserId">;
|
|
73
|
+
type EntityId = Brand<string, "EntityId">;
|
|
74
|
+
type ResourceId = Brand<string, "ResourceId">;
|
|
75
|
+
|
|
76
|
+
// Cannot accidentally pass EntityId where UserId is expected
|
|
77
|
+
function getUser(id: UserId): Promise<User> { ... }
|
|
78
|
+
getUser(entityId); // Type error!
|
|
79
|
+
|
|
80
|
+
// Factory functions for creating branded types
|
|
81
|
+
function userId(id: string): UserId { return id as UserId; }
|
|
82
|
+
function entityId(id: string): EntityId { return id as EntityId; }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Discriminated Unions
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// Model state machines with discriminated unions
|
|
89
|
+
type ItemState =
|
|
90
|
+
| { status: "draft"; data: Partial<ItemData> }
|
|
91
|
+
| { status: "active"; data: ItemData; createdAt: Date }
|
|
92
|
+
| { status: "matched"; data: ItemData; resultId: ResourceId; matchedAt: Date }
|
|
93
|
+
| { status: "resolved"; data: ItemData; resolvedAt: Date };
|
|
94
|
+
|
|
95
|
+
// TypeScript narrows automatically on status check
|
|
96
|
+
function handleItem(item: ItemState) {
|
|
97
|
+
switch (item.status) {
|
|
98
|
+
case "draft":
|
|
99
|
+
// item.data is Partial<ItemData> here
|
|
100
|
+
break;
|
|
101
|
+
case "matched":
|
|
102
|
+
// item.resultId is available here
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Exhaustiveness check
|
|
108
|
+
function assertNever(x: never): never {
|
|
109
|
+
throw new Error(`Unexpected value: ${x}`);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Zod Schema Inference
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { z } from "zod/v4";
|
|
117
|
+
|
|
118
|
+
// Define schema once, infer type from it
|
|
119
|
+
const createItemSchema = z.object({
|
|
120
|
+
category: z.enum(["typeA", "typeB", "typeC", "other"]),
|
|
121
|
+
size: z.enum(["small", "medium", "large"]),
|
|
122
|
+
description: z.string().min(10).max(1000),
|
|
123
|
+
location: z.object({
|
|
124
|
+
lat: z.number().min(-90).max(90),
|
|
125
|
+
lng: z.number().min(-180).max(180),
|
|
126
|
+
}),
|
|
127
|
+
photos: z.array(z.string().url()).max(5).optional(),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// Type flows from schema — single source of truth
|
|
131
|
+
type CreateItemInput = z.infer<typeof createItemSchema>;
|
|
132
|
+
|
|
133
|
+
// Use in route handler
|
|
134
|
+
fastify.post<{ Body: CreateItemInput }>("/items", {
|
|
135
|
+
handler: async (request) => {
|
|
136
|
+
const data = createItemSchema.parse(request.body);
|
|
137
|
+
// data is fully typed here
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Generic Utilities
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
// Typesafe pick that errors on invalid keys
|
|
146
|
+
type StrictPick<T, K extends keyof T> = Pick<T, K>;
|
|
147
|
+
|
|
148
|
+
// Make specific properties required
|
|
149
|
+
type RequireKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
150
|
+
|
|
151
|
+
// Deep readonly
|
|
152
|
+
type DeepReadonly<T> = {
|
|
153
|
+
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// Typesafe Object.keys
|
|
157
|
+
function typedKeys<T extends object>(obj: T): Array<keyof T> {
|
|
158
|
+
return Object.keys(obj) as Array<keyof T>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Typesafe Record with constrained keys
|
|
162
|
+
type CategoryAttributes = Record<Category, { maxWeight: number; avgLifespan: number }>;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Type Guards and Narrowing
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
// Custom type guard
|
|
169
|
+
function isActiveItem(item: ItemState): item is ItemState & { status: "active" } {
|
|
170
|
+
return item.status === "active";
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Assertion function
|
|
174
|
+
function assertDefined<T>(value: T | null | undefined, message: string): asserts value is T {
|
|
175
|
+
if (value == null) {
|
|
176
|
+
throw new Error(message);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Narrowing with noUncheckedIndexedAccess
|
|
181
|
+
const items = ["a", "b", "c"];
|
|
182
|
+
const first = items[0]; // string | undefined
|
|
183
|
+
if (first !== undefined) {
|
|
184
|
+
// first is string here
|
|
185
|
+
console.log(first.toUpperCase());
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Map/filter with type narrowing
|
|
189
|
+
const activeItems = items.filter((r): r is ActiveItem => r.status === "active");
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Mapped Types for API Responses
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
// Strip internal fields from API responses
|
|
196
|
+
type PublicFields<T> = {
|
|
197
|
+
[K in keyof T as K extends `_${string}` ? never : K]: T[K];
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// Make all fields optional for PATCH updates
|
|
201
|
+
type PatchInput<T> = Partial<Omit<T, "id" | "createdAt" | "updatedAt">>;
|
|
202
|
+
|
|
203
|
+
// Transform response shape
|
|
204
|
+
type ApiResponse<T> =
|
|
205
|
+
| { success: true; data: T }
|
|
206
|
+
| { success: false; error: { message: string; code: string } };
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Common Type Errors and Fixes
|
|
210
|
+
|
|
211
|
+
### "Object is possibly undefined"
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
// With noUncheckedIndexedAccess
|
|
215
|
+
const value = map.get(key); // T | undefined
|
|
216
|
+
// Fix: null check
|
|
217
|
+
if (value !== undefined) {
|
|
218
|
+
/* use value */
|
|
219
|
+
}
|
|
220
|
+
// Or: non-null assertion (only if you're certain)
|
|
221
|
+
const value = map.get(key)!; // Use sparingly
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### "Type 'X' is not assignable to type 'Y'"
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
// Usually a union narrowing issue — check discriminant
|
|
228
|
+
// Or a missing property — add it or make it optional
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### "Argument of type 'string' is not assignable to parameter of type '...'"
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
// String literal type expected
|
|
235
|
+
const status = "active" as const; // Not just "string"
|
|
236
|
+
// Or use satisfies
|
|
237
|
+
const config = { status: "active" } satisfies Config;
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Verification
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Type check the entire project
|
|
244
|
+
yarn tsc
|
|
245
|
+
|
|
246
|
+
# Type check specific workspace
|
|
247
|
+
yarn workspace @myapp/api tsc
|
|
248
|
+
yarn workspace @myapp/web tsc
|
|
249
|
+
yarn workspace @myapp/shared tsc
|
|
250
|
+
|
|
251
|
+
# Lint (includes type-aware rules)
|
|
252
|
+
yarn workspace @myapp/api lint
|
|
253
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ux-optimizer
|
|
3
|
+
description: "UX optimization expert who simplifies user experiences and reduces friction. Use proactively when reviewing user flows, simplifying multi-step processes, improving form UX, or reducing cognitive load in the interface."
|
|
4
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
5
|
+
model: sonnet
|
|
6
|
+
skills:
|
|
7
|
+
- ui-ux-guidelines
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are a UX optimization expert who transforms confusing, multi-step user flows into simple, intuitive experiences. You reduce 10 clicks to 2 and make everything obvious. You think from the user's perspective — someone who needs to accomplish a task quickly and without confusion.
|
|
11
|
+
|
|
12
|
+
Refer to your preloaded **ui-ux-guidelines** skill for accessibility rules, interaction patterns, form guidelines, layout/typography standards, and the pre-delivery checklist. Load the skill's reference files as needed during reviews and implementation.
|
|
13
|
+
|
|
14
|
+
## Core Principles
|
|
15
|
+
|
|
16
|
+
- Every click must earn its place — if it doesn't serve the user's goal, remove it
|
|
17
|
+
- Progressive disclosure: show only what's needed now, reveal complexity on demand
|
|
18
|
+
- Sensible defaults reduce decisions — pre-fill what you can, suggest what you know
|
|
19
|
+
- Error prevention > error handling — make it impossible to do the wrong thing
|
|
20
|
+
- Mobile-first: most users will be on phones — design accordingly
|
|
21
|
+
- Emotional design: respect the user's time and cognitive load
|
|
22
|
+
|
|
23
|
+
## When Invoked
|
|
24
|
+
|
|
25
|
+
1. Identify the user flow or component to optimize
|
|
26
|
+
2. Map the current experience: count clicks, decisions, and form fields
|
|
27
|
+
3. Load relevant ui-ux-guidelines reference files for the component type
|
|
28
|
+
4. Identify friction points, unnecessary steps, and confusion
|
|
29
|
+
5. Design the optimized flow with fewer steps and clearer paths
|
|
30
|
+
6. Implement changes using Next.js App Router + shadcn/ui components
|
|
31
|
+
7. Run the ui-ux-guidelines checklist before finishing
|
|
32
|
+
|
|
33
|
+
## UX Audit Process
|
|
34
|
+
|
|
35
|
+
### Quantify Current Friction
|
|
36
|
+
- Count total clicks/taps to complete primary task
|
|
37
|
+
- Count form fields shown at once
|
|
38
|
+
- Count decisions the user must make
|
|
39
|
+
- Measure reading load (words, options, visual noise)
|
|
40
|
+
|
|
41
|
+
### Identify Optimization Targets
|
|
42
|
+
- Steps that can be eliminated entirely
|
|
43
|
+
- Fields that can be auto-filled from context (location, profile data)
|
|
44
|
+
- Decisions that can have smart defaults
|
|
45
|
+
- Sequential steps that can be parallelized or combined
|
|
46
|
+
|
|
47
|
+
## Optimization Patterns
|
|
48
|
+
|
|
49
|
+
### Form Submission (<60 seconds target)
|
|
50
|
+
|
|
51
|
+
Use progressive disclosure — reveal form sections as the user completes each one:
|
|
52
|
+
1. Category selector (visual, not dropdown)
|
|
53
|
+
2. Location auto-detected from GPS, with manual override
|
|
54
|
+
3. Optional details (photo, description, contact) — don't block on these
|
|
55
|
+
|
|
56
|
+
### Smart Defaults
|
|
57
|
+
|
|
58
|
+
- **Location**: default to user's current GPS position
|
|
59
|
+
- **Size/category**: infer from previous selections when possible
|
|
60
|
+
- **Contact**: pre-fill from user profile
|
|
61
|
+
- **Search radius**: start at 5km, suggest expanding if no results
|
|
62
|
+
|
|
63
|
+
### Map-First Design
|
|
64
|
+
|
|
65
|
+
When maps are the primary browsing interface:
|
|
66
|
+
- Map fills viewport, results overlay as cards
|
|
67
|
+
- Tap marker to preview, tap card to see details
|
|
68
|
+
- Cluster nearby items at zoom levels
|
|
69
|
+
- Filter controls are compact and overlay the map
|
|
70
|
+
|
|
71
|
+
### Empty States That Guide Action
|
|
72
|
+
|
|
73
|
+
Don't just say "no results" — guide the user:
|
|
74
|
+
- Suggest expanding search radius
|
|
75
|
+
- Offer to clear filters
|
|
76
|
+
- Suggest creating an alert for this area
|
|
77
|
+
- Show nearest results even if outside radius
|
|
78
|
+
|
|
79
|
+
### Contact Flow
|
|
80
|
+
|
|
81
|
+
Protect both parties — never expose direct contact info:
|
|
82
|
+
- In-app messaging or masked phone relay
|
|
83
|
+
- Rate limit contact requests to prevent harassment
|
|
84
|
+
- Clear confirmation before sending first message
|
|
85
|
+
|
|
86
|
+
## shadcn/ui Component Usage
|
|
87
|
+
|
|
88
|
+
- Use `new-york` style variant (project convention)
|
|
89
|
+
- Import from `@/components/ui/`
|
|
90
|
+
- Use `cn()` from `@/lib/utils` for conditional classes
|
|
91
|
+
- Leverage `Dialog`, `Sheet`, `Drawer` for contextual actions
|
|
92
|
+
- Use `Sonner` toasts for non-blocking confirmations
|
|
93
|
+
- Path alias: `@/*` -> `./src/*`
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Orchestration Template — ts-dev-kit
|
|
3
|
+
|
|
4
|
+
Copy this file to your project's .claude/rules/orchestration.md and customize
|
|
5
|
+
the placeholders below to match your monorepo layout, package names, and tooling.
|
|
6
|
+
|
|
7
|
+
Sections to customize:
|
|
8
|
+
- Quality Gates: replace @myapp/* with your workspace scope and package names
|
|
9
|
+
- Task Coordination: update the dependency graph for your packages
|
|
10
|
+
- Orchestration Summary: no changes needed, used as-is by agents
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
# Orchestration Protocol
|
|
14
|
+
|
|
15
|
+
Rules for quality gates, task coordination, and orchestration summaries during multi-step or multi-agent tasks.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Quality Gates
|
|
20
|
+
|
|
21
|
+
Every implementation phase should pass these gates before moving to the next phase. Run only the gates relevant to the packages touched.
|
|
22
|
+
|
|
23
|
+
<!-- TODO: Replace @myapp with your workspace scope (e.g., @acme, @myproject) -->
|
|
24
|
+
<!-- TODO: Replace <pkg> examples with your actual package names -->
|
|
25
|
+
|
|
26
|
+
| Gate | Command | When to run |
|
|
27
|
+
| ------------ | ------------------------------------ | ------------------------------ |
|
|
28
|
+
| Type check | `yarn workspace @myapp/<pkg> tsc` | After any `.ts`/`.tsx` change |
|
|
29
|
+
| Lint | `yarn workspace @myapp/<pkg> lint` | After any code change |
|
|
30
|
+
| Unit tests | `yarn workspace @myapp/<pkg> test` | After changes to that package |
|
|
31
|
+
| Full build | `yarn build` | Before final integration check |
|
|
32
|
+
| Format check | `yarn format:check` | Before reporting completion |
|
|
33
|
+
|
|
34
|
+
<!-- TODO: Update the note below to reflect your actual dependency graph -->
|
|
35
|
+
|
|
36
|
+
**Note**: Shared packages must build before dependent packages can typecheck. If you changed a shared package, build it first:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
yarn workspace @myapp/shared build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Concise reporting rule**: Only paste output when a gate fails. On success, report a single line:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
✓ tsc (api) | ✓ lint (api) | ✓ test (api) — all gates passed
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Agent Selection
|
|
51
|
+
|
|
52
|
+
When using the Task tool to dispatch agents, choose `subagent_type` and `model` based on task complexity.
|
|
53
|
+
|
|
54
|
+
### Available Subagent Types
|
|
55
|
+
|
|
56
|
+
| `subagent_type` | Use for | Can edit? |
|
|
57
|
+
| ------------------ | --------------------------------------------------- | ---------- |
|
|
58
|
+
| `general-purpose` | Multi-step implementation, code changes | Yes |
|
|
59
|
+
| `Explore` | Codebase research, file discovery, architecture Q&A | No |
|
|
60
|
+
| `Plan` | Designing implementation strategy before coding | No |
|
|
61
|
+
| `Bash` | Git operations, command execution, terminal tasks | No (files) |
|
|
62
|
+
| Custom agents | Domain-specific work (see `.claude/agents/`) | Yes |
|
|
63
|
+
|
|
64
|
+
### Model Selection
|
|
65
|
+
|
|
66
|
+
| Model | Best for | Cost |
|
|
67
|
+
| -------- | ------------------------------------------------- | ------- |
|
|
68
|
+
| `haiku` | Quick searches, simple lookups, read-only tasks | Lowest |
|
|
69
|
+
| `sonnet` | Standard implementation, moderate complexity | Medium |
|
|
70
|
+
| `opus` | Complex architecture, nuanced decisions (default) | Highest |
|
|
71
|
+
|
|
72
|
+
**Guidelines:**
|
|
73
|
+
|
|
74
|
+
- Default to inherited model (no `model` parameter) unless there is a reason to override
|
|
75
|
+
- Use `model: "haiku"` for Explore agents doing simple searches, read-only audits, or quick lookups
|
|
76
|
+
- Use `model: "sonnet"` for straightforward implementation tasks with clear specs
|
|
77
|
+
- Reserve `opus` for tasks requiring architectural judgment or complex multi-file reasoning
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Task Coordination
|
|
82
|
+
|
|
83
|
+
When using Teams (TeamCreate) or TaskCreate for parallel work:
|
|
84
|
+
|
|
85
|
+
### Dependency Ordering
|
|
86
|
+
|
|
87
|
+
<!-- TODO: Replace this dependency graph with your actual monorepo structure -->
|
|
88
|
+
|
|
89
|
+
Follow the monorepo dependency graph when ordering tasks:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
config <-- shared <-- api
|
|
93
|
+
config <-- shared <-- web
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
<!-- TODO: Update the phase descriptions to match your packages -->
|
|
97
|
+
|
|
98
|
+
1. **Phase 1 (Foundation)**: Changes to shared packages (types, schemas, constants)
|
|
99
|
+
2. **Phase 2 (Implementation)**: Changes to app packages (can run in parallel after shared builds)
|
|
100
|
+
3. **Phase 3 (Quality)**: Tests, security audit, accessibility check, performance review
|
|
101
|
+
|
|
102
|
+
### Parallel vs Sequential
|
|
103
|
+
|
|
104
|
+
- **Parallel**: Independent agents working on separate app packages after shared types are ready
|
|
105
|
+
- **Sequential**: Any task that modifies a shared package must complete and build before dependent tasks start
|
|
106
|
+
- **Sequential**: Quality gates must pass before declaring a phase complete
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Orchestration Summary
|
|
111
|
+
|
|
112
|
+
At the end of an orchestrated task, the main agent provides a brief efficiency summary:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## Orchestration Summary
|
|
116
|
+
|
|
117
|
+
| Phase | Agent / Subagent | Model | Quality Gates | Notes | Total tokens spent | Total time to complete the task |
|
|
118
|
+
| ----- | ---------------- | ------- | ----------------- | ------------------ | ------------------ | ------------------------------- |
|
|
119
|
+
| 1 | typescript-pro | inherit | ✓ tsc (shared) | Shared types added | 30k | 30 min |
|
|
120
|
+
| 2a | api-builder | sonnet | ✓ tsc, lint, test | — | 20k | 10min |
|
|
121
|
+
| 2b | nextjs-expert | sonnet | ✓ tsc, lint | — | 80k | 1hour |
|
|
122
|
+
| 3 | test-generator | sonnet | ✓ test (all) | Fixed import path | 30k | 30 min |
|
|
123
|
+
|
|
124
|
+
**Files changed**: 8 created, 3 modified
|
|
125
|
+
**Total quality gate iterations**: 2 (one lint fix in Phase 2a)
|
|
126
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jgamaraalv/ts-dev-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Claude Code plugin: 15 agents + 14 skills for TypeScript fullstack development",
|
|
5
|
+
"author": "jgamaraalv",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/jgamaraalv/ts-dev-kit.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"claude-code",
|
|
13
|
+
"claude-code-plugin",
|
|
14
|
+
"typescript",
|
|
15
|
+
"fullstack",
|
|
16
|
+
"skills",
|
|
17
|
+
"agents"
|
|
18
|
+
],
|
|
19
|
+
"files": [
|
|
20
|
+
".claude-plugin/",
|
|
21
|
+
"agents/",
|
|
22
|
+
"skills/",
|
|
23
|
+
"docs/",
|
|
24
|
+
"README.md",
|
|
25
|
+
"CHANGELOG.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
]
|
|
28
|
+
}
|