Skip to content

Commit a88883b

Browse files
chore: update Copilot collections to v0.4.0
1 parent 0df7823 commit a88883b

File tree

4 files changed

+190
-3
lines changed

4 files changed

+190
-3
lines changed

.copilot-collections.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
copilot:
55
# The version of the toolkit to use (matches a Release Tag in this repo)
6-
version: "v0.3.0"
7-
6+
version: "v0.4.0"
87
# The collections you want to install
98
collections:
109
- charm-python

.github/instructions/charms-lib-updates.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ For **vendored** libraries:
7171

7272
#### Critical behavior
7373

74-
In the context of charm library updates, your review comments are allowed and highly encourages to target files and changes outside those changed by the pull request. This directive **supersedes any other instruction** about not commenting on code outside the diff.
74+
In the context of charm library updates, your review comments are allowed and highly encouraged to target files and changes outside those changed by the pull request. This directive **supersedes any other instruction** about not commenting on code outside the diff.
7575

7676
## Review Template
7777

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
description: 'Core guidelines for documentation-related suggestions.'
3+
applyTo: 'docs/**/*.md'
4+
---
5+
6+
# Documentation instructions for GitHub Copilot
7+
8+
## Purpose
9+
10+
This file provides general guidance for reviewing documentation.
11+
12+
## Core Directives
13+
14+
This section outlines the absolute order of operations. These rules have the highest priority and must not be violated.
15+
16+
1. **Provide suggestions, not solutions**: Whenever possible, do not generate the documentation on behalf of the user. Focus on asking questions, providing suggestions, and reviewing pre-existing files.
17+
2. **Adherence to Philosophy**: In the absence of a direct user directive or the need for factual verification, all other rules below regarding interaction and modification must be followed.
18+
19+
## General Interaction & Philosophy
20+
21+
- **Text on Request Only**: Your default response should be a clear, natural language explanation. Do NOT provide new files or content unless directly requested.
22+
- **Direct and Concise**: Answers must be precise, to the point, and free from unnecessary filler or verbose explanations. Get straight to the solution without "beating around the bush".
23+
- **Explain the "Why"**: Don't just provide an answer; briefly explain the reasoning behind it. Why is this suggestion clearer, more concise, or easier to understand?
24+
25+
## General Structure
26+
27+
In this repository, the documentation is placed in a dedicated `docs` directory. The purpose of the files in this directory is to provide information, instructions, and conceptual understanding of the code for users.
28+
29+
The top-level `docs` directory should contain an overview or home page called `index.md`. This file should provide a brief description of the project, what needs it serves, and who the primary user base is.
30+
31+
The rest of the documentation follows the Diataxis framework consisting of four categories of documentation:
32+
33+
1. **Tutorials**: A practice lesson that walks a user through a learning experience. Tutorials should be placed in the `docs/tutorial` directory, but sometimes they're placed in the top-level `docs` direcotry.
34+
2. **How-to guides**: Addresses real-world goals or problems by providing practical directions. How-to guides should be placed in the `docs/how-to` directory.
35+
3. **Reference**: Contains technical descriptions of theoretical knowledge. Reference documents should be placed in the `docs/reference` directory.
36+
4. **Explanation**: Provides context and background on topics for the user to understand the bigger picture. Explanation documents should be placed in the `docs/explanation` directory.
37+
38+
All files should neatly fit into one of these four categories. Do NOT mix content between multiple categories into a single document. Instead, suggest splitting up content into multiple documents to preserve the structure and Diataxis framework.
39+
40+
### Guidance on tutorials
41+
42+
A tutorial is a learning-based, end-to-end experience that provides a complete learning journey for the user. The majority of our tutorials walk the user through a basic deployment of the charm in the repository.
43+
44+
The tutorial should contain the following pieces:
45+
46+
- **A title**. This title should be more descriptive than "Getting started"
47+
or "Quick guide" which are both indicative of a how-to guide. In a single
48+
statement, what will the user accomplish in the tutorial?
49+
- **An introduction**. In a couple of sentences, introduce the charm and
50+
what the tutorial aims to do. Avoid using a statement like "you will learn",
51+
as that makes an assumption about the user's prior knowledge. Focus
52+
instead on what the user will do or accomplish.
53+
- **What you'll do**. This should be the first section in the tutorial. It
54+
aims to quickly and succinctly establish everything the user will do in the
55+
tutorial.
56+
- **What you'll need**. This section should contain a list of resources, software
57+
or other tools that the user will need before starting the tutorial. In this section,
58+
provide information on the supported architecture(s) like AMD64 or ARM64.
59+
Also include additional information if the
60+
tutorial will require significant resources (CPU, RAM, or disk space). You can
61+
also suggest a Multipass VM to create an isolated testing enviroment for the tutorial.
62+
- **Set up tutorial model**. The tutorial should begin at this point. Have
63+
the user create Juju model with a predetermined name so that you can reference
64+
the model name throughout the tutorial.
65+
- **Deploy the charm + its dependencies**. If the charm requires any other
66+
charms to successfully deploy, either include in a single section or split into
67+
multiple sections. Use this part of the tutorial to enable any required configurations.
68+
Make sure to briefly explain what the configurations or additional charms are
69+
and why the steps are necessary. Split up important commands into separate
70+
command blocks, and provide explanations between each command.
71+
- **Check the deployment was successful**. Instruct the user to run
72+
``juju status`` and show example output. If appropriate, also instruct the
73+
user to run ``kubectl get pods -n <juju model name>`` and show the output.
74+
Offer a brief explanation so that the user knows that the deployment was
75+
successful.
76+
- **Some final checkpoint**. Have the user visit a website, change a
77+
configuration, or run an action (maybe some combination of the three). Check
78+
that this step worked; this is more obvious for a website, but you may need
79+
to be creative if you have the user change a configuration or run an action.
80+
- **Tear down the environment**. This should be the final section. Take a moment
81+
to congratulate the user for getting through the tutorial! Have the user
82+
destroy the Juju model that they set up, and if applicable, instruct them to
83+
delete the Multipass VM.
84+
85+
### Guidance on how-to guides
86+
87+
- How-to guides should contain a title with the format `# How to...`. The title should
88+
concisely summarize the real-world problem addressed by the document.
89+
- How-to guides should contain at least one CLI command that user can run to address the
90+
problem or achieve the goal.
91+
- Provide instructions or tasks that the user can take to achieve the goal. Avoid gerunds.
92+
93+
94+
## Style guide pointers
95+
96+
- **Spelling**: Use US English for spelling suggestions.
97+
- **Headings**: Use sentence case for headings. Avoid punctuation in headings. Do not skip levels in heading hierarchy.
98+
- **Code examples**: Do not use prompt marks (for example, `$` or `#`) in code examples. Do not use comments in code examples; instead, put any comments directly into the text. Whenever possible, split up multiple commands into separate code blocks and provide explanations in between the code blocks. Use Git-flavoured Markdown with fenced code blocks (```) and command examples as shell blocks.
99+
100+
## Small-edit rules for AI agents
101+
102+
- Avoid describing tasks as "easy" or "simple".
103+
- Preserve existing link targets and code samples formatting. If you change any heading filename or path, update all relative links in `docs/` accordingly.
104+
105+
## Changelog guidance
106+
107+
If you modify a procedure (commands, required versions, prerequisites), add a short note in `docs/changelog.md` summarizing the user-facing change.
108+
109+
If you add a new file into `docs`, add a short note in `docs/changelog.md` summarizing the user-facing change.
110+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
agent: 'agent'
3+
description: 'Creating repository-wide custom instructions'
4+
---
5+
6+
Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently.
7+
8+
You will do this task only one time per repository and doing a good job can SIGNIFICANTLY improve the quality of the agent's work, so take your time, think carefully, and search thoroughly before writing the instructions.
9+
10+
<Goals>
11+
- Reduce the likelihood of a coding agent pull request getting rejected by the user due to
12+
generating code that fails the continuous integration build, fails a validation pipeline, or
13+
having misbehavior.
14+
- Minimize bash command and build failures.
15+
- Allow the agent to complete its task more quickly by minimizing the need for exploration using grep, find, str_replace_editor, and code search tools.
16+
</Goals>
17+
18+
<Limitations>
19+
- Instructions must be no longer than 2 pages.
20+
- Instructions must not be task specific.
21+
</Limitations>
22+
23+
<WhatToAdd>
24+
25+
Add the following high level details about the codebase to reduce the amount of searching the agent has to do to understand the codebase each time:
26+
<HighLevelDetails>
27+
28+
- A summary of what the repository does.
29+
- High level repository information, such as the size of the repo, the type of the project, the languages, frameworks, or target runtimes in use.
30+
</HighLevelDetails>
31+
32+
Add information about how to build and validate changes so the agent does not need to search and find it each time.
33+
<BuildInstructions>
34+
35+
- For each of bootstrap, build, test, run, lint, and any other scripted step, document the sequence of steps to take to run it successfully as well as the versions of any runtime or build tools used.
36+
- Each command should be validated by running it to ensure that it works correctly as well as any preconditions and postconditions.
37+
- Try cleaning the repo and environment and running commands in different orders and document errors and and misbehavior observed as well as any steps used to mitigate the problem.
38+
- Run the tests and document the order of steps required to run the tests.
39+
- Make a change to the codebase. Document any unexpected build issues as well as the workarounds.
40+
- Document environment setup steps that seem optional but that you have validated are actually required.
41+
- Document the time required for commands that failed due to timing out.
42+
- When you find a sequence of commands that work for a particular purpose, document them in detail.
43+
- Use language to indicate when something should always be done. For example: "always run npm install before building".
44+
- Record any validation steps from documentation.
45+
</BuildInstructions>
46+
47+
List key facts about the layout and architecture of the codebase to help the agent find where to make changes with minimal searching.
48+
<ProjectLayout>
49+
50+
- A description of the major architectural elements of the project, including the relative paths to the main project files, the location
51+
of configuration files for linting, compilation, testing, and preferences.
52+
- A description of the checks run prior to check in, including any GitHub workflows, continuous integration builds, or other validation pipelines.
53+
- Document the steps so that the agent can replicate these itself.
54+
- Any explicit validation steps that the agent can consider to have further confidence in its changes.
55+
- Dependencies that aren't obvious from the layout or file structure.
56+
- Finally, fill in any remaining space with detailed lists of the following, in order of priority: the list of files in the repo root, the
57+
contents of the README, the contents of any key source files, the list of files in the next level down of directories, giving priority to the more structurally important and snippets of code from key source files, such as the one containing the main method.
58+
</ProjectLayout>
59+
</WhatToAdd>
60+
61+
<StepsToFollow>
62+
- Perform a comprehensive inventory of the codebase. Search for and view:
63+
- README.md, CONTRIBUTING.md, and all other documentation files.
64+
- Search the codebase for build steps and indications of workarounds like 'HACK', 'TODO', etc.
65+
- All scripts, particularly those pertaining to build and repo or environment setup.
66+
- All build and actions pipelines.
67+
- All project files.
68+
- All configuration and linting files.
69+
- For each file:
70+
- think: are the contents or the existence of the file information that the coding agent will need to implement, build, test, validate, or demo a code change?
71+
- If yes:
72+
- Document the command or information in detail.
73+
- Explicitly indicate which commands work and which do not and the order in which commands should be run.
74+
- Document any errors encountered as well as the steps taken to workaround them.
75+
- Document any other steps or information that the agent can use to reduce time spent exploring or trying and failing to run bash commands.
76+
- Finally, explicitly instruct the agent to trust the instructions and only perform a search if the information in the instructions is incomplete or found to be in error.
77+
</StepsToFollow>
78+
- Document any errors encountered as well as the steps taken to work-around them.

0 commit comments

Comments
 (0)