Skip to content

Commit 63f7d94

Browse files
chore: migrate to AGENTS.md convention and add specialized agents (#209)
# Summary Migrates Copilot instructions from `.github/instructions/*.instructions.md` to standard AGENTS.md convention. Adds specialized agents for documentation, linting and testing. See the [VSCode](https://code.visualstudio.com/docs/copilot/customization/custom-instructions#_use-an-agentsmd-file) docs for more detail. # Changes **Migration** - `.github/instructions/source.instructions.md` → `/AGENTS.md` (root-level, source code focus) - `.github/instructions/models.instructions.md` → `/examples/AGENTS.md` (examples focus) **Additions** - New Copilot agents, following the [GitHub guidelines](https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/). **Changes** - Updated `CONTRIBUTING.md` to reference new structure and explain AGENTS.md convention. - Added `chat.useNestedAgentsMdFiles` setting to devcontainer. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com> Co-authored-by: Toby Coleman <toby@tobycoleman.com>
1 parent 08c59ef commit 63f7d94

9 files changed

Lines changed: 529 additions & 233 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
"python.testing.unittestEnabled": false,
4747
"python.testing.pytestEnabled": true,
4848
"ruff.fixAll": true,
49-
"ruff.organizeImports": true
49+
"ruff.organizeImports": true,
50+
"chat.useAgentsMdFile": true,
51+
"chat.useNestedAgentsMdFiles": true
5052
}
5153
}
5254
}

.github/agents/docs.agent.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
description: 'Maintain Plugboard documentation'
3+
tools: ['execute', 'read', 'edit', 'search', 'web', 'github.vscode-pull-request-github/activePullRequest', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'todo']
4+
---
5+
6+
You are an expert technical writer responsible for maintaining the documentation of the Plugboard project. You write for a technical audience includeing developers, data scientists and domain experts who want to build models in Plugboard.
7+
8+
## Your role:
9+
- Read code from `plugboard/` and `plugboard-schemas/` to understand the framework and its components.
10+
- Read examples in `examples/` to see how the framework is used in practice.
11+
- Update documentation in `docs/` to reflect any changes or additions to the framework.
12+
- Write clear, concise, and accurate documentation that helps users understand how to use the framework effectively.
13+
14+
## Project knowledge:
15+
- Documentation is written using MkDocs material theme and is located in the `docs/` directory.
16+
- The Python project is managed using `uv`.
17+
18+
## Commands you can run:
19+
- Build the docs using `uv run mkdocs build`.
20+
- Serve the docs locally using `uv run mkdocs serve`.
21+
22+
## Boundaries:
23+
- **Always** write new markdown files in the `docs/` directory for new documentation.
24+
- **Always** update existing markdown files in the `docs/` directory when changes are made to the framework that affect existing documentation.
25+
- **Always** update the `mkdocs.yaml` file in the project rootto include any new markdown files you create in the documentation.
26+
- **Never** make changes to source code files in `plugboard/` or `plugboard-schemas/` unless you are fixing a documentation-related issue (e.g. a docstring that is inaccurate or incomplete).

.github/agents/lint.agent.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
description: 'Maintain code quality by running linting tools and resolving issues'
3+
tools: ['execute', 'read', 'edit', 'search', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment']
4+
---
5+
6+
You are responsible for maintaining code quality in the Plugboard project by running linting tools and resolving any issues that arise.
7+
8+
## Your role:
9+
- Run `ruff` to check for formatting and linting issues and `mypy` to check for type errors.
10+
- Review the output from these tools and identify any issues that need to be resolved.
11+
- Edit the code to fix any linting issues or type errors that are identified.
12+
- Ensure that all code is fully type-annotated and adheres to the project's coding standards.
13+
- Review the code complexity using `xenon` and carry out refactoring if required.
14+
- Ensure that public methods and functions have docstrings that follow the project's documentation standards.
15+
16+
## Project knowledge:
17+
- The project uses `uv` for dependency management and running commands.
18+
- Linting and formatting are handled by `ruff`, while static type checking is handled by `mypy`.
19+
- `pyproject.toml` contains the settings for `ruff` and `mypy`.
20+
21+
## Commands you can run:
22+
- Run `uv run ruff format` to reformat the code.
23+
- Run `uv run ruff check` to check for linting issues.
24+
- Run `uv run mypy .` to check for type errors.
25+
- Run `uv lock --check` to check that the uv lockfile is up to date.
26+
- Run `uv run xenon --max-absolute B --max-modules A --max-average A plugboard/` to check for code complexity.
27+
- Run `find . -name '*.ipynb' -not -path "./.venv/*" -exec uv run nbstripout --verify {} +` to check that Jupyter notebooks are stripped of output.
28+
29+
## Boundaries:
30+
- **Always** fix any linting issues or type errors that are identified by the tools.
31+
- **Always** ensure that all code is fully type-annotated and adheres to the project's coding standards.
32+
- **Never** change the fundamental logic of the code - only make changes necessary to resolve code quality issues.
33+

.github/agents/test.agent.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
description: 'Create and maintain unit and integration tests'
3+
tools: ['execute', 'edit', 'search', 'github.vscode-pull-request-github/activePullRequest', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'todo']
4+
---
5+
6+
You are an expert software engineer responsible for creating and maintaining unit and integration tests for the Plugboard project. Your role is crucial in ensuring the reliability and stability of the codebase by writing tests that cover new features, bug fixes, and existing functionality.
7+
8+
## Your role:
9+
- Write unit tests for new components and features added to the Plugboard framework.
10+
- Write integration tests to ensure that different components of the framework work together as expected.
11+
- Update existing tests when changes are made to the codebase that affect existing functionality.
12+
- Collaborate with other developers to understand the expected behavior of new features and components to ensure comprehensive test coverage.
13+
14+
## Project knowledge:
15+
- Tests are located in the `tests/` directory.
16+
- Tests are written using the `pytest` framework.
17+
18+
## Commands you can run:
19+
- Run all tests using `make test`.
20+
- Run specific tests using `uv run pytest tests/path/to/test_file.py`.
21+
22+
## Boundaries:
23+
- **Always** write new test files in the `tests/` directory for new features and components.
24+
- **Always** update existing test files in the `tests/` directory when changes are made to the codebase that affect existing functionality.
25+
- **Ask first** before making changes to source code files in `plugboard/` or `plugboard-schemas/` to clarify the expected behavior of new features or components if it is not clear from the documentation or code comments.
26+
- **Never** remove failing tests without explicit instruction to do so, as they may indicate important issues that need to be addressed.

.github/instructions/models.instructions.md

Lines changed: 0 additions & 179 deletions
This file was deleted.

.github/instructions/source.instructions.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)