Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
378 changes: 378 additions & 0 deletions .github/copilot-instructions.md

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions .github/instructions/coding.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
applyTo: "**/*.rb,**/*.yml,**/*.sh,Rakefile"
---

# Coding Instructions

## General code style and readability
- Write code that is readable, understandable, and maintainable for future readers.
- Aim to create software that is not only functional but also readable, maintainable, and efficient throughout its lifecycle.
- Prioritize clarity to make reading, understanding, and modifying code easier.
- Adhere to established coding standards and write well-structured code to reduce errors.
- Regularly review and refactor code to improve structure, readability, and maintainability. Always leave the codebase cleaner than you found it.

## Naming conventions
- Choose names for variables, functions, and classes that reflect their purpose and behavior.
- A name should tell you why it exists, what it does, and how it is used. If a name requires a comment, then the name does not reveal its intent.
- Use specific names that provide a clearer understanding of what the variables represent and how they are used.

## DRY principle
- Follow the DRY (Don't Repeat Yourself) Principle and Avoid Duplicating Code or Logic.
- Avoid writing the same code more than once. Instead, reuse your code using functions, classes, modules, libraries, or other abstractions.
- Modify code in one place if you need to change or update it.

## Function length and responsibility
- Write short functions that only do one thing.
- Follow the single responsibility principle (SRP), which means that a function should have one purpose and perform it effectively.
- If a function becomes too long or complex, consider breaking it into smaller, more manageable functions.

## Comments usage
- Use comments sparingly, and when you do, make them meaningful.
- Don't comment on obvious things. Excessive or unclear comments can clutter the codebase and become outdated.
- Use comments to convey the "why" behind specific actions or explain unusual behavior and potential pitfalls.
- Provide meaningful information about the function's behavior and explain unusual behavior and potential pitfalls.

## Conditional encapsulation
- One way to improve the readability and clarity of functions is to encapsulate nested if/else statements into other functions.
- Encapsulating such logic into a function with a descriptive name clarifies its purpose and simplifies code comprehension.

<!-- the source of this file is https://github.com/solarwinds-sandbox/copilot/blob/main/.github/instructions/coding.instructions.md -->
7 changes: 7 additions & 0 deletions .github/instructions/jira.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
applyTo: "**"
---
Whenever you are provided with Jira issue key in following format "<key>-XXXXX" or "https://swicloud.atlassian.net/browse/<key>-XXXXX", the first thing you should do is to use `jira_` tools (if provided) to read the Jira issue description and if needed related Jira issues, comments or confluence documents, and take its context into account when answering the question.
If you are not provided with `jira_` tools, just mention that you cannot access Jira issues and provide a general answer based on your knowledge.

<!-- the source of this file is https://github.com/solarwinds-sandbox/copilot/blob/main/.github/instructions/jira.instructions.md -->
54 changes: 54 additions & 0 deletions .github/instructions/markdown.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
applyTo: "**/*.md"
description: 'Documentation and content creation standards'
---

## Markdown Content Rules

The following markdown content rules are enforced in the validators:

1. **Headings**: Use appropriate heading levels (H2, H3, etc.) to structure your content. Do not use an H1 heading, as this will be generated based on the title.
2. **Lists**: Use bullet points or numbered lists for lists. Ensure proper indentation and spacing.
3. **Code Blocks**: Use fenced code blocks for code snippets. Specify the language for syntax highlighting.
4. **Links**: Use proper markdown syntax for links. Ensure that links are valid and accessible.
5. **Images**: Use proper markdown syntax for images. Include alt text for accessibility.
6. **Tables**: Use markdown tables for tabular data. Ensure proper formatting and alignment.
7. **Line Length**: Limit line length to 400 characters for readability.
8. **Whitespace**: Use appropriate whitespace to separate sections and improve readability.
9. **Front Matter**: Include YAML front matter at the beginning of the file with required metadata fields.

## Formatting and Structure

Follow these guidelines for formatting and structuring your markdown content:

- **Headings**: Use `##` for H2 and `###` for H3. Ensure that headings are used in a hierarchical manner. Recommend restructuring if content includes H4, and more strongly recommend for H5.
- **Lists**: Use `-` for bullet points and `1.` for numbered lists. Indent nested lists with two spaces.
- **Code Blocks**: Use triple backticks (```) to create fenced code blocks. Specify the language after the opening backticks for syntax highlighting (e.g., ```csharp).
- **Links**: Use `[link text](URL)` for links. Ensure that the link text is descriptive and the URL is valid.
- **Images**: Use `![alt text](image URL)` for images. Include a brief description of the image in the alt text.
- **Tables**: Use `|` to create tables. Ensure that columns are properly aligned and headers are included.
- **Line Length**: Break lines at 80 characters to improve readability. Use soft line breaks for long paragraphs.
- **Whitespace**: Use blank lines to separate sections and improve readability. Avoid excessive whitespace.

## Validation Requirements

Ensure compliance with the following validation requirements:

- **Front Matter**: Include the following fields in the YAML front matter:

- `post_title`: The title of the post.
- `author1`: The primary author of the post.
- `post_slug`: The URL slug for the post.
- `microsoft_alias`: The Microsoft alias of the author.
- `featured_image`: The URL of the featured image.
- `categories`: The categories for the post. These categories must be from the list in /categories.txt.
- `tags`: The tags for the post.
- `ai_note`: Indicate if AI was used in the creation of the post.
- `summary`: A brief summary of the post. Recommend a summary based on the content when possible.
- `post_date`: The publication date of the post.

- **Content Rules**: Ensure that the content follows the markdown content rules specified above.
- **Formatting**: Ensure that the content is properly formatted and structured according to the guidelines.
- **Validation**: Run the validation tools to check for compliance with the rules and guidelines.

<!-- the source of this file is https://github.com/solarwinds-sandbox/copilot/blob/main/.github/instructions/markdown.instructions.md -->
Loading