Gem: ruby_api_pack_cloudways
Owner: PHCDevworks
Primary implementation agent: Claude Code
This repository is a Ruby gem that wraps Cloudways API authentication, list
endpoints, and server operations for Ruby and Rails applications. This file is
the implementation guide for Claude Code. Read AGENTS.md first for shared
agent boundaries.
This gem depends on ruby_api_pack_core for its connection wrapper base class
(RubyApiPackCore::Connection::Base) and configuration mixin
(RubyApiPackCore::Configurable). RubyApiPackCloudways::Connection::CwConnect
subclasses RubyApiPackCore::Connection::Base and only adds Cloudways-specific
behavior (the OAuth bearer token lookup and rate-limit retry). This gem keeps
its own Handlers::ResponseValidator locally — its expected_key signature
differs intentionally from ruby_api_pack_core's expected_type validator and
was not migrated; do not conflate the two. Shared HTTP plumbing beyond that
belongs upstream in ruby_api_pack_core — see that repo's own CLAUDE.md
before changing anything that looks like generic request/response handling.
Claude Code does not create commits in this repository unless explicitly asked. Prepare changes, run validation, and leave commit, tag, push, and release authority to the human maintainer.
Run bundle install, then the validation gate described in
AGENTS.md.
Use WebMock and VCR for specs. Do not depend on live Cloudways API calls unless a maintainer explicitly asks for live verification.
The public behavior surface is:
lib/ruby_api_pack_cloudways.rblib/ruby_api_pack_cloudways/configuration.rblib/ruby_api_pack_cloudways/connection/cw_token.rblib/ruby_api_pack_cloudways/connection/cw_connect.rblib/ruby_api_pack_cloudways/api/cw_lists.rblib/ruby_api_pack_cloudways/api/cw_server.rblib/ruby_api_pack_cloudways/handlers/response_validator.rbREADME.md
Configuration, endpoint, connection, and response changes require matching specs and a changelog entry.
- Keep token fetching inside
RubyApiPackCloudways::Connection::CwToken. - Keep authenticated GET and POST behavior inside
RubyApiPackCloudways::Connection::CwConnect, which subclassesRubyApiPackCore::Connection::Base— only add Cloudways-specific behavior there (auth headers, rate-limit retry), do not reimplement URL building, status handling, or JSON parsing locally. - Keep endpoint methods small and traceable to Cloudways API paths.
- Keep host app assumptions out of the gem.
- Avoid broad refactors unless they directly support the requested change.
- If a change requires modifying generic HTTP behavior (URL building, status
handling, JSON parsing, or the
configurepattern) rather than Cloudways-specific behavior, make that change inruby_api_pack_coreinstead, and coordinate the version bump here. This gem's ownHandlers::ResponseValidator(theexpected_keyvariant) stays local — do not merge it intoruby_api_pack_core'sexpected_typevalidator without an explicit decision to change its signature everywhere. - Do not expose Cloudways API keys, OAuth tokens, production account data, server IDs, or raw live responses in logs, fixtures, docs, or test output.
- New endpoint helpers need direct API wrapper specs.
- Token changes need success, failure, parsing, and cache-path specs.
- Connection changes need GET, POST, parsing, failure, and retry-path specs.
- Response validation changes need direct handler specs.
- Security-sensitive changes should include both success and failure coverage.
Update:
README.mdfor public installation, configuration, endpoint, or usage changes.CHANGELOG.mdfor every behavior-impacting change.SECURITY.mdwhen security reporting or credential guidance changes.- AI docs when agent workflows or authority boundaries change.
- Update
lib/ruby_api_pack_cloudways/version.rb. - Move changelog notes from
[Unreleased]into a dated version section. - Run the validation gate described in AGENTS.md.
- Build and publish only when the maintainer explicitly approves.