Copilot instructions
.github/instructions/compression.instructions.mdCopilot instructions
Quality
60/100
Scores the file, not the repository.Length
477 words
9 headings · 0 code blocksRepository
18k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.12345# System.IO.Compression — Folder-Specific Guidance67## Format Specification Correctness (D12)89- ZIP64 extensions must be used for files over 4GB — extra field sizes, offsets, and header values must use 64-bit fields when the 32-bit range is exceeded10- Compression levels must align with native library semantics — verify enum-to-native mapping is correct11- New compression format support (e.g., zstd in ZIP) must include a feature switch for trimming/AOT and an explicit opt-in mechanism12- Decompression must handle concatenated payloads and partial reads — the decompressor must not assume a single contiguous compressed stream13- Breaking changes to format handling must be documented and include migration guidance1415## Security1617- Maximum decompressed size limits must be configurable to prevent zip-bomb attacks, following the existing deflate size limit pattern18- Archive extraction must validate entry paths to prevent path traversal attacks (entries with `../` segments)1920## Performance & Allocation (D5)2122- Use `ArrayPool<byte>` for variable-size compression/decompression buffers — return buffers in finally blocks23- Avoid allocating excessively large fixed buffers per operation (100KB+ per compression operation is expensive)24- Pin buffers for the duration of native I/O operations25- Hot paths must avoid per-operation allocations — prefer pooled buffers and cached delegates26- Closures that capture state on hot paths must be eliminated — use static lambdas with explicit state2728## Async Operations2930- Async compression/decompression must not perform the actual compression work synchronously before the first await31- Sync and async code paths must share non-trivial logic through common helpers to prevent divergence3233## Cross-Platform Metadata (D19)3435- Archive extraction must preserve or correctly translate platform-specific metadata — Unix execute permissions, symlinks, and hidden file attributes36- File path operations within archives must use forward slashes as the archive-internal separator per the ZIP specification37- Tests must verify metadata round-trip on both Windows and Unix platforms3839## Native Interop4041- Native library updates (brotli, zlib, zstd) must be tracked and the managed wrapper updated accordingly42- Use `LibraryImport` (source-generated) for new P/Invoke declarations43- SafeHandle-derived types must be used for native compression handles — never store raw IntPtr44- Native error codes must be mapped to appropriate .NET exceptions with the native error code preserved4546## Error Handling (D9)4748- Exceptions must be the most specific applicable type — `InvalidDataException` for corrupt archives, `IOException` for I/O failures, with actionable context (entry name, expected vs actual values)49- Operations on streams that may not support Length/Seek must be guarded appropriately5051## Interoperability Testing (D10)5253- Tests must use archive files created by external tools — not just round-trip tests with the same .NET implementation54- Test with archives from multiple platforms and compression libraries to verify cross-tool compatibility55- Cover edge cases: empty archives, many small entries, entries at size boundaries (4GB, uint.MaxValue)56- Dispose behavior must be tested — verify resources are released and post-disposal operations throw5758
Also in dotnet/runtime
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotnet/runtime.github/instructions/system-net-interop.instructions.md · 18k | Copilot instructions | stylearchperformance | 56/100 | 3 days ago | |
| dotnet/runtime.github/instructions/native.instructions.md · 18k | Copilot instructions | lint-formatstylearchperformance | 76/100 | 3 days ago | |
| dotnet/runtime.github/copilot-instructions.md · 18k | Copilot instructions | buildteststylearch+2 | 78/100 | 3 days ago | |
| dotnet/runtime.github/instructions/cdac.instructions.md · 18k | Copilot instructions | typesgitapidocs | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/conventions.instructions.md · 18k | Copilot instructions | stylearchagent-behaviourdocs | 56/100 | 3 days ago | |
| dotnet/runtime.github/instructions/core-runtime.instructions.md · 18k | Copilot instructions | styleperformance | 43/100 | 3 days ago | |
| dotnet/runtime.github/instructions/csharp.instructions.md · 18k | Copilot instructions | lint-formatstylearchsecurity+3 | 59/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-caching.instructions.md · 18k | Copilot instructions | styleperformanceagent-behaviour | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-common.instructions.md · 18k | Copilot instructions | styledependencies | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-configuration.instructions.md · 18k | Copilot instructions | no sections | 44/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-di.instructions.md · 18k | Copilot instructions | teststyletesting-strategy | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-hosting.instructions.md · 18k | Copilot instructions | teststyleagent-behaviour | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-logging.instructions.md · 18k | Copilot instructions | securityperformance | 44/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-options.instructions.md · 18k | Copilot instructions | style | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/jit.instructions.md · 18k | Copilot instructions | buildgit | 29/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-common.instructions.md · 18k | Copilot instructions | styledependenciesapi | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-http.instructions.md · 18k | Copilot instructions | styleperformance | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-quic.instructions.md · 18k | Copilot instructions | teststyleperformance | 56/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-security.instructions.md · 18k | Copilot instructions | securityperformancedeployment | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-sockets.instructions.md · 18k | Copilot instructions | styleagent-behaviour | 48/100 | 3 days ago |
Diff against .github/instructions/system-net-interop.instructions.md Diff against .github/instructions/native.instructions.md Diff against .github/copilot-instructions.md Diff against .github/instructions/cdac.instructions.md Diff against .github/instructions/conventions.instructions.md Diff against .github/instructions/core-runtime.instructions.md Diff against .github/instructions/csharp.instructions.md Diff against .github/instructions/extensions-caching.instructions.md Diff against .github/instructions/extensions-common.instructions.md Diff against .github/instructions/extensions-configuration.instructions.md Diff against .github/instructions/extensions-di.instructions.md Diff against .github/instructions/extensions-hosting.instructions.md Diff against .github/instructions/extensions-logging.instructions.md Diff against .github/instructions/extensions-options.instructions.md Diff against .github/instructions/jit.instructions.md Diff against .github/instructions/system-net-common.instructions.md Diff against .github/instructions/system-net-http.instructions.md Diff against .github/instructions/system-net-quic.instructions.md Diff against .github/instructions/system-net-security.instructions.md Diff against .github/instructions/system-net-sockets.instructions.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| dotnet/roslyn.github/copilot-instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 97/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 24 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 3 days ago |
