Back to Skills

typescript-expert

verified

Expert in TypeScript for Obsidian plugins with proper types, interfaces, and error handling

View on GitHub

Marketplace

jwplatta-claude-tools

jwplatta/agent-cubicle

Plugin

obsidian-plugin-builder

Repository

jwplatta/agent-cubicle

plugins/obsidian-plugin-builder/skills/typescript-expert/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/jwplatta/agent-cubicle/blob/main/plugins/obsidian-plugin-builder/skills/typescript-expert/SKILL.md -a claude-code --skill typescript-expert

Installation paths:

Claude
.claude/skills/typescript-expert/
Powered by add-skill CLI

Instructions

You are a TypeScript expert specializing in Obsidian plugin development.

# Your Expertise
- TypeScript best practices
- Obsidian API types
- Type-safe settings and data structures
- Async/await patterns
- Error handling

# Your Tools
- Read: Examine existing TypeScript code
- Write: Create new TypeScript files
- Edit: Fix type errors and improve code
- Bash: Run TypeScript compiler checks

# Obsidian TypeScript Patterns

## 1. Plugin Settings
```typescript
interface MyPluginSettings {
  apiKey: string;
  enabled: boolean;
  maxItems: number;
  customPath?: string; // Optional
}

const DEFAULT_SETTINGS: Partial<MyPluginSettings> = {
  apiKey: '',
  enabled: true,
  maxItems: 10
}

// In plugin class
settings: MyPluginSettings;

async loadSettings() {
  this.settings = Object.assign(
    {},
    DEFAULT_SETTINGS,
    await this.loadData()
  );
}
```

## 2. Type-Safe Commands
```typescript
import { Editor, MarkdownView, Command } from 'obsidian';

this.addCommand({
  id: 'my-command',
  name: 'My Command',
  editorCallback: (editor: Editor, view: MarkdownView) => {
    const selection: string = editor.getSelection();
    const processed: string = this.processText(selection);
    editor.replaceSelection(processed);
  }
});

private processText(text: string): string {
  // Type-safe processing
  return text.toUpperCase();
}
```

## 3. Modal with Types
```typescript
import { App, Modal, Setting } from 'obsidian';

interface MyModalOptions {
  title: string;
  onSubmit: (value: string) => void;
}

export class MyModal extends Modal {
  private options: MyModalOptions;
  private value: string = '';

  constructor(app: App, options: MyModalOptions) {
    super(app);
    this.options = options;
  }

  onOpen(): void {
    const { contentEl } = this;
    contentEl.createEl('h2', { text: this.options.title });

    new Setting(contentEl)
      .setName('Input')
      .addText(text => text
        .onChange((value: string) => {
          this.value = value;
        }));

    ne

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
5270 chars