alpha

Sets guidelines for writing good GitHub Copilot custom instruction files: required frontmatter, structure, sections, naming and a validation checklist.
description: 'Guidelines for creating high-quality custom instruction files for GitHub Copilot'
applyTo: '**/*.instructions.md'
Instructions for creating effective and maintainable custom instruction files that guide GitHub Copilot in generating domain-specific code and following project conventions.
react-best-practices.instructions.md).github/instructions/ directoryEvery instruction file must include YAML frontmatter with the following fields:
---
description: 'Brief description of the instruction purpose and scope'
applyTo: 'glob pattern for target files (e.g., **/*.ts, **/*.py)'
---
'**/*.ts''**/*.ts, **/*.tsx, **/*.js''src/**/*.py''**'A well-structured instruction file should include the following sections:
# headingOrganize content into logical sections based on the domain:
Provide concrete examples with clear labels:
### Good Example
\`\`\`language
// Recommended approach
code example here
\`\`\`
### Bad Example
\`\`\`language
// Avoid this pattern
code example here
\`\`\`
| Altitude | Failure Mode | Result |
| --- | --- | --- |
| Over-specified | Brittle if-else prose | Breaks on unlisted cases |
| Under-specified | Assumes shared context | Generic outputs |
| Right altitude | Heuristics + examples | Stable, generalizable quality |
## Security Best Practices
- Always validate user input before processing
- Use parameterized queries to prevent SQL injection
- Store secrets in environment variables, never in code
- Implement proper authentication and authorization
- Enable HTTPS for all production endpoints
## Common Issues
| Issue | Solution | Example |
| ---------------- | ------------------- | ----------------------------- |
| Magic numbers | Use named constants | `const MAX_RETRIES = 3` |
| Deep nesting | Extract functions | Refactor nested if statements |
| Hardcoded values | Use configuration | Store API URLs in config |
### Good Example - Using TypeScript interfaces
\`\`\`typescript
interface User {
id: string;
name: string;
email: string;
}
function getUser(id: string): User {
// Implementation
}
\`\`\`
### Bad Example - Using any type
\`\`\`typescript
function getUser(id: any): any {
// Loses type safety
}
\`\`\`
## Framework Selection
- **For small projects**: Use Minimal API approach
- **For large projects**: Use controller-based architecture with clear separation
- **For microservices**: Consider domain-driven design patterns
Before finalizing instruction files:
applyTo patterns match intended filesHere's a minimal example structure for a new instruction file:
---
description: 'Brief description of purpose'
applyTo: '**/*.ext'
---
# Technology Name Development
Brief introduction and context.
## General Instructions
- High-level guideline 1
- High-level guideline 2
## Best Practices
- Specific practice 1
- Specific practice 2
## Code Standards
### Naming Conventions
- Rule 1
- Rule 2
### File Organization
- Structure 1
- Structure 2
## Common Patterns
### Pattern 1
Description and example
\`\`\`language
code example
\`\`\`
### Pattern 2
Description and example
## Validation
- Build command: `command to verify`
- Linting: `command to lint`
- Testing: `command to test`
© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com


Woman Defeats Attacker on Subway Platform
Describes a 10-second cinematic subway-platform action sequence in which a woman defeats a larger attacker, with shot-by-shot coverage and character consistency rules.
video-prompt, seedance, action, martial-arts, multi-shot, camera-movement, handheld, low-angle, character-consistency, cinematic, negative-prompt, photorealistic, moody, timed-beats, tracking-shot, dramatic-lighting, guardrails, structured-output, long-form

Woman raises iced tea bottle under sunny sky
Generates a nine-scene storyboard commercial for a Chinese iced tea, with shot types, camera moves and sound effects per scene, in an energetic Japanese summer-ad style.
video-prompt, hailuo, video-ad, product-video, storyboard, multi-panel, multi-shot, sound-effects, camera-movement, slow-motion, macro, low-angle, photorealistic, vibrant-colors, natural-light, summer, advertising, for-marketers, food-photography, character-consistency, text-rendering, cinematic, long-form, structured-output, product-photography

White futuristic car lifts off from city traffic
Generates a 13-second realistic video where a white angular futuristic car in city traffic suddenly lifts off like a rocket, looping through the sky with smoke trails.
video-prompt, seedance, sci-fi, futuristic, cars, cityscape, timed-beats, multi-shot, cinematic, visual-effects, scene-transitions, photorealistic, character-consistency, text-rendering, transformation, long-form, humorous, camera-movement, natural-light, negative-prompt
Loading reviews…
Loading comments…