Skip to content

Commit 56c18ec

Browse files
committed
Add AI agent guidelines specific to Faraday repository
1 parent 3201a42 commit 56c18ec

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.ai/guidelines.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# AI Agent Guidelines for Faraday
2+
3+
## Introduction
4+
AI agents must read these guidelines before any work and suggest updates to keep them current. This document focuses on Faraday-specific conventions to ensure consistency and quality in our projects.
5+
6+
## Middleware Patterns
7+
- **Definition**: Middleware in Faraday acts as a bridge between the request and response, allowing for pre-processing or post-processing of data.
8+
- **Implementation**: Use named functions for middleware logic to enhance readability and testability.
9+
- **Order of Execution**: Ensure middleware is applied in the correct sequence, as defined in the application settings.
10+
11+
## Adapter Implementation
12+
- **Purpose**: Adapters are used to translate data formats or protocols, ensuring compatibility between different systems.
13+
- **Structure**: Implement adapters as classes with clearly defined interfaces. Each adapter should handle one specific type of transformation.
14+
- **Testing**: Write unit tests for each adapter to verify that input and output formats align with expectations.
15+
16+
## Testing Approaches
17+
- **Unit Testing**: Focus on testing individual components in isolation. Use mocking to simulate external dependencies.
18+
- **Integration Testing**: Ensure that different components work together as intended. This includes testing middleware and adapters in conjunction.
19+
- **End-to-End Testing**: Validate the entire workflow from start to finish, ensuring that the AI agent behaves as expected in real-world scenarios.
20+
21+
## Code Organization
22+
- **Directory Structure**: Follow the established directory structure in the existing codebase. Place all middleware in the `middleware` directory and adapters in the `adapters` directory.
23+
- **File Naming**: Use descriptive names for files and classes. For middleware, consider using the format `middlewareName.middleware.js`. For adapters, use `adapterName.adapter.js`.
24+
- **Documentation**: Maintain clear documentation for each component, including purpose, usage, and examples. All public methods should be documented with JSDoc comments to facilitate understanding.
25+
26+
## Conclusion
27+
These guidelines are designed to facilitate the effective and efficient use of AI agents in the Faraday project. Regularly review and update these guidelines to reflect changes in best practices and project evolution.

0 commit comments

Comments
 (0)