Skip to content

Commit 307843f

Browse files
committed
Restructure for readability
1 parent 539d35e commit 307843f

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

docs/copilot/copilot-customization.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -148,73 +148,85 @@ Common use cases include:
148148

149149
- `react-form.prompt.md` - documents a reusable task for generating a form:
150150

151-
```markdown
152-
Your goal is to generate a new React form component.
151+
```markdown
152+
Your goal is to generate a new React form component.
153153

154-
Ask for the form name and fields if not provided.
154+
Ask for the form name and fields if not provided.
155155

156-
Requirements for the form:
157-
- Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
158-
- Use `react-hook-form` for form state management:
156+
Requirements for the form:
157+
- Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
158+
- Use `react-hook-form` for form state management:
159159
- Always define TypeScript types for your form data
160160
- Prefer *uncontrolled* components using register
161161
- Use `defaultValues` to prevent unnecessary rerenders
162-
- Use `yup` for validation:
162+
- Use `yup` for validation:
163163
- Create reusable validation schemas in separate files
164164
- Use TypeScript types to ensure type safety
165165
- Customize UX-friendly validation rules
166-
```
166+
```
167167

168168
- `security-api.prompt.md` - documents reusable security practices for REST APIs, which can be used to do security reviews of REST APIs:
169169

170-
```markdown
171-
Secure REST API review:
172-
- Ensure all endpoints are protected by authentication and authorization
173-
- Validate all user inputs and sanitize data
174-
- Implement rate limiting and throttling
175-
- Implement logging and monitoring for security events
176-
177-
```
170+
```markdown
171+
Secure REST API review:
172+
- Ensure all endpoints are protected by authentication and authorization
173+
- Validate all user inputs and sanitize data
174+
- Implement rate limiting and throttling
175+
- Implement logging and monitoring for security events
176+
177+
```
178178

179179
### Usage
180180

181-
To enable prompt files, configure the `setting(chat.promptFiles)` VS Code setting. Set it to `true` or use the `{ "/path/to/folder": boolean }` notation to specify a different path. Relative paths are resolved from the root folder(s) of your workspace, and the default value of `.github/prompts` is used if no other paths provided.
181+
To enable prompt files, configure the `setting(chat.promptFiles)` VS Code setting. By default, prompt files are located in the `.github/prompts` directory of your workspace. You can also [specify additional folders](#prompt-files-experimental-settings) where prompt files are located.
182182

183-
To use prompt files, follow these steps:
183+
#### Create a prompt file
184184

185185
1. Create a `.prompt.md` file in the `.github/prompts` directory of your workspace.
186186

187-
2. Write prompt instructions by using Markdown formatting.
187+
1. Write prompt instructions by using Markdown formatting.
188188

189-
Reference additional workspace files as Markdown links (`[index](../index.ts)`), or as `#file:../index.ts` references within the prompt file. You can also reference other `.prompt.md` files.
189+
Within a prompt file, reference additional workspace files as Markdown links (`[index](../index.ts)`), or as `#file:../index.ts` references within the prompt file.
190190

191-
1. Select the Attach <i class="codicon codicon-attach"></i> icon, then select **Prompt...** and choose the prompt file to attach it in Copilot Chat or Edits.
191+
You can also reference other `.prompt.md` files to create a hierarchy of prompts, with reusable prompts that can be shared across multiple prompt files.
192+
193+
#### Attach a prompt file to a chat request
194+
195+
1. Select the **Attach Context** <i class="codicon codicon-attach"></i> icon (`kb(workbench.action.chat.attachContext)`), and then select **Prompt...**.
196+
197+
1. Choose a prompt file from the Quick Pick to attach it to your chat request.
198+
199+
You can use prompt files in both Copilot Chat and Copilot Edits.
192200

193201
1. Optionally, attach additional context files required for the task.
194202

195-
1. Send the chat prompt
203+
For reusable tasks, send the prompt without any additional instructions.
196204

197-
- For reusable tasks, send the prompt without any additional instructions.
198-
199-
- Include additional instructions to provide more context for the task at hand.
205+
To further refine a reusable prompt, include additional instructions to provide more context for the task at hand.
200206

201207
> [!TIP]
202208
> Reference additional context files like API specs or documentation by using Markdown links to provide Copilot with more complete information.
203209

204210
## Settings
205211

206-
### Custom instructions
212+
### Custom instructions settings
207213

208214
* `setting(github.copilot.chat.codeGeneration.instructions)` _(Experimental)_: A set of instructions that will be added to Copilot requests that generate code.
209215
* `setting(github.copilot.chat.codeGeneration.useInstructionFiles)` _(Preview)_: Controls whether code instructions from `.github/copilot-instructions.md` are added to Copilot requests.
210216
* `setting(github.copilot.chat.testGeneration.instructions)` _(Experimental)_: A set of instructions that will be added to Copilot requests that generate tests.
211217
* `setting(github.copilot.chat.reviewSelection.instructions)` _(Preview)_: A set of instructions that will be added to Copilot requests for reviewing the current editor selection.
212218
* `setting(github.copilot.chat.commitMessageGeneration.instructions)` _(Experimental)_: A set of instructions that will be added to Copilot requests that generate commit messages.
213219

214-
### Prompt files (experimental)
220+
### Prompt files (experimental) settings
215221

216222
* `setting(chat.promptFiles)` _(Experimental)_: enable prompt files and specify prompt file folder(s). Set to `true` to use the default location (`.github/prompts`), or use the `{ "/path/to/folder": boolean }` notation to specify a different path. Relative paths are resolved from the root folder(s) of your workspace.
217223

224+
| Setting value | Description |
225+
|---------------|-------------|
226+
| `false` (default) | Disable prompt files. |
227+
| `true` | Enable prompt files. Use the default prompt file location (`.github/prompts`). |
228+
| `{ "/path/to/folder": boolean }` | Enable prompt files. Specify one or more folders where prompt files are located. Relative paths are resolved from the root folder(s) of your workspace. |
229+
218230
## Related content
219231

220232
* Start AI chat conversations with [Copilot Chat](/docs/copilot/copilot-chat.md).

0 commit comments

Comments
 (0)