Skip to content

Latest commit

 

History

History
135 lines (93 loc) · 3.02 KB

File metadata and controls

135 lines (93 loc) · 3.02 KB

Contributing to Agentry

Thank you for your interest in contributing to Agentry! This document provides guidelines for contributors.

Development Setup

Prerequisites

  • Go 1.21 or higher
  • Git

Getting Started

  1. Fork the repository

  2. Clone your fork:

    git clone https://github.com/yourusername/agentry.git
    cd agentry
  3. Install dependencies:

    go mod download
  4. Install the development version:

    go install ./cmd/agentry
  5. Verify the installation:

    agentry version

Building and Testing

Running Tests

# Run all tests
go test ./...

# Run tests with coverage
go test -cover ./...

# Run specific test files
go test ./tests/

Building Components

# Build all components
make build

# Build specific components
go build ./cmd/agentry
go build ./cmd/agent-hub
go build ./cmd/agent-node

⚠️ Important: Do not run go build in the repository root directory as this creates build artifacts that should not be committed. Use go install for installing binaries or go build ./cmd/... for building specific components.

Code Style

  • Follow standard Go formatting with gofmt
  • Run go vet to check for common issues
  • Use meaningful variable and function names
  • Add comments for exported functions and types

Submitting Changes

  1. Create a feature branch from main
  2. Make your changes
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Commit with a clear message
  6. Push to your fork
  7. Create a pull request

Git Workflow

  • Keep commits atomic and focused
  • Write clear commit messages
  • Rebase feature branches before submitting PRs
  • Use git status to verify you're not committing build artifacts

Common Issues

Build Artifacts in Git

If you accidentally run go build in the root and have agentry or agentry.exe files:

# Remove the artifacts
rm -f agentry agentry.exe

# They should already be in .gitignore, but verify:
git status

Testing New Tools

When adding new built-in tools:

  1. Register the tool in an init() (see existing builtins files)
  2. Add comprehensive tests in tests/
  3. Update documentation in docs/api.md and docs/usage.md
  4. Add examples to configuration files if appropriate

Documentation

  • Update relevant documentation for any user-facing changes
  • Add examples for new features
  • Keep README.md and docs/ in sync

Submitting Plugins to the Registry

The plugin registry lives in docs/registry/plugins.json. To add your plugin:

  1. Append a new JSON object with your plugin's name, description, url and a signature field.
  2. The signature is an Ed25519 signature of the string name|url|sha256 where sha256 is the checksum of your plugin release archive. Encode the signature as hex.
  3. Open a pull request with the updated file. The GitHub Pages site will automatically update on merge.

Questions?

If you have questions about contributing, please open an issue or start a discussion on GitHub.