add-converter
Guide for implementing and testing new resource converters in acplugin.
Install
mkdir -p .claude/skills/add-converter && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9700" && unzip -o skill.zip -d .claude/skills/add-converter && rm skill.zipInstalls to .claude/skills/add-converter
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Add a new resource type converter to acplugin (e.g., adding support for converting a new Claude Code resource type)Key capabilities
- →Define resource interfaces
- →Implement scanner functions
- →Create conversion logic
- →Integrate with writers
- →Add unit tests
How it works
It follows a multi-step process to define types, implement scanning, create converters, and integrate with writers and CLI outputs.
Inputs & outputs
When to use add-converter
- →Add resource converter
- →Extend acplugin functionality
- →Test converter logic
About this skill
添加新资源类型转换器
当需要支持转换新的 Claude Code 资源类型时,按以下步骤操作。
步骤
1. 定义类型 (src/types.ts)
添加新资源的接口定义和 frontmatter 类型(如果有),以及在 ScanResult 中添加字段。在 ConvertedFile.type 联合类型中添加新值。
2. 添加扫描函数 (src/scanner/claude.ts)
创建并导出可复用的扫描函数(如 scanXxxDir()),这样 plugin.ts 也能使用。
在 scanClaudeProject() 中调用新函数。
3. 集成 Plugin Scanner (src/scanner/plugin.ts)
在 scanPlugin() 中调用新扫描函数,注意 plugin 目录结构与 .claude/ 不同:
- 项目:
.claude/xxx/ - Plugin:
xxx/(直接在 plugin 根目录下)
更新 countResources() 包含新资源。
4. 创建 Converter (src/converter/xxx.ts)
实现 convertXxx(item, platform) 函数,处理三个平台:
export function convertXxx(item: Xxx, platform: Platform): ConvertedFile {
switch (platform) {
case 'codex': return convertToCodex(item);
case 'opencode': return convertToOpenCode(item);
case 'cursor': return convertToCursor(item);
}
}
关键原则:
- Converter 无副作用,只返回
ConvertedFile - 不支持的功能用降级策略(合并到 AGENTS.md 或 rules)
- 返回 warnings 告知用户不兼容项
5. 集成 Writer (src/writer/*.ts)
在三个 writer 文件中调用新 converter,处理合并逻辑。
6. 更新 CLI 输出 (src/index.ts)
更新 printScanResult() 和 convertSingleScan() 中的资源计数。
7. 添加测试 (src/__tests__/xxx.test.ts)
为新 converter 创建测试,覆盖三个平台的转换逻辑。
8. 更新 test-fixture/
在 test-fixture/ 中添加新资源类型的示例文件,确保 scanner.test.ts 覆盖。
Frontmatter 解析容错
社区插件的 YAML 可能格式不规范。扫描函数中必须 try-catch parseFrontmatter(),解析失败时用空 frontmatter + 原始内容兜底。
When not to use it
- →Modifying existing core logic without adding new resource types
Prerequisites
Limitations
- →Frontmatter parsing requires error handling
How it compares
This provides a structured, repeatable framework for extending plugin functionality rather than ad-hoc code changes.
Compared to similar skills
add-converter side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| add-converter (this skill) | 0 | 4mo | No flags | Advanced |
| codex-skill | 12 | 5mo | Review | Advanced |
| run-nx-generator | 5 | 3mo | Review | Intermediate |
| cli-builder | 5 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
codex-skill
feiskyer
Use when user asks to leverage codex, gpt-5, or gpt-5.1 to implement something (usually implement a plan or feature designed by Claude). Provides non-interactive automation mode for hands-off task execution without approval prompts.
run-nx-generator
nrwl
Run Nx generators with prioritization for workspace-plugin generators. Use this when generating code, scaffolding new features, or automating repetitive tasks in the monorepo.
cli-builder
joelhooks
Guide for building TypeScript CLIs with Bun. Use when creating command-line tools, adding subcommands to existing CLIs, or building developer tooling. Covers argument parsing, subcommand patterns, output formatting, and distribution.
upgrading-expo
sickn33
Upgrade Expo SDK versions
nx-generate
nrwl
Generate code using nx generators. USE WHEN scaffolding code or transforming existing code - for example creating libraries or applications, or anything else that is boilerplate code or automates repetitive tasks. ALWAYS use this first when generating code with Nx instead of calling MCP tools or running nx generate immediately.
open-prose
openprose
OpenProse is a programming language for AI sessions. Activate on ANY `prose` command (prose boot, prose run, prose compile, prose update, etc.), running .prose files, mentioning OpenProse/Prose, or orchestrating multi-agent workflows. The skill intelligently interprets what the user wants.