Skip to content

[BX-8] New Feature: CoPilot first reviewer prompt#9

Draft
scottqueen-bixal wants to merge 18 commits intomainfrom
feature/bx-copilot-first-reviewer-prompt
Draft

[BX-8] New Feature: CoPilot first reviewer prompt#9
scottqueen-bixal wants to merge 18 commits intomainfrom
feature/bx-copilot-first-reviewer-prompt

Conversation

@scottqueen-bixal
Copy link
Member

@scottqueen-bixal scottqueen-bixal commented Feb 4, 2026

Description

Tell us what you changed and why.

Related Issues

Closes #ISSUE_NO

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Other (please explain):

How did you test?

leverage test-code for testing against the code-review.prompt.md

Note

This code will be removed before merged

By default /code-review will review uncommitted changes

  • make changes to file, keep unstaged
  • use /code-review

Other methods
By selected lines:

  • highlight lines of code in current open file
  • use /code-review

By file in context window:

  • drag test files to the chat for context
  • use /code-review

Checklist

  • I've done a self-review of my code
  • I've updated the docs

@scottqueen-bixal scottqueen-bixal self-assigned this Feb 4, 2026
@scottqueen-bixal scottqueen-bixal linked an issue Feb 4, 2026 that may be closed by this pull request
- **Readability by others**: Can team members unfamiliar with this code understand it quickly? Is it written for humans first?
- **Author's intention**: Does the code do what the author intended, and is that intention good for both end-users and maintainers?
- **Complexity**: Is this no more complex than needed? Can it be understood quickly? Are developers likely to introduce bugs when modifying it?
- **Naming conventions**: Are variable, function, class, file, metric, and logger names sensible, readable, and consistent with existing codebase?

Choose a reason for hiding this comment

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

It's worth thinking about "Does the code follow coding conventions for the language used?" e.g. snake case vs camel case, indentation and whitespace, file/project organization.

We should prefer to use language/framework conventions in most cases, but also allow those to be overridden and say that consistency with the rest of the codebase is most important.

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed this in the ## Review Scope

- Are there overly complex conditionals that could be simplified?
- Can nested loops/conditionals be flattened or extracted?
- Is there dead code or unused imports/variables?
- Are there opportunities to leverage language/framework features better?

Choose a reason for hiding this comment

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

One thing that I thought of for this section was "are we implementing something that already exists". Meaning could we bring in a library/package and eliminate code in our project.

However, being a gov contractor, there's probably a balance to be struck since every new dependency is a new security/maintenance item.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good considerations, added with focus on current codebase reuse.

You're right, there is value in an assessment of package replacements, but critical to not reproduce something that already exist in the current project.

- Are edge cases and error conditions tested?
- Are tests readable and maintainable?
- Is test coverage adequate for the risk level?
- Are integration points properly tested?

Choose a reason for hiding this comment

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

The testing requirements should be flexible and maybe reference a repo-level document describing testing approach. For example a project/team may prefer low level unit tests with all integration points mocked, or a project/team may prefer integration level tests with less mocking. An acceptable code coverage level should be outlined, not every team wants to be at 100%. (The last 5-10% coverage is often a lot of work for questionable value)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is a case where a lead could "tweak" for their own references, but added a third item in ## Review Scope to generically address.

- Are style guidelines followed (or enforced by linters)?
- Are there linting/type-checking errors that need addressing?
- For migrations: Is there a deployment plan documented?
- Is superfluous or experimental code being committed accidentally?

Choose a reason for hiding this comment

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

This is mostly duplicate of section 3


You are a senior technical software engineer lead performing a thorough pre-commit code review. Your goal is to reduce risk and improve code quality through objective, actionable feedback while being polite, complimentary, and pragmatic.

## Review Scope

Choose a reason for hiding this comment

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

Does the review happen one time, on every commit, on demand?

Copy link
Member Author

Choose a reason for hiding this comment

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

I took pre-commit language out.

The two use cases are:

  1. to review the open doc
  2. Or, the context of highlighted code

I've outlined those in the testing steps above.

I could see a tool call here where users might be able to say

/code-review the last three commits

or

/code-review upstaged changes

Maybe these are more advanced for this first effort.

### Strengths
[Highlight 2-3 positive aspects - be genuinely complimentary]

### Required Changes [h: high]

Choose a reason for hiding this comment

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

Consider if the reviewer should have a limit on the number of comments. We don't want to have a review seem harsh because of the volume of changes.

Maybe say something like "List all required changes, and then other comments up to 10(?) ordered by priority". The amount is just an example magic number.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Thanks for adding this, I'm excited to try it out! Added my comments from a brief review/test.

