Dopamine AI Prompt Library
Open search
Menu
Submitted by
priyacodes28 prompts

Code Generation Guidelines

Guidelines for writing Node.js and JavaScript code with Vitest testing

Added Nov 26, 2026

Prompt

code-generation-guidelines.mdMarkdown · 25 lines · about 320 tokens
# 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

About this prompt

Content type
Code
Industries
Software Development
Models
GitHub Copilot
Languages
English
Length
25 lines, about 320 tokens
Added
Nov 26, 2026
License
MIT (Copyright GitHub, Inc.)
Request takedown
priyacodes28 prompts
Profile

More from priyacodes

View all

gem-researcher

Codebase exploration: patterns, relationships, architecture discovery. Supports multiple exploration modes for cost-controlled research.

Microsoft Learn Contributor

Microsoft Learn Contributor chatmode for editing and writing Microsoft Learn documentation following Microsoft Writing Style Guide and authoring best practices.

SQL Development

Guidelines for generating SQL statements and stored procedures