[PR #983] Configure Copilot coding agent instructions for SharpCompress #1402

Closed
opened 2026-01-29 22:20:23 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/983

State: closed
Merged: Yes


Adds project-specific instructions for the GitHub Copilot coding agent to guide contributions to SharpCompress, a pure C# compression library supporting multiple archive formats.

Changes

AGENTS.md - Enhanced with SharpCompress-specific context:

  • Archive format support matrix (Zip, Tar, 7Zip, Rar, LZip, XZ, ZStandard)
  • Stream disposal patterns (v0.21+ behavior: wrapped streams closed by default, use LeaveStreamOpen or NonDisposingStream to override)
  • Async/await patterns with CancellationToken for I/O operations
  • Archive API (seekable, random access) vs Reader/Writer API (forward-only streaming) usage guidance
  • Format-specific constraints (Tar requires file size in header, Zip64 needs seekable streams, encrypted LZMA unsupported)
  • Testing guidelines for multi-format compression scenarios
  • CSharpier formatting configuration (local tool in .config/dotnet-tools.json)

.github/COPILOT_AGENT_README.md - Corrected references:

  • Fixed filename reference (AGENTS.md not AGENTS.yml)
  • Added .github/agents/copilot-agent.yml to file listing
  • Corrected test project name (SharpCompress.Test not SharpCompress.Tests)

Example Usage

The instructions guide agent to properly handle stream disposal:

// Correct: Explicit control over stream lifecycle
using (var fileStream = File.OpenRead("archive.zip"))
using (var reader = ReaderFactory.Open(fileStream, new ReaderOptions { LeaveStreamOpen = true }))
{
    // Process entries
}
// fileStream still open for further use

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.github.com
    • Triggering command: curl -L REDACTED (dns block)
  • gh.io
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title> Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository.

</issue_description>

Comments on the Issue (you are @copilot in this section)


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

**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/983 **State:** closed **Merged:** Yes --- Adds project-specific instructions for the GitHub Copilot coding agent to guide contributions to SharpCompress, a pure C# compression library supporting multiple archive formats. ## Changes **AGENTS.md** - Enhanced with SharpCompress-specific context: - Archive format support matrix (Zip, Tar, 7Zip, Rar, LZip, XZ, ZStandard) - Stream disposal patterns (v0.21+ behavior: wrapped streams closed by default, use `LeaveStreamOpen` or `NonDisposingStream` to override) - Async/await patterns with `CancellationToken` for I/O operations - Archive API (seekable, random access) vs Reader/Writer API (forward-only streaming) usage guidance - Format-specific constraints (Tar requires file size in header, Zip64 needs seekable streams, encrypted LZMA unsupported) - Testing guidelines for multi-format compression scenarios - CSharpier formatting configuration (local tool in `.config/dotnet-tools.json`) **.github/COPILOT_AGENT_README.md** - Corrected references: - Fixed filename reference (AGENTS.md not AGENTS.yml) - Added .github/agents/copilot-agent.yml to file listing - Corrected test project name (SharpCompress.Test not SharpCompress.Tests) ## Example Usage The instructions guide agent to properly handle stream disposal: ```csharp // Correct: Explicit control over stream lifecycle using (var fileStream = File.OpenRead("archive.zip")) using (var reader = ReaderFactory.Open(fileStream, new ReaderOptions { LeaveStreamOpen = true })) { // Process entries } // fileStream still open for further use ``` > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `docs.github.com` > - Triggering command: `curl -L REDACTED` (dns block) > - `gh.io` > - Triggering command: `curl -s REDACTED` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/adamhathcock/sharpcompress/settings/copilot/coding_agent) (admins only) > > </details> <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>✨ Set up Copilot instructions</issue_title> > <issue_description>Configure instructions for this repository as documented in [Best practices for Copilot coding agent in your repository](https://gh.io/copilot-coding-agent-tips). > > <Onboard this repo></issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes adamhathcock/sharpcompress#982 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
claunia added the pull-request label 2026-01-29 22:20:23 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1402