Skip to content

fix: reuse CLI skill projection#154

Open
0xpolarzero wants to merge 5 commits into
wevm:mainfrom
0xpolarzero:fix/skillgen-syncskills-cli-projection
Open

fix: reuse CLI skill projection#154
0xpolarzero wants to merge 5 commits into
wevm:mainfrom
0xpolarzero:fix/skillgen-syncskills-cli-projection

Conversation

@0xpolarzero
Copy link
Copy Markdown

@0xpolarzero 0xpolarzero commented May 27, 2026

Warning

This PR is stacked on top of #149 (fix(cli): preserve stream terminal records). Because wevm/incur does not have that base branch and this PR targets main, the diff includes the commits from that prerequisite branch as well.

Skillgen and SyncSkills had copied their own command-to-skill collectors instead of reusing the one in Cli.ts.

The copied collectors had drifted from the CLI behavior used by --llms --format md.

Previous behavior

Aliases could leak into generated skills as if they were real commands:

const cli = Cli.create('tool').command('real', {
  aliases: ['r'],
  run: () => ({}),
})

// Before this fix, generated/synced skill markdown could contain both:
expect(content).toMatch(/^# tool real$/m)
expect(content).toMatch(/^# tool r$/m)

Fetch gateways were also treated like ordinary commands, so they missed the CLI's fetch-specific skill hint:

const cli = Cli.create('tool').command('api', {
  fetch: () => new Response('{}'),
})

// Before this fix, this was missing from Skillgen/SyncSkills output:
expect(content).not.toContain('Fetch gateway. Pass path segments')

Fixed behavior

Skillgen and SyncSkills now use the same projection as the CLI, so generated skills match --llms --format md:

expect(content).toMatch(/^# tool real$/m)
expect(content).not.toMatch(/^# tool r$/m)
expect(content).toContain('Fetch gateway. Pass path segments')

The tests also cover preserving examples and output schemas while reusing the shared projection.

Changes

  • Exports the CLI skill projection and generated-skill frontmatter parser for reuse.
  • Replaces the local Skillgen and SyncSkills collectors with the shared CLI projection.
  • Adds regression coverage for aliases, fetch gateways, examples, and output schemas.

Check the PR on my fork for reviewing from a stacked diff.

@0xpolarzero 0xpolarzero marked this pull request as ready for review May 27, 2026 16:58
@0xpolarzero 0xpolarzero force-pushed the fix/skillgen-syncskills-cli-projection branch from c677c76 to 4a8351c Compare May 27, 2026 17:21
@0xpolarzero 0xpolarzero force-pushed the fix/skillgen-syncskills-cli-projection branch from 4a8351c to f73324e Compare May 27, 2026 17:23
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