Back to list
hyz0906

autofix-type-conversion

by hyz0906

0🍴 0📅 Jan 19, 2026

SKILL.md


name: autofix-type-conversion description: Fixes type mismatch errors by adding appropriate casts or conversions.

Type Conversion Skill

Fixes compilation errors related to incompatible type assignments or conversions.

Detection Patterns

  • cannot convert 'X' to 'Y'
  • invalid conversion from 'X' to 'Y'
  • no viable conversion
  • incompatible types

Strategy

  1. Identify Types: Extract source and target types from error.
  2. Determine Conversion: Choose appropriate cast or method.
  3. Apply Fix: Add cast or conversion call.

Instructions

Step 1: Parse the Error

Extract:

  • Source type (what you have)
  • Target type (what is expected)
  • Location of the conversion

Step 2: Common Conversions

FromToFix
std::stringconst char*.c_str()
const char*std::stringConstructor or assignment
intenumstatic_cast<EnumType>(val)
void*T*static_cast<T*>(ptr)
Base*Derived*dynamic_cast<Derived*>(base)
int64_tintstatic_cast<int>(val) (with care)

Step 3: Apply Fix

Example: string to const char*

// Before (error)
void log(const char* msg);
std::string message = "Hello";
log(message);  // ERROR

// After
log(message.c_str());

Example: enum cast

// Before
int value = 5;
MyEnum e = value;  // ERROR

// After
MyEnum e = static_cast<MyEnum>(value);

Step 4: Verify

Ensure semantic correctness, not just compilation success.

Score

Total Score

50/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon