-
Notifications
You must be signed in to change notification settings - Fork 15
Update copilot instructions #572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,82 +1,53 @@ | ||
| # GitHub Copilot Instructions for simulation-systems | ||
| # GitHub Copilot Instructions: simulation-systems | ||
|
|
||
| Welcome to the `simulation-systems` project! This guide provides best practices | ||
| and instructions for using GitHub Copilot and Copilot Chat effectively within | ||
| this repository. | ||
| You are an expert technical writer and developer for the `simulation-systems` | ||
| project. Follow these directives for all code generation and chat responses. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. I'll add repository context to clarify the purpose. |
||
|
|
||
| ## General Guidelines | ||
| ## Core Directives | ||
|
|
||
| - **Use Copilot for:** | ||
| - Writing and editing documentation (reStructuredText `.rst` files) | ||
| - Generating code snippets or templates for documentation | ||
| - Refactoring or improving documentation structure | ||
| - Answering questions about Sphinx, reStructuredText, and documentation | ||
| workflows | ||
| - **Do NOT use Copilot for:** | ||
| - Generating legal, licensing, or policy documents without review | ||
| - Adding or modifying files outside the documentation scope unless explicitly | ||
| requested | ||
| - Committing changes directly to `main` without review | ||
| - **Primary Format:** Always use reStructuredText (`.rst`) for documentation. | ||
| Never suggest Markdown unless specifically requested. | ||
| - **Scope Constraint:** Focus changes on the `source/` directory. Do not modify | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I would go something like By the way, are you happy for Copilot to modofy .rst files without confirmation?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you. Your suggestion is clearer. Regarding automatic |
||
| root-level configuration or licensing files without explicit confirmation. | ||
| - **Tone:** Use professional, technical, and concise language. | ||
|
|
||
| ## Documentation Structure | ||
| ## Documentation Standards | ||
|
|
||
| - All documentation is located in the `source/` directory. | ||
| - Use `.rst` (reStructuredText) format for all documentation files. | ||
| - Custom templates and static assets are in `source/_templates/` and | ||
| `source/_static/`. | ||
| - Follow the style and structure of existing documentation when adding new | ||
| content. | ||
| - **Structure:** All new `.rst` files must include clear section headings using | ||
| Sphinx conventions (e.g., `===` for titles, `---` for sections). | ||
| - **Location Awareness:** | ||
| - Templates: `source/_templates/` | ||
| - Static Assets: `source/_static/` | ||
| - **Technical Elements:** Always include appropriate Sphinx directives for code | ||
| blocks (`.. code-block:: python`), cross-references (`:ref:`), and notes | ||
| (`.. note::`). | ||
|
|
||
| ## Writing and Editing Documentation | ||
| ## Coding & Linting Standards | ||
|
|
||
| - When creating new documentation, use clear section headings and follow the | ||
| Sphinx/reStructuredText conventions. | ||
| - For technical documentation, include code blocks, examples, and | ||
| cross-references where appropriate. | ||
| - Use Copilot Chat to: | ||
| - Generate outlines for new documentation | ||
| - Suggest improvements to existing docs | ||
| - Answer questions about Sphinx directives and configuration | ||
| When generating Python snippets or documentation content, you must ensure | ||
| compliance with: | ||
|
|
||
| ## Code of Conduct and Contribution | ||
| - **Python Style:** Follow [PEP 8 guidelines](https://peps.python.org) and | ||
| ensure compatibility with the [Ruff linter](https://docs.astral.sh). | ||
| - **RST Quality:** Adhere to [doc8 standards](https://github.com) for line | ||
| lengths and formatting. | ||
| - **RST Linting:** Follow rules enforced by `sphinx-lint`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can CoPilot do that? Can it run
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it cant execute the commands. As I understand Copilot uses those instructions as behavioural guidelines to mimic the results of those tools while it generates code or text for you. Please correct me if I am wrong. |
||
| - **Terminology:** Maintain consistency with existing terminology in | ||
| `source/FurtherDetails/code_of_conduct.rst` and the project root. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reference files does not contains any terminology but only the conduct that users should have. Fo you want to refence a document with typical terminology, I would find a better document. You need to test to see if Compilot can follow referenced documentats in the instructutions.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well spotted - that file is about conduct, not terminology. I'll remove this misleading reference. If you have a glossary or terminology guide, I can adapt that instead. |
||
|
|
||
| - Review the `CONTRIBUTING.md` and `source/FurtherDetails/code_of_conduct.rst` | ||
| before making contributions. | ||
| - All contributions should be made via pull requests and reviewed by a project | ||
| maintainer. | ||
| ## Performance Requirements | ||
|
|
||
| ## Copilot Chat Prompts | ||
| - **Refactoring:** When asked to improve documentation, prioritise hierarchical | ||
| structure and clarity of cross-referencing. | ||
| - **Python Snippets:** Always include type hints for any Python code snippets | ||
| provided within documentation blocks. | ||
| - **Validation:** If unsure of a Sphinx directive or configuration setting, | ||
| prioritise the standard [Sphinx Documentation](https://www.sphinx-doc.org) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can Copilot reach an external web-site?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. But it relies on the pre-trained data (static context) in the underlying model. If the website contains information newer than the model's training data, Copilot will be cut-off from the new knowledge. I think the URL (acts as a strong keyword) provision here helps prioritise existing training data? |
||
| syntax. | ||
|
|
||
| - Be specific in your prompts (e.g., "Add a section on running tests in | ||
| `source/Development/testing.rst`"). | ||
| - Request code or documentation examples as needed. | ||
| - Ask for explanations of Sphinx or reStructuredText features if unsure. | ||
| ## Prohibited Actions | ||
|
|
||
| ## Coding Standards | ||
| - Do not generate legal, licensing, or security policy text. | ||
| - Do not suggest direct commits to the `main` branch. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It took me a while to udnerstand that this is about "suggest" in the documentation, instead to the user or to copilot itself. I would change it to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like your rewording; it is much clearer - it's about documentation content, not Copilot's behaviour |
||
| - Do not include sensitive or proprietary data in examples. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is sensitive and proprietary data? What is data? Shouldn't MS make sure that code generated by Copilot can be used by us?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In principle yes. But I don't want to take any chance. Maybe I can be a bit more specific here:
|
||
|
|
||
| - Follow the existing documentation style and formatting. | ||
| - Use consistent terminology and phrasing throughout the documentation. | ||
| - Follow PEP 8 guidelines for any Python code snippets included in the | ||
| documentation. | ||
| - Use `ruff` for linting any Python code snippets. | ||
| - Use `sphinx-lint` for checking reStructuredText documentation quality. | ||
| - Use `doc8` for spell checking and line lengths in documentation files. | ||
| - Ensure proper formatting of reStructuredText files. | ||
|
|
||
| ## Limitations | ||
|
|
||
| - Copilot suggestions are not always correct-review and edit as needed. | ||
| - Do not use Copilot to generate sensitive, proprietary, or confidential | ||
| information. | ||
|
|
||
| ## Getting Help | ||
|
|
||
| - For questions about Copilot usage, ask in Copilot Chat or consult the | ||
| [GitHub Copilot documentation](https://docs.github.com/en/copilot). | ||
| - For project-specific questions, refer to the `README.md` or open an issue. | ||
|
|
||
| --- | ||
|
|
||
| _This file provides guidance for using GitHub Copilot in the | ||
| `simulation-systems` project. Please keep it up to date as project practices | ||
| evolve._ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is missing a litle of context of what the repository is about
This repository contains the working practicesand what is the purpose of the work that Copilot should on this repo.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - this can be simplified.