Skip to content

fix: reuse CLI skill projection#13

Open
0xpolarzero wants to merge 2 commits into
stream-terminal-command-resultsfrom
fix/skillgen-syncskills-cli-projection
Open

fix: reuse CLI skill projection#13
0xpolarzero wants to merge 2 commits into
stream-terminal-command-resultsfrom
fix/skillgen-syncskills-cli-projection

Conversation

@0xpolarzero
Copy link
Copy Markdown
Owner

@0xpolarzero 0xpolarzero commented May 27, 2026

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.

Copy link
Copy Markdown
Owner Author

0xpolarzero commented May 27, 2026

@0xpolarzero 0xpolarzero changed the title fix: reuse cli skill projection fix: reuse CLI skill projection May 27, 2026
@0xpolarzero 0xpolarzero marked this pull request as ready for review May 27, 2026 16:58
@0xpolarzero 0xpolarzero force-pushed the stream-terminal-command-results branch from 53fdfcf to 6be41bd Compare May 27, 2026 17:21
@0xpolarzero 0xpolarzero force-pushed the fix/skillgen-syncskills-cli-projection branch 2 times, most recently from 4a8351c to f73324e Compare May 27, 2026 17:23
@0xpolarzero 0xpolarzero force-pushed the stream-terminal-command-results branch from 3776dbe to ea85131 Compare May 27, 2026 18:50
@0xpolarzero 0xpolarzero force-pushed the fix/skillgen-syncskills-cli-projection branch from 8bed02c to 375c0eb Compare May 27, 2026 18:50
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