Skip to content

Commit dce880c

Browse files
authored
Merge pull request #388 from xylar/add-ai-instructions
add AI agent instructions
2 parents dfed4b4 + ee12317 commit dce880c

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

.github/copilot-instructions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Polaris Copilot Instructions
2+
3+
Follow the repository's automated style configuration in
4+
`pyproject.toml` and `.pre-commit-config.yaml`.
5+
6+
- Keep changes consistent with existing Polaris patterns.
7+
- For Python, follow the path-specific instructions in
8+
`.github/instructions/python.instructions.md`.
9+
- Prefer changes that pass the configured pre-commit hooks without
10+
adding ignores or suppressions.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
applyTo: "**/*.py"
3+
---
4+
5+
# Python Instructions
6+
7+
- Keep lines at 79 characters or fewer whenever possible.
8+
- Adhere to `ruff format` formatting.
9+
- Keep imports at module scope whenever possible. Avoid local imports
10+
unless they are needed for circular-import avoidance, lazy loading, or
11+
optional dependencies.
12+
- Avoid nested functions whenever possible.
13+
- Prefer public functions before private helper functions whenever
14+
practical.
15+
- Prefer private module-level helper functions over nested helpers.

AGENTS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Polaris Agent Instructions
2+
3+
These instructions apply to the whole repository unless a deeper
4+
`AGENTS.md` overrides them.
5+
6+
## Source of truth
7+
8+
- Follow the repo's automated style and lint configuration in
9+
`pyproject.toml` and `.pre-commit-config.yaml`.
10+
- If an instruction here conflicts with automated tooling, follow the
11+
automated tooling.
12+
13+
## Python style
14+
15+
- Keep Python lines at 79 characters or fewer whenever possible.
16+
- Use `ruff format` style. Do not preserve manual formatting that Ruff
17+
would rewrite.
18+
- Keep imports at module scope whenever possible. Avoid local imports
19+
unless they are needed to prevent circular imports, defer expensive
20+
dependencies, or avoid optional dependency failures.
21+
- Avoid nested functions whenever possible. Prefer private module-level
22+
helpers instead.
23+
- Put public functions before private helper functions whenever
24+
practical.
25+
- Name private helper functions with a leading underscore when that fits
26+
existing repo conventions.
27+
28+
29+
## Validation
30+
31+
- Run relevant pre-commit hooks on changed files before finishing when
32+
practical.
33+
- Prefer fixing lint and formatting issues rather than suppressing them.

0 commit comments

Comments
 (0)