CopilotHub
SearchPromptsInstructionsAgentsToolsMCPs
  1. Home
  2. Instructions
  3. Code Generation Guidelines
Back to Instructions

Code Generation Guidelines

Coding standards for nodejs javascript vitest.instructions

javascript
0 downloads
33 views
0

Tags

testing
best-practices
documentation
error-handling
async

Related Instructions

View all →

Python Docstring Standards

*.py

Write clear and consistent Python docstrings

python
python
documentation
+1
1
117

TypeScript Error Handling

*.ts

Comprehensive error handling patterns for TypeScript applications

typescript
typescript
error-handling
+1
0
101

React Component Best Practices

*.tsx

Guidelines for creating maintainable and performant React components

typescript
react
react
typescript
+2
0
116

WordPress Development — Copilot Instructions

Coding standards for wordpress.instructions

typescript
testing
security
+5
1
185

VueJS 3 Development Instructions

Coding standards for vuejs3.instructions

typescript
react
testing
security
+6
0
157

Update Code from Shorthand

Edit the code file ${REQUIRED_FILE}.

javascript
1
106
Browse More Instructions

CopilotHub

A curated collection of prompts, instructions, agents, and tools for AI-powered development.

Quick Links

  • Prompts
  • Instructions
  • Agents
  • Tools
  • MCPs
  • Search

Browse by Category

  • Code Generation
  • Debugging
  • Documentation
  • Refactoring
  • Testing
  • Security

Legal

  • Guidelines
  • About
  • Privacy Policy
  • Terms of Service

Community

GitHub

© 2026 CopilotHub.

Code Generation Guidelines

Coding standards

  • Use JavaScript with ES2022 features and Node.js (20+) ESM modules
  • Use Node.js built-in modules and avoid external dependencies where possible
  • Ask the user if you require any additional dependencies before adding them
  • Always use async/await for asynchronous code, and use 'node:util' promisify function to avoid callbacks
  • Keep the code simple and maintainable
  • Use descriptive variable and function names
  • Do not add comments unless absolutely necessary, the code should be self-explanatory
  • Never use null, always use undefined for optional values
  • Prefer functions over classes

Testing

  • Use Vitest for testing
  • Write tests for all new features and bug fixes
  • Ensure tests cover edge cases and error handling
  • NEVER change the original code to make it easier to test, instead, write tests that cover the original code as it is

Documentation

  • When adding new features or making significant changes, update the README.md file where necessary

User interactions

  • Ask questions if you are unsure about the implementation details, design choices, or need clarification on the requirements
  • Always answer in the same language as the question, but use english for the generated content like code, comments or docs