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

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/983
Author: @Copilot
Created: 10/27/2025
Status: Merged
Merged: 10/27/2025
Merged by: @adamhathcock

Base: masterHead: copilot/set-up-copilot-instructions


📝 Commits (7)

  • 3095c80 Initial plan
  • 9cefb85 Enhance AGENTS.md with SharpCompress-specific guidelines
  • 11c90ae Update Copilot configuration to reflect actual project setup
  • 48be7bb Correct formatting instructions to use CSharpier
  • b272dbf Clarify CSharpier should be run from project root
  • 41ae036 Merge branch 'master' into copilot/set-up-copilot-instructions
  • e862480 Merge branch 'master' into copilot/set-up-copilot-instructions

📊 Changes

3 files changed (+88 additions, -33 deletions)

View changed files

📝 .github/COPILOT_AGENT_README.md (+5 -3)
📝 AGENTS.md (+80 -27)
📝 src/SharpCompress/packages.lock.json (+3 -3)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/983 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 10/27/2025 **Status:** ✅ Merged **Merged:** 10/27/2025 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `copilot/set-up-copilot-instructions` --- ### 📝 Commits (7) - [`3095c80`](https://github.com/adamhathcock/sharpcompress/commit/3095c805ad443398a291e99394d366ff67348fe1) Initial plan - [`9cefb85`](https://github.com/adamhathcock/sharpcompress/commit/9cefb859054a3a0e64d5d41934451b3702877206) Enhance AGENTS.md with SharpCompress-specific guidelines - [`11c90ae`](https://github.com/adamhathcock/sharpcompress/commit/11c90ae879b049de6ceef04ca9930e4376c64f5c) Update Copilot configuration to reflect actual project setup - [`48be7bb`](https://github.com/adamhathcock/sharpcompress/commit/48be7bbf86de1f3a22b17509782dd13a37d77c15) Correct formatting instructions to use CSharpier - [`b272dbf`](https://github.com/adamhathcock/sharpcompress/commit/b272dbfd1fda69852374ae5f5db31e1f943a6bd8) Clarify CSharpier should be run from project root - [`41ae036`](https://github.com/adamhathcock/sharpcompress/commit/41ae036ab4420047389c218994b3495eaa340f83) Merge branch 'master' into copilot/set-up-copilot-instructions - [`e862480`](https://github.com/adamhathcock/sharpcompress/commit/e862480b86f0d710f7fbbcb3d1ab5edf4fa8d0d2) Merge branch 'master' into copilot/set-up-copilot-instructions ### 📊 Changes **3 files changed** (+88 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `.github/COPILOT_AGENT_README.md` (+5 -3) 📝 `AGENTS.md` (+80 -27) 📝 `src/SharpCompress/packages.lock.json` (+3 -3) </details> ### 📄 Description 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:20:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1400