feat: add generate-spec command#2937
Conversation
🦋 Changeset detectedLatest commit: 45980fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
2c94a80 to
6b62b28
Compare
generate-spec commandgenerate-spec command
Performance Benchmark (Lower is Faster)
|
|
@cursor review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
2 issues from previous reviews remain unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 956bf00. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3a11b20. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d7ee556. Configure here.
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 90a2052. Configure here.

What/Why/How?
Added new
generate-speccommand which will infer OAD basing on traffic data. To improve accuracy, there is option to use AI agents to improve results.Reference
Testing
Screenshots (optional)
Check yourself
Security
Note
Medium Risk
Large new surface area and
--with-aiexfiltrates traffic samples to external CLIs; deterministic path is lower risk but output quality depends on capture coverage.Overview
Adds an experimental
generate-specCLI command that builds an OpenAPI 3.1 description from recorded HTTP traffic (HAR, Kong, Nginx/Apache JSON, NDJSON), reusing the same traffic parsing asdrift.The pipeline is deterministic first: path templating for ID-like segments, schema merge with
oneOffor alternate bodies and nullable unions, repeated shapes lifted tocomponents/schemas, and conservativeformat/enuminference from observed strings. Optional--with-airefines one operation at a time via localclaude,codex, orcursorCLIs; accepted output must keep path/method, all observed status codes, and pass lint with the pinnedspecruleset, otherwise that operation keeps the baseline. Traffic samples (URLs, bodies) are sent to the provider when AI is enabled.Wiring includes yargs registration, CODEOWNERS, changeset, command README, unit tests, and e2e tests with stub AI CLIs.
Reviewed by Cursor Bugbot for commit 90a2052. Bugbot is set up for automated code reviews on this repo. Configure here.