> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laragent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Development

> Contribute to LarAgent development

# Contributing to LarAgent

We welcome contributions to LarAgent! Whether it's improving documentation, fixing bugs, or adding new features, your help is appreciated. This guide will walk you through the process of setting up your development environment and submitting contributions.

<Warning>
  Need help in contributing? Join our [Discord community](https://discord.gg/NAczq2T9F8), send "@Maintainer 🛠️  onboard me" in any channel and we will help you to get started.
</Warning>

## Development Setup

Follow these steps to set up your local development environment:

1. **Fork the repository** on GitHub

2. **Clone your fork**:
   ```bash theme={null}
   git clone https://github.com/YOUR_USERNAME/LarAgent.git
   cd LarAgent
   ```

3. **Install dependencies**:
   ```bash theme={null}
   composer install
   ```

4. **Create a new branch** for your feature or bugfix:
   ```bash theme={null}
   git checkout -b feature/your-feature-name
   ```

## Coding Guidelines

When contributing to LarAgent, please follow these guidelines to ensure your code meets our standards:

### Code Style

* Use type hints and return types where possible
* Add PHPDoc blocks for classes and methods
* Keep methods focused and concise
* Follow PSR-12 coding standards

LarAgent uses PHP CS Fixer to maintain code style. You can run it with:

```bash theme={null}
composer format
```

### Testing

All new features and bug fixes should include tests. LarAgent uses [PEST](https://pestphp.com/) for testing.

* Add tests for new features
* Ensure all tests pass before submitting:
  ```bash theme={null}
  composer test
  ```
* Maintain or improve code coverage

### Documentation

Good documentation is crucial for any project:

* Add PHPDoc blocks for new classes and methods
* Include examples for new features
* Consider updating the [official documentation](https://github.com/MaestroError/docs) for major changes

### Commit Guidelines

* Use clear, descriptive commit messages
* Reference issues and pull requests in your commits
* Keep commits focused and atomic

## Pull Request Process

Follow these steps to submit your contributions:

1. **Update your fork** with the latest changes from main:
   ```bash theme={null}
   git remote add upstream https://github.com/MaestroError/LarAgent.git
   git fetch upstream
   git rebase upstream/main
   ```

2. **Push your changes** to your fork:
   ```bash theme={null}
   git push origin feature/your-feature-name
   ```

3. **Create a Pull Request** with:
   * Clear title and description
   * List of changes and impact
   * Any breaking changes highlighted
   * Screenshots/examples if relevant

The maintainers aim to review all pull requests within 2 weeks.

## Getting Help

If you need assistance while contributing:

* Open an issue for bugs or feature requests
* Join discussions in existing issues
* Join our [Discord community](https://discord.gg/NAczq2T9F8)
* Reach out to maintainers for guidance

## Security Vulnerabilities

If you discover a security vulnerability, please review [our security policy](https://github.com/MaestroError/LarAgent/security/policy) on how to report it properly.

## Running Tests

You can run the test suite with:

```bash theme={null}
composer test
```

For more specific tests:

```bash theme={null}
# Run a specific test file
./vendor/bin/pest tests/YourTestFile.php

# Run with coverage report
composer test-coverage
```

Thank you for contributing to LarAgent! Your efforts help make the package better for everyone.
