Skip to content

Instantly share code, notes, and snippets.

@rockyburt
Last active August 6, 2025 14:08
Show Gist options
  • Save rockyburt/84295d956b1f6547cc2a251af5220acd to your computer and use it in GitHub Desktop.
Save rockyburt/84295d956b1f6547cc2a251af5220acd to your computer and use it in GitHub Desktop.
Developer AI Tips and Tricks

Developer AI Tips and Tricks

GitHub Copilot

USE AGENT MODE:

  • To use Copilot to run and troubleshoot Rentals-API tests, follow these steps:

    1. In a separate terminal, run make dev_shell to start the Docker container.
    2. Use docker container ls to find the container name.
    3. Use this Copilot chat prompt in agent mode:

    In order to run pytest-based tests, the steps are:

    1. connect to docker container: -somecontainername-
    2. run cd /rentals/api/src/Rentals-API
    3. run pytest

    Can you run the tests just for the test_quick_rental_listing module and troubleshoot the problems?

    Added: Fri, Aug-06-2025

  • When asking Copilot to do a multi-step task, be sure to tell it to record its progress in a file such as worklog.md, so that you can watch it being updated in real time as Copilot goes about its work.

    Added: Fri, Jul-25-2025

  • If you're using Copilot Chat to help build tests and other tasks, be sure to use custom instructions that Copilot keeps in mind for every chat session.

    Added: Fri, Jul-25-2025

  • Instruct chat to:

    Run pytest -k sometestmatch and fix any errors found

    to run pytest on a specific test and troubleshoot the errors.

    Added: Fri, Jul-25-2025

  • While working with an older Python file, use copilot chat to:

    Run poetry run ruff check on the current file and fix all warnings.

    Fill in all those missing docstrings and such 🙂

    Added: Fri, Jul-25-2025

  • To improve a spec file, use the following:

    Review this document:

    • fix grammar mistakes
    • make sure language is concise
    • offer suggestions for improved readibility and the removal of ambiguity

    And finally:

    • make sure there are no lint warnings or errors
    • restrict line length to 119 columns

    Added: Fri, Jul-25-2025

  • If the chat modifies a file but gets a minor detail wrong (e.g., using an incorrect type for a field), ask it to explain its reasoning. This feedback helps you refine future prompts and reduces the chance of the AI making incorrect assumptions.

    Added: Wed, Jul-30-2025

References


Last modified: Wed, Jul-30-2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment