Skip to content

Commit 7498473

Browse files
authored
docs: add prompt files documentation (#201)
* docs: add prompt files documentation Describes available prompt files, how to download them individually (bash and PowerShell), and how to use them in VS Code and GitHub Copilot CLI. * docs: add prompt-files.md to docs README structure
1 parent 0720b0d commit 7498473

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ docs/
6666
│ ├── multi-team-workflows.md — Selective extraction, CODEOWNERS
6767
│ ├── code-first-workflow.md — IDE → git → CI/CD → APIM
6868
│ ├── token-substitution.md — Pipeline token/placeholder substitution
69+
│ ├── prompt-files.md — Copilot prompt files for APIOps tasks
6970
│ └── migration-from-v1.md — Migrate from Azure/apiops toolkit
7071
├── ci-cd/
7172
│ ├── github-actions.md — GitHub Actions integration

docs/guides/prompt-files.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Prompt Files
2+
3+
APIOps provides [prompt files](https://code.visualstudio.com/docs/copilot/copilot-customization#_reusable-prompt-files-experimental) that guide GitHub Copilot through common APIOps configuration tasks. These are reusable `.prompt.md` files that give Copilot the context it needs to help you configure extraction filters, environment overrides, and CI/CD identity setup.
4+
5+
## What are prompt files?
6+
7+
Prompt files are markdown files with a `.prompt.md` extension that provide instructions and context to GitHub Copilot. When you open a prompt file in VS Code and invoke Copilot, it uses the file's content as context to guide you through a task interactively.
8+
9+
## Available prompt files
10+
11+
| File | Description |
12+
|------|-------------|
13+
| `apiops-configure-filter.prompt.md` | Guides Copilot through creating a `configuration.extractor.yaml` filter file to control which API Management resources are extracted. See also: [Filtering resources guide](./filtering-resources.md) |
14+
| `apiops-configure-overrides.prompt.md` | Guides Copilot through creating environment override files (`configuration.<env>.yaml`) for promoting APIs across environments. See also: [Environment overrides guide](./environment-overrides.md) |
15+
| `apiops-setup-workflow-identity-github-actions.prompt.md` | Walks through setting up Azure identity (app registration, federated credentials, RBAC) for GitHub Actions CI/CD pipelines. |
16+
| `apiops-setup-workflow-identity-azure-devops.prompt.md` | Walks through setting up Azure identity (app registration, federated credentials, RBAC) for Azure DevOps CI/CD pipelines. |
17+
18+
## Getting prompt files
19+
20+
### Via `apiops init` (recommended)
21+
22+
The easiest way to get prompt files is to run [`apiops init`](../commands/init.md), which scaffolds your repository with prompt files already in place at `.github/prompts/`.
23+
24+
### Download individually
25+
26+
If you already have an APIOps repository and want to add prompt files without re-running init, you can download them directly from this repository.
27+
28+
#### Bash
29+
30+
```bash
31+
# Resolve repo root so this works from any subdirectory
32+
repo_root="$(git rev-parse --show-toplevel)"
33+
34+
# Create the prompts directory
35+
mkdir -p "${repo_root}/.github/prompts"
36+
37+
# Available prompt files — remove any you don't need
38+
files=(
39+
"apiops-configure-filter.prompt.md"
40+
"apiops-configure-overrides.prompt.md"
41+
# Remove the identity setup prompt that doesn't apply to your CI provider:
42+
"apiops-setup-workflow-identity-github-actions.prompt.md"
43+
"apiops-setup-workflow-identity-azure-devops.prompt.md"
44+
)
45+
46+
base_url="https://raw.githubusercontent.com/Azure/apiops-cli/main/src/templates/copilot"
47+
48+
for file in "${files[@]}"; do
49+
curl -sL "${base_url}/${file}" -o "${repo_root}/.github/prompts/${file}"
50+
echo "Downloaded ${file}"
51+
done
52+
```
53+
54+
#### PowerShell
55+
56+
```powershell
57+
# Resolve repo root so this works from any subdirectory
58+
$repoRoot = git rev-parse --show-toplevel
59+
60+
# Create the prompts directory
61+
New-Item -ItemType Directory -Path "$repoRoot/.github/prompts" -Force | Out-Null
62+
63+
# Available prompt files — remove any you don't need
64+
$files = @(
65+
"apiops-configure-filter.prompt.md"
66+
"apiops-configure-overrides.prompt.md"
67+
# Remove the identity setup prompt that doesn't apply to your CI provider:
68+
"apiops-setup-workflow-identity-github-actions.prompt.md"
69+
"apiops-setup-workflow-identity-azure-devops.prompt.md"
70+
)
71+
72+
$baseUrl = "https://raw.githubusercontent.com/Azure/apiops-cli/main/src/templates/copilot"
73+
74+
foreach ($file in $files) {
75+
Invoke-WebRequest -Uri "$baseUrl/$file" -OutFile "$repoRoot/.github/prompts/$file"
76+
Write-Host "Downloaded $file"
77+
}
78+
```
79+
80+
## Further reading
81+
82+
- [VS Code: Reusable prompt files](https://code.visualstudio.com/docs/copilot/copilot-customization#_reusable-prompt-files-experimental)
83+
- [GitHub Copilot in the CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli)

0 commit comments

Comments
 (0)