Skip to content

feat(score): add --suggestions for hotspot LLM prompts#2754

Draft
adamaltman wants to merge 1 commit into
mainfrom
aa/score-suggestions
Draft

feat(score): add --suggestions for hotspot LLM prompts#2754
adamaltman wants to merge 1 commit into
mainfrom
aa/score-suggestions

Conversation

@adamaltman
Copy link
Copy Markdown
Member

What/Why/How?

What: Adds optional --suggestions to the experimental score command. Hotspot detection now produces structured issues (stable codes plus the same human messages as before). When the flag is set, the CLI prints copy-paste LLM prompts per hotspot (stylish) and adds hotspots[].suggestion in JSON.

Why: Brings the score command closer to agent-readiness workflows where users paste actionable prompts into an assistant to improve their OpenAPI description.

How: getHotspotIssues in hotspots.ts is the single source of truth; reasons remains issues.map((i) => i.message). New suggestions.ts implements buildHotspotAgentPrompt. JSON strips issues and only attaches suggestion when --suggestions is true so default JSON stays stable.

Reference

OpenAPI 3.x score command; hotspot thresholds unchanged.

Testing

  • packages/cli/src/commands/score/__tests__/ (hotspots, suggestions, index).
  • E2E: tests/e2e/score/score.test.ts and tests/e2e/score/score-suggestions/snapshot.txt.

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 19, 2026

⚠️ No Changeset found

Latest commit: cbe57d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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