|
| 1 | +# GitHub Copilot Instructions for Faraday |
| 2 | + |
| 3 | +## Essential Reading |
| 4 | +**Before making any code suggestions**, consult `.ai/guidelines.md` for comprehensive Faraday-specific conventions and patterns. |
| 5 | + |
| 6 | +## About This Repository |
| 7 | +Faraday is a Ruby HTTP client library that provides: |
| 8 | +- A middleware-based architecture (similar to Rack) |
| 9 | +- A common interface over various HTTP adapters (Net::HTTP, HTTPClient, etc.) |
| 10 | +- Extensible request/response processing pipeline |
| 11 | + |
| 12 | +## Your Responsibilities |
| 13 | +As GitHub Copilot working on Faraday, you must: |
| 14 | + |
| 15 | +1. **Read & Follow**: Always reference `.ai/guidelines.md` for all Faraday conventions and implementation details |
| 16 | +2. **Stay Current**: Suggest updates to `.ai/guidelines.md` when you notice: |
| 17 | + - New patterns not yet documented |
| 18 | + - Changes to existing conventions |
| 19 | + - Discrepancies between guidelines and actual code |
| 20 | +3. **Focus on Faraday**: Provide Faraday-specific guidance, not generic Ruby/RSpec tips |
| 21 | + |
| 22 | +## Critical Context |
| 23 | + |
| 24 | +### Middleware and Adapters |
| 25 | +- **New middleware and adapters should be separate gems**, NOT added to the base Faraday repository |
| 26 | +- Only middleware expected to be used by the vast majority of projects can be considered for the base repo |
| 27 | +- See [faraday-net_http](https://github.com/lostisland/faraday-net_http) as an example of an adapter in its own repository |
| 28 | +- Consult `.ai/guidelines.md` for detailed implementation patterns |
| 29 | + |
| 30 | +### Code Quality |
| 31 | +- Follow RuboCop style guide (`.rubocop.yml`) |
| 32 | +- Run tests: `bundle exec rspec` |
| 33 | +- Check style: `bundle exec rubocop` |
| 34 | +- Use inclusive language (see `.github/CONTRIBUTING.md`) |
| 35 | + |
| 36 | +## Self-Maintaining Guidelines |
| 37 | +Keep `.ai/guidelines.md` accurate and current. When you identify code patterns not reflected in guidelines, convention changes, or better practices, propose updates to maintain alignment with the actual codebase. |
| 38 | + |
| 39 | +## Reference Files |
| 40 | +- **`.ai/guidelines.md`** - Complete conventions and patterns (PRIMARY REFERENCE) |
| 41 | +- `.github/CONTRIBUTING.md` - Contribution process and workflow |
| 42 | +- `lib/faraday/middleware.rb` - Middleware base class |
| 43 | +- `lib/faraday/request/json.rb` - Example middleware implementation |
| 44 | +- `.rubocop.yml` - Code style guide |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +**Remember**: The guidelines in `.ai/guidelines.md` are the source of truth for Faraday conventions. Keep them current and refer to them consistently. |
0 commit comments