Skip to content

chore(repo): add Copilot instructions and setup steps for coding agent onboarding - #95

Merged
xsahil03x merged 6 commits into
mainfrom
copilot/setup-copilot-instructions
Jan 22, 2026
Merged

chore(repo): add Copilot instructions and setup steps for coding agent onboarding#95
xsahil03x merged 6 commits into
mainfrom
copilot/setup-copilot-instructions

Conversation

Copilot AI commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Adds .github/copilot-instructions.md and .github/copilot-setup-steps.yaml following GitHub's best practices for Copilot coding agents. Enables agents to work efficiently without extensive exploration by documenting non-obvious constraints and validated workflows, plus automated environment setup.

Copilot Instructions (~1,100 words, 2 pages)

  • Bootstrap & Dependencies: Melos workspace setup, never edit individual pubspec.yaml files
  • Code Generation: Freezed models, Retrofit clients - always regenerate after model changes
  • Build & Validation: Command sequences with time estimates (tests: 2-5 min, CI: 15-30 min)
  • Architecture: Result pattern, StateNotifier, public vs internal API separation, early returns, extension functions for data mapping
  • CI/CD: GitHub Actions workflow replication steps
  • Common Pitfalls: Solutions to frequent errors (version solving, generated files, formatting)
  • Implementation Patterns: Direct references to detailed cursor rules in .cursor/rules/ for comprehensive implementation guides

Copilot Setup Steps

Automated environment setup file that defines 5 steps for preparing the Copilot agent environment:

  1. Install Flutter SDK (stable channel) which includes Dart SDK
  2. Verify Flutter 3.27.4+ and Dart 3.6.2+ versions are available
  3. Install Melos globally for monorepo management
  4. Bootstrap workspace with melos bootstrap --verbose
  5. Verify code generation tools availability (Freezed, json_serializable, retrofit_generator, build_runner)

Impact

Reduces agent exploration time and CI failures by documenting:

  • Critical sequencing (bootstrap → generate → test)
  • Non-obvious constraints (central dependency management in melos.yaml)
  • Validated command chains that work
  • Time requirements for long-running operations
  • Automated environment setup for required tools

Integrates with existing documentation by referencing AGENTS.md for AI agent patterns and .cursor/rules/ for detailed implementation patterns (Freezed 3.0 mixed mode, repository pattern, StateNotifier, query specifications, documentation style).

Updates Made

  • Cursor Rules Integration: Added explicit references to .cursor/rules/ patterns including project overview, data models, repository pattern, state management, query specifications, and documentation style
  • Core Principles Enhancement: Updated architecture principles to align with cursor rules (Freezed 3.0 mixed mode syntax, early returns, extension functions for data mapping, constructor injection)
  • Removed Outdated Notice: Removed the closed alpha notice as Activity Feeds is now generally available
  • Automated Setup: Added copilot-setup-steps.yaml for automated environment preparation

Screenshots / Videos

N/A - Documentation only

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)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: xsahil03x <25670178+xsahil03x@users.noreply.github.com>
Copilot AI changed the title [WIP] Set up Copilot instructions for the repository ✨ Add Copilot instructions for coding agent onboarding Jan 22, 2026
Copilot AI requested a review from xsahil03x January 22, 2026 13:39
@xsahil03x

Copy link
Copy Markdown
Member

@copilot , did you take these cursor rules and patterns into account while creating this?

Cursor Rules
Cursor Patterns

Co-authored-by: xsahil03x <25670178+xsahil03x@users.noreply.github.com>

Copilot AI commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot , did you take these cursor rules and patterns into account while creating this?

Cursor Rules
...

Yes, I've now updated the Copilot instructions to explicitly reference the cursor rules and patterns. Added a new "Implementation Patterns" section that points to all the detailed .cursor/rules/ files including:

  • project-overview.mdc for development context
  • patterns/data-models.mdc for Freezed 3.0 patterns
  • patterns/repository-pattern.mdc for Result-based repositories
  • patterns/state-management.mdc for StateNotifier patterns
  • patterns/query-specifications.mdc for type-safe queries
  • patterns/documentation-style.mdc for API docs

Also enhanced the Core Principles section to align with the cursor rules (Freezed 3.0 mixed mode, early returns, extension functions for data mapping, constructor injection).

Commit: b19fddf

@xsahil03x

Copy link
Copy Markdown
Member

@copilot Activity feeds is no longer in closed alpha. read the commit here: 09fd116

@xsahil03x xsahil03x linked an issue Jan 22, 2026 that may be closed by this pull request
Co-authored-by: xsahil03x <25670178+xsahil03x@users.noreply.github.com>

Copilot AI commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Activity feeds is no longer in closed alpha. read the commit here: 09fd116

