diff --git a/README.md b/README.md index 733986eda..53764363c 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,20 @@ nox -s docs nox -s serve_docs ``` +### Documentation Index + +| Resource | Description | Link | +|----------|-------------|------| +| Getting Started | Step-by-step setup and first plan | [docs/guides/getting-started.md](docs/guides/getting-started.md) | +| CLI Reference | All `agents` commands and flags | [docs/api/cli-reference.md](docs/api/cli-reference.md) | +| Python API | Application layer API reference | [docs/api/python-api.md](docs/api/python-api.md) | +| Architecture Overview | Six-layer architecture and design | [docs/architecture/overview.md](docs/architecture/overview.md) | +| ADR Index | Architecture Decision Records | [docs/adr/index.md](docs/adr/index.md) | +| Release Notes | Version history and release notes | [docs/release-notes/index.md](docs/release-notes/index.md) | +| Observability | LangSmith, logging, metrics | [docs/observability.md](docs/observability.md) | +| Contributing | Contributor guide | [docs/development/contributor-guide.md](docs/development/contributor-guide.md) | +| Quality Automation | Nox, pre-commit, CI | [docs/development/quality-automation.md](docs/development/quality-automation.md) | + ## Tests Behave feature scenarios live under `features/` and Robot suites under `robot/`. Use the Nox sessions above to execute them in parity with the implementation plan. diff --git a/docs/development/contributor-guide.md b/docs/development/contributor-guide.md new file mode 100644 index 000000000..cf0ae8449 --- /dev/null +++ b/docs/development/contributor-guide.md @@ -0,0 +1,617 @@ +# Contributor Guide + +This guide walks you through the practical day-to-day workflow for contributing to +CleverAgents Core. It complements [CONTRIBUTING.md](../../CONTRIBUTING.md) (which defines +the rules and standards) by focusing on the *how* — concrete commands, conventions, and +checklists you need to get from idea to merged PR. + +> **New here?** Start with [CONTRIBUTING.md](../../CONTRIBUTING.md) to understand the +> project's philosophy, then return here for the step-by-step workflow. + +--- + +## Table of Contents + +1. [Prerequisites and Environment Setup](#prerequisites-and-environment-setup) +2. [Fork and Clone Workflow](#fork-and-clone-workflow) +3. [Branch Naming Conventions](#branch-naming-conventions) +4. [Commit Message Format](#commit-message-format) +5. [Pre-commit Hooks](#pre-commit-hooks) +6. [Running the Test Suite](#running-the-test-suite) +7. [Writing New Tests](#writing-new-tests) +8. [Code Style](#code-style) +9. [Type Checking](#type-checking) +10. [ADR Process](#adr-process) +11. [PR Submission Checklist](#pr-submission-checklist) +12. [Review Process](#review-process) +13. [Further Reading](#further-reading) + +--- + +## Prerequisites and Environment Setup + +### System Requirements + +| Tool | Minimum Version | Notes | +|------|----------------|-------| +| Python | 3.13 | Required; the CI pipeline targets 3.13 | +| Git | 2.40+ | For `git add -p` interactive staging support | +| Node.js | 18+ | Only needed for Commitizen (`npm install -g`) | +| Docker | 24+ | Optional; needed for integration tests and Helm | + +### Initial Setup + +```bash +# 1. Clone your fork (see Fork and Clone Workflow below) +git clone https://git.cleverthis.com//cleveragents-core.git +cd cleveragents-core + +# 2. Create and activate a virtual environment +python -m venv .venv +source .venv/bin/activate # Linux / macOS +# .venv\Scripts\activate # Windows + +# 3. Install all development dependencies +pip install -e ".[dev,tests,docs,tui]" + +# 4. Run the setup script — installs pre-commit hooks and verifies tooling +bash scripts/setup-dev.sh + +# 5. Verify the CLI works +agents --help +agents --version + +# 6. (Optional) Install Commitizen for interactive commit messages +npm install -g commitizen@2.8.6 cz-customizable@4.0.0 +``` + +### Environment Variables + +For local development you do not need a real LLM API key. The test suite uses a mock +provider automatically: + +```bash +export CLEVERAGENTS_TESTING_USE_MOCK_AI=true +``` + +For LangSmith tracing (optional): + +```bash +export CLEVERAGENTS_LANGSMITH_ENABLED=true +export CLEVERAGENTS_LANGSMITH_PROJECT=my-dev-project +export CLEVERAGENTS_LANGSMITH_API_KEY= +``` + +--- + +## Fork and Clone Workflow + +CleverAgents uses a **fork-and-branch** model. All contributions come through a personal +fork, never by pushing directly to the upstream repository. + +```bash +# 1. Fork the repository on Forgejo (click "Fork" in the UI) + +# 2. Clone your fork +git clone https://git.cleverthis.com//cleveragents-core.git +cd cleveragents-core + +# 3. Add the upstream remote so you can pull in future changes +git remote add upstream https://git.cleverthis.com/cleveragents/cleveragents-core.git + +# 4. Verify remotes +git remote -v +# origin https://git.cleverthis.com//cleveragents-core.git (fetch) +# upstream https://git.cleverthis.com/cleveragents/cleveragents-core.git (fetch) + +# 5. Keep your fork up to date before starting new work +git fetch upstream +git checkout master +git merge upstream/master +git push origin master +``` + +--- + +## Branch Naming Conventions + +All feature branches must be created from `master` and follow this naming pattern: + +``` +/ +``` + +Where `` matches the Conventional Changelog type of the primary change: + +| Type | When to use | +|------|-------------| +| `feat` | New feature or capability | +| `fix` | Bug fix | +| `docs` | Documentation only | +| `refactor` | Code restructuring without behavior change | +| `test` | Adding or updating tests | +| `chore` | Build scripts, tooling, CI changes | +| `perf` | Performance improvement | +| `style` | Formatting, whitespace (no logic change) | + +**Examples:** + +```bash +git checkout -b feat/session-export-markdown +git checkout -b fix/tui-persona-switch-crash +git checkout -b docs/contributor-guide +git checkout -b refactor/actor-registry-cleanup +``` + +**Rules:** +- Use lowercase and hyphens only — no underscores, no spaces. +- Keep descriptions short (3–5 words). +- One logical change per branch. If you are fixing two separate bugs, use two branches. +- Never commit directly to `master`. + +--- + +## Commit Message Format + +All commits must follow the +[Conventional Changelog standard](https://github.com/conventional-changelog/conventional-changelog-eslint/blob/master/convention.md). +This format drives automated changelog generation and makes history searchable. + +### Structure + +``` +(): + + + +