<< All versions
Skill v1.0.0
currentLLM-judged scan90/100tiagoeduardobr/opencode_termux/javascript-typescript
──Details
PublishedOctober 22, 2026 at 08:48 AM
Content Hashsha256:c400e68676948208...
Git SHAa4abb22b7a0b
──Files
Files (1 file, 3.1 KB)
SKILL.md3.1 KBactive
SKILL.md · 144 lines · 3.1 KB
version: "1.0.0" name: javascript-typescript description: JavaScript and TypeScript development with ES6+, Node.js, React, and modern web frameworks. Use for frontend, backend, or full-stack JavaScript/TypeScript projects. source: wshobson/agents license: MIT
JavaScript/TypeScript Development
TypeScript Configuration
json
{"compilerOptions": {"target": "ES2022","module": "ESNext","moduleResolution": "bundler","strict": true,"noUncheckedIndexedAccess": true,"noImplicitOverride": true,"skipLibCheck": true,"declaration": true,"outDir": "./dist"},"include": ["src/**/*"],"exclude": ["node_modules", "dist"]}
Type Patterns
Utility Types
typescript
// Pick specific propertiestype UserPreview = Pick<User, 'id' | 'name'>;// Omit propertiestype CreateUser = Omit<User, 'id' | 'createdAt'>;// Make all properties optionaltype PartialUser = Partial<User>;// Make all properties requiredtype RequiredUser = Required<User>;// Extract union typestype Status = 'pending' | 'active' | 'inactive';type ActiveStatus = Extract<Status, 'active' | 'pending'>;
Discriminated Unions
typescript
type Result<T> =| { success: true; data: T }| { success: false; error: Error };function handleResult<T>(result: Result<T>) {if (result.success) {console.log(result.data); // T} else {console.error(result.error); // Error}}
Generic Constraints
typescript
interface HasId {id: string | number;}function findById<T extends HasId>(items: T[], id: T['id']): T | undefined {return items.find(item => item.id === id);}
Modern JavaScript
Destructuring & Spread
javascript
const { name, ...rest } = user;const merged = { ...defaults, ...options };const [first, ...others] = items;
Optional Chaining & Nullish Coalescing
javascript
const city = user?.address?.city ?? 'Unknown';const count = data?.items?.length ?? 0;
Array Methods
javascript
const adults = users.filter(u => u.age >= 18);const names = users.map(u => u.name);const total = items.reduce((sum, item) => sum + item.price, 0);const hasAdmin = users.some(u => u.role === 'admin');const allActive = users.every(u => u.active);
React Patterns
typescript
// Props with childreninterface CardProps {title: string;children: React.ReactNode;}// Event handlersinterface ButtonProps {onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;}// Custom hooksfunction useLocalStorage<T>(key: string, initial: T) {const [value, setValue] = useState<T>(() => {const stored = localStorage.getItem(key);return stored ? JSON.parse(stored) : initial;});useEffect(() => {localStorage.setItem(key, JSON.stringify(value));}, [key, value]);return [value, setValue] as const;}
Node.js Patterns
typescript
// ES Modulesimport { readFile } from 'node:fs/promises';import { join } from 'node:path';// Error handlingprocess.on('unhandledRejection', (reason) => {console.error('Unhandled Rejection:', reason);process.exit(1);});