Contributing to Agent Rules Kit
May 29, 2025 · View on GitHub
Thank you for considering contributing to our project! This document outlines the process for contributing and the standards we follow.
Code of Conduct
Please read our Code of Conduct before participating in our project.
How to Contribute
- Fork the repository
- Clone your fork
git clone https://github.com/your-username/agent-rules-kit.git cd agent-rules-kit - Create a new branch
git checkout -b feature/your-feature-name - Make your changes
- Test your changes
pnpm run test - Commit your changes
Follow our commit conventions as documented in our README.md
git commit -m "✨ feat: add new feature" - Push to your fork
git push origin feature/your-feature-name - Submit a pull request
Development Standards
Code Style
- Use ESLint and Prettier for JavaScript/TypeScript code
- Follow the style guidelines established in the codebase
- Run
pnpm run lintbefore committing
Testing
- All new features should include tests
- All tests should pass before submitting a PR
- Run
pnpm run testto execute the test suite
Documentation
- Update documentation for any changed functionality
- Add JSDoc comments for new functions and classes
- Keep the README and other docs up to date
- Follow the Documentation Guide for creating or updating rule documentation
Language Policy
- All code, comments, documentation, and files must be written in English, even if communicating with the agent in another language
- Variable names, function names, and identifiers should be in English
- Documentation must follow English naming conventions and grammar
Architecture and Development Guides
Before making changes, please familiarize yourself with our architecture and development guides:
- Services Architecture: Understand the service-oriented architecture of the project
- Extending Services: Guide for adding new stacks or features
- Rule Organization: How rules are organized and structured
- Performance Guide: Performance optimization recommendations
- CLI Documentation: Details about the CLI implementation
- MCP Tools Integration Guide: Comprehensive guide for MCP tools development and usage
Service Development
When developing new services or features:
- Follow the existing patterns in similar services
- Use asynchronous operations for file handling and other I/O
- Implement batch processing for better memory management
- Create appropriate tests for all new functionality
- Document service methods with JSDoc comments
Rule Development
When creating new rules:
- Follow the structure outlined in the Documentation Guide
- Place rules in the appropriate directories based on their scope and application
- Update
kit-config.jsonto register new rules - Test the rules with the CLI to ensure proper generation
MCP Tools Development
Agent Rules Kit v2.0+ includes comprehensive support for Model Context Protocol (MCP) tools. When contributing MCP tools:
Adding New MCP Tools
-
Create template directory structure:
templates/mcp-tools/your-tool/ ├── tool-usage.md # Usage rules and guidelines ├── best-practices.md # Best practices specific to the tool └── examples.md # Common usage examples -
Register the tool in kit-config.json:
"mcp_tools": { "your-tool": { "name": "Your Tool - Description", "description": "Detailed description of what the tool does" } } -
Follow MCP documentation standards:
- Include available tool functions
- Provide usage examples
- Document security considerations
- Add common workflow patterns
MCP Tool Documentation Guidelines
Each MCP tool should include:
- Basic Instructions: How to initialize and use the tool
- Available Functions: Complete list of tool functions with parameters
- Security Guidelines: Access controls and safety considerations
- Common Patterns: Typical workflows and usage examples
- Error Handling: How to handle common error scenarios
Testing MCP Tools
Test your MCP tool rules using the CLI:
# Test MCP tools generation
pnpm run start
# Select "Yes" for MCP tools
# Choose your tool from the list
# Verify generated rules in .cursor/rules/rules-kit/mcp-tools/
MCP Service Development
When extending the McpService class:
- Add new methods following the existing patterns
- Implement proper error handling with meaningful messages
- Use batch processing for better performance
- Add comprehensive tests in
tests/cli/services/mcp-service.test.js
Pull Request Process
- Ensure your code adheres to the styling guidelines
- Update documentation as necessary
- Include tests for your changes
- Make sure all tests pass
- The PR will be reviewed by maintainers
- Once approved, a maintainer will merge your PR
Questions?
If you have any questions, feel free to open an issue or contact the maintainers.
Thank you for contributing!