Files
opencli/.agents/workflows/cross-project-adapter-migration.md
jackwener 68840fc85c refactor: P0 architecture improvements
- Split browser.ts (700 lines) into src/browser/ module (page, mcp, errors, discover, tabs, index)
- Add unified error handling: CliError base class + logger module
- Enable TypeScript strict mode, fix 12 type errors
- Extract inline build scripts to scripts/clean-yaml.cjs and copy-yaml.cjs
- All 178 unit tests pass, build produces 83 entries across 19 sites
2026-03-17 17:01:51 +08:00

1.4 KiB

description
description
Migrate commands from an external CLI project into opencli adapters

// turbo-all

Steps

  1. Clone the source CLI project for analysis:
git clone <source_repo_url> /tmp/<source-cli>
  1. Analyze source project: list all commands, auth method, API endpoints, and output fields.

  2. Check existing opencli adapters for the target site:

ls src/clis/<site>/
opencli list | grep <site>
  1. Generate a comparison matrix table (source commands vs opencli existing). Mark each as: ✅ New / ✅ Enhance / ❌ Skip. Ask user to confirm which commands to migrate.

  2. Implement YAML Read adapters first (highest ROI, 10-20 lines each). Place files in src/clis/<site>/<name>.yaml.

  3. Implement TS Read adapters for complex cases (GraphQL, pagination, signing). Place files in src/clis/<site>/<name>.ts.

  4. Implement TS Write adapters using Strategy.UI or Strategy.COOKIE. Place files in src/clis/<site>/<name>.ts.

  5. Verify build:

npx tsc --noEmit
  1. Verify all commands are registered:
opencli list | grep <site>
  1. Run each new command to verify it works:
opencli <site> <command> --limit 3 -f json
  1. Update README.md with new command examples in the appropriate platform section.

  2. Update SKILL.md Commands Reference with new commands.

  3. Commit and push:

git add -A
git commit -m "feat(<site>): migrate <N> commands from <source-cli>"
git push