Skip to main content
Brimham Rocks, Yorkshire, UK

My experiences with GitHub CoPilot

A software review
CoPilot chat
This is a new website and is under active development. There will be some odd-looking layouts and colours while this is happening. Please bear with me and check back again to see any updates.
Article Status
Incomplete (Expect further updates)

I signed up for a personal license at US$10 per month with a view to deciding whether $100 per year is worth it for me as an open source developer who isnā€™t making any money from their outputs.

I was already making fairly extensive use of the public ChatGPT service to get answers to coding questions and code suggestions. I already noted a significant improvement in responses when the 4o model went live.

As with most things related to GitHub, sign-up, configuration and integration with VSCode wasnā€™t hard but it was reasonably involved. Not all configuration settings were obvious. Nor are all of the VSCode integrations. So this is my first observation.

Tip
Even being familiar with ChatGPT and prompt engineering, you will need to invest time and energy learning how to use CoPilot.

VSCode Installation

Summary: RTFM!. šŸ˜Š

VSCode Chat Sidebar

Failures

Summary: As with all LLM-based AI tools, they only really work when they have plenty of source material to work with. The more specialist the data/question, the less likely to are to get a decent answer.

VSCode Code Edit Integration

Successes

Failures

Help with GIT

Successes

Steering CoPilot Responses

When using GitHub CoPilot with VSCode, you can give it a set of fixed guidance instructions either through settings in VSCodeā€™s setting or better still, using a .github/copilot-instructions.md file. These instructions can be quite comprehensive and you can even ask CoPilot to improve them for you.

Example instructions file

This is the file Iā€™m using to help steer responses for an Astro build repository. As you can see, it is a Markdown formatted file.

# Copilot Instructions
## Core Requirements
- Use Astro (v4.x or newer)
- Follow project eslint configuration
- Ensure WCAG 2.2 Level AA compliance
- Apply Shift-Left security practices
## Code Style
### JavaScript/TypeScript
- For node.js, use features available to v18
- For browsers, use features available to 90%+ browsers/users
- No trailing semicolons
- Single quotes for strings
- Use const by default, let when needed
- Prefer arrow functions
- Use optional chaining
- Add JSDoc if missing
- Add TypeScript types/interfaces
### Documentation
- Include JSDoc for functions and classes
- Add @param and @returns tags
- Document thrown errors
- Include usage examples for complex functions
### HTML/CSS
- Use semantic HTML elements
- Only use features available to 90%+ browsers/users
- Include ARIA attributes where needed
- Mobile-first responsive design
- Use CSS custom properties
- Follow BEM naming convention
- Include print styles
## Testing
- Write unit tests using Vitest
- Include accessibility tests
- Maintain >80% code coverage
- Test error scenarios
## Performance
- Lazy load components when possible
- Optimize images and assets
- Keep bundle size minimal
- Use proper caching strategies
## Security
- Sanitize user inputs
- Validate data on server-side
- Follow OWASP guidelines
- Use Content Security Policy

VSCode Extensions that use CoPilot

In addition to the 2 GitHub official CoPilot extensions, here are a few more that I thought were interesting.

You can search the VSCode extensions marketplace with the tag chat-participant to see the full list.

References