Skip to content

refactor(skills): filter search JSON output to stable CLI fields only#54

Merged
BlackHole1 merged 1 commit into
mainfrom
add-skills-search-json
Mar 31, 2026
Merged

refactor(skills): filter search JSON output to stable CLI fields only#54
BlackHole1 merged 1 commit into
mainfrom
add-skills-search-json

Conversation

@BlackHole1
Copy link
Copy Markdown
Member

Transform the skill search schema to expose only stable CLI fields (description, name, packageName, packageVersion, skillDisplayName) and drop server-internal fields (icon, owner, when).

  • Rename title to skillDisplayName in JSON output via zod transform
  • Remove .passthrough() to prevent leaking unknown server fields
  • Add test coverage for --json alias and field filtering
  • Update documentation to describe the stable output contract

Transform the skill search schema to expose only stable CLI fields
(description, name, packageName, packageVersion, skillDisplayName)
and drop server-internal fields (icon, owner, when).

- Rename `title` to `skillDisplayName` in JSON output via zod transform
- Remove `.passthrough()` to prevent leaking unknown server fields
- Add test coverage for `--json` alias and field filtering
- Update documentation to describe the stable output contract

Signed-off-by: Kevin Cui <bh@bugs.cc>
@BlackHole1 BlackHole1 merged commit 9b0daed into main Mar 31, 2026
4 of 5 checks passed
@BlackHole1 BlackHole1 deleted the add-skills-search-json branch March 31, 2026 08:31
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 45586c6d-aefa-4628-8d9f-5bb7de66ae79

📥 Commits

Reviewing files that changed from the base of the PR and between b48856d and 2145ad2.

⛔ Files ignored due to path filters (1)
  • src/application/commands/skills/__snapshots__/search.cli.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • docs/commands.md
  • docs/commands.zh-CN.md
  • src/application/commands/skills/search.cli.test.ts
  • src/application/commands/skills/search.test.ts
  • src/application/commands/skills/search.ts

Summary by CodeRabbit

The oo skills search command's JSON output has been refined to return only stable CLI fields. The title field is now mapped to skillDisplayName, and server-only fields are no longer exposed.

  • Documentation

    • Updated JSON output specification
  • Tests

    • Updated test cases for refined output format

Walkthrough

The pull request modifies the oo skills search <text> command's JSON output contract by constraining returned entries to specific stable CLI fields (description, name, packageName, packageVersion, skillDisplayName). The implementation transforms the schema to rename title to skillDisplayName, removes the icon field, and updates label formatting logic accordingly. Documentation is updated in English and Chinese versions to reflect the new output specification. Tests are expanded to validate the constrained output and verify that server-only fields are excluded from CLI results.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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