Feedback

Chat Icon

Building with GitHub Copilot

From Autocomplete to Autonomous Agents

If Content is King, Then Context is God
62%

Prompt Files: Reusable, Maintainable, and Shareable Prompts

Another way to make your journey more productive is by using prompt files.

Prompt files, in addition to their contextual value, also bring reusability to the table. You can create one or more prompt files stored under .github/prompts/ in your workspace.

These Markdown files use the .prompt.md naming convention and can be imported as a context manually when needed. They are primarily used to create prompts that are reusable, maintainable, and easy to share. In the settings.json file, you need to add "chat.promptFiles": true to enable them. You can also use this link vscode://settings/chat.promptFiles to open the specific setting directly.

Let's say you use Copilot to refactor your code after every feature you implement. You have a specific way you want your code to be refactored. Instead of writing the same prompt over and over again, you can create a prompt file called refactor.prompt.md, write your prompt, then import it as a context (Add context -> Prompts or Related files -> prompts/refactor.prompt.md) whenever you need it.

Building with GitHub Copilot

From Autocomplete to Autonomous Agents

Enroll now to unlock all content and receive all future updates for free.