-
Notifications
You must be signed in to change notification settings - Fork 713
/
.cursorrules
75 lines (65 loc) · 2.85 KB
/
.cursorrules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Rules:
- Coding: screenpipe is an open source positive sum endeavour that is a bridge between dull context-free AI and context aware super intelligence, this bridge is a lib, and CLI, that record screens & mics 24/7, extract OCR & STT, save to local db, connect to AI, do magic, it's written in Rust + Tauri and we write plugins (pipes) in TS + Bun. the Rust CLI is embedded as a sidecar in Tauri. it works on macos, windows, linux
- Coding: always keep my style black and white, with some nerdy style and fonts pixelated / scientific style
- Coding: do not remove @ts-ignore except if i explicitly ask you
- Coding: always use lower case for logging stuff or UI
- Coding: Rust: always use anyhow error, tokio instead of std stuff, avoid mutex if you can, prefer channels, write code easy to read for humans, fast for machines
- Coding: when i ask to give me the full code it means FULL, no fucking // rest of the code comments GIVE ME THE FULL CODE
- Coding: if it seems like you lack some context about a niche lib just ask me to provide the source code and i will (instead of providing a bad answer)
- Coding: NextJS: make sure to use tailwind, typescript, shadcn, lucide, magicui, and framer-motion to make UIs amazing
- Coding: Make sure to escape html thing like quotes etc properly. Only when necessary
- Coding: When writing react or html code make sure to use thing like ' instead of ". Only when necessary (e.g inside quote themselves)
// Code Examples & Context:
// 1. Logging Style
// Always lowercase, use println! in tests
````rust
println!("starting pipe: {}", name);
println!("error occurred: {:?}", err);
````
// 2. Error Handling in Rust
````rust
use anyhow::{Result, Context};
async fn process_data() -> Result<()> {
let data = fetch_data().await.context("failed to fetch data")?;
process(data).await.context("failed to process data")?;
Ok(())
}
````
// 3. Async Patterns
````rust
// Prefer channels over mutex
let (tx, rx) = tokio::sync::mpsc::channel(32);
// Instead of mutex
let data = Arc::new(tokio::sync::RwLock::new(Vec::new()));
````
// 4. NextJS/UI Style
````typescript
// Use tailwind + shadcn
export default function Component() {
return (
<div className="flex flex-col space-y-4 bg-background text-foreground">
<Button variant="outline">action</Button>
</div>
)
}
````
// 5. Screenpipe API Usage
````typescript
// Query example
await pipe.queryScreenpipe({
q: "meeting notes",
contentType: "ocr",
limit: 10
});
// Notification example
await pipe.sendDesktopNotification({
title: "task completed",
body: "processing finished"
});
````
// Key Principles:
// - Fast for machines: Use channels, avoid mutex
// - Easy for humans: Clear error messages, consistent logging
// - Black & white UI: Clean, pixelated/scientific style
// - Context-aware: Always leverage screen/audio context
// - Cross-platform: Works on macos, windows, linux