ApplicationInsights-node.js / workflows
Copilot instructions334 starsChanged 17 months agoMITView on GitHub
These instructions help GitHub Copilot generate code that aligns with our team's standards and avoids common issues in JavaScript and TypeScript development. Before suggesting code, ensure:
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
28 rules. About 0 are common, 25 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈25
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use only officially supported JavaScript and TypeScript APIs.
- Very specific: line 10
Avoid suggesting third-party libraries unless explicitly listed in package.json.
- Distinctive: line 11
Prefer native language features over external utilities.
- Very specific: line 19
Only use officially supported JavaScript/TypeScript APIs and Node.js built-in modules
- Distinctive: line 20
Avoid experimental, deprecated, or non-standard APIs
- Very specific: line 21
Verify API availability in the target Node.js version before suggesting
- Distinctive: line 22
Prefer stable, documented APIs over cutting-edge features
- Distinctive: line 26
Avoid any types and type assertions without justification
- Distinctive: line 27
Prefer proper typing and type guards for unknown data
- Distinctive: line 31
Avoid unsafe property access that could throw errors
- Distinctive: line 32
Prefer safe navigation with optional chaining and nullish coalescing
- Distinctive: line 36
Avoid ignoring errors or using generic catch blocks
- Distinctive: line 37
Prefer explicit error handling with proper typing and meaningful error messages
- Distinctive: line 41
Avoid Promise constructor anti-patterns and missing error handling
- Distinctive: line 42
Prefer proper async patterns with comprehensive error handling
- Distinctive: line 46
Avoid mutating operations and unsafe array access
- Distinctive: line 47
Prefer immutable operations and safe access patterns
- Distinctive: line 51
Avoid unclear parameter types and missing return types
- Distinctive: line 52
Prefer explicit types and input validation
- Distinctive: line 56
Avoid var declarations and unnecessary let usage
- Distinctive: line 57
Prefer const by default, let only when reassignment is needed
- Distinctive: line 61
Avoid loose equality and implicit boolean conversions
- Distinctive: line 62
Prefer strict equality and explicit checks
- Distinctive: line 66
Avoid unremoved event listeners and unclosed resources
- Distinctive: line 67
Prefer proper cleanup patterns and resource management
- Distinctive: line 71
Avoid unnecessary operations in loops and inefficient patterns
- Distinctive: line 72
Prefer optimized patterns and consider memoization for expensive operations
- Distinctive: line 78
Before suggesting code, ensure:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Instructions for TypeScript and JavaScript Projects
These instructions help GitHub Copilot generate code that aligns with our team's standards and avoids common issues in JavaScript and TypeScript development.
✅ General Guidelines
- Use only officially supported JavaScript and TypeScript APIs.
- Avoid suggesting third-party libraries unless explicitly listed in
package.json. - Prefer native language features over external utilities.
🛡️ Common Issue Prevention Checks
1. Official API Usage
- Only use officially supported JavaScript/TypeScript APIs and Node.js built-in modules
- Avoid experimental, deprecated, or non-standard APIs
- Verify API availability in the target Node.js version before suggesting
- Prefer stable, documented APIs over cutting-edge features
2. Type Safety (TypeScript)
- Avoid any types and type assertions without justification
- Prefer proper typing and type guards for unknown data
3. Null/Undefined Safety
- Avoid unsafe property access that could throw errors
- Prefer safe navigation with optional chaining and nullish coalescing
4. Error Handling
- Avoid ignoring errors or using generic catch blocks
- Prefer explicit error handling with proper typing and meaningful error messages
5. Async/Await Best Practices
- Avoid Promise constructor anti-patterns and missing error handling
- Prefer proper async patterns with comprehensive error handling
6. Array and Object Operations
- Avoid mutating operations and unsafe array access
- Prefer immutable operations and safe access patterns
7. Function Parameters and Return Types
- Avoid unclear parameter types and missing return types
- Prefer explicit types and input validation
8. Variable Declarations
- Avoid var declarations and unnecessary let usage
- Prefer const by default, let only when reassignment is needed
9. Comparison Operations
- Avoid loose equality and implicit boolean conversions
- Prefer strict equality and explicit checks
10. Memory Leaks Prevention
- Avoid unremoved event listeners and unclosed resources
- Prefer proper cleanup patterns and resource management
11. Performance Considerations
- Avoid unnecessary operations in loops and inefficient patterns
- Prefer optimized patterns and consider memoization for expensive operations
📋 Code Review Checklist
Before suggesting code, ensure:
- Only official APIs and standard library features are used
- All variables have appropriate types (TypeScript)
- Null/undefined safety is handled
- Errors are properly caught and handled
- No memory leaks (event listeners, timers, etc.)
- Functions have single responsibility
- No magic numbers or strings (use constants)
- Async operations are properly awaited
- Arrays/objects are not mutated unexpectedly
- Performance implications are considered
- Code follows existing project patterns
🚀 Modern JavaScript/TypeScript Features to Prefer
- Optional chaining (
?.) and nullish coalescing (??) - Destructuring assignment for cleaner code
- Template literals instead of string concatenation
- Arrow functions for short, pure functions
constassertions for immutable datasatisfiesoperator for type checking without wideningRecord<K, V>for object types with known keys
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