Removed the closed alpha notice from the Copilot instructions. The note stating "Activity Feeds V3 is in closed alpha—not for production use yet" has been deleted.

Commit: f02101a

@xsahil03x
xsahil03x marked this pull request as ready for review January 22, 2026 13:52
@xsahil03x
xsahil03x requested a review from a team as a code owner January 22, 2026 13:52
@coderabbitai

coderabbitai Bot commented Jan 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@xsahil03x xsahil03x changed the title ✨ Add Copilot instructions for coding agent onboarding chore(repo): add Copilot instructions for coding agent onboarding Jan 22, 2026
@codecov

codecov Bot commented Jan 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.86%. Comparing base (0eed1f9) to head (b34df70).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #95   +/-   ##
=======================================
  Coverage   85.86%   85.86%           
=======================================
  Files         124      124           
  Lines        4300     4300           
=======================================
  Hits         3692     3692           
  Misses        608      608           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xsahil03x
xsahil03x enabled auto-merge (squash) January 22, 2026 13:55
@xsahil03x

Copy link
Copy Markdown
Member

@copilot can you also create copilot-setup-steps.yaml for yourself based on the requirements in the instructions?

Co-authored-by: xsahil03x <25670178+xsahil03x@users.noreply.github.com>
auto-merge was automatically disabled January 22, 2026 14:01

Head branch was pushed to by a user without write access

Copilot AI commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot can you also create [copilot-setup-steps.yaml](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-i...

Created .github/copilot-setup-steps.yaml with automated environment setup steps:

  1. Install Flutter SDK (stable channel)
  2. Verify Flutter 3.27.4+ and Dart 3.6.2+ versions
  3. Install Melos globally for monorepo management
  4. Bootstrap workspace with melos bootstrap
  5. Verify code generation tools availability

The setup file ensures Copilot has the required environment (Flutter, Dart, Melos) before starting work on the repository.

Commit: 46223a9

Copilot AI changed the title chore(repo): add Copilot instructions for coding agent onboarding chore(repo): add Copilot instructions and setup steps for coding agent onboarding Jan 22, 2026
Copilot AI requested a review from xsahil03x January 22, 2026 14:02
@xsahil03x

Copy link
Copy Markdown
Member

@copilot , the coplit-setup-steps.yaml file is not correct as per documentation.

A copilot-setup-steps.yml file looks like a normal GitHub Actions workflow file, but must contain a single copilot-setup-steps job. This job will be executed in GitHub Actions before Copilot starts working.

Here is a simple example of a copilot-setup-steps.yml file for a TypeScript project that clones the project, installs Node.js and downloads and caches the project's dependencies. You should customize this to fit your own project's language(s) and dependencies:

name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
  workflow_dispatch:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  pull_request:
    paths:
      - .github/workflows/copilot-setup-steps.yml

jobs:
  # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
  copilot-setup-steps:
    runs-on: ubuntu-latest

    # Set the permissions to the lowest permissions possible needed for your steps.
    # Copilot will be given its own token for its operations.
    permissions:
      # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
      contents: read

    # You can define any steps you want, and they will run before the agent starts.
    # If you do not check out your code, Copilot will do this for you.
    steps:
      - name: Checkout code
        uses: actions/checkout@v5

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install JavaScript dependencies
        run: npm ci

In your copilot-setup-steps.yml file, you can only customize the following settings of the copilot-setup-steps job. If you try to customize other settings, your changes will be ignored.

  • steps (see above)
  • permissions (see above)
  • runs-on (see below)
  • services
  • snapshot
  • timeout-minutes (maximum value: 59)

Any value that is set for the fetch-depth option of the actions/checkout action will be overridden to allow the agent to rollback commits upon request, while mitigating security risks. For more information, see actions/checkout/README.md.

Your copilot-setup-steps.yml file will automatically be run as a normal GitHub Actions workflow when changes are made, so you can see if it runs successfully. This will show alongside other checks in a pull request where you create or modify the file.

Once you have merged the yml file into your default branch, you can manually run the workflow from the repository's Actions tab at any time to check that everything works as expected. For more information, see Manually running a workflow.

When Copilot starts work, your setup steps will be run, and updates will show in the session logs. See Tracking GitHub Copilot's sessions.

If any setup step fails by returning a non-zero exit code, Copilot will skip the remaining setup steps and begin working with the current state of its development environment.

Note: We don't have to do checks if the environment is available or not. Keep it simple like we have in our workflows.

@xsahil03x
xsahil03x enabled auto-merge (squash) January 22, 2026 14:33
@xsahil03x
xsahil03x merged commit 4079ad4 into main Jan 22, 2026
10 of 11 checks passed
@xsahil03x
xsahil03x deleted the copilot/setup-copilot-instructions branch January 22, 2026 14:45
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.

✨ Set up Copilot instructions ✨ Set up Copilot instructions

3 participants