Implement TypeScript patterns, convert JavaScript to TypeScript, add type annotations, create generics, implement decorators, and enforce strict type safety in Angular projects.
Converts JavaScript to TypeScript, adds type annotations, creates generics and decorators, and enforces strict type safety in Angular projects. Use when you need to implement TypeScript patterns or migrate codebases to TypeScript.
/plugin marketplace add pluginagentmarketplace/custom-plugin-angular/plugin install angular-development-assistant@pluginagentmarketplace-angularThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/README.mdassets/config.yamlassets/tsconfig-strict.jsonreferences/CHEATSHEET.mdreferences/GUIDE.mdreferences/README.mdscripts/README.mdscripts/helper.pyscripts/type-check.sh// Primitive types
let name: string = "Angular";
let version: number = 18;
let active: boolean = true;
// Union types
let id: string | number;
// Type aliases
type User = {
name: string;
age: number;
};
interface Component {
render(): string;
}
// Generic interface
interface Repository<T> {
getAll(): T[];
getById(id: number): T | undefined;
}
class UserRepository implements Repository<User> {
getAll(): User[] { /* ... */ }
getById(id: number): User | undefined { /* ... */ }
}
// Class decorator
function Component(config: any) {
return function(target: any) {
target.prototype.selector = config.selector;
};
}
// Method decorator
function Log(target: any, propertyKey: string, descriptor: PropertyDescriptor) {
const originalMethod = descriptor.value;
descriptor.value = function(...args: any[]) {
console.log(`Calling ${propertyKey} with:`, args);
return originalMethod.apply(this, args);
};
return descriptor;
}
// Parameter decorator
function Required(target: any, propertyKey: string, parameterIndex: number) {
// Validation logic
}
Utility Types:
Partial<T> - Make all properties optionalRequired<T> - Make all properties requiredReadonly<T> - Make all properties readonlyRecord<K, T> - Object with specific key typesPick<T, K> - Select specific propertiesOmit<T, K> - Exclude specific propertiesConditional Types:
type IsString<T> = T extends string ? true : false;
type A = IsString<"hello">; // true
type B = IsString<number>; // false
Mapped Types:
type Getters<T> = {
[K in keyof T as `get${Capitalize<string & K>}`]: () => T[K];
};
// Extend constraint
function processUser<T extends User>(user: T) {
console.log(user.name); // OK, T has 'name'
}
// Keyof constraint
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// Type predicate
function isUser(value: unknown): value is User {
return typeof value === 'object' && value !== null && 'name' in value;
}
// Discriminated unions
type Shape =
| { kind: 'circle'; radius: number }
| { kind: 'square'; side: number };
function getArea(shape: Shape) {
switch (shape.kind) {
case 'circle': return Math.PI * shape.radius ** 2;
case 'square': return shape.side ** 2;
}
}
// Export
export interface User { name: string; }
export const API_URL = 'https://api.example.com';
// Import
import { User, API_URL } from './types';
import * as Types from './types'; // Namespace import
// Promises
async function fetchUser(): Promise<User> {
const response = await fetch('/api/users/1');
return response.json();
}
// Error handling
async function safeRequest() {
try {
const result = await fetchUser();
} catch (error) {
console.error('Request failed:', error);
}
}
any: Use unknown and type guards insteadstrict in tsconfig.jsontype Result<T, E> =
| { ok: true; value: T }
| { ok: false; error: E };
function createUser(data: any): Result<User, string> {
try {
// validation and creation
return { ok: true, value: user };
} catch (e) {
return { ok: false, error: e.message };
}
}
class QueryBuilder<T> {
private query: any = {};
where(field: keyof T, value: any): this {
this.query[field] = value;
return this;
}
build() {
return this.query;
}
}
@Injectable()
export class UserService {
constructor(private http: HttpClient) {}
getUser(id: number): Observable<User> {
return this.http.get<User>(`/api/users/${id}`);
}
}
interface ComponentProps {
title: string;
items: Item[];
onSelect: (item: Item) => void;
}
@Component({
selector: 'app-list',
template: `...`
})
export class ListComponent implements ComponentProps {
@Input() title!: string;
@Input() items: Item[] = [];
@Output() itemSelected = new EventEmitter<Item>();
onSelect(item: Item) {
this.itemSelected.emit(item);
}
}
const assertions for literal typesomit to reduce property accessThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.