<!-- markdownlint-disable-file -->
# Coding Standards

Language-specific coding instructions and pre-PR code review agents for bash, Bicep, C#, PowerShell, Python, Rust, and Terraform projects

## Overview

Enforce language-specific coding conventions and best practices across your projects, with pre-PR code review agents for catching functional defects early. This collection provides instructions for bash, Bicep, C#, PowerShell, Python, Rust, and Terraform that are automatically applied based on file patterns, plus agents that review branch diffs before opening pull requests.

## Included Artifacts

<!-- BEGIN AUTO-GENERATED ARTIFACTS -->

### Chat Agents

| Name                       | Description                                                                                                               |
|----------------------------|---------------------------------------------------------------------------------------------------------------------------|
| **code-review-full**       | Orchestrator that runs functional and standards code reviews via subagents and produces a merged report                   |
| **code-review-functional** | Pre-PR branch diff reviewer for functional correctness, error handling, edge cases, and testing gaps                      |
| **code-review-standards**  | Skills-based code reviewer for local changes and PRs - applies project-defined coding standards via dynamic skill loading |

### Prompts

| Name                       | Description                                                                                        |
|----------------------------|----------------------------------------------------------------------------------------------------|
| **code-review-full**       | Run both functional and standards code reviews on the current branch in a single pass              |
| **code-review-functional** | Pre-PR branch diff review for functional correctness, error handling, edge cases, and testing gaps |

### Instructions

| Name                                              | Description                                                                                                                                                                                                                                                 |
|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **coding-standards/bash/bash**                    | Bash script authoring conventions                                                                                                                                                                                                                           |
| **coding-standards/bicep/bicep**                  | Bicep infrastructure-as-code authoring conventions                                                                                                                                                                                                          |
| **coding-standards/code-review-telemetry**        | Code Review telemetry overlay applying telemetry-foundations vocabulary to code-review report artifacts                                                                                                                                                     |
| **coding-standards/code-review/diff-computation** | Code review diff computation: branch detection, scope locking, large-diff handling, and non-source filtering                                                                                                                                                |
| **coding-standards/code-review/review-artifacts** | Code review artifact persistence: folder structure, metadata schema, verdict normalization, and writing rules                                                                                                                                               |
| **coding-standards/csharp/csharp**                | C# (CSharp) code authoring conventions                                                                                                                                                                                                                      |
| **coding-standards/csharp/csharp-tests**          | C# (CSharp) test code authoring conventions                                                                                                                                                                                                                 |
| **coding-standards/powershell/pester**            | Instructions for Pester testing conventions                                                                                                                                                                                                                 |
| **coding-standards/powershell/powershell**        | PowerShell scripting conventions                                                                                                                                                                                                                            |
| **coding-standards/python-script**                | Python scripting conventions                                                                                                                                                                                                                                |
| **coding-standards/python-tests**                 | Python test code authoring conventions                                                                                                                                                                                                                      |
| **coding-standards/rust/rust**                    | Rust code authoring conventions                                                                                                                                                                                                                             |
| **coding-standards/rust/rust-tests**              | Rust test code authoring conventions                                                                                                                                                                                                                        |
| **coding-standards/terraform/terraform**          | Terraform infrastructure-as-code authoring conventions                                                                                                                                                                                                      |
| **coding-standards/uv-projects**                  | Create and manage Python virtual environments using uv commands                                                                                                                                                                                             |
| **shared/hve-core-location**                      | Important: hve-core is the repository containing this instruction file; Guidance: if a referenced prompt, instructions, agent, or script is missing in the current directory, fall back to this hve-core location by walking up this file's directory tree. |

### Skills

| Name                      | Description                                                                                                                                                                                                                                                                                                                                                                  |
|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pr-reference**          | Generates PR reference XML containing commit history and unified diffs between branches with extension and path filtering. Includes utilities to list changed files by type and read diff chunks. Use when creating pull request descriptions, preparing code reviews, analyzing branch changes, discovering work items from diffs, or generating structured diff summaries. |
| **python-foundational**   | Foundational Python best practices, idioms, and code quality fundamentals                                                                                                                                                                                                                                                                                                    |
| **telemetry-foundations** | Declarative OpenTelemetry-aligned telemetry vocabulary and instrumentation conventions for traces, metrics, logs, and PII handling                                                                                                                                                                                                                                           |

<!-- END AUTO-GENERATED ARTIFACTS -->

## Install

```bash
copilot plugin install coding-standards@hve-core
```

## Agents

| Agent                  | Description                                                                                                                                                      |
|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| code-review-full       | Orchestrator that runs functional and standards code reviews via subagents and produces a merged report - Brought to you by microsoft/hve-core                   |
| code-review-functional | Pre-PR branch diff reviewer for functional correctness, error handling, edge cases, and testing gaps - Brought to you by microsoft/hve-core                      |
| code-review-standards  | Skills-based code reviewer for local changes and PRs - applies project-defined coding standards via dynamic skill loading - Brought to you by microsoft/hve-core |

## Commands

| Command                | Description                                                                                                                               |
|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| code-review-functional | Pre-PR branch diff review for functional correctness, error handling, edge cases, and testing gaps - Brought to you by microsoft/hve-core |
| code-review-full       | Run both functional and standards code reviews on the current branch in a single pass - Brought to you by microsoft/hve-core              |

## Instructions

| Instruction                        | Description                                                                                                                                                                                                                                                 |
|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| diff-computation.instructions      | Code review diff computation: branch detection, scope locking, large-diff handling, and non-source filtering                                                                                                                                                |
| review-artifacts.instructions      | Code review artifact persistence: folder structure, metadata schema, verdict normalization, and writing rules                                                                                                                                               |
| bash.instructions                  | Bash script authoring conventions                                                                                                                                                                                                                           |
| bicep.instructions                 | Bicep infrastructure-as-code authoring conventions                                                                                                                                                                                                          |
| csharp.instructions                | C# (CSharp) code authoring conventions                                                                                                                                                                                                                      |
| csharp-tests.instructions          | C# (CSharp) test code authoring conventions                                                                                                                                                                                                                 |
| pester.instructions                | Instructions for Pester testing conventions                                                                                                                                                                                                                 |
| powershell.instructions            | PowerShell scripting conventions                                                                                                                                                                                                                            |
| rust.instructions                  | Rust code authoring conventions                                                                                                                                                                                                                             |
| rust-tests.instructions            | Rust test code authoring conventions                                                                                                                                                                                                                        |
| python-script.instructions         | Python scripting conventions                                                                                                                                                                                                                                |
| python-tests.instructions          | Python test code authoring conventions                                                                                                                                                                                                                      |
| terraform.instructions             | Terraform infrastructure-as-code authoring conventions                                                                                                                                                                                                      |
| uv-projects.instructions           | Create and manage Python virtual environments using uv commands                                                                                                                                                                                             |
| hve-core-location.instructions     | Important: hve-core is the repository containing this instruction file; Guidance: if a referenced prompt, instructions, agent, or script is missing in the current directory, fall back to this hve-core location by walking up this file's directory tree. |
| code-review-telemetry.instructions | Code Review telemetry overlay applying telemetry-foundations vocabulary to code-review report artifacts                                                                                                                                                     |

## Skills

| Skill                 | Description                                                                                                                                                                                                                                                                                                                                                                                                         |
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| python-foundational   | Foundational Python best practices, idioms, and code quality fundamentals - Brought to you by microsoft/hve-core                                                                                                                                                                                                                                                                                                    |
| pr-reference          | Generates PR reference XML containing commit history and unified diffs between branches with extension and path filtering. Includes utilities to list changed files by type and read diff chunks. Use when creating pull request descriptions, preparing code reviews, analyzing branch changes, discovering work items from diffs, or generating structured diff summaries. - Brought to you by microsoft/hve-core |
| telemetry-foundations | Declarative OpenTelemetry-aligned telemetry vocabulary and instrumentation conventions for traces, metrics, logs, and PII handling                                                                                                                                                                                                                                                                                  |

---

> Source: [microsoft/hve-core](https://github.com/microsoft/hve-core)

