ricardo-bernardes/ricardo-bernardes-first-assistant icon
public
Published on 6/10/2025
Javascript

This is an example custom assistant that will help you complete the Python onboarding in VS Code. After trying it out, feel free to experiment with other blocks or create your own custom assistant.

Rules
Prompts
Models
Context
relace Relace Instant Apply model icon

Relace Instant Apply

relace

40kinput·32koutput
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

deepseek DeepSeek-R1 model icon

DeepSeek-R1

deepseek

deepseek DeepSeek-V3 model icon

DeepSeek-V3

deepseek

anthropic Claude 4 Sonnet model icon

Claude 4 Sonnet

anthropic

200kinput·64koutput
- Follow ES6+ conventions
- Avoid using 'var' keyword
always write the explanation in Portuguese
MDN Web Docs - JavaScripthttps://developer.mozilla.org/en-US/docs/Web/JavaScript
ECMAScript Language Specificationhttps://262.ecma-international.org/index.html
Cloudflare Developershttps://developers.cloudflare.com/
Vitest Guidehttps://vitest.dev/guide/
Vite Guidehttps://vite.dev/guide/
NPM Docshttps://docs.npmjs.com/
Continuehttps://docs.continue.dev
Deepseek API Docshttps://api-docs.deepseek.com/
Visual Studio Code Docshttps://code.visualstudio.com/docs

Prompts

Learn more
Cloudflare Worker API Generator
Scaffolds a new serverless API on Cloudflare Workers with a clean architecture.
# New serverless API using Cloudflare Worker
You are an expert in serverless API development using Cloudflare Workers. Your task is to build a new application following the rules below.
## Official Cloudflare Tech Stack
1.  **Runtime**: Cloudflare Workers (ES2022) 2.  **Package Manager**: npm (with `wrangler`) 3.  **Validation**: `zod` + `@cloudflare/itty-router-openapi` for schemas 4.  **Routing**: `itty-router` or `@cloudflare/itty-router-openapi` 5.  **Documentation**: OpenAPI 3.0 via `@cloudflare/itty-router-openapi` 6.  **Persistence**:
    -   KV Storage (simple key-value)
    -   Durable Objects (complex stateful operations)
    -   D1 (relational)
7.  **Testing**: `vitest` + `@cloudflare/workers-types`
## Requirements:
1.  **Clear Separation of Concerns**:
    -   API Layer (HTTP endpoints)
    -   Domain Layer (business logic and rules)
    -   Infrastructure Layer (persistence)

2.  **Flexible, Per-Resource Persistence**:
    -   Key-value storage for simple data.
    -   Durable Objects for complex or stateful operations.
    -   Relational databases when needed.

3.  **Standard Git Repository Files**:
    -   Create `.gitignore` and `README.md`.

4.  **Strict Validation with Zod**.
5.  **Default context path**: `/api`
6. **OpenAPI Documentation**
The documentation will be automatically generated via `@cloudflare/itty-router-openapi` decorators and available at:
-   `/docs` - Swagger UI -   `/openapi.json` - Raw OpenAPI 3.0 specification
7. Use TypeScript and modern ES features. 8. Keep endpoint handlers clean (no direct persistence logic).      
## Base Directory Structure:
``` . ├── .gitignore ├── README.md ├── package.json ├── tsconfig.json ├── wrangler.jsonc ├── vitest.config.ts ├── src/ │   ├── index.ts              # Main router and entry point │   ├── types.ts              # Global types (e.g., Env) │   ├── api/ │   │   └── [resource_1]/ │   │       ├── [resource_1]Create.ts   # Create operation │   │       ├── [resource_1]Delete.ts   # Delete operation │   │       ├── [resource_1]Fetch.ts    # Fetch by ID │   │       └── [resource_1]List.ts     # List with filters │   ├── domain/ │   │   └── [resource_1]/ │   │       └── [resource_1].ts         # Zod schemas and types │   └── infrastructure/ │       └── [resource_1]Repository.ts   # Persistence abstraction ```
## Your Development Flow:
1.  **Define Main Resources**: Ask the user to specify the core resources of the system. 2.  **Model Data and Operations**: For each resource, determine its fields, types, and supported operations. 3.  **Select Persistence Strategy**: Based on requirements, choose KV, Durable Objects, or D1 for each resource. 4.  **Generate Files**:
    4.1. **Configuration First**: Start by creating the root configuration files.
         - Ensure `.gitignore` is created with entries for Node.js and Cloudflare temporary files.
         - Ensure `package.json` is created with all required dependencies (`@cloudflare/itty-router-openapi`, `itty-router`, `zod`) and dev dependencies (`wrangler`, `vitest`, `@cloudflare/workers-types`, `typescript`).
         - Ensure `tsconfig.json` is created with the correct TypeScript configuration for Cloudflare Workers.
         - Ensure `wrangler.jsonc` is created based on the official documentation (https://developers.cloudflare.com/workers/wrangler/configuration/), including bindings for any chosen persistence layers.
         - Ensure `vitest.config.ts` is created for the Vitest test runner.
    4.2. **Implement Modules**: Write the code for each layer (API, Domain, Infrastructure) based on the defined resources.
5.  **Ensure Quality Standards**: Adhere to static typing, low coupling, and testability. 6.  **Generate Unit Tests**: Create `vitest` tests for key logic, especially for the domain and API layers. 7.  **Setup OpenAPI Documentation**: Ensure all API routes are decorated with Zod schemas for automatic documentation generation. 8.  **Finalize and Document**:
    8.1. Ensure all generated code is correctly formatted and ready for deployment.
    8.2. **Steps to Run**: Generate a comprehensive `README.md` file with instructions on how to set up, test, and deploy the project using Wrangler.

## Start by asking the user for the following information:
-   The **names** of the primary RESOURCES (e.g., `User`, `Product`, `Order`). -   The **fields** for each RESOURCE (e.g., for `User`: `id`, `name`, `email`). -   The specific **validation rules** for each field (e.g., `email` must be a valid email format, `name` has a max length of 50). -   The **persistence requirements** for each RESOURCE (should it use KV, D1, or Durable Objects? And why?).

Context

Learn more
@code
Reference specific functions or classes from throughout your project
@docs
Reference the contents from any documentation site
@diff
Reference all of the changes you've made to your current branch
@terminal
Reference the last command you ran in your IDE's terminal and its output
@problems
Get Problems from the current file
@folder
Uses the same retrieval mechanism as @Codebase, but only on a single folder
@codebase
Reference the most relevant snippets from your codebase
@file
Reference any file in your current workspace
@url
Reference the markdown converted contents of a given URL
@open
Reference the contents of all of your open files
@clipboard
Reference recent clipboard items
@commit
@os
Reference the architecture and platform of your current operating system
@repo-map
Reference the outline of your codebase
@currentFile
Reference the currently open file

No Data configured

MCP Servers

Learn more

GitHub

npx -y @modelcontextprotocol/server-github

Gitlab

docker run -e GITLAB_PERSONAL_ACCESS_TOKEN -e GITLAB_API_URL mcp/gitlab