/ 目錄 / 演練場 / skill-arkts-syntax-assistant
● 社群 SummerKaze ⚡ 即開即用

skill-arkts-syntax-assistant

作者 SummerKaze · SummerKaze/skill-arkts-syntax-assistant

Claude Code skill for ArkTS — OpenHarmony's stricter TypeScript. Covers syntax, TS→ArkTS migration, perf patterns, and compilation errors.

ArkTS is the default language for OpenHarmony apps: TypeScript with stricter static typing and a ban on dynamic object mutation. skill-arkts-syntax-assistant teaches Claude the constraints: declarations/types/functions/classes/modules, TypeScript→ArkTS migration gotchas, performance best practices (memory, loops, arrays, exceptions), and compilation error diagnosis. Auto-activates on ArkTS-related questions.

為什麼要用

核心特性

即時演示

實際使用效果

skill-arkts-syntax-assistant-skill.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "skill-arkts-syntax-assistant-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/SummerKaze/skill-arkts-syntax-assistant",
        "~/.claude/skills/skill-arkts-syntax-assistant"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "skill-arkts-syntax-assistant-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/SummerKaze/skill-arkts-syntax-assistant",
        "~/.claude/skills/skill-arkts-syntax-assistant"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "skill-arkts-syntax-assistant-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/SummerKaze/skill-arkts-syntax-assistant",
        "~/.claude/skills/skill-arkts-syntax-assistant"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "skill-arkts-syntax-assistant-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/SummerKaze/skill-arkts-syntax-assistant",
        "~/.claude/skills/skill-arkts-syntax-assistant"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "skill-arkts-syntax-assistant-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/SummerKaze/skill-arkts-syntax-assistant",
        "~/.claude/skills/skill-arkts-syntax-assistant"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "skill-arkts-syntax-assistant-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/SummerKaze/skill-arkts-syntax-assistant",
          "~/.claude/skills/skill-arkts-syntax-assistant"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add skill-arkts-syntax-assistant-skill -- git clone https://github.com/SummerKaze/skill-arkts-syntax-assistant ~/.claude/skills/skill-arkts-syntax-assistant

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: skill-arkts-syntax-assistant

Migrate a TypeScript module to ArkTS without fighting the compiler

👤 Devs porting existing TS code to OpenHarmony ⏱ ~45 min intermediate

何時使用: You pasted TS into an ArkTS file and the compiler erupted.

前置條件
  • Skill cloned — git clone https://github.com/SummerKaze/skill-arkts-syntax-assistant ~/.claude/skills/skill-arkts-syntax-assistant
步驟
  1. Paste the errors
    Use skill-arkts-syntax-assistant — here's the TS file and the ArkTS compile errors. What's incompatible?✓ 已複製
    → Errors explained with ArkTS's stricter rules, not generic TS advice
  2. Get a compliant rewrite
    Rewrite the file to be ArkTS-valid while preserving behavior.✓ 已複製
    → Rewrite with typed declarations and no dynamic object mutations

結果: A clean ArkTS port with a note on why each change was needed.

注意事項
  • Dynamic property access patterns are everywhere in the original — Skill will refactor to typed interfaces — accept the added verbosity
搭配使用: filesystem

Diagnose a specific ArkTS compilation error

👤 HarmonyOS devs stuck on a specific error ⏱ ~10 min beginner

何時使用: Compiler message is cryptic and the docs don't explain.

步驟
  1. Share error + code
    skill-arkts-syntax-assistant — error: <paste>. Code: <paste>.✓ 已複製
    → Root cause explained in ArkTS terms + correct pattern

結果: A fix plus understanding of why the rule exists.

Review a hot loop for ArkTS-specific performance issues

👤 HarmonyOS app developers tuning performance ⏱ ~20 min intermediate

何時使用: Component is janky; you suspect allocation or typing pitfalls.

步驟
  1. Show the code
    skill-arkts-syntax-assistant — perf review this loop. Memory and allocation patterns.✓ 已複製
    → Specific allocations flagged + array/object alternatives

結果: A measurably faster version or a clear 'this is already fine' verdict.

組合

與其他 MCP 搭配,撬動十倍槓桿

skill-arkts-syntax-assistant-skill + filesystem

Batch-migrate a whole directory of TS files to ArkTS

For every .ts file under src/utils, apply the ArkTS migration and save as .ets.✓ 已複製
skill-arkts-syntax-assistant-skill + github

Open a PR with migration diffs chunked by file

After migration, open a PR with one commit per migrated file.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
migrate_ts_file TS file path + compile errors Porting TS code 0
diagnose_error error text + code snippet Stuck on a specific compiler error 0
perf_review code + suspect area Tuning HarmonyOS component perf 0

成本與限制

運行它的成本

API 配額
None
每次呼叫 Token 數
Moderate — pattern examples loaded when needed
費用
Free — skills are local files
提示
Migrate file-by-file rather than whole-repo to keep context manageable.

安全

權限、密鑰、影響範圍

憑證儲存: No credentials — pure prompts
資料出站: None

故障排查

常見錯誤與修復

Skill not invoked — Claude applies generic TS fixes that fail in ArkTS

Say 'ArkTS' explicitly; 'TypeScript' alone won't activate this skill.

驗證: ls ~/.claude/skills/skill-arkts-syntax-assistant/SKILL.md
SKILL.md frontmatter wrong

Re-clone; description drives auto-activation.

驗證: head ~/.claude/skills/skill-arkts-syntax-assistant/SKILL.md
Wrong trigger keywords — compile error not resolved

Include the exact compiler message in the prompt, not a paraphrase.

替代方案

skill-arkts-syntax-assistant 對比其他方案

替代方案何時用它替代權衡
Vanilla TypeScript skillsYou're not targeting HarmonyOSMisses ArkTS's stricter rules
OpenHarmony official docsYou want authoritative reference material, not a chat interfaceNo interactive diagnosis

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills