Maintain DisCatSharp
Make evidence-backed changes against the live checkout. Preserve user work, trace every connected behavior that carries a public value, and validate the smallest relevant surface across the supported frameworks.
Start safely
- Read the repository's root
AGENTS.md and CONTRIBUTING.md.
- Confirm the exact checkout, branch, target issue or PR, and working-tree state.
- Treat existing tracked and untracked changes as user-owned. Never discard, rewrite, or include unrelated work.
- Re-read files immediately before patching when another person or agent may be editing concurrently.
- Use live files and current supplied upstream documentation as authoritative.
discatsharp-ai.xml is a read-only Repomix snapshot and may be stale.
Read references/repository-map.md before changing an unfamiliar subsystem.
Trace the behavior
Do not review a public member or payload field in isolation. Depending on the feature, inspect:
- Input parsing and type mapping.
- Constructors, property setters, validation, and default values.
- JSON serialization/deserialization and
Optional<T> behavior.
- Manual copies, localization reconstruction, cloning, and builders.
- Equality, synchronization, overwrite, and cache-update decisions.
- REST request models and Gateway payload/event models.
- XML documentation for public, internal, and private symbols, plus conceptual guidance, analyzers, and migrations.
- Focused regression tests for the failure mode.
Mirror Discord's actual contract. Do not add speculative REST enrichment to a Gateway event when its payload already carries the authoritative data.
Implement consistently
- Follow the repository's C# style, including file-scoped namespaces and existing
this. usage.
- Preserve compatibility. Discuss breaking changes and prefer the repository's
Deprecated migration path for public API removal.
- Use exact current upstream documentation when Discord behavior is revision-sensitive.
- Maintain the repository's 100% documentation goal. Every declaration is in scope regardless of visibility, including internal and private types, members, and fields. New and materially changed code must not add undocumented declarations; explain state invariants and ownership rather than restating names, and improve adjacent gaps when practical.
- Keep REST bucket ordering distinct from Gateway dispatch ordering.
- Avoid broad redesign during a focused fix unless a connected correctness path requires it.
- Use
apply_patch or an equally reviewable edit path and inspect the resulting diff.
Validate proportionally
Read references/validation-matrix.md, then:
- Run the smallest relevant test project or filtered regression tests.
- Cover
net9.0, net10.0, and net11.0 when the project targets all three.
- Build the affected package or solution when public/API shape changes.
- Run
git diff --check and inspect untracked files separately from the diff stat.
- For Gateway tests that immediately inspect callbacks, select
SequentialHandlers or explicitly wait for concurrent handlers to complete.
- Run broader tests only when the touched dependency surface justifies them.
Documentation and release work
- Generate documentation with
docfx DisCatSharp.Docs/docfx.json; do not manually maintain generated API navigation.
- Keep conceptual content discoverable through DocFX rather than hardcoded search-index folder lists.
- Update XML documentation across every affected visibility level and add migration guidance for behavioral or breaking changes.
- Keep
RELEASENOTES.md as the active cumulative release-cycle notes.
- Treat
CHANGELOG.md as the stable release index and DocFX changelog pages as the detailed historical record.
- Public releases are created only through the manually dispatched
Release DisCatSharp workflow.
Hand off cleanly
- State what changed, what was verified, and any remaining risk.
- Do not claim a timed-out command failed without checking the process or its output.
- Follow the repository's pull-request template and requested draft/merge boundary.
- Never merge, publish a package, enable repository policy, or mutate production infrastructure unless the user explicitly authorizes it.
1---2name: maintain-discatsharp3description: Review, modify, test, document, or release the DisCatSharp repository. Use for DisCatSharp source changes, API additions and migrations, Discord payload models, serialization, command synchronization, Gateway dispatch, REST behavior, analyzer work, multi-target testing, DocFX generation, release notes, and repository pull requests.4license: MIT5---67# Maintain DisCatSharp89Make evidence-backed changes against the live checkout. Preserve user work, trace every connected behavior that carries a public value, and validate the smallest relevant surface across the supported frameworks.1011## Start safely12131. Read the repository's root `AGENTS.md` and `CONTRIBUTING.md`.142. Confirm the exact checkout, branch, target issue or PR, and working-tree state.153. Treat existing tracked and untracked changes as user-owned. Never discard, rewrite, or include unrelated work.164. Re-read files immediately before patching when another person or agent may be editing concurrently.175. Use live files and current supplied upstream documentation as authoritative. `discatsharp-ai.xml` is a read-only Repomix snapshot and may be stale.1819Read [references/repository-map.md](references/repository-map.md) before changing an unfamiliar subsystem.2021## Trace the behavior2223Do not review a public member or payload field in isolation. Depending on the feature, inspect:2425- Input parsing and type mapping.26- Constructors, property setters, validation, and default values.27- JSON serialization/deserialization and `Optional<T>` behavior.28- Manual copies, localization reconstruction, cloning, and builders.29- Equality, synchronization, overwrite, and cache-update decisions.30- REST request models and Gateway payload/event models.31- XML documentation for public, internal, and private symbols, plus conceptual guidance, analyzers, and migrations.32- Focused regression tests for the failure mode.3334Mirror Discord's actual contract. Do not add speculative REST enrichment to a Gateway event when its payload already carries the authoritative data.3536## Implement consistently3738- Follow the repository's C# style, including file-scoped namespaces and existing `this.` usage.39- Preserve compatibility. Discuss breaking changes and prefer the repository's `Deprecated` migration path for public API removal.40- Use exact current upstream documentation when Discord behavior is revision-sensitive.41- Maintain the repository's 100% documentation goal. Every declaration is in scope regardless of visibility, including internal and private types, members, and fields. New and materially changed code must not add undocumented declarations; explain state invariants and ownership rather than restating names, and improve adjacent gaps when practical.42- Keep REST bucket ordering distinct from Gateway dispatch ordering.43- Avoid broad redesign during a focused fix unless a connected correctness path requires it.44- Use `apply_patch` or an equally reviewable edit path and inspect the resulting diff.4546## Validate proportionally4748Read [references/validation-matrix.md](references/validation-matrix.md), then:49501. Run the smallest relevant test project or filtered regression tests.512. Cover `net9.0`, `net10.0`, and `net11.0` when the project targets all three.523. Build the affected package or solution when public/API shape changes.534. Run `git diff --check` and inspect untracked files separately from the diff stat.545. For Gateway tests that immediately inspect callbacks, select `SequentialHandlers` or explicitly wait for concurrent handlers to complete.556. Run broader tests only when the touched dependency surface justifies them.5657## Documentation and release work5859- Generate documentation with `docfx DisCatSharp.Docs/docfx.json`; do not manually maintain generated API navigation.60- Keep conceptual content discoverable through DocFX rather than hardcoded search-index folder lists.61- Update XML documentation across every affected visibility level and add migration guidance for behavioral or breaking changes.62- Keep `RELEASENOTES.md` as the active cumulative release-cycle notes.63- Treat `CHANGELOG.md` as the stable release index and DocFX changelog pages as the detailed historical record.64- Public releases are created only through the manually dispatched `Release DisCatSharp` workflow.6566## Hand off cleanly6768- State what changed, what was verified, and any remaining risk.69- Do not claim a timed-out command failed without checking the process or its output.70- Follow the repository's pull-request template and requested draft/merge boundary.71- Never merge, publish a package, enable repository policy, or mutate production infrastructure unless the user explicitly authorizes it.