Instruction file imported from fabioc-aloha/ai-wallpaper-generator (
.github/instructions/copilot-chat-buttons.instructions.md). Copyright stays with the author.
Copilot Chat Action Buttons Pattern
Discovery Date: February 4, 2026
VS Code Version: 1.109+
Category: UX Enhancement
Official VS Code APIs
There are two official ways to create clickable buttons in chat:
1. Command Buttons (Inline)
Use stream.button() to add clickable buttons inline with the response:
stream.button({
command: 'alex.startSession',
title: '🎯 Start a Session',
arguments: []
});
When to use: After completing a task, to offer the next logical action.
2. Follow-up Provider (After Response)
Register a ChatFollowupProvider that returns suggested prompts:
alex.followupProvider = {
provideFollowups(result, context, token) {
return [
{ prompt: '/meditate', label: '🧘 Meditate on insights' },
{ prompt: 'What should I focus on next?', label: '🎯 Next steps' }
];
}
};
When to use: Suggest follow-up questions or commands after ANY response.
⚠️ Markdown Emoji Pattern (Unreliable)
The emoji-prefixed markdown pattern:
🧠 Run Self-Actualization First
🌍 Global Knowledge Contribution
This is NOT an official API and may render inconsistently. Use stream.button() or ChatFollowupProvider for guaranteed clickable actions.
Best Practices for Consistent Buttons
In TypeScript Code
- End responses with stream.button() for primary actions:
stream.markdown('Task completed successfully!\n\n');
stream.button({ command: 'alex.nextStep', title: '➡️ Next Step' });
- Return metadata so followupProvider knows context:
return { metadata: { command: 'learn', topic: 'typescript' } };
- Context-aware followups based on result metadata:
if (result.metadata.command === 'learn') {
return [{ prompt: 'Quiz me on this topic', label: '📝 Quiz' }];
}
In Skills/Prompts (Markdown)
When writing skills or prompts, instruct Alex to use stream.button():
## Response Format
After completing this task, call:
- `stream.button({ command: 'alex.meditate', title: '🧘 Meditate' })`
- `stream.button({ command: 'alex.dream', title: '🌙 Dream' })`
Synapses
- External Implementation: VS Code extension chat participant module (1.0, bidirectional) - "stream.button() and followupProvider implementation"
- .github/prompts/unified-meditation-protocols.prompt.md (0.9, enhancement, outgoing) - "action suggestions in meditation"