Skip to content

docs: Enhance Copilot instruction files for project files#621

Merged
rjmurillo merged 8 commits intomainfrom
docs/update-copilot-instructions
Jul 26, 2025
Merged

docs: Enhance Copilot instruction files for project files#621
rjmurillo merged 8 commits intomainfrom
docs/update-copilot-instructions

Conversation

@rjmurillo
Copy link
Copy Markdown
Owner

@rjmurillo rjmurillo commented Jul 26, 2025

Update instruction files to provide clearer guidance for GitHub Copilot when editing C# and project files. Include mandatory instructions, validation checklists, and maintenance notes to ensure comprehensive understanding and adherence to development standards.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive instruction files for editing various file types, including C#, JSON, XML, YAML, Markdown, shell scripts, project files, and configuration files.
    • Introduced a centralized index mapping file patterns to their respective instruction files for easy reference.
    • Expanded and clarified procedural guidelines, validation checklists, escalation paths, commit message conventions, and review processes to ensure consistency and quality across contributions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 26, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This change introduces a comprehensive set of instruction files under .github/instructions/ for editing various file types (C#, project, XML, JSON, YAML, markdown, shell, editorconfig, gitignore, etc.), each detailing validation, escalation, and procedural requirements. The main copilot-instructions.md is extensively expanded with stricter rules for AI agents, validation evidence, escalation protocols, and commit message standards.

Changes

File(s) Change Summary
.github/copilot-instructions.md Major expansion: new structured sections, quick reference, validation evidence, escalation protocols, commit message rules, and more.
.github/instructions/README.md New instruction file index mapping file patterns to their respective instruction files.
.github/instructions/csharp.instructions.md Rewritten and expanded: now a comprehensive procedural guide for C# files, with decision trees, test data, and coverage strategy.
.github/instructions/editorconfig.instructions.md New: detailed procedural and validation instructions for editing .editorconfig.
.github/instructions/generic.instructions.md New: generic instruction file for unknown/rare file types, with validation, escalation, and decision trees.
.github/instructions/gitignore.instructions.md New: detailed procedural and validation instructions for editing .gitignore.
.github/instructions/json.instructions.md New: comprehensive JSON editing and validation guidelines, including security, formatting, and PR standards.
.github/instructions/markdown.instructions.md New: comprehensive markdown editing guidelines, validation, escalation, and documentation standards.
.github/instructions/msbuild.instructions.md New: detailed procedural and validation instructions for editing MSBuild .props and .targets files.
.github/instructions/project.instructions.md New: comprehensive procedural and validation instructions for editing project files (.csproj, .sln).
.github/instructions/shell.instructions.md New: comprehensive guidelines for shell scripts, including validation, security, and best practices.
.github/instructions/text.instructions.md New: detailed instructions for editing text files, including validation, documentation, and commit standards.
.github/instructions/xml.instructions.md New: comprehensive XML editing guidelines, validation, documentation, and PR standards.
.github/instructions/yaml.instructions.md New: comprehensive YAML/CI workflow editing guidelines, validation, security, and PR requirements.

Sequence Diagram(s)

sequenceDiagram
    participant Contributor
    participant InstructionFile
    participant Maintainer
    participant CI/Bot

    Contributor->>InstructionFile: Locate relevant instruction file for file type
    InstructionFile-->>Contributor: Provide procedural/validation/escalation guidelines
    Contributor->>CI/Bot: Submit PR with validation evidence
    CI/Bot-->>Contributor: Automated feedback and checks
    Contributor->>Maintainer: Escalate if blocked/uncertain or upon instruction
    Maintainer-->>Contributor: Provide guidance/review
    Contributor->>CI/Bot: Address all feedback before review/merge
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

releasable

Suggested reviewers

  • MattKotsenas

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f05add and 9611604.

📒 Files selected for processing (14)
  • .github/copilot-instructions.md (8 hunks)
  • .github/instructions/README.md (1 hunks)
  • .github/instructions/csharp.instructions.md (1 hunks)
  • .github/instructions/editorconfig.instructions.md (1 hunks)
  • .github/instructions/generic.instructions.md (1 hunks)
  • .github/instructions/gitignore.instructions.md (1 hunks)
  • .github/instructions/json.instructions.md (1 hunks)
  • .github/instructions/markdown.instructions.md (1 hunks)
  • .github/instructions/msbuild.instructions.md (1 hunks)
  • .github/instructions/project.instructions.md (1 hunks)
  • .github/instructions/shell.instructions.md (1 hunks)
  • .github/instructions/text.instructions.md (1 hunks)
  • .github/instructions/xml.instructions.md (1 hunks)
  • .github/instructions/yaml.instructions.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/update-copilot-instructions

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Jul 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-89.12% (target: -1.00%) (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6f05add) 1820 1622 89.12%
Head commit (9611604) 0 (-1820) 0 (-1622) 0.00% (-89.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#621) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@rjmurillo rjmurillo marked this pull request as ready for review July 26, 2025 15:50
Copilot AI review requested due to automatic review settings July 26, 2025 15:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances GitHub Copilot instruction files to provide comprehensive, self-contained guidance for editing various file types in the repository. The update ensures that Copilot has complete context when working with different file types without needing to traverse external references.

Key Changes:

  • Creates comprehensive instruction files for 11 different file types (C#, YAML, XML, JSON, etc.)
  • Establishes consistent validation checklists and escalation procedures across all file types
  • Adds decision trees for complex scenarios and multi-file changes

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/instructions/yaml.instructions.md New comprehensive guide for YAML/CI workflow files with security and performance validation
.github/instructions/xml.instructions.md New guide for XML files focusing on documentation standards and schema compliance
.github/instructions/text.instructions.md New guide for text files with formatting and content validation requirements
.github/instructions/shell.instructions.md New guide for shell scripts emphasizing security, error handling, and testing
.github/instructions/project.instructions.md New guide for project files (.csproj/.sln) with build and dependency management
.github/instructions/msbuild.instructions.md New concise guide for MSBuild property/target files
.github/instructions/markdown.instructions.md New guide for markdown files with documentation standards
.github/instructions/json.instructions.md New guide for JSON configuration files with validation requirements
.github/instructions/gitignore.instructions.md New concise guide for .gitignore file modifications
.github/instructions/generic.instructions.md New fallback guide for unknown file types with decision trees
.github/instructions/editorconfig.instructions.md New guide for .editorconfig formatting rules
.github/instructions/csharp.instructions.md Enhanced C# guide with decision trees and test data guidelines
.github/instructions/README.md New index mapping file patterns to instruction files
.github/copilot-instructions.md Enhanced with quick reference table, validation requirements, and maintenance notes
Comments suppressed due to low confidence (4)

.github/copilot-instructions.md:25

  • The instruction specifies targeting .NET 9 and C# 13, but according to my knowledge cutoff, these versions do not exist. The latest stable versions are .NET 8 and C# 12. The quick reference table correctly mentions .NET 8 and C# 12, creating an inconsistency.
You are an experienced .NET developer working on Roslyn analyzers for the Moq framework. All code must target **.NET 9** and **C# 13**. Use only official .NET patterns and practices—**never** StackOverflow shortcuts. Keep responses clear, concise, and at a grade 9 reading level. Use plain English, avoid jargon. Follow SOLID, DRY, and YAGNI principles. Respond directly and keep explanations straightforward.

.github/instructions/project.instructions.md:34

  • While .NET 8 and C# 12 are valid versions according to my knowledge, there's an inconsistency with the main copilot-instructions.md file which mentions .NET 9 and C# 13. This creates conflicting guidance.
- [ ] Target .NET 8, C# 12 by default; Analyzers and Code Fixes target .NET Standard 2.0

.github/instructions/project.instructions.md:148

  • References .NET 9 which does not exist according to my knowledge cutoff. This is inconsistent with line 34 which correctly mentions .NET 8.
1. **Check compatibility** with target framework (.NET 9)

.github/instructions/json.instructions.md:181

  • References .NET 9 which does not exist according to my knowledge cutoff. Should be .NET 8 to be consistent with other parts of the documentation.
- Ensure compatibility with target framework (.NET 9)

@rjmurillo rjmurillo merged commit 3fd72de into main Jul 26, 2025
17 checks passed
@rjmurillo rjmurillo deleted the docs/update-copilot-instructions branch July 26, 2025 15:51
@rjmurillo rjmurillo added this to the vNext milestone Jul 26, 2025
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.

| Instruction Files | Read and comply with all `.github/instructions/*` for edited file types |

---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Mixed Framework Versions in Documentation

Conflicting .NET and C# target framework versions are specified across the documentation. copilot-instructions.md contains internal inconsistencies (referencing both .NET 8/C# 12 and .NET 9/C# 13), and these contradictions extend to other instruction files like project.instructions.md and json.instructions.md. This creates confusion for developers and AI agents regarding the correct target framework.

Locations (3)

Fix in CursorFix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants