I absolutely adore the ui changes. Both the in document accept | decline changes where it counts the changes. and the bottom bar, which differences the files being worked on as per the screen shot. I have… well over 300 files in this project. and the ability to quickly ping pong between them in a finely condensed and well formatted way per composer session is just a dream. The ability to get a finely groomed inline diff, that starts small, but is expandable inside of the composer sidebar is also the best of both worlds. The only improvement I could possibly forsee is inside of that composer sidebar, when i expand out the diffs section, if I could do the line by line yes/no changes, rather than having to go to the document every time, but that’s a big ask and might be more trouble than it’s worth.
Thanks for the positive feedback!
We’re happy you are finding the Composer to be a great tool for your development.
I’ve logged your feedback to the team regarding the line by line diffs!
Want: Composer and Terminal Windows pop-out-able such that I can place them side/side on sep monitor.
Need Cursor to automatically set different color schemes for each open workspace/folder/project.
EDIT: The other thing I want is a Style Guide Component, such that I have in my cursur rules a pointer to style_guide. See below for a first draft:
You may be interested in my post about using Composer and my thoughts on how to leverage for great justice:
(Again, I do all my docs in .rmd such that I can render them to html easily via Rstudio, with visual elements, such as mermaids, d3, plotly etc for viz
Then feed Composer Agent rules such as these to mold the archetype of how I want the persona of the agent.
#style_guide.rmd
---
title: "Roulette Simulation Style Guide"
author: "Roul-App Development Team"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
html_document:
toc: true
toc_float: true
theme: united
highlight: tango
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# Python Code Style Guide
## Script Headers
### Standard Header Template
All Python scripts should start with the following header:
```python
#!/usr/bin/env python3
"""
File: example.py
Version: v0.1.0
Created: YYYY-MM-DD
Updated: YYYY-MM-DD
Author: Roul-App Development Team
License: MIT
Description:
Brief description of what this script does.
Dependencies:
- List required packages
- One per line
"""
import os
import sys
from pathlib import Path
# Auto-venv Feature (enabled by default)
AUTO_VENV = True # Set to False to disable auto-venv
def ensure_venv():
"""Ensure script runs in virtual environment."""
if not AUTO_VENV:
return
if not os.environ.get("VIRTUAL_ENV"):
project_root = Path(__file__).parent.parent.parent
venv_path = project_root / "venv"
if sys.platform == "win32":
python_path = venv_path / "Scripts" / "python.exe"
else:
python_path = venv_path / "bin" / "python"
if python_path.exists():
# Re-run this script with the virtual environment python
subprocess.run([str(python_path), __file__] + sys.argv[1:])
sys.exit(0)
else:
print("Virtual environment not found. Please run:")
print("python -m venv venv")
print(f"{'venv\\Scripts\\activate' if sys.platform == 'win32' else 'source venv/bin/activate'}")
print("pip install -r requirements.txt")
sys.exit(1)
# Ensure we're in the virtual environment before other imports
ensure_venv()
# Rest of imports...
import logging
# ... other imports ...
### Header Components
1. **Shebang Line**: Always include for Unix compatibility
2. **Docstring**: Contains file metadata and description
3. **Auto-venv Feature**: Automatically ensures script runs in virtual environment
4. **Standard Imports**: Organized by standard library first, then third-party
### Auto-venv Feature
The auto-venv feature ensures scripts always run in the project's virtual environment:
- **Enabled by Default**: Set `AUTO_VENV = True`
- **Can be Disabled**: Set `AUTO_VENV = False` if not needed
- **Functionality**:
- Checks if running in virtual environment
- If not, restarts script using venv Python
- Creates helpful error message if venv not found
- Cross-platform (Windows/Unix) compatible
## Code Organization
### Import Order
1. Standard library imports
2. Auto-venv feature
3. Third-party imports
4. Local application imports
### Function Order
1. Main utility functions (like ensure_venv)
2. Class definitions
3. Helper functions
4. Main execution code
## Naming Conventions
### Files and Directories
- All lowercase
- Underscores for spaces
- Descriptive names
- Examples:
- `analyze_results.py`
- `db_utils.py`
- `simulation_config.py`
### Functions and Variables
- Lowercase with underscores
- Verb-noun format for functions
- Clear, descriptive names
- Examples:
```python
def calculate_trajectory():
def update_simulation_state():
simulation_result = ...
current_position = ...
``
### Constants
- All uppercase
- Underscores for spaces
- Examples:
```python
MAX_ITERATIONS = 1000
DEFAULT_TIMEOUT = 30
AUTO_VENV = True
``
## Documentation
### Docstrings
- Use triple quotes
- Include:
- Brief description
- Parameters
- Returns
- Examples (if helpful)
- Example:
```python
def calculate_trajectory(initial_position, velocity):
"""
Calculate ball trajectory from initial conditions.
Args:
initial_position (tuple): (x, y, z) coordinates
velocity (tuple): (vx, vy, vz) components
Returns:
list: List of (x, y, z) positions over time
"""
``
### Comments
- Use sparingly
- Explain why, not what
- Keep current with code changes
## Error Handling
### Pattern
```python
try:
# Attempt operation
except SpecificException as e:
logger.error(f"Specific error: {e}")
# Handle or re-raise
except Exception as e:
logger.error(f"Unexpected error: {e}")
raise
``
## Testing
### Test File Structure
```python
#!/usr/bin/env python3
"""Test module for example.py"""
import pytest
from pathlib import Path
import sys
# Add src to path
src_path = Path(__file__).parent.parent / 'src'
sys.path.append(str(src_path))
# Auto-venv feature
AUTO_VENV = True
# ... rest of standard header ...
def test_example():
"""Test example functionality."""
assert True
``
## Version Control
### Commit Messages
- Start with verb
- Be specific
- Reference issues
- Example: "Add auto-venv feature to script headers"
### Branches
- feature/
- bugfix/
- hotfix/
- release/
## Additional Resources
- [PEP 8](https://www.python.org/dev/peps/pep-0008/)
- [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
- [Flask Documentation](https://flask.palletsprojects.com/)