Add AGENTS.md and GitHub Copilot instructions#276
Conversation
Introduce structured AI agent instructions following Intel's AGENTS spec v4: - AGENTS.md: project context (archetype, structure, source-of-truth) - .github/copilot-instructions.md: agent behavior policy Key guidance: - Preserve NumPy/SciPy FFT API compatibility - C templates: edit only .c.src files - Cython: release GIL for MKL calls - Local dev: conda env + pip install -e . - Pre-commit hooks required Token budget: 205 words (AGENTS.md) + copilot-instructions Reviewed by: architect + pragmatist agents
There was a problem hiding this comment.
Pull request overview
This PR adds structured AI agent instructions following Intel's AGENTS spec v4 to standardize how AI coding assistants (GitHub Copilot, Claude, etc.) understand and interact with the mkl_fft repository. The documentation provides project context, source-of-truth mappings, and behavioral policies to reduce AI hallucinations and enforce Intel engineering standards.
Changes:
- Added
AGENTS.mdwith project archetype, structure, development workflow, and source-of-truth file mappings - Added
.github/copilot-instructions.mdwith AI agent identity, precedence hierarchy, contribution expectations, and Intel-specific constraints - Established guidelines for C template editing, API compatibility, testing requirements, and build/style conventions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AGENTS.md | Root-level project context file defining mkl_fft's structure, development practices, and source-of-truth locations per Intel's AGENTS spec v4 |
| .github/copilot-instructions.md | AI agent behavior policy establishing precedence rules, contribution expectations, authoring rules, and Intel-specific constraints for automated coding assistants |
Comments suppressed due to low confidence (1)
.github/copilot-instructions.md:33
- For consistency with source-of-truth file references elsewhere in this document (lines 39-44), the path should be
mkl_fft/src/*.c.srcinstead ofsrc/*.c.src. This makes the path unambiguous from the repository root.
- **C templates:** Edit only `src/*.c.src`; do not manually edit generated `.c` files.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Use stable entry points: `pip install -e .` (dev), `pytest mkl_fft/tests` (test). | ||
| - Never include sensitive data in any file. | ||
| - **C templates:** Edit only `src/*.c.src`; do not manually edit generated `.c` files. | ||
| - **Cython/MKL calls:** Release GIL with `with nogil:` blocks for performance-critical MKL functions. |
There was a problem hiding this comment.
The instruction to release GIL with with nogil: blocks is not reflected in the current codebase, which does not use nogil blocks. Since MKL internally manages threading, verify whether this guidance is appropriate. If this is intended as prescriptive guidance for future contributions, consider clarifying that context or verifying with domain experts that GIL release is beneficial for MKL FFT operations.
| - **Cython/MKL calls:** Release GIL with `with nogil:` blocks for performance-critical MKL functions. | |
| - **Cython/MKL calls:** For new or refactored performance-critical MKL calls, consider releasing the GIL with `with nogil:` around long-running sections, but only after verifying (with benchmarks or domain experts) that this is safe and beneficial given MKL's internal threading. |
What
Add structured AI agent instructions following Intel's AGENTS spec v4:
AGENTS.md— project context for agents (archetype, structure, source-of-truth mapping).github/copilot-instructions.md— agent behavior policy (precedence, contribution expectations, Intel-specific constraints)Why
Standardizes how AI coding assistants (GitHub Copilot, Claude, etc.) understand and work with this repo, reducing hallucinations and enforcing Intel engineering standards automatically.
Key guidance added
.c.srctemplates; generated.cfiles are ephemeralwith nogil:) for performance-critical MKL callssetup.pypre-commit run --all-filesbefore proposing changesconda create -n dev python numpy cython mkl-devel pytest && pip install -e .Token budget
AGENTS.md: 205 words (limit 220)Checklist