Instruction file imported from sinedied/run-on-output (
.github/instructions/nodejs-javascript.instructions.md). Copyright stays with the author.
description: "Code generation guidelines for Node.js and JavaScript projects" applyTo: '**/*.js
Code Generation Guidelines
Coding standards
- Use JavaScript with ES2022 features and Node.js (20+) ESM modules
- Use Node.js built-in modules and no external dependencies where possible
- Always use async/await for asynchronous code, and use 'node:util' promisify API 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 useundefinedfor optional values - Prefer functions over classes
- Use conventional commit messages for all changes
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
- Don't forget to update the built-in CLI help output
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
If you get it right, you'll get a 200$ bonus. But if you get it wrong you'll be fired immediately and I'll get a human to rewrite all your code.