nhatpmsg/nhatpmsg-first-assistant icon
public
Published on 5/22/2025
My First Assistant

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
anthropic Claude 3.7 Sonnet model icon

Claude 3.7 Sonnet

anthropic

200kinput·8.192koutput
Rule: Generate a reusable Flask authentication module with the following requirements:

1. Use Flask Blueprint to isolate auth routes (login, logout, register).
2. Implement User model with SQLAlchemy ORM:
   - Fields: id (int, primary key), username (unique), email (unique), password_hash.
3. Use secure password hashing (e.g., Werkzeug's generate_password_hash and check_password_hash).
4. Provide WTForms form classes for login and registration, with validation:
   - LoginForm: email, password.
   - RegistrationForm: username, email, password, confirm password.
5. Implement routes for:
   - /login: GET to display login form; POST to process login with validation.
   - /logout: logs out user and redirects to login page.
   - /register: GET to display registration form; POST to create new user with validation.
6. Use Flask-Login for user session management.
7. Render HTML templates stored under templates/auth/:
   - login.html
   - register.html
8. Structure the module as a Python package with:
   - __init__.py to create Blueprint instance.
   - models.py for User model.
   - forms.py for WTForms classes.
   - routes.py for route definitions.
9. Write clean, readable, and well-commented code.
10. Ensure all database interactions are via SQLAlchemy session.
11. Provide clear error handling for invalid inputs or failed logins.
12. Avoid hardcoding secrets or configurations; use config variables.
13. Make the module easily integrable by importing and registering the Blueprint in any Flask app.
Pythonhttps://docs.python.org/3/

Prompts

Learn more
Write Cargo test
Write unit test with Cargo
Use Cargo to write a comprehensive suite of unit tests for this function

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

No Data configured

MCP Servers

Learn more

No MCP Servers configured