Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for TypeScript 5.8+ advanced type system, strict mode, generics, utility types, branded types, inferred type predicates, isolated declarations, and type-safe architectural patterns / Panduan ahli untuk sistem tipe TypeScript 5.8+, mode strict, generics, utility types, branded types, inferred type predicates, isolated declarations, dan pola arsitektur type-safe.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
<a name="english"></a>
Connects and orchestrates with relevant domain skills like brainstorming, zero-to-prod-orchestrator, and session-memory-manager to ensure cohesive execution.
Expert-level TypeScript development covering the advanced type system, strict mode enforcement, generic programming, utility types, branded types, and type-safe patterns for production applications. Targets TypeScript 5.8+ features including inferred type predicates, isolated declarations, NoInfer, using declarations, variadic tuple improvements, and const type parameters.
any pollution.tsconfig.json for strict projects.using Declarations (Explicit Resource Management, TS 5.2)// Automatically calls [Symbol.dispose] on scope exit
function processFile(path: string) {
using handle = openFile(path); // disposed when function exits
handle.write('data');
}
// Async version with [Symbol.asyncDispose]
async function processDatabase() {
await using conn = await getConnection();
await conn.query('SELECT 1');
} // conn.close() called automatically
NoInfer<T> Utility Type (TS 5.4)// Prevents unintended type widening in generic inference
function createState<T>(initial: T, fallback: NoInfer<T>): T {
return initial ?? fallback;
}
// TS now errors if fallback type doesn't match initial
createState('hello', 42); // Error: Argument of type 'number' is not assignable to type 'string'
const Type Parameters (TS 5.0)// Infer literal types from generic arguments
function identity<const T>(value: T): T { return value; }
const a = identity(['a', 'b', 'c']); // type: readonly ["a", "b", "c"]
const b = identity({ x: 10 }); // type: { readonly x: 10 }
// TypeScript now infers type predicates from return statements automatically
const nums = [1, null, 2, undefined, 3].filter((x) => x !== null);
// nums is now inferred as number[] — no manual type assertion needed!
// Before TS 5.5 you needed:
const nums = [1, null, 2].filter((x): x is number => x !== null);
// Works with any refinement pattern:
function isString(x: unknown) {
return typeof x === 'string'; // TS 5.5 infers: (x: unknown) => x is string
}
// New tsconfig option: "isolatedDeclarations": true
// Forces explicit return types on all exported functions — enables
// parallel .d.ts generation (massively speeds up monorepo builds)
export function add(a: number, b: number): number { // explicit return type required
return a + b;
}
// Native iterator methods now fully typed
const result = [1, 2, 3, 4, 5]
.values() // IteratorObject
.filter(x => x % 2 === 0) // 2, 4
.map(x => x * 10) // 20, 40
.toArray(); // [20, 40]
// tsconfig.json — recommended strict config for Next.js / monorepo projects
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "Preserve",
"moduleResolution": "Bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"isolatedModules": true,
"isolatedDeclarations": true,
"verbatimModuleSyntax": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
}
Note: Use
"moduleResolution": "Bundler"with"module": "Preserve"for Vite, Next.js, and other bundler-based projects. Use"NodeNext"for Node.js/Bun/Deno runtimes.
// Prevent mixing semantically different primitives
type Brand<T, B extends string> = T & { readonly __brand: B };
type UserId = Brand<string, 'UserId'>;
type PostId = Brand<string, 'PostId'>;
type Email = Brand<string, 'Email'>;
// Constructor functions with validation
function createUserId(id: string): UserId {
if (!id.startsWith('user_')) throw new Error('Invalid user ID format');
return id as UserId;
}
function getUser(id: UserId): Promise<User> { /* ... */ }
const postId = 'post_abc' as PostId;
getUser(postId); // Compile error: PostId is not assignable to UserId
type ApiState<T> =
| { status: 'idle' }
| { status: 'loading' }
| { status: 'success'; data: T }
| { status: 'error'; error: Error };
function render<T>(state: ApiState<T>) {
switch (state.status) {
case 'idle': return 'Idle';
case 'loading': return 'Loading...';
case 'success': return `Data: ${JSON.stringify(state.data)}`;
case 'error': return `Error: ${state.error.message}`;
// TypeScript enforces exhaustive matching
}
}
type EventName = 'click' | 'focus' | 'blur';
type HandlerName = `on${Capitalize<EventName>}`;
// Result: 'onClick' | 'onFocus' | 'onBlur'
type DeepReadonly<T> = {
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
};
type Paths<T, Prefix extends string = ''> = {
[K in keyof T & string]: T[K] extends object
? Paths<T[K], `${Prefix}${K}.`>
: `${Prefix}${K}`;
}[keyof T & string];
// Paths<{ user: { name: string; age: number } }> = "user.name" | "user.age"
infertype UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
type ArrayElement<T> = T extends (infer U)[] ? U : never;
type ReturnType<T> = T extends (...args: any[]) => infer R ? R : never;
// Extract function parameter types
type Parameters<T extends (...args: any) => any> =
T extends (...args: infer P) => any ? P : never;
import { z } from 'zod';
const UserSchema = z.object({
id: z.string().cuid(),
email: z.string().email(),
role: z.enum(['USER', 'ADMIN']),
createdAt: z.coerce.date(),
});
type User = z.infer<typeof UserSchema>; // Derive type from schema
// Type-safe parsing with error handling
function parseUser(data: unknown): User {
return UserSchema.parse(data); // throws ZodError on failure
}
const safeResult = UserSchema.safeParse(data);
if (safeResult.success) {
console.log(safeResult.data.email); // fully typed
}
// env.ts — validate env at startup
import { z } from 'zod';
const envSchema = z.object({
DATABASE_URL: z.string().url(),
NEXTAUTH_SECRET: z.string().min(32),
NODE_ENV: z.enum(['development', 'test', 'production']),
PORT: z.coerce.number().default(3000),
});
export const env = envSchema.parse(process.env);
// env.PORT is now type `number`, not `string | undefined`
interface Repository<T, TId> {
findById(id: TId): Promise<T | null>;
findMany(filter?: Partial<T>): Promise<T[]>;
create(data: Omit<T, 'id' | 'createdAt' | 'updatedAt'>): Promise<T>;
update(id: TId, data: Partial<Omit<T, 'id'>>): Promise<T>;
delete(id: TId): Promise<void>;
}
class UserRepository implements Repository<User, UserId> {
async findById(id: UserId) { /* ... */ }
// TypeScript enforces all interface methods are implemented
}
| Anti-Pattern | Problem | Solution |
|---|---|---|
as any | Disables type checking | Use unknown + narrowing or Zod |
as Type (unsafe cast) | Bypasses structural checking | Use type guards or satisfies |
// @ts-ignore | Silences real errors | Fix the root type issue |
! non-null assertion | Runtime errors if null | Use optional chaining + nullish coalescing |
Object / {} type | Accepts anything non-null | Use specific types or Record<string, unknown> |
Implicit any in callbacks | Breaks type inference | Always type function parameters |
satisfies Operator (TS 4.9+)// Validates against a type without widening the inferred type
const config = {
port: 3000,
host: 'localhost',
debug: true,
} satisfies Record<string, string | number | boolean>;
// config.port is still inferred as `3000` (literal), not `number`
config.port.toFixed(2); // Works! Literal type preserved.
<a name="bahasa-indonesia"></a>
Terhubung dan mengorkestrasi skill domain yang relevan seperti brainstorming, zero-to-prod-orchestrator, dan session-memory-manager untuk memastikan eksekusi yang kohesif.
Panduan TypeScript level ahli mencakup sistem tipe tingkat lanjut, penerapan strict mode, pemrograman generik, utility types, branded types, dan pola type-safe untuk aplikasi produksi. Menargetkan fitur TypeScript 5.8+ termasuk inferred type predicates, isolated declarations, NoInfer, deklarasi using, peningkatan variadic tuple, dan parameter tipe const.
any.tsconfig.json untuk proyek strict dengan isolatedDeclarations."strict": true ditambah noUncheckedIndexedAccess, exactOptionalPropertyTypes, dan isolatedDeclarations..d.ts generation.as any: Gunakan unknown dengan narrowing atau Zod untuk data yang tidak diketahui tipenya.satisfies operator: Validasi objek terhadap tipe tanpa melebarkan tipe yang diinferensi.moduleResolution: Bundler: Gunakan untuk proyek Next.js/Vite; NodeNext untuk Node.js/Bun backend.まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for long-term episodic memory integration (Mem0 v2, Letta/MemGPT, Zep v2), memory tier architecture, pgvector HNSW storage, and unified context management for autonomous AI agents / Panduan ahli untuk integrasi memori episodik jangka panjang (Mem0 v2, Letta/MemGPT, Zep v2), arsitektur tier memori, penyimpanan pgvector HNSW, dan manajemen konteks terpadu untuk agen AI otonom.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for designing Machine-to-Machine (M2M) micro-economies, autonomous agent wallets, and swarm budget allocation / Panduan ahli merancang ekonomi mikro antar-agen (M2M), dompet agen otonom, dan alokasi anggaran swarm.
日本語の概要は準備中です。原文の説明を表示しています。