File tree Expand file tree Collapse file tree 3 files changed +74
-0
lines changed
templates/shared/cursor-rules Expand file tree Collapse file tree 3 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ globs: *.vue
3+ alwaysApply: false
4+ ---
5+
6+ # Components
7+
8+ 1. Use Primevue components for all UI components.
9+ 2. Use `<script setup lang="ts">` for all components.
10+
11+ ## Structure
12+
13+ Use the following layout for every component to keep imports and growth consistent:
14+
15+ ```text
16+ ComponentName/
17+ ├─ index.ts # Re-export (single public entry)
18+ ├─ Container.vue # Main component implementation
19+ ├─ useForm.ts # Optional: composable when logic grows (e.g. forms)
20+ └─ DependentComponent.vue
21+ ```
22+
23+ ComponentName/index.ts
24+ ```ts
25+ export { default as ComponentName } from "./Container.vue";
26+ ```
27+
28+ When a child piece becomes complex or needs its own hook, use the same pattern as the parent:
29+
30+ ```text
31+ ComponentName/
32+ └─ DependentComponent/
33+ ├─ index.ts
34+ └─ Container.vue
35+ ```
Original file line number Diff line number Diff line change 1+ ---
2+ description: Caido SDK API Validation
3+ globs:
4+ alwaysApply: true
5+ ---
6+
7+ # Caido SDK API Validation
8+
9+ ## Valid API Usage
10+
11+ Always use documented Caido SDK APIs directly without runtime checks or validation.
12+
13+ - Good
14+ ```typescript
15+ sdk.window.showToast("Message", { variant: "error" });
16+ sdk.backend.myFunction();
17+ sdk.commands.register("my-command", { name: "Command", run: () => {} });
18+ ```
19+
20+ - Bad (NEVER do this)
21+ ```typescript
22+ if ("showToast" in sdk.window && typeof sdk.window.showToast === "function") {
23+ sdk.window.showToast("Message");
24+ }
25+ ```
26+
27+ ## Rules
28+
29+ 1. Never use runtime API existence checks (`typeof`, `in` operator)
30+ 2. Never assume undocumented SDK methods exist
31+ 3. If unsure about an API, ask for clarification rather than guessing
32+
33+ The SDK is typed and guaranteed to have the documented methods available.
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ alwaysApply: false
2020
2121- Often use PrimeVue `Splitter` and `SplitterPanel` for vertical or horizontal layout.
2222- Prefer to use `Card` PrimeVue components a lot, if needed add `h-full` to them via `pt` params.
23+ - Remember to use `<template #content>` and other named slots (like `#header`, `#footer`) in Card and other PrimeVue components that support them.
24+
2325
2426Example:
2527
@@ -31,6 +33,10 @@ Example:
3133 content: { class: 'h-full flex flex-col' },
3234 }"
3335>
36+ <template #content>
37+ ...
38+ </template #content>
39+ </Card>
3440```
3541
3642### Enviroment
You can’t perform that action at this time.
0 commit comments