-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
AGI Corp edited this page Mar 8, 2026
·
1 revision
Thank you for your interest in contributing to Web4AGI! This document outlines the process for contributing code, documentation, and ideas to the project.
- Code - Implement features, fix bugs, improve performance
- Documentation - Improve Wiki pages, add examples, fix typos
- Testing - Write tests, report bugs, validate fixes
- Design - UI/UX improvements, architecture suggestions
- Research - Investigate new agent models, protocol integrations
# Fork via GitHub UI, then:
git clone https://github.com/YOUR_USERNAME/Web4AGI.git
cd Web4AGI
git remote add upstream https://github.com/AGI-Corporation/Web4AGI.gitSee Development-Guide for complete environment setup.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
npm install# Sync with upstream first
git fetch upstream
git checkout -b feature/your-feature-name upstream/main| Type | Pattern | Example |
|---|---|---|
| Feature | feature/description |
feature/add-agent-memory |
| Bug fix | fix/description |
fix/wallet-balance-error |
| Documentation | docs/description |
docs/update-api-ref |
| Testing | test/description |
test/trading-integration |
| Refactor | refactor/description |
refactor/optimize-mcp |
Follow Conventional Commits:
<type>(<scope>): <short description>
[optional body]
[optional footer(s)]
Types: feat, fix, docs, test, refactor, chore, perf
Examples:
feat(agents): add memory persistence using Redis
fix(trading): resolve escrow deadlock on concurrent trades
docs(wiki): update MCP integration examples
test(contracts): add Hardhat tests for agreement signing
Before opening a PR, ensure:
- Code follows style guidelines (black, flake8, mypy)
- All existing tests pass:
pytest tests/andnpm test - New tests added for new functionality
- Wiki documentation updated if needed
-
.env.exampleupdated if new env vars added - No hardcoded secrets or API keys
- PR description explains the change and links to relevant issue
# Format
black src/ tests/
# Lint
flake8 src/ tests/ --max-line-length 100
# Type check
mypy src/ --ignore-missing-imports
# All at once
make lintKey rules:
- Use type hints everywhere
- Write docstrings for all public functions/classes
- Keep functions focused (< 50 lines)
- Use
async/awaitfor all I/O operations - Prefer dataclasses for data structures
# Lint
npm run lint
# Format
npm run format
# Type check
npx tsc --noEmitKey rules:
- Use TypeScript strict mode
- Prefer
constoverlet - Use React hooks over class components
- Add JSDoc for exported functions
# Compile
npx hardhat compile
# Test
npx hardhat test
# Coverage
npx hardhat coverageKey rules:
- Follow Solidity style guide
- Use OpenZeppelin contracts where possible
- All state-changing functions must emit events
- Add NatSpec comments for all public functions
Every new feature must include:
- Unit tests covering the happy path
- Unit tests covering error/edge cases
- Integration test if the feature touches multiple systems
Every bug fix must include:
- A regression test that reproduces the bug
- The fix that makes the test pass
tests/unit/test_<module_name>.py
tests/integration/test_<feature_name>.py
tests/e2e/test_<user_flow>.py
When filing a bug report, include:
- Environment: OS, Python version, Node.js version
- Description: What happened vs what you expected
- Reproduction steps: Minimal steps to reproduce
- Logs: Relevant error messages or stack traces
-
Configuration: Relevant
.envvariables (no secrets!)
Use the Bug Report template.
Before submitting a feature request:
- Check existing Issues to avoid duplicates
- Consider if the feature fits the project scope
- Think through the implementation approach
Use the Feature Request template.
- Discussions: Use GitHub Discussions for questions and ideas
- Issues: For bugs and feature requests
- Discord: Join at discord.gg/web4agi
By contributing, you agree that your contributions will be licensed under the MIT License.
See Home to return to the main page.