refactor: gen-skill-docs.ts consumes typed host configs

Replace hardcoded EXTERNAL_HOST_CONFIG, transformFrontmatter host
branches, path/tool rewrite if-chains, and ALL_HOSTS array with
config-driven lookups from hosts/*.ts.

- Host detection uses resolveHostArg() (handles aliases like agents/droid)
- transformFrontmatter uses config's allowlist/denylist mode, extraFields,
  conditionalFields, renameFields, and descriptionLimitBehavior
- Path rewrites use config's pathRewrites array (replaceAll, order matters)
- Tool rewrites use config's toolRewrites object
- Skill skipping uses config's generation.skipSkills
- ALL_HOSTS derived from ALL_HOST_NAMES
- Token budget display regex derived from host configs

Golden-file comparison: all 3 hosts produce IDENTICAL output to baselines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-03 15:55:43 -07:00
parent 4a1a70c2c7
commit 9612b1c82e
3 changed files with 97 additions and 66 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ const factory: HostConfig = {
generation: {
generateMetadata: false,
skipSkills: [],
skipSkills: ['codex'], // Codex skill is a Claude wrapper around codex exec
},
pathRewrites: [
+1 -1
View File
@@ -19,7 +19,7 @@ const kiro: HostConfig = {
generation: {
generateMetadata: false,
skipSkills: ['codex'],
skipSkills: ['codex'], // Codex skill is a Claude wrapper around codex exec
},
pathRewrites: [