Skip to content

Conversation

@ryanzhang-oss
Copy link
Contributor

Description of your changes

add the copilot instruction to make our agent even more smart

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@ryanzhang-oss ryanzhang-oss requested a review from Copilot May 22, 2025 01:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The purpose of this PR is to add a new documentation file containing copilot instructions to enhance our agent’s guidance.

  • Adds a new file (.github/copilot-instructions.md) with comprehensive guidelines on repository structure, testing rules, domain knowledge, and breadcrumb protocol.
  • Details instructions for maintaining consistency in code reviews and development workflows.
Comments suppressed due to low confidence (1)

.github/copilot-instructions.md:1

  • [nitpick] Consider renaming the 'Overview' section or adding a dedicated 'Copilot Instructions' header to clearly distinguish the copilot-specific guidelines from general repository information.
# Overview

@ryanzhang-oss ryanzhang-oss requested a review from Copilot May 22, 2025 03:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new Copilot instruction document outlining agent behavior, repository conventions, testing protocols, and collaboration workflows.

  • Introduces general rules, terminology, and repository directory structure.
  • Defines testing guidelines, domain knowledge/specification references, and a breadcrumb collaboration protocol.
  • Provides an example usage scenario and plan-structure guidelines for implementation tasks.
Comments suppressed due to low confidence (1)

.github/copilot-instructions.md:9

  • [nitpick] Provide a brief explanation or example of the '@Terminal' annotation so it's clear how terminal commands should be formatted or executed.
+- Use @terminal when answering questions about Git.

- `pkg/authtoken` folder contains the authentication sidecar code which has a provider model.
- `pkg/controller` folder contains most of the controllers for the member and hub agent.
- each sub folder is a controller for a specific resource of the same name in most cases.
- `pkg/metrics` folder contains all the metrics definitions.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not true: this folder contains metrics for member agent and v1alpha1 placement metrics (should be deprecated?). The metrics for latest hub agent are in pkg/utils/controller/metrics.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Iooks like the new metrics should be moved here instead of buried deep in util dir. That file should only contain the metrics for our customized controller runtime


- Use @terminal when answering questions about Git.
- If you're waiting for my confirmation ("OK"), proceed without further prompting.
- Follow the [Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md) if possible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we also include these?
https://go.dev/wiki/Style

checked the uber style, which only includes the Go Code Review Comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

according to the copilot tips, this type of link might not even work. We probably need a MCP.

- `pkg/controller` folder contains most of the controllers for the member and hub agent.
- each sub folder is a controller for a specific resource of the same name in most cases.
- `pkg/metrics` folder contains all the metrics definitions.
- `pkg/propertyprovider` folder contains the property provider code which is used to get the properties of a member cluster.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to add the sub folders? Granted all we have at the moment is for azure so may not be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the copilot should be able to guess by reading the code


## Domain Knowledge

Use the files in the `.github/.copilot/domain_knowledge/**/*` as a source of truth when it comes to domain knowledge. These files provide context in which the current solution operates. This folder contains information like entity relationships, workflows, and ubiquitous language. As the understanding of the domain grows, take the opportunity to update these files as needed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The .github/.copilot directory doesn't exist. Do we plan to utilize this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is useful for the breadcrumb


## Specification Files

Use specifications from the `.github/.copilot/specifications` folder. Each folder under `specifications` groups similar specifications together. Always ask the user which specifications best apply for the current conversation context if you're not sure.
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

└── main.spec.md
```

## Breadcrumb Protocol
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this how to utilize the copilot agent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just one way and it changes every few weeks :)

ryanzhang-oss and others added 4 commits May 22, 2025 21:17
accept comments

Co-authored-by: Arvind Thirumurugan <[email protected]>
Signed-off-by: Ryan Zhang <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Ryan Zhang <[email protected]>
Co-authored-by: Wantong <[email protected]>
Co-authored-by: Britania Rodriguez Reyes <[email protected]>
Signed-off-by: Ryan Zhang <[email protected]>
@ryanzhang-oss ryanzhang-oss merged commit c773848 into kubefleet-dev:main May 23, 2025
6 checks passed
audrastump pushed a commit to audrastump/kubefleet that referenced this pull request Aug 20, 2025
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.

5 participants