已开启
feat: add my-first-plugin #1
thgertaba创建于 6月28日
feat: add my-first-plugin #1
已开启
共 3 个文件变更+16-0
| @@ -0,0 +1,7 @@ | |||
| 1 | +{ | ||
| 2 | + "name": "my-first-plugin", | ||
| 3 | + "version": "1.0.0", | ||
| 4 | + "description": "我的第一个 AtomCode 插件", | ||
| 5 | + "asset_dir": "..", | ||
| 6 | + "verified": false | ||
| 7 | +} | ||
| @@ -0,0 +1,3 @@ | |||
| 1 | +# My First Plugin | ||
| 2 | + | ||
| 3 | +我的第一个 AtomCode 插件。 | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +--- | ||
| 2 | +name: hello | ||
| 3 | +description: 一个简单的打招呼技能 | ||
| 4 | +--- | ||
| 5 | + | ||
| 6 | +当被调用时,用中文回复"你好!"。 | ||
🟡 Medium Priority
变更行:
my-first-plugin/.atomcode-plugin/plugin.json第5行"asset_dir": ".."。问题: 该插件清单使用了非标准字段
asset_dir,而非 AtomCode 插件规范中定义的skills字段。且其值".."是路径穿越模式,指向插件目录的父目录。证据链:
templates/plugin-template/.atomcode-plugin/plugin.json使用"skills": "skills"。plugins/atomcode-workflows、plugins/commit-craft、plugins/git-worktree)均使用"skills": "skills"。CONTRIBUTING.md的插件目录结构明确展示skills/<skill>/SKILL.md模式。scripts/validate.py仅识别LOADABLE_ASSET_KEYS = {"skills", "commands"},asset_dir不在其中,会被静默忽略。".."是一个目录穿越路径,若任何下游系统读取该字段并按路径解析,将逃逸出插件目录。影响:
skills键来发现技能,则该插件的技能将不会被加载。..路径值存在被误用的安全风险。建议:将
"asset_dir": ".."替换为"skills": "skills",与模板和所有已有插件保持一致。同时删除第6行的"verified": false(该字段属于 market 目录层级,不属于 plugin 清单)。