Build a Reusable GitHub Copilot .prompt.md Workflow for Teams

Get a ready-to-commit .prompt.md file with valid YAML frontmatter, scoped Copilot tool permissions, and a deterministic verification loop for your team.

Agent prompt for ChatGPT and Claude

You get: File Path, prompt File and team Rollout Note

Prompt

Prompt
Act as a Staff Developer Experience Engineer who builds standardized GitHub Copilot workflows for engineering teams.

Your job is to write a complete, ready-to-commit .prompt.md file that teammates can invoke in GitHub Copilot Chat with a single slash command.

First, ask these 3 short questions in one numbered message and wait for my answers:
1. What repeatable task should this slash command run (such as PR security review, endpoint scaffolding, or unit test generation)?
2. What language, framework, and test or lint command does the repository use?
3. Should Copilot only read and suggest edits, or modify files and run terminal commands?

Once I reply, follow these rules:
- Include valid YAML frontmatter with description, mode, and a minimal tools list scoped only to what the task requires.
- Write concrete, numbered instructions that reference real repository paths instead of vague guidance.
- Add a deterministic verification step using the exact test, typecheck, or lint command before finishing.
- Keep the file under 80 lines so it stays readable in version control.

Output format:
- File Path: exact path under .github/prompts/
- Prompt File: the complete .prompt.md file in one Markdown code block
- Team Rollout Note: 2-3 bullets on how to invoke and verify it locally

End with one line listing any assumptions about repository layout or tool permissions.

Example output

What the add-route-tests prompt does when runSix-step workflow in .github/prompts/add-route-tests.prompt.md
  1. Inspect route and schemaStep 1Read the handler, Zod schema and nearest spec
  2. Create or update test fileStep 2Use Supertest and Vitest in tests/routes/
  3. Cover four casesStep 3200/201, 400, 401 and 404 responses
  4. Keep validators unmockedStep 4Use the shared test app in tests/helpers/app.ts
  5. Run tests and typecheckStep 5Fix and re-run until both exit with code 0
  6. Summarize resultsStep 6Report added cases and final command output

Example for: a TypeScript Express API team automating Vitest integration test generation with edit and terminal permissions.

File Path

.github/prompts/add-route-tests.prompt.md

Prompt File
---
description: Generate Vitest integration tests for an Express route handler
mode: agent
tools:
  - codebase
  - editFiles
  - runInTerminal
---

Write integration tests for the currently open Express route file under `src/routes/`.

1. Inspect the route handler, its Zod request schema in `src/schemas/`, and the nearest existing spec in `tests/routes/` to match helper imports and database fixtures.
2. Create or update the matching test file in `tests/routes/` using Supertest and Vitest.
3. Cover four cases: valid payload returning 200 or 201, missing required fields returning 400, unauthenticated request returning 401, and a missing resource returning 404.
4. Do not mock the Zod validator or Express middleware; use the shared test app from `tests/helpers/app.ts`.
5. Run `npm run test -- tests/routes/` and `npm run typecheck` in the terminal. If any test or type check fails, fix the test file and re-run until both commands exit with code 0.
6. Summarize the added test cases and report the final command output.
Team Rollout Note
  • Commit .github/prompts/add-route-tests.prompt.md to your default branch so VS Code discovers it automatically.
  • Open any file in src/routes/, open Copilot Chat, and type /add-route-tests to run the workflow.
  • Test it once on src/routes/invoices.ts to confirm the terminal command runs cleanly in your local environment.

Assumptions: Your team uses VS Code with prompt files enabled, stores route tests in tests/routes/, and exposes a shared Express test app at tests/helpers/app.ts.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Asks 3 targeted questions first so the generated frontmatter, paths, and commands match your actual repository.
  • Enforces least-privilege tool scoping in YAML so read-only workflows never accidentally edit files or run shell commands.
  • Requires an explicit test or lint command loop so Copilot verifies its own output before finishing.

Use this in ChatGPT, Claude, or GitHub Copilot Chat when standardizing a repeatable engineering task. Have your repo stack, desired slash command name, and exact test or lint command ready.

Common edits

  • Add a rule requiring a specific model in the YAML frontmatter if your team standardizes on one Copilot model.
  • Ask for two variants in one run: a read-only review prompt and an agent-mode autofix prompt.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Audit Cursor Rules Files for Conflicts and Context Bloat

Get a line-by-line audit of your .cursor/rules files that flags overlapping globs, contradictory instructions, and token waste, plus a consolidation diff.

Implement a Scoped Feature in Copilot Agent Mode with Repo Discovery and Tests

Guides GitHub Copilot agent mode to inspect the repository, state assumptions, plan a minimal change, implement it, and add tests. It ends with a verification report you can use to decide whether to open a PR.

AI SEOClaude

Draft LLM-Ready API Deprecation Notices with Migration Syntax

Generates unambiguous API deprecation docs with version cutoffs and side-by-side migration code designed for LLM coding agents to ingest without errors.