Skip to content

Commit 31e0e02

Browse files
authored
Merge pull request #2166 from mito-ds/improve-verify
improve cursor validation commands
2 parents 074d51f + 75a326b commit 31e0e02

File tree

3 files changed

+72
-22
lines changed

3 files changed

+72
-22
lines changed

.cursor/commands/verify.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
11
# Verify Feature Command
22

3-
When invoked, automatically test and fix the feature that you just created using the Browser tool to access JupyterLab. Continue correcting and verifying the feature until it works.
3+
When invoked, automatically verify a feature or change by launching the appropriate app (JupyterLab or trymito.io), testing baseline functionality, and fixing issues until the feature works correctly.
4+
5+
## App Detection
6+
7+
Automatically determine which app to verify based on:
8+
- Files in `mito-ai/` → Verify in JupyterLab
9+
- Files in `trymito.io/` → Verify in trymito.io website
10+
- User specification or plan context if provided
411

512
## Execution Steps
613

714
### 0. Setting up Environment
815

916
Make sure that the code passes linting first. Check the typescript terminal that is running for errors. You must resolve those first to ensure you are testing the most up to date version of the code.
1017

11-
### 1. Check JupyterLab Status
18+
### 1. Determine Target App and Check Status
1219

13-
First, verify JupyterLab is running on port 8888. Navigate to:
14-
```
15-
http://localhost:8888/lab?token=dev-token-for-cursor-testing-12345
16-
```
20+
**For JupyterLab:**
21+
- Verify JupyterLab is running on port 8888
22+
- Navigate to: `http://localhost:8888/lab?token=dev-token-for-cursor-testing-12345`
23+
24+
**For trymito.io:**
25+
- Verify Next.js dev server is running on port 3000
26+
- If not running, provide instructions: `cd trymito.io && npm run dev`
27+
- Navigate to: `http://localhost:3000`
1728

1829
### 2. Navigate and Load
1930

20-
Use browser to navigate to JupyterLab URL above. Wait 3-5 seconds for full page load, then take a snapshot to understand current state.
31+
Use browser to navigate to the appropriate URL. Wait 3-5 seconds for full page load, then take a snapshot to understand current state.
2132

2233
### 3. Identify Feature to Test
2334

24-
Use the conversation history to identify the feature to test. Your goal is to QA the new feature that was just created.
35+
Use the conversation history to identify the feature to test. Your goal is to validate the feature that was just created or changed.
2536

2637
### 4. Test the Feature
2738

28-
Interact with the feature using browser tools:
39+
Interact with the feature using browser tools and test baseline functionality to ensure no regressions.
2940

3041
### 5. Check for Issues
3142

@@ -37,29 +48,25 @@ After each interaction:
3748

3849
### 6. Fix Issues Found
3950

40-
- Fix the issues you found if if they are related to the feature you are testing
41-
- Document any additional issues you found that are not related to the feature you are testing
51+
Fix the issues you found if they are related to the feature you are testing. Document any additional issues you found that are not related to the feature you are testing.
4252

4353
### 7. Rebuild and Re-test
4454

4555
After making code changes and before testing again:
4656

4757
1. **For Frontend Changes** (TypeScript/React/CSS/JavaScript):
4858
- Wait a few seconds for the build to complete (check the TypeScript terminal)
49-
- **Refresh the browser** to load the updated code:
50-
- Use browser navigation to reload the page, or
51-
- Use browser refresh functionality
59+
- **Refresh the browser** to load the updated code
5260
- Retest the feature
5361

54-
5562
2. **For Backend Changes** (Python/server code):
56-
- **Shut down the Jupyter server** (stop the running JupyterLab process)
57-
- **Relaunch the Jupyter server** to load the updated backend code
58-
- Navigate to the JupyterLab URL again
63+
- **Shut down the server** (stop the running process)
64+
- **Relaunch the server** to load the updated backend code
65+
- Navigate to the app URL again
5966
- Wait 3-5 seconds for full page load
6067
- Take a new snapshot
6168
- Re-test the feature
6269

6370
### 8. Iterate Until Complete
6471

65-
Repeat steps 4-7 until the feature works correctly.
72+
Repeat steps 4-7 until the feature works correctly.

.cursorrules

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Cursor Rules for Mito Project
22

3-
## Virtual Environment
4-
- ALWAYS activate the virtual environment before running any Python commands: `cd mito-ai && source venv/bin/activate`
5-
- For other components: check for venv directories and activate appropriately
3+
## Verify Mode
4+
5+
When creating plans or implementing features, use verify mode to ensure quality:
6+
7+
### Automatic Validation Step Insertion
8+
- After each implementation task in a plan, automatically insert a validation step
9+
- Validation steps should specify which app to verify (JupyterLab or trymito.io) based on:
10+
- Files being modified: `mito-ai/` → JupyterLab, `trymito.io/` → trymito.io website
11+
- Context from the implementation task
12+
- User specification if provided
13+
14+
### Validation Workflow
15+
When executing validation steps:
16+
1. **App Detection**: Determine target app (JupyterLab: localhost:8888, trymito.io: localhost:3000)
17+
2. **Baseline Validation**: Ensure existing functionality still works
18+
3. **Improvement Analysis**: Identify potential improvements (bugs, UX, code quality)
19+
4. **Prioritization**: Create prioritized list (P0 Critical → P1 High → P2 Medium → P3 Low)
20+
5. **Decision**: Decide if improvements are worth implementing now
21+
6. **Implementation Loop**: If yes, implement highest priority, rebuild, re-validate (repeat)
22+
7. **Completion**: Mark validation complete and move to next task
23+
24+
### Validation Command
25+
- Use the `verify` command (`.cursor/commands/verify.md`) for manual validation
26+
- The command automatically detects which app to use based on file paths
27+
- Follow the verify workflow: baseline → improvements → prioritize → implement → verify
28+
29+
### App-Specific Notes
30+
- **JupyterLab**: Runs on `localhost:8888`, token: `dev-token-for-cursor-testing-12345`
31+
- **trymito.io**: Next.js app runs on `localhost:3000`, start with `cd trymito.io && npm run dev`
32+
- Always check app is running before validation
33+
- For frontend changes: wait for build, refresh browser
34+
- For backend changes: restart server if needed, reload page

agent.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Virtual Environment
2+
- ALWAYS activate the virtual environment before running any Python commands: `cd mito-ai && source venv/bin/activate`
3+
- For other components: check for venv directories and activate appropriately
4+
5+
## Engineering practices
6+
7+
We're a startup. You're probably used to writing enterprise code -- code that tries to handle every possible edge case and has fallbacks for everything. That's not how we do things around here: our number one rule is to keep things simple. We handle ONLY the most important cases.
8+
9+
We try to only add new functionality that is small (that is, simple and few lines of code) or absolutely necessary. If a change is not small or absolutely necessary, don't make it.
10+
11+
**Backwards-compatibility**: Since our app runs locally on a user's machine, we think about backwards compatibility very differently than enterprise code.
12+
- For things like updating the environment variables structure, we don't need to worry about backwards compatibility because if the enterprise opts in to upgrading, they can update the enviornment variables at the same time.
13+
- For things like adding new tool options, we don't need to worry about backwards compatibility because only users on the newest version of the tool are going to have access to the new options.
14+
- For things like changing how we read in old chat histories, we DO need to worry about backwards compatibility because the chat histories live on the user's machine, so we don't have a way to migrate them to the new format without adding that migration step into the tool.

0 commit comments

Comments
 (0)