スキル一覧に戻る
cpa03

typescript-refactor

by cpa03

🏗️ AI-powered blueprint generator for codebases with autonomous multi-agent CI/CD workflow

0🍴 0📅 2026年1月15日
GitHubで見るManusで実行

SKILL.md


name: typescript-refactor description: Safely refactor TypeScript code while maintaining type safety and test coverage. Includes verification steps.

TypeScript Refactor Skill

Safely refactor TypeScript code with full verification.

Pre-Refactor Checklist

  1. Run current tests to establish baseline:

    npm run test
    
  2. Run type check:

    npm run typecheck
    
  3. Note current state as baseline

Refactoring Patterns

Extract Function

// Before
function process(data: Data) {
  // complex validation logic
  if (!data.field1) throw new Error("field1 required");
  if (!data.field2) throw new Error("field2 required");
  // ... more processing
}

// After
function validateData(data: Data): void {
  if (!data.field1) throw new Error("field1 required");
  if (!data.field2) throw new Error("field2 required");
}

function process(data: Data) {
  validateData(data);
  // ... more processing
}

Extract Component (React)

// Before: Large component with repeated patterns
// After: Smaller, focused components with clear props

Rename Symbol

# Find all usages first
grep -r "oldName" --include="*.ts" --include="*.tsx" src/

Post-Refactor Verification

  1. Run type check:

    npm run typecheck
    
  2. Run tests:

    npm run test
    
  3. Run linter:

    npm run lint
    
  4. Build project:

    npm run build
    

Rules

  • Never change behavior during refactor
  • One refactor type at a time
  • Commit after each successful refactor
  • If tests fail, rollback immediately

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です