

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456Guidelines for creating, registering, and testing model-specific prompts via the `PromptRegistry` system.78## Prompt Registry910The `PromptRegistry` in `promptRegistry.ts` maps AI models to their optimal prompt structures. Each model provider has a **resolver** class implementing `IAgentPrompt` that returns prompt customizations for that provider's models.1112### Resolution Order1314When `PromptRegistry.resolveAllCustomizations()` is called:151. **Phase 1 — `matchesModel()`**: Iterates registered resolvers in order, calling `matchesModel()`. First `true` wins.162. **Phase 2 — `familyPrefixes`**: If no `matchesModel` matched, checks `endpoint.family.startsWith(prefix)`. First match wins.173. **Defaults**: If no resolver matches, defaults are used for all customizations.1819Registration order matters — more specific resolvers (e.g., hash-based) should be registered before broader ones (e.g., prefix-based fallbacks).2021### Resolver Interface2223The `IAgentPrompt` interface provides these customization methods:2425| Method | Returns | Purpose |26|--------|---------|--------|27| `resolveSystemPrompt(endpoint)` | `SystemPrompt` | Main system prompt class |28| `resolveReminderInstructions?(endpoint)` | `ReminderInstructionsConstructor` | Reminder instructions appended to user messages |29| `resolveToolReferencesHint?(endpoint)` | `ToolReferencesHintConstructor` | Tool usage hints |30| `resolveCopilotIdentityRules?(endpoint)` | `CopilotIdentityRulesConstructor` | Identity/role rules |31| `resolveSafetyRules?(endpoint)` | `SafetyRulesConstructor` | Safety rules |32| `resolveUserQueryTagName?(endpoint)` | `string` | Tag name wrapping user queries |3334All methods are optional except `resolveSystemPrompt`. Unimplemented methods fall back to defaults (`DefaultReminderInstructions`, `DefaultToolReferencesHint`, etc.).3536### Dependency Injection in Resolvers3738Resolvers are created via `instantiationService.createInstance()`, so they support full constructor DI. Inject `IConfigurationService`, `IExperimentationService`, etc. to read experiment flags or config values:3940```typescript41class MyProviderPromptResolver implements IAgentPrompt {42 static readonly familyPrefixes = ['my-model'];4344 constructor(45 @IConfigurationService private readonly configurationService: IConfigurationService,46 @IExperimentationService private readonly experimentationService: IExperimentationService,47 ) { }4849 private getVariant(): string {50 return this.configurationService.getExperimentBasedConfig(51 ConfigKey.MyPromptVariant, this.experimentationService);52 }5354 resolveSystemPrompt(endpoint: IChatEndpoint): SystemPrompt | undefined {55 if (this.getVariant() === 'optimized') {56 return MyOptimizedPrompt;57 }58 if (endpoint.model?.includes('v4')) {59 return MyV4Prompt;60 }61 return MyDefaultPrompt;62 }6364 resolveReminderInstructions(endpoint: IChatEndpoint): ReminderInstructionsConstructor | undefined {65 if (this.getVariant() === 'optimized') {66 return MyOptimizedReminderInstructions;67 }68 return MyDefaultReminderInstructions;69 }7071 resolveCopilotIdentityRules(endpoint: IChatEndpoint): CopilotIdentityRulesConstructor | undefined {72 return MyCopilotIdentityRules;73 }7475 resolveSafetyRules(endpoint: IChatEndpoint): SafetyRulesConstructor | undefined {76 return MySafetyRules;77 }78}79```8081See `AnthropicPromptResolver` in `anthropicPrompts.tsx` for a production example using config and experiment flags across multiple resolve methods.8283## Creating a New Model Prompt8485### 1. Create the prompt component8687Copy `DefaultAgentPrompt` from `defaultAgentInstructions.tsx`:8889```tsx90export class MyProviderAgentPrompt extends PromptElement<DefaultAgentPromptProps> {91 async render(state: void, sizing: PromptSizing) {92 const tools = detectToolCapabilities(this.props.availableTools);93 return <InstructionMessage>94 {/* Your customizations here */}95 </InstructionMessage>;96 }97}98```99100### 2. Create the resolver101102A resolver can match models by hash (via `matchesModel`) and/or by family prefix:103104```typescript105class MyProviderPromptResolver implements IAgentPrompt {106 static readonly familyPrefixes = ['my-model', 'provider-name'];107108 // Optional: hash-based matching for models that can't be identified by prefix109 static async matchesModel(endpoint: IChatEndpoint): Promise<boolean> {110 return isMyModel(endpoint);111 }112113 resolveSystemPrompt(endpoint: IChatEndpoint): SystemPrompt | undefined {114 return MyProviderAgentPrompt;115 }116117 resolveReminderInstructions(endpoint: IChatEndpoint): ReminderInstructionsConstructor | undefined {118 return MyProviderReminderInstructions;119 }120}121```122123A single resolver can return different prompts for different models within the same family using conditional logic inside `resolveSystemPrompt`.124125### 3. Register and import126127Register at the bottom of the file:128129```typescript130PromptRegistry.registerPrompt(MyProviderPromptResolver);131```132133Then add the import in `allAgentPrompts.ts`.134135### 4. Test136137Add your model family to the list at the top of `test/agentPrompt.spec.tsx`. This renders the prompt for your model with different input scenarios and validates against snapshots.138139## Prompt Authoring Principles140141- **Start with defaults** — most models infer correct behavior from tool definitions alone. Only customize if the model consistently fails.142- **Make minimal adjustments** — add 1-2 sentences targeting specific issues rather than over-specifying.143- **Use conditional sections** — wrap instructions in tool availability checks (`detectToolCapabilities`).144- **Remove redundancy** — avoid repeating what tool definitions already convey.145146### Behaviors to Validate147148Run the model through test scenarios and check these categories before adding customizations:149150**1. Tool Usage Patterns**151- Uses edit tools (`replace_string_in_file`, `apply_patch`, `insert_edit_into_file`) instead of code blocks152- Uses code search tools (`read_file`, `semantic_search`, `grep_search`, `file_search`) to gather context153- Uses terminal tool (`run_in_terminal`) instead of bash commands154- Does NOT use terminal tools to create, edit, or update files — always uses dedicated edit tools155- Uses planning tools (`manage_todo_list`) for complex tasks156157**2. Response Format**158- File paths and symbols linkified159- Structured markdown with headers and sections160- Concise, well-timed progress updates between tool calls161162**3. Workflow Execution**163- Gathers context before acting164- Completes tasks end-to-end without pausing to check with user165- Handles errors and iterates appropriately166167### Common Model Misbehaviors and Fixes168169Only add these if the model **consistently** fails the behavior. Target the specific issue with 1-2 sentences:170171```tsx172// Fix: Model shows code blocks instead of using edit tools173{tools[ToolName.ReplaceStringInFile] && <>174 NEVER print out a code block with file changes unless the user asked for it.175 Use the appropriate edit tool (replace_string_in_file, apply_patch, or insert_into_file).176</>}177178// Fix: Model calls terminal tool in parallel179{tools[ToolName.CoreRunInTerminal] && <>180 Don't call the run_in_terminal tool multiple times in parallel.181 Instead, run one command and wait for the output before running the next command.182</>}183184// Fix: Model doesn't use TODO tool for planning185{tools[ToolName.CoreManageTodoList] && <>186 For complex multi-step tasks, use the manage_todo_list tool to track your progress187 and provide visibility to the user.188</>}189190// Fix: Model front-loads thinking and only summarizes at the end191Provide brief progress updates every 3-5 tool calls to keep the user informed of your progress.<br />192After completing parallel tool calls, provide a brief status update before proceeding to the next step.<br />193```194
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| microsoft/vscodeextensions/copilot/src/platform/authentication/common/AGENTS.md · 189k | AGENTS.md | archsecurityagent-behaviour | 58/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss.instructions.md · 189k | Copilot instructions | git | 44/100 | 14 days ago | |
| microsoft/vscode.github/copilot-instructions.md · 189k | Copilot instructions | stylearchtypesui+2 | 74/100 | 13 days ago | |
| microsoft/vscode.github/instructions/accessibility.instructions.md · 189k | Copilot instructions | styledo-not | 61/100 | 14 days ago | |
| microsoft/vscode.github/instructions/agentHostTesting.instructions.md · 189k | Copilot instructions | teststyletesting-strategyagent-behaviour | 55/100 | 7 days ago | |
| microsoft/vscode.github/instructions/best-practices.instructions.md · 189k | Copilot instructions | styleui | 60/100 | today | |
| microsoft/vscode.github/instructions/chat.instructions.md · 189k | Copilot instructions | agent-behaviour | 39/100 | today | |
| microsoft/vscode.github/instructions/coding-guidelines.instructions.md · 189k | Copilot instructions | styletypesuidocs | 60/100 | 14 days ago | |
| microsoft/vscode.github/instructions/committing.instructions.md · 189k | Copilot instructions | do-not | 23/100 | 14 days ago | |
| microsoft/vscode.github/instructions/css-best-practices.instructions.md · 189k | Copilot instructions | styleui | 29/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-philosophy.instructions.md · 189k | Copilot instructions | style | 34/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-tokens.instructions.md · 189k | Copilot instructions | styledo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/interactive.instructions.md · 189k | Copilot instructions | ui | 43/100 | 14 days ago | |
| microsoft/vscode.github/instructions/notebook.instructions.md · 189k | Copilot instructions | no sections | 48/100 | 14 days ago | |
| microsoft/vscode.github/instructions/observables.instructions.md · 189k | Copilot instructions | no sections | 40/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss-third-party-notices.instructions.md · 189k | Copilot instructions | buildgitdependenciesdeployment+1 | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/sessions.instructions.md · 189k | Copilot instructions | no sections | 24/100 | today | |
| microsoft/vscode.github/instructions/source-code-organization.instructions.md · 189k | Copilot instructions | do-not | 73/100 | 14 days ago | |
| microsoft/vscode.github/instructions/telemetry.instructions.md · 189k | Copilot instructions | styletypesdo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/tree-widgets.instructions.md · 189k | Copilot instructions | stylearchperformance | 62/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/microsoft-vscode-extensions-copilot-github-instructions-model-prompts-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.