Skip to main content
Brian Cantoni

Copilot is my Copilot

Migrating this blog to Eleventy has been a good project for learning GitHub Copilot with some real-world scenarios and problem solving. We're currently using Cursor and other in-house AI tools at work, so playing with Copilot here has been a nice comparison. Here's a sample of several ways I used Copilot and how well it worked.

Overall experience with this blog project: Overall Copilot has been very helpful and it's been fun to learn how to get the most out of it. I believe my choice of popular technologies here (JavaScript, Python, Nunjucks templates, Eleventy blog system) have helped Copilot give good answers because there's a ton of existing knowledge out there. Ask mode, edit mode and inline suggestions have really improved even as I've just been using Copilot for a few months now. sentiment_satisfied

Agent mode: This was my first steps into letting the AI run in Agent mode and it showed how effective it can be. I haven't had it do anything super complicated, but for any type of "fix or improve this" task, just giving it the ability to iterate by making a change and then running a build was really helpful. For any new changes I'm most likely to start with Agent mode. sentiment_satisfied

Contextual questions: I like selecting something in a file and asking "explain this" or "why is this JavaScript file imported this way?". A great example was a weird-looking regular expression which it helpfully explained -- it was something I had implemented a few weeks ago but promptly forgot! Comments can be a gift to your future self. sentiment_satisfied

Creating scripts from a short spec: Copilot does very well when given even a short definition of what you want to accomplish. It tends to be pretty verbose and implements things the long simple way, but that's kind of my habit too. A great example was a markup change I needed made in all 600 blog post Markdown files. Originally I had Copilot running in Agent mode to find and modify these files, but it would either get stuck or pause after a few files. Instead I asked it to write the equivalent Python script which I then ran myself and it was quickly finished. Scripts also let you try one first to make sure it's right, then let it loose. sentiment_satisfied

Eleventy and Nunjucks templates: Just using straight Ask mode, Copilot was pretty knowledgeable about the Eleventy blog system and Nunjucks templates, but would sometimes get stuck on simple things or would suggest things that were incorrect. Adding custom instructions for Copilot helped a little bit (I think), but switching to Agent mode where it could check its own work really helped. (See above.) sentiment_neutral

Print stylesheets: Print stylesheets is something I've always found really helpful. Even if I'm the last person who still prints things, even printing to PDF comes through a lot cleaner. It's a nice touch for visitors to your site. For my WordPress site I had hand-crafted a print stylesheet, so I asked Copilot to do the same for the new Eleventy blog. I used a pretty simple prompt: "In this CSS file please create a print media stylesheet that will adjust styles to make everything look clean when printed. The index.html file is an example output page from this blog. I'd like the print output to include the page title, date and the content section." The results were pretty good, if not a bit verbose. It really liked the !important attribute and used it liberally :) I made a couple of manual tweaks but overall it worked pretty well. sentiment_neutral