Repository navigation
Add LLM guidance, scaffold generator, exchangerate.host example, and WebMock testing docs - #24
Merged
kalashnikovisme merged 2 commits intoJan 24, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
AGENTS.mdthat explains what a wrapper client is/is not, golden-path structure, naming conventions, modeling rules (params, body, response, optional/allow_blank, Purple::Boolean, :array_of), DO/DON'Ts for LLMs, and a copy-paste skeleton template.docs/openapi_mapping.mdand testing guidancedocs/testing_wrappers.mdthat show how OpenAPI concepts map to the Purple DSL and how to test with RSpec + WebMock (worked example included).examples/real_world/exchangerate_host/includingclient.rb(live, historical, convert, timeframe endpoints demonstrating required/optional params, nested response shapes, optional/allow_blank, Purple::Boolean, and a response transform) andREADME.mddocumenting how to run it.bin/purple-clientwhich implementsbin/purple-client scaffold PROVIDER_NAME [--force]to generatelib/<provider>/client.rb,lib/<provider>/version.rb,lib/<provider>/README.md, andspec/<provider>/client_spec.rbwhile refusing to overwrite existing files unless--forceis passed; made the CLI executable and documented the command inREADME.md.Gemfileand included a new wrapper specspec/exchangerate_host/client_spec.rbusing RSpec + WebMock to validate requests and responses.paramsis used to build request bodies for POST/PUT/PATCH and leftbody(...)for response schemas; adjusted the exchangerate exampletimeframerates shape to use{ type: Hash, allow_blank: true }to avoid overly strict validation.AGENTS.md,docs/openapi_mapping.md,docs/testing_wrappers.md,examples/real_world/exchangerate_host/client.rb,examples/real_world/exchangerate_host/README.md,spec/exchangerate_host/client_spec.rb,bin/purple-client,Gemfile, and updates toREADME.md.Testing
bundle installto fetch test deps but it failed due to a network/Gem::HTTP 403 from rubygems.org in this environment, so gems could not be installed (failure: network/403).bundle exec rspecbut it failed because bundler/executables were not available due to the failed install (failure: missing gems); nevertheless, RSpec spec files were added and follow the existing test style and WebMock stubbing pattern.bin/purple-clientand making it executable, and validated generated file contents via inspection; the CLI will refuse to overwrite files unless--forceis given.bundle installin an environment with network access.Run instructions
bundle installthenbundle exec rspec(note: in CI/dev with network accessbundle installshould succeed and specs will run).ruby -r "./examples/real_world/exchangerate_host/client" -e "puts ExchangerateHost::Client.live(base: 'USD', symbols: 'EUR').rates[:eur]".bin/purple-client scaffold my_providerand re-run with--forceto overwrite.Notes
Codex Task