Documentation Index
Fetch the complete documentation index at: https://mintlify.com/garagon/aguara/llms.txt
Use this file to discover all available pages before exploring further.
Welcome
Thanks for your interest in contributing to Aguara! This guide covers the development workflow, from setting up your environment to submitting pull requests.Development Setup
Prerequisites
- Go 1.25+ is required for building and testing
- Git for version control
- A GitHub account for submitting PRs
Getting Started
Project Structure
Understanding the codebase organization:Makefile Targets
Common development commands:| Command | Description |
|---|---|
make build | Build production binary to ./aguara |
make test | Run tests with race detector |
make lint | Run golangci-lint checks |
make fmt | Format code with gofmt |
make vet | Run go vet static analysis |
make clean | Remove binary and artifacts |
Adding Detection Rules
Rule File Structure
Rules are defined in YAML files underinternal/rules/builtin/. Each rule must follow this schema:
Self-Testing
Every rule must includetrue_positive and false_positive examples. The test suite validates these automatically:
Regex Tips
Best practices:- Test your regex at regex101.com using the Go flavor
- For JSON patterns, account for optional quotes:
["']?key["']? - Use case-insensitive matching:
(?i)pattern - Escape special characters:
\.,\$,\(
Reducing False Positives
Useexclude_patterns to suppress matches in safe contexts:
Running Tests
Full Test Suite
Specific Packages
Pull Request Process
Before You Start
- Open an issue first to discuss the change
- Search existing issues to avoid duplicates
- Fork the repository and create a feature branch
Making Changes
-
Create a branch from
main: - Make your changes with clear commit messages
- Write tests for new functionality
-
Run all checks:
-
Update CHANGELOG.md under the
[Unreleased]section
Submitting Your PR
-
Push to your fork:
-
Open a pull request on GitHub with:
- Clear description of what changed
- Why the change is needed
- Link to related issue
- Screenshots for UI changes
- Address review feedback promptly
PR Checklist
Before submitting, ensure:- Tests pass (
make test) - No lint issues (
make lint) - Code is formatted (
make fmt) - CHANGELOG.md updated
- No breaking changes (or clearly documented)
- Examples and documentation updated if needed
Reporting Issues
Different types of issues have different processes:Bug Reports
Use the bug report template:- Description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Aguara version (
aguara version) - Operating system
- Sample files if applicable
Feature Requests
Use the feature request template:- Use case description
- Proposed solution
- Alternative approaches considered
- Examples of how it would work
Security Vulnerabilities
Code Style
- Follow standard Go conventions
- Use
gofmtfor formatting (runmake fmt) - Keep functions focused and testable
- Add comments for exported functions
- Use meaningful variable names
Getting Help
If you need help with your contribution:- Comment on the related issue
- Ask questions in your PR
- Check existing issues for similar problems
- Review the codebase for examples
License
By contributing to Aguara, you agree that your contributions will be licensed under the Apache License 2.0.Recognition
All contributors are recognized in:- GitHub contributors list
- Release notes for significant contributions
- Project documentation for new features
