openai-ruby
AGENTS.md465 starsChanged 3 months agoApache-2.0View on GitHub
- Use the examples: Conventional Commit prefix for changes whose primary purpose is updating or fixing examples, including their dedicated tests. Apply the same prefix to pull request titles; do not use fix: or fix(examples): for these changes. - Choose Conventional Commit prefixes based on user impact. Reserve fix: for changes that materially change the shipped gem's behavior in a way that impacts users. CI-only, workflow-only, build/test infrastructure, and repository-maintenance changes should use an appropriate non-user-facing prefix such as ci:.…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- improve-openai-rubySkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 5
Use the examples: Conventional Commit prefix for changes whose primary purpose is updating or fixing examples, including their dedicated …
- Very specific: line 24
When regenerating gemfiles/bedrock.gemfile.lock, preserve the x-release-please markers around the local openai version.
- Very specific: line 30
Follow the custom-code guidance.
- Very specific: line 40
Never commit real API keys, access tokens, signing keys, credentials, or customer data.
- Distinctive: line 50
Do not run unreviewed scripts.
- Very specific: line 66
Treat large payloads as a normal API contract, not evidence of malformed or hostile input.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contributor instructions
Commit conventions
- Use the
examples:Conventional Commit prefix for changes whose primary purpose is updating or fixing examples, including their dedicated tests. Apply the same prefix to pull request titles; do not usefix:orfix(examples):for these changes. - Choose Conventional Commit prefixes based on user impact. Reserve
fix:for changes that materially change the shipped gem's behavior in a way that impacts users. CI-only, workflow-only, build/test infrastructure, and repository-maintenance changes should use an appropriate non-user-facing prefix such asci:. For example, a change like PR #572 should be titledci: restore Castiron statuses for fork PRs, notfix(ci): restore Castiron statuses for fork PRs, because it changes CI behavior rather than gem behavior.
Ruby implementation guidelines
- Prefer direct method calls over Ruby reflection (
send,__send__, orpublic_send) for internal SDK plumbing. When an internal method must be callable across components without becoming supported public API, keep the method public for direct dispatch and mark it@api private. Keep its RBI and RBS declarations at the same visibility.
Release maintenance
When regenerating gemfiles/bedrock.gemfile.lock, preserve the
x-release-please markers around the local openai version. Release Please
uses them to update this lockfile; Bundler can remove them when rewriting it.
Custom-code budget
Follow the custom-code guidance. Budget changes
belong in a separate PR containing only .castiron-ratchet.json, with an explicit justification
in the PR description. Increases require a human approving review before merging.
Agents may investigate and draft proposals, but must not approve budget increases
(including through a human's credentials) or bypass the gate. Do not weaken
counting, broaden exclusions, or alter generation metadata to make a change pass.
The checker and effective budget come from main, not the PR. Keep default CODEOWNERS.
Security requirements
- Never commit real API keys, access tokens, signing keys, credentials, or
customer data. Read secrets from environment variables such as
OPENAI_API_KEYand use clearly fake values in examples, tests, and fixtures. - Redact authorization headers, cookies, tokens, signed URLs, customer data, and sensitive request/response bodies, prompts, or uploaded files from logs, errors, snapshots, and CI artifacts. Clearly fake or sanitized payloads may remain in tests and diagnostics.
- Review direct and transitive dependency changes in
Gemfile,Gemfile.lock,docs/Gemfile,docs/Gemfile.lock, andopenai.gemspec, including gem sources, locked Git revisions, native extensions, and install/build scripts. Do not run unreviewed scripts. - Pin GitHub Actions to full commit SHAs and preserve least-privilege job
permissions,
permissions: {}, andpersist-credentials: false. - Protect GitHub App private keys and release credentials. Preserve protected
release environments and RubyGems trusted publishing; grant
id-token: writeonly to the publishing job and never introduce long-lived publishing tokens. - Request
@openai/sdks-teamreview for changes involving authentication, endpoints/transports, redirects, TLS, file uploads/paths, deserialization, logging, webhooks, dependencies, or CI/release behavior. Add focused regression/security tests and follow the generated-code guidance in CONTRIBUTING.md. - Report suspected vulnerabilities privately as described in SECURITY.md, never in public issues or pull requests.
Large-payload compatibility
Treat large payloads as a normal API contract, not evidence of malformed or
hostile input. Responses, Chat Completions, and other APIs can legitimately
return large application/json bodies and SSE streaming events. Do not introduce
arbitrary fixed limits on HTTP bodies, events, or lines as a security or efficiency
fix. Prefer incremental processing, amortized-linear buffering, timely cleanup,
and caller cancellation. Any new
rejection limit needs an explicit, owner-approved API contract and a review of
existing supported payloads and transports.
Protect this behavior with focused, deterministic public-entrypoint tests using large synthetic payloads generated in memory, not committed captures or live image generation. Their high memory use is intentional: do not shrink the payloads or raise client limits to make the tests pass. Keep coverage to the main HTTP JSON and streaming categories, and run large cases sequentially to keep peak memory reasonable. The fixture size is a regression probe, not a new API maximum.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

