/ 目录 / 演练场 / 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

安装

作者仓库 · Claude Skills 官方文档

使用场景

实战用法: 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.

步骤
  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

故障排查

常见错误与修复

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