Skip to content

Add GitHub Copilot instructions for SSH.NET#1767

Open
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-copilot-instructions
Open

Add GitHub Copilot instructions for SSH.NET#1767
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-copilot-instructions

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Adds .github/copilot-instructions.md to give GitHub Copilot accurate, repository-specific context so AI-generated contributions align with existing architecture, style, and safety expectations.

Coverage

  • Domain & entry points — SSH-2 library capabilities; SshClient, SftpClient, ScpClient, NetConfClient all extending BaseClient
  • Core technologies — C# LangVersion=latest, multi-TFM (.NET 4.6.2 / netstandard2.0 / .NET 8+), BouncyCastle for crypto, MEL abstractions for logging, MSTest + Moq + Testcontainers for testing, StyleCop + Meziantou + Sonar analyzers
  • Code organization — namespace/directory map, partial-class pattern for large files (e.g. PrivateKeyFile.PKCS1.cs, PrivateKeyFile.OpenSSH.cs)
  • Naming & style — PascalCase members, _camelCase private fields, I-prefix interfaces; StyleCop rules: #nullable enable at file top, using directives outside namespace with System.* first, XML doc on all public/internal members
  • Error handling — full SshException hierarchy; #if NETFRAMEWORK serialization constructor pattern; ErrorOccurred events for cross-thread errors; no silent swallowing
  • API design — every blocking method needs an …Async(CancellationToken) counterpart; ReadOnlyMemory<byte> preferred over byte[] in protocol code; no exposed mutable collections
  • Async & concurrencyConfigureAwait(false) throughout; TaskCompletionSource<T> for event bridging; no .Result/.Wait() inside async code
  • Security-sensitive areas — key exchange (Security/), private key parsing (PrivateKeyFile*.cs), host key verification; guidance to clear key material and never log secrets; WiresharkKeyLogFilePath must not be enabled in production
  • Testing — MSTest Arrange-Act-Assert pattern, file-per-scenario partial class layout, test commands including coverage collection
  • PerformanceArrayPool/MemoryPool over ad-hoc byte[], lock-contention avoidance, BenchmarkDotNet for significant changes
  • Safe-change checklist — unit test baseline, multi-TFM build verification, breaking-change policy, Release-mode analyzer enforcement
Original prompt

Create a pull request in sshnet/SSH.NET targeting the develop branch that adds repository-specific GitHub Copilot instructions based on analysis of the existing codebase.

Goal

Add a Copilot instruction document tailored to this repository so AI-generated code aligns with project architecture, coding style, testing approach, and contribution expectations.

Required work

  1. Analyze the repository structure and code patterns across the project.
  2. Infer and document:
    • What the repository does (domain and major capabilities).
    • Core technologies used (language/runtime/tooling/frameworks).
    • Architectural and code organization patterns.
    • Naming/style conventions used in the code.
    • Error handling and API design patterns.
    • Testing strategy and expectations.
    • Performance/concurrency considerations relevant to this repo.
    • Security-sensitive areas and guidance for safe changes.
    • Documentation/change hygiene expectations for contributors.
  3. Create a Copilot instruction file suitable for GitHub Copilot in this repository (use the currently recommended location/format, e.g. .github/copilot-instructions.md).
  4. Ensure instructions are practical and actionable, with concise “do/don’t” guidance and examples where helpful.
  5. Keep guidance repository-specific; avoid generic boilerplate unless necessary.
  6. If appropriate, include a short section on how to propose changes safely in this repo (tests to run, compatibility considerations, and scope discipline).

Quality bar

  • Instructions should clearly reflect real patterns found in this repository.
  • The document should be easy for contributors and Copilot to follow.
  • Keep tone professional and concise.
  • Ensure markdown formatting is clean.

Deliverables

  • New Copilot instruction file committed in the PR.
  • PR description summarizing the repository analysis and what guidance was added.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: WojciechNagorski <17333903+WojciechNagorski@users.noreply.github.com>
Copilot AI changed the title [WIP] Add repository-specific GitHub Copilot instructions Add GitHub Copilot instructions for SSH.NET Feb 28, 2026
@WojciechNagorski WojciechNagorski marked this pull request as ready for review February 28, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants