valurinn/mymercury icon
public
Published on 3/23/2025
MyMercury

Rules
Models
Context
anthropic Claude 3.7 Sonnet model icon

Claude 3.7 Sonnet

anthropic

200kinput·8.192koutput
anthropic Claude 3.5 Sonnet model icon

Claude 3.5 Sonnet

anthropic

200kinput·8.192koutput
mistral Codestral model icon

Codestral

mistral

voyage voyage-code-3 model icon

voyage-code-3

voyage

voyage Voyage AI rerank-2 model icon

Voyage AI rerank-2

voyage

Express Server Agent
1. Build & Development Commands: Project Setup:
Use npm install to install all dependencies specified in package.json.
Ensure the .env file is present in the project root with the GOOGLE_API_KEY environment variable set.
Running the Server:
Use node index.js or npm start to run the server.
Use nodemon index.js for development to enable automatic server restarts on file changes.
Dependency Management:
Add new dependencies using npm install <package-name> --save.
Remove dependencies using npm uninstall <package-name> --save.
Never alter package-lock.json manually.
Environment Variables:
All sensitive information, especially the Google Gemini API key, must be stored in the .env file.
Access environment variables using process.env.<VARIABLE_NAME>.
2. Testing Guidelines:

Unit Testing:
Implement unit tests for all core functions (e.g., generateResponse, startChat).
Use a testing framework like Jest or Mocha with Chai or Supertest.
Integration Testing:
Write integration tests to verify the behavior of API endpoints.
Test API endpoints with various input scenarios, including edge cases and error conditions.
API Testing:
Use Postman or curl to manually test API endpoints during development.
Verify that API responses are in the expected format and contain the correct data.
Error Handling:
Test error handling scenarios to ensure the server responds appropriately to invalid requests or API errors.
3. Code Style & Guidelines:

JavaScript Style:
Follow a consistent coding style (e.g., Airbnb JavaScript Style Guide).
Use ESLint to enforce code style and catch potential errors.
Use Prettier for automatic code formatting.
Code Organization:
Structure the codebase logically with separate files or modules for different functionalities.
Use comments to explain complex logic or non-obvious code sections.
Utilize Async/Await for asynchronous code.
Error Handling:
Implement robust error handling using try...catch blocks.
Log errors using Winston or a similar logging library.
Return meaningful error messages to the client.
Dependencies:
Use the dependencies listed in your package.json, and keep them updated.
Use Morgan for HTTP request logging.
Use lru-cache to cache frequent API requests.
Use Multer to handle multipart/form-data.
Use Body-parser to parse request bodies.
Use Node-fetch to make http requests.
Security:
Sanitize user inputs to prevent security vulnerabilities.
Implement proper authentication and authorization if necessary.
Use Cors to control which origins can access the API.
Documentation:
Document all API endpoints with clear descriptions of request parameters and response formats.
Document the server's setup and configuration.

No Docs configured

Prompts

Learn more

No Prompts configured

Context

Learn more
@diff
Reference all of the changes you've made to your current branch
@codebase
Reference the most relevant snippets from your codebase
@url
Reference the markdown converted contents of a given URL
@folder
Uses the same retrieval mechanism as @Codebase, but only on a single folder
@terminal
Reference the last command you ran in your IDE's terminal and its output
@code
Reference specific functions or classes from throughout your project
@file
Reference any file in your current workspace

No Data configured

MCP Servers

Learn more

No MCP Servers configured