用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/yimian-521/kotlin-head --skill kotlin-head命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | kotlin-head |
| description | 有头编译器——零依赖Kotlin编译器前端。编译Kotlin源码、AST分析、Bug扫描、进程树检测。一条命令即可运行。 |
| version | 0.9.1 |
| source | https://github.com/yimian-521/kotlin-head |
| disable-model-invocation | false |
零依赖 Kotlin 编译器前端。 拿到一个 .kt 文件,直接编译、看 AST、扫 Bug、展示进程树。
# AI 加载 skill 后先跑这句——确认 jar 可用+版本号
kotlin -cp kotlin-head.jar com.qitong.head.Main --help 2>&1 || echo "NEED_UPDATE"
如果输出版本号不是最新或报错:
# 从 GitHub Release 拉最新 jar
curl -L -o kotlin-head.jar https://github.com/yimian-521/kotlin-head/releases/latest/download/kotlin-head.jar
## 快速使用
```bash
# 编译一个 .kt 文件
kotlin -cp /sdcard/Download/Operit/skills/kotlin-head/kotlin-head.jar com.qitong.head.Main <file.kt>
# 只看 AST
kotlin -cp ...jar com.qitong.head.Main <file.kt> --ast
# 看诊断
kotlin -cp ...jar com.qitong.head.Main <file.kt> --diag
# 看进程树(注解处理+检测进程报告)
kotlin -cp ...jar com.qitong.head.Main <file.kt> --process
| 能力 | 说明 |
|---|---|
| Lexer → Parser → AST | 完整 Kotlin 前端,递归下降+容错跳过 |
| TypeChecker | 符号表+类型绑定 |
| Diagnostic | 四级诊断(错误/警告/预期/信息) |
| BugScanner | 12条 Kotlin 冷门编译器 bug 规则 |
| 进程树 | 四层架构:主进程→指挥官→子进程→进程体 |
| 检测进程 | 五种风格:哨兵/胆小/勇敢/抽样/趋势 |
| LiveDeclarationGraph | 声明级活图,混合编译 |
| IR + Pass | 三地址码 IR + 死代码消除/常量折叠/内联展开 |
| EventBus | 三种通道:事件/流式/工作 |
skill 目录下自带两个测试文件:
proc_test.kt — 注解+进程树+检测进程完整测试bug_test.kt — BugScanner 冷门 bug 触发测试kotlin -cp ...jar com.qitong.head.Main proc_test.kt --process
| 语法 | 状态 |
|---|---|
| data class / fun / val / var / if / return | ✅ |
| 注解 (@Entity, @Serializable, @Inject 等) | ✅ |
| when / for / while | ❌ 待支持 |
| Lambda / 泛型 / suspend | ❌ 待支持 |
| object / enum / interface | ❌ 待支持 |