agentleFS
MicrosoftKnown publishermicrosoft/ApplicationInsights-node.js/.github/workflows/copilot-instructions.md

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
  1. Distinctive:

    Use only officially supported JavaScript and TypeScript APIs.

    line 9
  2. Very specific:

    Avoid suggesting third-party libraries unless explicitly listed in package.json.

    line 10
  3. Distinctive:

    Prefer native language features over external utilities.

    line 11
  4. Very specific:

    Only use officially supported JavaScript/TypeScript APIs and Node.js built-in modules

    line 19
  5. Distinctive:

    Avoid experimental, deprecated, or non-standard APIs

    line 20
  6. Very specific:

    Verify API availability in the target Node.js version before suggesting

    line 21
  7. Distinctive:

    Prefer stable, documented APIs over cutting-edge features

    line 22
  8. Distinctive:

    Avoid any types and type assertions without justification

    line 26
  9. Distinctive:

    Prefer proper typing and type guards for unknown data

    line 27
  10. Distinctive:

    Avoid unsafe property access that could throw errors

    line 31
  11. Distinctive:

    Prefer safe navigation with optional chaining and nullish coalescing

    line 32
  12. Distinctive:

    Avoid ignoring errors or using generic catch blocks

    line 36
  13. Distinctive:

    Prefer explicit error handling with proper typing and meaningful error messages

    line 37
  14. Distinctive:

    Avoid Promise constructor anti-patterns and missing error handling

    line 41
  15. Distinctive:

    Prefer proper async patterns with comprehensive error handling

    line 42
  16. Distinctive:

    Avoid mutating operations and unsafe array access

    line 46
  17. Distinctive:

    Prefer immutable operations and safe access patterns

    line 47
  18. Distinctive:

    Avoid unclear parameter types and missing return types

    line 51
  19. Distinctive:

    Prefer explicit types and input validation

    line 52
  20. Distinctive:

    Avoid var declarations and unnecessary let usage

    line 56
  21. Distinctive:

    Prefer const by default, let only when reassignment is needed

    line 57
  22. Distinctive:

    Avoid loose equality and implicit boolean conversions

    line 61
  23. Distinctive:

    Prefer strict equality and explicit checks

    line 62
  24. Distinctive:

    Avoid unremoved event listeners and unclosed resources

    line 66
  25. Distinctive:

    Prefer proper cleanup patterns and resource management

    line 67
  26. Distinctive:

    Avoid unnecessary operations in loops and inefficient patterns

    line 71
  27. Distinctive:

    Prefer optimized patterns and consider memoization for expensive operations

    line 72
  28. Distinctive:

    Before suggesting code, ensure:

    line 78

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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
  • const assertions for immutable data
  • satisfies operator for type checking without widening
  • Record<K, V> for object types with known keys

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.