Summary
Replace defi schema [command path] output with runtime output JSON schema (envelope + command data shape), even though this is a breaking change for current schema consumers.
Problem
Current schema output describes command/flag metadata, not the response contract. Agents and typed clients still need to infer runtime output shapes manually.
Proposal
- Make
defi schema [command path] return JSON Schema for that command's runtime output.
- Include:
- full envelope schema (
version/success/data/error/warnings/meta)
data item schema for the selected command
- explicit optional fields for provider-specific extras (for example execution IDs / fee breakdown fields)
- Keep deterministic field ordering expectations documented separately.
Breaking-change note
This intentionally changes the shape returned by defi schema.
Acceptance criteria
defi schema yield opportunities returns JSON Schema (Draft 2020-12) for the output contract, not Cobra command metadata.
- Schema includes both success and error envelope shapes.
- Schema covers provider-optional fields already in contract (e.g.
provider_native_id, market_address, fee_breakdown).
- Tests validate schema generation for at least one command in each major domain (
lend, yield, bridge, swap).
- README/AGENTS updated to describe the new
schema behavior and breaking change.
Implementation notes
Prefer generating schema from model types + command response wrappers to minimize maintenance drift.
Summary
Replace
defi schema [command path]output with runtime output JSON schema (envelope + command data shape), even though this is a breaking change for currentschemaconsumers.Problem
Current
schemaoutput describes command/flag metadata, not the response contract. Agents and typed clients still need to infer runtime output shapes manually.Proposal
defi schema [command path]return JSON Schema for that command's runtime output.version/success/data/error/warnings/meta)dataitem schema for the selected commandBreaking-change note
This intentionally changes the shape returned by
defi schema.Acceptance criteria
defi schema yield opportunitiesreturns JSON Schema (Draft 2020-12) for the output contract, not Cobra command metadata.provider_native_id,market_address,fee_breakdown).lend,yield,bridge,swap).schemabehavior and breaking change.Implementation notes
Prefer generating schema from model types + command response wrappers to minimize maintenance drift.