Skip to content

Add .github/copilot-instructions.md for Copilot cloud agent onboarding#112

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/add-copilot-instructions-file
Draft

Add .github/copilot-instructions.md for Copilot cloud agent onboarding#112
Copilot wants to merge 1 commit into
mainfrom
copilot/add-copilot-instructions-file

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 3, 2026

Adds a copilot-instructions.md to give Copilot cloud agents enough context about this repo to work efficiently from first contact.

What's documented

  • Project purpose & structure – annotated directory tree covering source, tests, analyzers, and CI
  • Build/test commands – exact dotnet invocations, target frameworks, warnings-as-errors enforcement
  • Core architectureSlackWebApiClient facade, lazy-init API group pattern, IWebApiClient transport abstraction, Request/Response conventions
  • Code conventions – naming rules, mandatory Newtonsoft.Json usage (no System.Text.Json), NullValueHandling.Ignore on optional props, one-class-per-file
  • Extension patterns – step-by-step guides for adding API endpoints, API groups, event types, and message blocks, including interface wiring and test fixture requirements
  • Test helpersUtility assertion methods and fixture naming conventions (Web_, Events_, Blocks_, etc.)
  • CI/CD – workflow triggers, deployment targets, commit-message skip flags
  • Common pitfalls – polymorphic converter registration, internal-only API classes, Admin sub-group nesting


- **Treat warnings as errors**: Any new compiler warning will break the build. Always resolve analyzer and compiler warnings before committing.
- **Use `NullValueHandling.Ignore`** on every optional JSON property or Slack's strict field presence rules may cause unexpected serialisation behaviour.
- **Do not use `System.Text.Json`**: The entire library depends on Newtonsoft.Json conventions and custom converters.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi !
Why not to use System.Text.Json ?

Cheers

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The converters and attributes in this library are based on Newtonsoft, if the agent built anything using System.Text.Json then the output wouldn't work with the rest of the library and the serialized/deserialised output would be incorrect.

Originally this was because the early versions of System.Text.Json didn't support polymorphism and their interface support was poor, so it was necessary for things like the block converters. Now it's a large piece of work for little reward.

Copilot did a good first run of this, I need the rules I've created in Roslyn to be taken into account, and some of the response patterns to be written up, then this would be a good starting context for an agent to take the Slack update from the changelog and attempt a pull request which could then be tweaked - reducing overall time to stay as up to date as possible.

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