Skip to content

Commit c0b38f0

Browse files
authored
refactor(docs): Refactor GEMINI.md file (#855)
# Changes - add AGENTS.md file - add docs/ai/coding_conventions.md file - add docs/mandatory_checks.md file - refactor GEMINI.md - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [x] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [x] Appropriate docs were updated (if necessary)
1 parent 6ba923b commit c0b38f0

4 files changed

Lines changed: 73 additions & 18 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Always check @./GEMINI.md for the full instruction list.
2+
3+
This file exists for compatibility with tools that look for AGENTS.md.

GEMINI.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
**A2A specification:** https://a2a-protocol.org/latest/specification/
1+
# Agent Command Center
22

3-
## Project frameworks
4-
- uv as package manager
3+
## 1. Project Overview & Purpose
4+
**Primary Goal**: This is the Python SDK for the Agent2Agent (A2A) Protocol. It allows developers to build and run agentic applications as A2A-compliant servers. It handles complex messaging, task management, and communication across different transports (REST, gRPC, JSON-RPC).
5+
**Specification**: [A2A-Protocol](https://a2a-protocol.org/latest/specification/)
56

6-
## Code style and mandatory checks
7-
1. Whenever writing python code, write types as well.
8-
2. After making the changes run ruff to check and fix the formatting issues
9-
```
10-
uv run ruff check --fix
11-
uv run ruff format
12-
```
13-
3. Run mypy type checkers to check for type errors
14-
```
15-
uv run mypy src
16-
```
17-
4. Run the unit tests to make sure that none of the unit tests are broken.
18-
```
19-
uv run pytest
20-
```
7+
## 2. Technology Stack & Architecture
8+
9+
- **Language**: Python 3.10+
10+
- **Package Manager**: `uv`
11+
- **Lead Transports**: FastAPI (REST/JSON-RPC), gRPC
12+
- **Data Layer**: SQLAlchemy (SQL), Pydantic (Logic/Legacy), Protobuf (Modern Messaging)
13+
- **Key Directories**:
14+
- `/src`: Core implementation logic.
15+
- `/tests`: Comprehensive test suite.
16+
- `/docs`: AI guides.
17+
18+
## 3. Style Guidelines & Mandatory Checks
19+
- **Style Guidelines**: Follow the rules in @./docs/ai/coding_conventions.md for every response involving code.
20+
- **Mandatory Checks**: Run the commands in @./docs/ai/mandatory_checks.md after making any changes to the code and before committing.
21+
22+
## 4. Mandatory AI Workflow for Coding Tasks
23+
1. **Required Reading**: You MUST read the contents of @./docs/ai/coding_conventions.md and @./docs/ai/mandatory_checks.md at the very beginning of EVERY coding task.
24+
2. **Initial Checklist**: Every `task.md` you create MUST include a section for **Mandatory Checks** from @./docs/ai/mandatory_checks.md.
25+
3. **Verification Requirement**: You MUST run all mandatory checks before declaring any task finished.

docs/ai/coding_conventions.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
### Coding Conventions & Style Guide
2+
3+
Non-negotiable rules for code quality and style.
4+
5+
1. **Python Types**: All Python code MUST include type hints. All function definitions MUST include return types.
6+
2. **Type Safety**: All code MUST pass `mypy` and `pyright` checks.
7+
3. **Formatting & Linting**: All code MUST be formatted with `ruff`.
8+
9+
#### Examples:
10+
11+
**Correct Typing:**
12+
```python
13+
async def get_task_status(task: Task) -> TaskStatus:
14+
return task.status
15+
```
16+
17+
**Incorrect (Do NOT do this):**
18+
```python
19+
async def get_task_status(task): # Missing type hints for argument and return value
20+
return task.status
21+
```

docs/ai/mandatory_checks.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
### Test and Fix Commands
2+
3+
Exact shell commands required to test the project and fix formatting issues.
4+
5+
1. **Formatting & Linting**:
6+
```bash
7+
uv run ruff check --fix
8+
uv run ruff format
9+
```
10+
11+
2. **Type Checking**:
12+
```bash
13+
uv run mypy src
14+
uv run pyright src
15+
```
16+
17+
3. **Testing**:
18+
```bash
19+
uv run pytest
20+
```
21+
22+
4. **Coverage**:
23+
Only run this command after adding new source code and before committing.
24+
```bash
25+
uv run pytest --cov=src --cov-report=term-missing
26+
```

0 commit comments

Comments
 (0)