Skip to content

Commit 3acfa82

Browse files
committed
docs: improve AGENTS.md structure
1 parent 038c84e commit 3acfa82

File tree

1 file changed

+60
-66
lines changed

1 file changed

+60
-66
lines changed

AGENTS.md

Lines changed: 60 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,15 @@ This guide helps new contributors get started with the OpenAI Agents Python repo
66

77
## Table of Contents
88

9-
1. [Mandatory Skill Usage](#mandatory-skill-usage)
10-
2. [ExecPlans](#planning-execplans)
11-
3. [Overview](#overview)
12-
4. [Repo Structure & Important Files](#repo-structure--important-files)
13-
5. [Testing & Automated Checks](#testing--automated-checks)
14-
6. [Repo-Specific Utilities](#repo-specific-utilities)
15-
7. [Style, Linting & Type Checking](#style-linting--type-checking)
16-
8. [Development Workflow](#development-workflow)
17-
9. [Pull Request & Commit Guidelines](#pull-request--commit-guidelines)
18-
10. [Review Process & What Reviewers Look For](#review-process--what-reviewers-look-for)
19-
11. [Tips for Navigating the Repo](#tips-for-navigating-the-repo)
20-
12. [Prerequisites](#prerequisites)
21-
22-
## Mandatory Skill Usage
23-
24-
### `$code-change-verification`
9+
1. [Policies & Mandatory Rules](#policies--mandatory-rules)
10+
2. [Project Structure Guide](#project-structure-guide)
11+
3. [Operation Guide](#operation-guide)
12+
13+
## Policies & Mandatory Rules
14+
15+
### Mandatory Skill Usage
16+
17+
#### `$code-change-verification`
2518

2619
Run `$code-change-verification` before marking work complete when changes affect runtime code, tests, or build/test behavior.
2720

@@ -33,21 +26,23 @@ Run it when you change:
3326

3427
You can skip `$code-change-verification` for docs-only or repo-meta changes (for example, `docs/`, `.codex/`, `README.md`, `AGENTS.md`, `.github/`), unless a user explicitly asks to run the full verification stack.
3528

36-
### `$openai-knowledge`
29+
#### `$openai-knowledge`
3730

3831
When working on OpenAI API or OpenAI platform integrations in this repo (Responses API, tools, streaming, Realtime API, auth, models, rate limits, MCP, Agents SDK or ChatGPT Apps SDK), use `$openai-knowledge` to pull authoritative docs via the OpenAI Developer Docs MCP server (and guide setup if it is not configured).
3932

40-
## Planning & ExecPlans
33+
### ExecPlans
4134

4235
Call out potential backward compatibility or public API risks early in your plan and confirm the approach before implementing changes that could impact users.
4336

4437
Use an ExecPlan when work is multi-step, spans several files, involves new features or refactors, or is likely to take more than about an hour. Start with the template and rules in `PLANS.md`, keep milestones and living sections (Progress, Surprises & Discoveries, Decision Log, Outcomes & Retrospective) up to date as you execute, and rewrite the plan if scope shifts. If you intentionally skip an ExecPlan for a complex task, note why in your response so reviewers understand the choice.
4538

46-
## Overview
39+
## Project Structure Guide
40+
41+
### Overview
4742

4843
The OpenAI Agents Python repository provides the Python Agents SDK, examples, and documentation built with MkDocs. Use `uv run python ...` for Python commands to ensure a consistent environment.
4944

50-
## Repo Structure & Important Files
45+
### Repo Structure & Important Files
5146

5247
- `src/agents/`: Core library implementation.
5348
- `tests/`: Test suite; see `tests/README.md` for snapshot guidance.
@@ -60,13 +55,38 @@ The OpenAI Agents Python repository provides the Python Agents SDK, examples, an
6055
- `.github/PULL_REQUEST_TEMPLATE/pull_request_template.md`: Pull request template to use when opening PRs.
6156
- `site/`: Built documentation output.
6257

63-
## Testing & Automated Checks
58+
## Operation Guide
59+
60+
### Prerequisites
61+
62+
- Python 3.9+.
63+
- `uv` installed for dependency management (`uv sync`) and `uv run` for Python commands.
64+
- `make` available to run repository tasks.
65+
66+
### Development Workflow
67+
68+
1. Sync with `main` and create a feature branch:
69+
```bash
70+
git checkout -b feat/<short-description>
71+
```
72+
2. If dependencies changed or you are setting up the repo, run `make sync`.
73+
3. Implement changes and add or update tests alongside code updates.
74+
4. Highlight backward compatibility or API risks in your plan before implementing breaking or user-facing changes.
75+
5. Build docs when you touch documentation:
76+
```bash
77+
make build-docs
78+
```
79+
6. When `$code-change-verification` applies, run it to execute the full verification stack before marking work complete.
80+
7. Commit with concise, imperative messages; keep commits small and focused, then open a pull request.
81+
8. When reporting code changes as complete (after substantial code work), invoke `$pr-draft-summary` to generate the required PR summary block with change summary, PR title, and draft description.
82+
83+
### Testing & Automated Checks
6484

6585
Before submitting changes, ensure relevant checks pass and extend tests when you touch code.
6686

6787
When `$code-change-verification` applies, run it to execute the required verification stack from the repository root. Rerun the full stack after applying fixes.
6888

69-
### Unit tests and type checking
89+
#### Unit tests and type checking
7090

7191
- Run the full test suite:
7292
```bash
@@ -81,7 +101,7 @@ When `$code-change-verification` applies, run it to execute the required verific
81101
make mypy
82102
```
83103

84-
### Snapshot tests
104+
#### Snapshot tests
85105

86106
Some tests rely on inline snapshots; see `tests/README.md` for details. Re-run `make tests` after updating snapshots.
87107

@@ -94,14 +114,21 @@ Some tests rely on inline snapshots; see `tests/README.md` for details. Re-run `
94114
make snapshots-create
95115
```
96116

97-
### Coverage
117+
#### Coverage
98118

99119
- Generate coverage (fails if coverage drops below threshold):
100120
```bash
101121
make coverage
102122
```
103123

104-
### Mandatory local run order
124+
#### Formatting, linting, and type checking
125+
126+
- Formatting and linting use `ruff`; run `make format` (applies fixes) and `make lint` (checks only).
127+
- Type hints must pass `make mypy`.
128+
- Write comments as full sentences ending with a period.
129+
- Imports are managed by Ruff and should stay sorted.
130+
131+
#### Mandatory local run order
105132

106133
When `$code-change-verification` applies, run the full sequence in order (or use the skill scripts):
107134

@@ -112,7 +139,7 @@ make mypy
112139
make tests
113140
```
114141

115-
## Repo-Specific Utilities
142+
### Utilities & Tips
116143

117144
- Install or refresh development dependencies:
118145
```bash
@@ -133,57 +160,24 @@ make tests
133160
make snapshots-fix
134161
make snapshots-create
135162
```
163+
- Use `examples/` to see common SDK usage patterns.
164+
- Review `Makefile` for common commands and use `uv run` for Python invocations.
165+
- Explore `docs/` and `docs/scripts/` to understand the documentation pipeline.
166+
- Consult `tests/README.md` for test and snapshot workflows.
167+
- Check `mkdocs.yml` to understand how docs are organized.
136168

137-
## Style, Linting & Type Checking
138-
139-
- Formatting and linting use `ruff`; run `make format` (applies fixes) and `make lint` (checks only).
140-
- Type hints must pass `make mypy`.
141-
- Write comments as full sentences ending with a period.
142-
- Imports are managed by Ruff and should stay sorted.
143-
144-
## Development Workflow
145-
146-
1. Sync with `main` and create a feature branch:
147-
```bash
148-
git checkout -b feat/<short-description>
149-
```
150-
2. If dependencies changed or you are setting up the repo, run `make sync`.
151-
3. Implement changes and add or update tests alongside code updates.
152-
4. Highlight backward compatibility or API risks in your plan before implementing breaking or user-facing changes.
153-
5. Build docs when you touch documentation:
154-
```bash
155-
make build-docs
156-
```
157-
6. When `$code-change-verification` applies, run it to execute the full verification stack before marking work complete.
158-
7. Commit with concise, imperative messages; keep commits small and focused, then open a pull request.
159-
8. When reporting code changes as complete (after substantial code work), invoke `$pr-draft-summary` to generate the required PR summary block with change summary, PR title, and draft description.
160-
161-
## Pull Request & Commit Guidelines
169+
### Pull Request & Commit Guidelines
162170

163171
- Use the template at `.github/PULL_REQUEST_TEMPLATE/pull_request_template.md`; include a summary, test plan, and issue number if applicable.
164172
- Add tests for new behavior when feasible and update documentation for user-facing changes.
165173
- Run `make format`, `make lint`, `make mypy`, and `make tests` before marking work ready.
166174
- Commit messages should be concise and written in the imperative mood. Small, focused commits are preferred.
167175

168-
## Review Process & What Reviewers Look For
176+
### Review Process & What Reviewers Look For
169177

170178
- ✅ Checks pass (`make format`, `make lint`, `make mypy`, `make tests`).
171179
- ✅ Tests cover new behavior and edge cases.
172180
- ✅ Code is readable, maintainable, and consistent with existing style.
173181
- ✅ Public APIs and user-facing behavior changes are documented.
174182
- ✅ Examples are updated if behavior changes.
175183
- ✅ History is clean with a clear PR description.
176-
177-
## Tips for Navigating the Repo
178-
179-
- Use `examples/` to see common SDK usage patterns.
180-
- Review `Makefile` for common commands and use `uv run` for Python invocations.
181-
- Explore `docs/` and `docs/scripts/` to understand the documentation pipeline.
182-
- Consult `tests/README.md` for test and snapshot workflows.
183-
- Check `mkdocs.yml` to understand how docs are organized.
184-
185-
## Prerequisites
186-
187-
- Python 3.9+.
188-
- `uv` installed for dependency management (`uv sync`) and `uv run` for Python commands.
189-
- `make` available to run repository tasks.

0 commit comments

Comments
 (0)