@dspedorco/a2htrans
v0.1.6
Published
A2HTrans (Android-to-HarmonyOS) skill + agent installer. Run `hm setup` to distribute conversion skills and subagents into Claude Code, Cursor, OpenCode, and Codex.
Maintainers
Readme
a2htrans
Skill + agent installer for the A2HTrans Android-to-HarmonyOS conversion toolkit. One command (
hm setup) distributes 13 skills and 20 subagents (plus their associated script bundles) into Claude Code, Cursor, OpenCode, and Codex.
The skills and agents are converted from the upstream android-harmonyos-converter Claude Code plugin so they can be installed cross-editor via npm.
Install
Global install — exposes both a2htrans and the short alias hm on PATH:
npm install -g a2htrans
hm setupOne-shot via npx (no global install required):
npx a2htrans setup
# or
npx hm setupRequires Node.js ≥ 18.
What hm setup does
- Detects each supported editor by checking whether its standard config directory exists under
$HOME. - For every editor that exists, copies:
- every skill folder under
skills/→<editor>/skills/<skill-name>/(recursive — preservesreferences/,tools/, etc.) - every agent under
agents/→<editor>/agents/(recursive — preserves sibling<agent>/scripts/andconfig/subtrees)
- every skill folder under
- Editors whose marker directory is missing are reported as
skipped— nothing is written for them. - The install is idempotent — re-running overwrites the same files with the latest bundled content. It never touches existing files under
<editor>/skills/or<editor>/agents/that don't share a name with a bundled item, so other tools' skills are left alone.
Target directories
| Editor | Marker | Skills target | Agents target |
| ------------ | ----------------------- | ---------------------------------- | -------------------------------- |
| Claude Code | ~/.claude/ | ~/.claude/skills/ | ~/.claude/agents/ |
| Cursor | ~/.cursor/ | ~/.cursor/skills/ | ~/.cursor/agents/ |
| OpenCode | ~/.config/opencode/ | ~/.config/opencode/skills/ | ~/.config/opencode/agents/ |
| Codex | ~/.codex/ | ~/.agents/skills/ | ~/.codex/agents/ |
Codex deliberately uses two roots: the shared Agent-Skills convention
~/.agents/skills/for skills, and the editor-scoped~/.codex/agents/for subagent definitions.
Example output
A2HTrans Setup
===============
Configured:
+ Claude Code skills (13 → ~/.claude/skills)
+ Claude Code agents (20 → ~/.claude/agents)
+ Cursor skills (13 → ~/.cursor/skills)
+ Cursor agents (20 → ~/.cursor/agents)
Skipped:
- OpenCode (not installed)
- Codex (not installed)
Source skills: /usr/local/lib/node_modules/a2htrans/skills
Source agents: /usr/local/lib/node_modules/a2htrans/agents
Done. Re-open your editor for the new skills/agents to be picked up.Skills shipped (13)
Listed roughly in pipeline order:
| Skill | Purpose |
| ---------------------------------- | ------------------------------------------------------------- |
| a2htrans-requirements-analysis | Analyze Android project → requirements-analysis.md |
| a2htrans-architecture-design | Requirements → feature.md HarmonyOS architecture blueprint |
| a2htrans-spec-generate | .txt requirement folder → per-requirement spec markdown |
| a2htrans-ui-dev | Full Android → HarmonyOS UI migration pipeline (6 phases) |
| a2htrans-logic-dev | Implement HarmonyOS ArkTS logic from a spec document |
| a2htrans-build | Build HarmonyOS project (signed/unsigned), produce .hap |
| a2htrans-code-review | Per-scenario review of HarmonyOS code at a commit |
| a2htrans-fix | Auto-dispatch fixer (build / self-test / review / general) |
| a2htrans-self-test | On-device functional verification of a HAP via AutoTest |
| a2htrans-integration-test | End-to-end integration test of the built app |
| a2htrans-dev-pipeline | Full 11-agent Android → HarmonyOS conversion pipeline |
| a2htrans-human-ai-fix | Collaborative fix with [Human-AI] audit-trail commit |
| a2htrans-tool-setup | Interactively populate converter-config.json tool paths |
Each skill is a directory of the form skills/<name>/SKILL.md, with frontmatter name + trigger description so agentic editors can match them against user requests.
⚠️
a2htrans-tool-setupconfigures the converter's tool paths (DevEco Studio, Harmony SDK, Node, Python). It is not the same as thehm setupCLI command (which installs skills + agents into editors).
Agents shipped (20 + 2 script bundles)
Flat .md files in agents/, two of which (logic-coding, logic-developer-v6) have sibling script directories with helper Python scripts (DeepWiki query, codelinter, wave-verification, error recording, etc.):
architecture-designer, build-engineer, build-fixer, code-reviewer, integration-tester, logic-coding (+ scripts/: platform context query, DeepWiki, codelinter), logic-coding-minimal, logic-context-builder, logic-context-builder-minimal, logic-developer, logic-developer-v6 (+ scripts/: project index builder, wave verification, error ledger, codelinter, DeepWiki tests), requirements-analyst, review-fixer, self-test-fixer, self-test-setup, self-tester, self-tester-zwk, spec-generator, ui-developer, ui-developer-analysis.
Commands
hm setup # install skills + agents into detected editors
hm --version # show installed version
hm --help # list commands
# `a2htrans` works identically — both aliases point to the same CLI:
a2htrans setup
a2htrans --helpDevelopment
# 1. Install dev deps (commander, tsx, typescript). The `prepare` hook
# automatically runs the build, so `dist/` is ready right after this.
npm install
# 2. Run the CLI from source (TypeScript via tsx — no rebuild needed):
npm run dev -- setup
# 3. Production build (writes dist/cli/*.js, chmod +x on the entry):
npm run build
# 4. Inspect the would-be npm tarball without publishing:
npm pack --dry-runRepo layout
a2htrans/
├── package.json # bin: { a2htrans, hm }, files: [dist, skills, agents]
├── tsconfig.json
├── scripts/build.js # tsc + chmod +x dist/cli/index.js
├── src/cli/
│ ├── index.ts # commander entry, registers `setup`
│ └── setup.ts # editor detection + installSkillsTo / installAgentsTo
├── skills/ # 13 skill folders, each with SKILL.md
└── agents/ # 20 .md agent files + 2 script bundlesPublishing checklist
- Bump
versioninpackage.json. npm pack --dry-run— confirmdist/+skills/+agents/are included and the total file count matches expectations.npm publish(afternpm login).
License
The CLI shell (src/, scripts/, package.json, README.md) is MIT.
The bundled skill and agent content under skills/ and agents/ is sourced from the upstream android-harmonyos-converter Claude Code plugin and is redistributed under its respective licence. Refer to the upstream project for the canonical license terms.
