Skip to content

Commit 397e3de

Browse files
CopilotiMacTia
andauthored
Add comprehensive AI agent guidelines for Claude, Cursor, and GitHub Copilot (#1642)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: iMacTia <[email protected]>
1 parent d98c65c commit 397e3de

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed

.claude/CLAUDE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Claude AI Agent Instructions for Faraday
2+
3+
## About Faraday
4+
Faraday is a Ruby HTTP client library with a middleware-based architecture (similar to Rack). It provides a common interface over various HTTP adapters and uses middleware for request/response processing.
5+
6+
## Primary Directive
7+
**Before making any code changes or suggestions**, you **must** read and follow the comprehensive guidelines in `.ai/guidelines.md`.
8+
9+
## Your Responsibilities
10+
1. **Read** `.ai/guidelines.md` for all Faraday-specific conventions and patterns
11+
2. **Follow** the established conventions documented there
12+
3. **Propose updates** to `.ai/guidelines.md` when you identify:
13+
- New code patterns not yet documented
14+
- Changes to existing conventions
15+
- Inconsistencies between guidelines and actual codebase
16+
17+
## Important Context
18+
- **New middleware and adapters** should be created as separate gems, NOT added to the base Faraday repository (with rare exceptions for widely-used core middleware)
19+
- See [faraday-net_http](https://github.com/lostisland/faraday-net_http) as an example adapter in its own repository
20+
- Focus on Faraday-specific patterns, not generic Ruby/RSpec advice
21+
22+
## Reference Files
23+
- **`.ai/guidelines.md`** - Complete Faraday conventions (PRIMARY REFERENCE)
24+
- `.github/CONTRIBUTING.md` - Contribution process and policies
25+
- `lib/faraday/middleware.rb` - Middleware base class
26+
- `lib/faraday/request/json.rb` - Example middleware implementation
27+
28+
---
29+
30+
**Keep `.ai/guidelines.md` current.** Propose updates when you notice any drift between documentation and reality.

.cursorrules

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Cursor AI Rules for Faraday Repository
2+
3+
## Primary Guidelines Reference
4+
**CRITICAL**: Before making any code changes, read `.ai/guidelines.md` for comprehensive Faraday-specific conventions.
5+
6+
## About Faraday
7+
Faraday is a Ruby HTTP client library with a middleware-based architecture similar to Rack. It provides a common interface over many HTTP adapters and uses middleware for request/response processing.
8+
9+
## Core Responsibilities
10+
1. **Read** `.ai/guidelines.md` for all implementation details, patterns, and conventions
11+
2. **Follow** the Faraday-specific patterns documented in the guidelines
12+
3. **Propose updates** to `.ai/guidelines.md` when conventions change or new patterns emerge
13+
14+
## Important Context
15+
- **New middleware and adapters** belong in separate repositories and gems, NOT in the base Faraday repo
16+
- Only middleware used by the vast majority of projects can be considered for the base repo
17+
- See [faraday-net_http](https://github.com/lostisland/faraday-net_http) for an example adapter in its own repository
18+
- Focus on Faraday-specific patterns, not generic Ruby/RSpec knowledge
19+
- Run tests with `bundle exec rspec` and check style with `bundle exec rubocop`
20+
21+
## Reference Files
22+
- **`.ai/guidelines.md`** - Complete conventions and patterns (READ THIS FIRST)
23+
- `.github/CONTRIBUTING.md` - Contribution process and workflow
24+
- `lib/faraday/middleware.rb` - Middleware base class
25+
- `lib/faraday/request/json.rb` - Example middleware
26+
27+
---
28+
29+
**Self-Maintaining**: Keep `.ai/guidelines.md` aligned with the actual codebase. Propose updates when you detect any divergence.

.github/copilot-instructions.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

Comments
 (0)