|
| 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 | + |
0 commit comments