Would it be possible to configure the agent to use the Command Prompt instead of PowerShell when executing commands?
Would be also interested. Right now it uses bash commands in my case, and it autocorrects itself, but sometimes it bugs after trying the first command which is always a bash command, but I rather have cursor use a PowerShell command instead.
Try setting in cursor rules:
Seems to work with my Yoloing Beautifully – so do the inverse of what I say here, but use the same language if your on a mac/linux box tell it what you want it to do.
You are an expert in Python, Flask, and scalable API development. Always use windows powershell when scripting. With .ps1 files to facilitate smoother implementations and YOLO-ing through generation.
Always full path, header, narrate, development_diary, postgres_diary, diary RMDs.
daily_diary as well.
Key Principles
- Write concise, technical responses with accurate Python examples.
- Use functional, declarative programming; avoid classes where possible except for Flask views.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., is_active, has_permission).
- Use lowercase with underscores for directories and files (e.g., blueprints/user_routes.py).
- Favor named exports for routes and utility functions.
- Use the Receive an Object, Return an Object (RORO) pattern where applicable.
Python/Flask
- Use def for function definitions.
- Use type hints for all function signatures where possible.
- File structure: Flask app initialization, blueprints, models, utilities, config.
- Avoid unnecessary curly braces in conditional statements.
- For single-line statements in conditionals, omit curly braces.
- Use concise, one-line syntax for simple conditional statements (e.g., if condition: do_something()).
Error Handling and Validation
- Prioritize error handling and edge cases:
- Handle errors and edge cases at the beginning of functions.
- Use early returns for error conditions to avoid deeply nested if statements.
- Place the happy path last in the function for improved readability.
- Avoid unnecessary else statements; use the if-return pattern instead.
- Use guard clauses to handle preconditions and invalid states early.
- Implement proper error logging and user-friendly error messages.
- Use custom error types or error factories for consistent error handling.
Dependencies
- Flask
- Flask-RESTful (for RESTful API development)
- Flask-SQLAlchemy (for ORM)
- Flask-Migrate (for database migrations)
- Marshmallow (for serialization/deserialization)
- Flask-JWT-Extended (for JWT authentication)
Flask-Specific Guidelines
- Use Flask application factories for better modularity and testing.
- Organize routes using Flask Blueprints for better code organization.
- Use Flask-RESTful for building RESTful APIs with class-based views.
- Implement custom error handlers for different types of exceptions.
- Use Flask's before_request, after_request, and teardown_request decorators for request lifecycle management.
- Utilize Flask extensions for common functionalities (e.g., Flask-SQLAlchemy, Flask-Migrate).
- Use Flask's config object for managing different configurations (development, testing, production).
- Implement proper logging using Flask's app.logger.
- Use Flask-JWT-Extended for handling authentication and authorization.
Performance Optimization
- Use Flask-Caching for caching frequently accessed data.
- Implement database query optimization techniques (e.g., eager loading, indexing).
- Use connection pooling for database connections.
- Implement proper database session management.
- Use background tasks for time-consuming operations (e.g., Celery with Flask).
Key Conventions
1. Use Flask's application context and request context appropriately.
2. Prioritize API performance metrics (response time, latency, throughput).
3. Structure the application:
- Use blueprints for modularizing the application.
- Implement a clear separation of concerns (routes, business logic, data access).
- Use environment variables for configuration management.
Database Interaction
- Use Flask-SQLAlchemy for ORM operations.
- Implement database migrations using Flask-Migrate.
- Use SQLAlchemy's session management properly, ensuring sessions are closed after use.
Serialization and Validation
- Use Marshmallow for object serialization/deserialization and input validation.
- Create schema classes for each model to handle serialization consistently.
Authentication and Authorization
- Implement JWT-based authentication using Flask-JWT-Extended.
- Use decorators for protecting routes that require authentication.
Testing
- Write unit tests using pytest.
- Use Flask's test client for integration testing.
- Implement test fixtures for database and application setup.
API Documentation
- Use Flask-RESTX or Flasgger for Swagger/OpenAPI documentation.
- Ensure all endpoints are properly documented with request/response schemas.
Deployment
- Use Gunicorn or uWSGI as WSGI HTTP Server.
- Implement proper logging and monitoring in production.
- Use environment variables for sensitive information and configuration.
Refer to Flask documentation for detailed information on Views, Blueprints, and Extensions for best practices.
I am working on a far more sophisitacted rules system for behavior wrangling of agents…
Its a tiny passion project so I become really proficient wielding multi agentic interface to have the bots do my evil magnanimous biddings…
We use whatever vscode’s default shell is set to.
You can change this with cmd+shift+p > select default profile > choose shell you want.
Then cmd+shift+p > reload window.
im still stuck constantly using powershell and it constantly trying && to join cmds vs ;, my default profile is cmd.exe too
You should be able to tell the agent what terminal it’s using in the Rules for AI, but the obvious fix here is for it to use the right terminal in the first place!
Will report to the team to look at.
so i’ve changed it from powershell to cmd and it’s been acting better, but a few times i’ve had to not just close cursor out, but log out and back into windows.
it’s been better since leaving it on cmd.exe
Version: 0.45.9
VSCode Version: 1.96.2
Commit: cce0110ca40ceb61e76ecea08d24210123895320
Date: 2025-02-02T06:44:49.761Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100
Helpful directives for Windows users:
First - running Cursor as administrator helps.
Second I had wonderful results with the following (add whatever you like):
“Always wrap files in a .ps1 to execute”
I still have some ussues - but I find demanding for .ps1s for everything helps preseve going from Agent/LLM prompt stream to execution in this model was great.
Then since I have directives for the header comments I want in my files:
"Appropriate header with path, version, description, invokation"
Then - I keep them all in /Scripts. And then I had it pip them into Postgres as the Readme.rmds and a DB of all the scripts the bots write, with their descriptions such that as you develop tons of ■■■■, you have a library in the DB with all the mini-tasks, scripts, description, function…
However, that deteriated because the agents were too wea at the moment.
NOW – I thought of an MCP for this today in the park:
An MCP which is called when files are created (with some other heuristic for when a particular action is taken:
That the file immediately gets logged into the DB with the desc, meta, etc…
And then there are checkpoints for various funmctions in files whereby;
If the bot fn changes some [thing] that it was not supposed to touch, that certain [reasons] cause trigger if [thing] changes as if you apply model XYZ to projects abc – Ive found that all the models when given the same large file and told to make readme, describe code, propose improvements.
They ALL immediatwly fuckup all the functionality and try to assume they know the intent based on bad context and become useless.
So AIccountability MCPs which Big.Bot_Brother keenly on the entanglements
this is a good call… i’ve noticed how i need to do garbage collection occasionally and i’ve had a huge build up of files in my root workspace dir. obviously adjusting .cursorrules would help, but this is an interesting call. why the use of a db for storing that? because it doesn’t have delete access to that, whereas it could clear out an old readme file? or even fill up its context space needlessly? could put it in an .cursorignore dir?
It was in the days when context was lost in like three minutes - so I was aggressively having the bots document and log all their thoughts, actions, plans so I could feed the context into the next entanglement.
Imgur: The magic of the Internet a couple…
Sorta thing…
Ive spent like the last six months learning how to manage Agent Attention, Context and Effectiveness -
Constantly attempting different approaches…
Cursor is using default terminal for it’s agents.
Make sure you have git installed, it comes bundled with that thing called “git bash”. Use this thing and there would be no need to force LLMs to use powershell.
Remember: they are trained on our data, they are just like us, humans. They also hate powershell.