- Provide objective, evidence-based feedback
- Avoid boasting about programming knowledge
- Remember: "Perfect is the enemy of good" - pragmatism over perfection
- Focus on reducing risk, not producing perfect code
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: I like this approach on reducing risk, not perfect code.

- **Write clear and specific comments**: Be precise about what needs to change and why
- **Include positive feedback**: Always highlight strengths and good decisions, not just issues
- **Be generous with code examples**: Show the suggested improvement in code when possible
- **Frame feedback as requests, not commands**: "Consider refactoring..." vs. "Refactor this..."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Something to think about for the future, we could use conventional comments to format the feedback.

So, suggestion: or issue (security) etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

trying this out

- **Include positive feedback**: Always highlight strengths and good decisions, not just issues
- **Be generous with code examples**: Show the suggested improvement in code when possible
- **Frame feedback as requests, not commands**: "Consider refactoring..." vs. "Refactor this..."
- **Tie notes to principles, not opinions**: Reference standards, best practices, or project guidelines rather than personal preference
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Tie notes to principles, not opinions**: Reference standards, best practices, or project guidelines rather than personal preference
- **Tie notes to principles, not opinions**: Reference standards, best practices, official guidance, or project guidelines rather than personal preference

Suggestion: Not sure if it needs to be said explicitly, but something like prioritize the official source first.

- **Start high-level, then work down**: Review architecture and design first, then dive into implementation details

**Feedback Priority** (Scale|LOC):
- **[l: low]** - Nitpick. Author may address but doesn't have to
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **[l: low]** - Nitpick. Author may address but doesn't have to
- **[l: low]** - Non-blocking. Author may address but doesn't have to

Just rephrasing for additional clarity.

Comment on lines 102 to 109
### 8. Security Review
- Apply all checks from `security.instructions.md`:
- Input validation and sanitization
- Authentication and authorization
- Data protection (encryption, secure storage)
- Dependency vulnerabilities
- Injection attack prevention (SQL, XSS, etc.)
- Proper error handling without exposing sensitive info
Copy link
Contributor

Choose a reason for hiding this comment

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

Copilot review feedback:

Suggested change
### 8. Security Review
- Apply all checks from `security.instructions.md`:
- Input validation and sanitization
- Authentication and authorization
- Data protection (encryption, secure storage)
- Dependency vulnerabilities
- Injection attack prevention (SQL, XSS, etc.)
- Proper error handling without exposing sensitive info
### 8. Security Review
- Apply all checks from `security.instructions.md`:
- Input validation and sanitization (e.g., Are user inputs validated before database queries?)
- Authentication and authorization (e.g., Are protected routes checking user permissions?)
- Data protection (encryption, secure storage)
- Dependency vulnerabilities
- Injection attack prevention (SQL, XSS, etc.)
- Proper error handling without exposing sensitive info (e.g., Are stack traces hidden in production?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Since we are already referencing the security.instructions.md file this might be adding more prescriptive or redundancies as well as adding more tokens.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, the more concise we can make it the easier it'll be to modify/maintain.

Copy link
Contributor

Choose a reason for hiding this comment

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

Meta, but I used this prompt to review the prompt!

Image

The suggested lines for comments seems off:

Note

Not a criticism, just flagging that this is a recurring problem I've noticed when using my own prompts.

Image

Copy link
Member Author

Choose a reason for hiding this comment

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

LLM's are bad at counting lines apparently 😞 -> also this issue in progress microsoft/vscode#280523

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup. I would add a note for user that for now line numbers might not match up, but it doesn't mean the suggestion is wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to have a README.md file in this directory or header comments about what this is and what it's for.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is just for testing the current work, will be removed before merging


### 3. Code Quality & Maintainability
- **System design**: How well do the various pieces interact together? Is the integration with the overall system well-designed?
- **Readability by others**: Can team members unfamiliar with this code understand it quickly? Is it written for humans first?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Readability by others**: Can team members unfamiliar with this code understand it quickly? Is it written for humans first?
- **Readability for others**: Can team members unfamiliar with this code understand it quickly? Is it written for humans first?


### 6. Refactoring Opportunities
- Can code be simplified without losing clarity?
- Are there overly complex conditionals that could be simplified?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Are there overly complex conditionals that could be simplified?
- Are there unnecessarily complex conditionals that could be simplified?

- Created package.json for project dependencies and scripts.
- Added styles.css for alert button component with accessibility support.
- Implemented test setup in test-setup.js for Node environment.
- Developed HTML test suite for alert button functionality.
- Created utils.test.js to test utility functions with localStorage mocks.
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.

Feature request: CoPilot First Reviewer

3 participants