Skip to content

refactor: migrate all CLI adapters from YAML to TypeScript#887

Merged
jackwener merged 6 commits intomainfrom
coding-claude-opus/yaml-to-ts-migration
Apr 8, 2026
Merged

refactor: migrate all CLI adapters from YAML to TypeScript#887
jackwener merged 6 commits intomainfrom
coding-claude-opus/yaml-to-ts-migration

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

  • Convert all 123 YAML adapter files in clis/ to TypeScript using cli() from @jackwener/opencli/registry
  • Remove YAML scanning/registration from discovery.ts (registerYamlCli, parseStrategy for YAML, js-yaml import)
  • Remove scanYaml() and shouldReplaceManifestEntry() from build-manifest.ts
  • Change synthesize.ts to output JSON candidates (internal intermediate format)
  • Change generate-verified.ts to write .ts adapter files (not .yaml) via new candidateToTs() helper
  • Delete dead code: yaml-schema.ts, scripts/yaml-to-ts.mjs
  • Update all affected tests

Motivation

Per @WAWQAQ: "cls里的yaml我觉得不用保留了,完全去掉" — YAML as an adapter format adds unnecessary complexity with no user benefit. TypeScript provides type safety, IDE support, and a single source of truth.

What changed

Layer Before After
clis/ adapters 123 .yaml + some .ts All .ts
discovery.ts Scans YAML + TS TS only
build-manifest.ts Compiles YAML + TS entries TS only
synthesize.ts Writes .yaml candidates Writes .json candidates
generate-verified.ts Reads YAML candidates, writes .yaml artifacts Reads JSON candidates, writes .ts artifacts
yaml-schema.ts YAML type defs + parseYamlArgs() Deleted (dead code)

Test plan

  • TypeScript compilation passes (tsc --noEmit)
  • All 187 test files pass (1425 tests, 1 skipped)
  • Verified converted adapter output matches original YAML semantics (e.g. clis/hackernews/top.ts, clis/bilibili/hot.ts)
  • @mbp-codex-pr0 review per @WAWQAQ's request

All consumers are in the same repo and evolve together — version field
adds ceremony without practical value at this stage.

Keeps schema_version in VerifiedArtifactMetadata (sidecar file format).
Remove YAML as an adapter format entirely. All adapters now use
TypeScript with cli() from @jackwener/opencli/registry.

- Convert 123 YAML adapter files to TypeScript via batch script
- Remove YAML scanning from discovery.ts (registerYamlCli, yaml import)
- Remove scanYaml() and shouldReplaceManifestEntry() from build-manifest.ts
- Change synthesize.ts to output JSON candidates (internal format)
- Change generate-verified.ts to write .ts adapter files instead of .yaml
- Delete yaml-schema.ts (dead code) and scripts/yaml-to-ts.mjs (one-time tool)
- Update all tests to match new format

Closes discussion in #OpenCLI thread 47ddba82.
- plugin-scaffold.ts: generate hello.ts (TS pipeline) instead of hello.yaml
- plugin.ts validatePluginStructure: no longer accept .yaml as valid command file
- plugin.ts scanPluginCommands: remove .yaml/.yml from scanned extensions
- discovery.ts: add explicit log.warn() when YAML files detected in clis/ or plugins/
- plugin.test.ts: update all test fixtures from .yaml to .js
- plugin-scaffold.test.ts: update hello.yaml references to hello.ts
- Delete dead src/yaml-schema.ts

Resolves PR #887 review blockers from @mbp-codex-pr0.
…nce adapters

Code changes:
- record.ts: candidate output changed from .yaml (yaml.dump) to .json (JSON.stringify), removed js-yaml import
- src/clis/binance: convert all 11 YAML adapters to TypeScript cli() format
- binance/commands.test.ts: rewrite to use registry instead of yaml.load
- skill-generate.test.ts, diagnostic.test.ts: update mock paths from .yaml to .ts
- build-manifest.ts, synthesize.ts: update stale YAML comments

Documentation:
- README.md: remove .yaml from Dynamic Loader, fix plugin types, fix synthesize comment
- README.zh-CN.md: fix synthesize comment
- CONTRIBUTING.md: replace YAML Adapter section with Pipeline Adapter (TS), update arg examples
- docs/developer/yaml-adapter.md: replaced with deprecation redirect
- docs/developer/architecture.md: remove YAML pipeline references
- docs/developer/contributing.md: remove YAML adapter section
- docs/developer/ai-workflow.md: YAML → TS in synthesize description
- docs/guide/getting-started.md: remove .yaml from loader, update engine description
- docs/guide/plugins.md: remove YAML plugin option, update plugin types
- docs/index.md, docs/comparison.md: remove YAML adapter references
- docs/zh/guide/plugins.md: remove .yaml from scan description

Skills:
- opencli-explorer/SKILL.md: rewrite YAML vs TS decision tree to TS-only
- opencli-oneshot/SKILL.md: replace YAML templates with TS cli() templates
- opencli-generate/SKILL.md: YAML artifact path → TS artifact path
- opencli-usage/SKILL.md, plugins.md: update adapter format references
- docs/zh/guide/plugins.md: replace YAML plugin example with TS pipeline
- docs/developer/testing.md: YAML Adapter heading → Adapter, remove validate line
- TESTING.md: same fix in root testing doc
- CONTRIBUTING.md: remove "YAML validation" comment
- docs/.vitepress/config.mts: mark YAML Adapter Guide as (Deprecated) in nav
- docs/advanced/download.md: remove "YAML Adapters" from pipeline step heading
@jackwener jackwener merged commit 70b1145 into main Apr 8, 2026
@jackwener jackwener deleted the coding-claude-opus/yaml-to-ts-migration branch April 8, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant