

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Rails API Guide78## Core Philosophy910- Design APIs for longevity and stability11- Version from the very beginning12- Keep responses consistent and predictable13- Document thoroughly and accurately14- Build APIs that developers love to use1516## API Design Principles1718- Follow RESTful conventions strictly19- Use standard HTTP methods appropriately20- Return meaningful status codes21- Keep endpoints focused and simple22- Design for future extensibility2324## Versioning Strategy2526- Version APIs from day one27- Use URL path versioning (/api/v1)28- Never break backward compatibility29- Deprecate gracefully with notices30- Document version differences clearly3132## Request Handling3334- Accept JSON by default35- Support content negotiation36- Validate request formats37- Handle malformed requests gracefully38- Provide clear error messages3940## Response Format4142- Use consistent JSON structure43- Include metadata when helpful44- Implement sparse fieldsets45- Support response filtering46- Keep payloads minimal4748## Authentication Methods4950- Use token-based authentication51- Implement OAuth when appropriate52- Support API keys for simple cases53- Never use session cookies for APIs54- Document authentication clearly5556## Authorization Patterns5758- Check permissions for every endpoint59- Use consistent authorization logic60- Return proper 401/403 status codes61- Implement role-based access62- Audit API access patterns6364## Error Handling6566- Return consistent error format67- Include error codes and messages68- Provide debugging information in development69- Log errors appropriately70- Handle exceptions gracefully7172## Status Codes7374- Use standard HTTP status codes correctly75- 200 OK for successful GET/PUT76- 201 Created for successful POST77- 204 No Content for successful DELETE78- 422 Unprocessable Entity for validation errors7980## Pagination8182- Always paginate list endpoints83- Use consistent pagination format84- Include total count and page info85- Support customizable page sizes86- Consider cursor-based pagination8788## Rate Limiting8990- Implement rate limiting from start91- Return rate limit headers92- Use progressive throttling93- Provide higher limits for authenticated users94- Document rate limits clearly9596## Filtering and Sorting9798- Support field filtering99- Implement sort parameters100- Allow multiple sort fields101- Use consistent parameter names102- Document available options103104## Serialization105106- Use Active Model Serializers or similar107- Keep serializers focused108- Support nested resources carefully109- Implement field selection110- Cache serialized responses111112## Documentation113114- Document every endpoint115- Include request/response examples116- Specify required parameters117- List possible error responses118- Keep documentation updated119120## Testing APIs121122- Test all endpoints thoroughly123- Verify authentication and authorization124- Test error scenarios125- Check response formats126- Validate status codes127128## Performance Optimization129130- Implement response caching131- Use ETags for conditional requests132- Support compression133- Optimize database queries134- Monitor response times135136## Webhooks137138- Design webhook payloads carefully139- Include event types140- Implement retry logic141- Sign webhook requests142- Document webhook events143144## CORS Configuration145146- Configure CORS appropriately147- Limit allowed origins148- Specify allowed methods149- Handle preflight requests150- Document CORS policy151152## API Security153154- Always use HTTPS155- Validate all input156- Implement request signing157- Audit API usage158- Monitor for abuse159160## Backward Compatibility161162- Never remove fields163- Add new fields as optional164- Deprecate features gracefully165- Maintain old versions166- Communicate changes clearly167168## API Monitoring169170- Track response times171- Monitor error rates172- Log API usage patterns173- Alert on anomalies174- Review metrics regularly175176## Client Libraries177178- Provide SDKs when possible179- Include code examples180- Test client libraries181- Version SDKs with API182- Support multiple languages183184## GraphQL Considerations185186- Use GraphQL for complex queries187- Implement proper authorization188- Handle N+1 queries189- Rate limit by complexity190- Document schema thoroughly191192## API Gateway Patterns193194- Consider API gateway for microservices195- Implement request routing196- Handle authentication centrally197- Add request/response transformation198- Monitor gateway performance199200## Development Workflow201202- Use API-first design203- Mock endpoints early204- Test with real clients205- Version control API specs206- Review API changes carefully207208## Common Patterns209210- Resource-based URLs211- Nested resources sparingly212- Bulk operations support213- Async processing for long operations214- Webhook notifications215216## Anti-Patterns to Avoid217218- Exposing database structure219- Inconsistent naming220- Breaking changes without versioning221- Poor error messages222- Missing documentation223224## API Standards225226- Follow JSON:API or similar spec227- Use ISO 8601 for dates228- Implement UUID for identifiers229- Support internationalization230- Handle timezones properly231232## Best Practices Summary233234- Version from the start235- Document thoroughly236- Keep responses consistent237- Monitor everything238- Design for developers239240Remember: APIs are forever. Design them carefully, version them properly, and never break backward compatibility.241
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| levifig/rails-instructions.github/instructions/rails-controllers.instructions.md · 54 | Copilot instructions | teststylesecurityapi+1 | 56/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-models.instructions.md · 54 | Copilot instructions | teststylearchtypes+4 | 60/100 | 14 days ago | |
| levifig/rails-instructions.cursor/rules/rails-rules.mdc · 54 | Cursor rules | testlint-formatstylearch+9 | 84/100 | 14 days ago | |
| levifig/rails-instructions.github/copilot-instructions.md · 54 | Copilot instructions | teststyletesting-strategysecurity+4 | 71/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-services.instructions.md · 54 | Copilot instructions | teststylearchtesting-strategy+4 | 75/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-background-jobs.instructions.md · 54 | Copilot instructions | teststyletesting-strategydatabase+2 | 63/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-core.instructions.md · 54 | Copilot instructions | teststylearchtesting-strategy+5 | 68/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-deployment.instructions.md · 54 | Copilot instructions | setupstylesecuritydatabase+2 | 52/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-hotwire.instructions.md · 54 | Copilot instructions | teststylesecurityperformance+1 | 56/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-importmaps.instructions.md · 54 | Copilot instructions | teststylesecuritydatabase+2 | 56/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-mobile.instructions.md · 54 | Copilot instructions | styleuiperformance | 66/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-performance.instructions.md · 54 | Copilot instructions | teststylegitdatabase+2 | 56/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-security.instructions.md · 54 | Copilot instructions | teststylesecuritydependencies+3 | 63/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-styling.instructions.md · 54 | Copilot instructions | styledatabaseuiperformance+3 | 59/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-testing.instructions.md · 54 | Copilot instructions | teststyletesting-strategysecurity+2 | 56/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails-views.instructions.md · 54 | Copilot instructions | teststylearchsecurity+3 | 60/100 | 14 days ago | |
| levifig/rails-instructions.github/instructions/rails.instructions.md · 54 | Copilot instructions | testlint-formatstylearch+9 | 84/100 | 14 days ago | |
| levifig/rails-instructions.cursor/rules/guidelines.mdc · 54 | Cursor rules | teststyletesting-strategysecurity+4 | 71/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/levifig-rails-instructions-github-instructions-rails-api-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.