diff --git a/.cursor/rules/naming-conventions.mdc b/.cursor/rules/naming-conventions.mdc new file mode 100644 index 00000000..cc6544d1 --- /dev/null +++ b/.cursor/rules/naming-conventions.mdc @@ -0,0 +1,25 @@ +--- +description: Naming conventions for value mappings in the Void project +alwaysApply: true +--- + +# Naming Conventions + +## Mapping Types: `bOfA` + +All types/variables that map from a value **A** to a value **B** should be named **`bOfA`**. + +Examples: +- A hashmap from `toolId` to `toolName` → `toolNameOfToolId` +- A map from `userId` to `userEmail` → `userEmailOfUserId` +- A map from `fileUri` to `fileContent` → `fileContentOfFileUri` + +```typescript +// BAD +const toolMap: Record = {}; +const idToName = new Map(); + +// GOOD +const toolNameOfToolId: Record = {}; +const userEmailOfUserId = new Map(); +``` diff --git a/.cursor/rules/scope-and-validation.mdc b/.cursor/rules/scope-and-validation.mdc new file mode 100644 index 00000000..e6730e6d --- /dev/null +++ b/.cursor/rules/scope-and-validation.mdc @@ -0,0 +1,23 @@ +--- +description: Scope guardrails and validation policy for the Void project +alwaysApply: true +--- + +# Scope & Validation + +## Modification Scope + +**Never** modify files outside `src/vs/workbench/contrib/void` without consulting with the user first. + +If a change appears to require touching files in other parts of the repo (e.g. core VSCode files, build configs, other contribs), pause and ask before editing. + +## Validation Policy + +Do **not** run anything to validate your changes. This includes: +- `npm run`, `yarn`, `pnpm` build/test/lint scripts +- `tsc`, `eslint`, or any type-checker / linter directly +- Launching the app + +Instead, **tell the user what to run** to validate the changes, e.g.: + +> To validate, please run `npm run watch` and reload the Extension Host window. diff --git a/.cursor/rules/typescript-conventions.mdc b/.cursor/rules/typescript-conventions.mdc new file mode 100644 index 00000000..07e27f80 --- /dev/null +++ b/.cursor/rules/typescript-conventions.mdc @@ -0,0 +1,28 @@ +--- +description: TypeScript conventions for the Void project +globs: **/*.ts,**/*.tsx +alwaysApply: false +--- + +# TypeScript Conventions + +## No Unnecessary Casting + +Do **NOT** cast to types if not necessary. **NEVER** lazily cast to `any`. Find the correct type to apply and use it. + +```typescript +// BAD +const result = (data as any).value; +const node = something as MyType; + +// GOOD +const result: ValueType = data.value; +// If types genuinely don't line up, fix the source type or use a type guard: +if (isMyType(something)) { + const node = something; +} +``` + +## Semicolons + +Do **not** add or remove semicolons in existing files. Follow the existing convention of the file and make the **least** number of changes. diff --git a/.cursor/rules/void-context.mdc b/.cursor/rules/void-context.mdc new file mode 100644 index 00000000..ba1267f9 --- /dev/null +++ b/.cursor/rules/void-context.mdc @@ -0,0 +1,12 @@ +--- +description: Project context for the Void repo (a VSCode fork) +alwaysApply: true +--- + +# Void Project Context + +This is a fork of the VSCode repo called **Void**. + +- Most code we care about lives in `src/vs/workbench/contrib/void`. +- You may often need to explore the full repo to find relevant parts of code. +- Look for existing services and built-in functions you might need to reuse instead of re-implementing functionality.