diff --git a/.cursor/rules/copyright-header.mdc b/.cursor/rules/copyright-header.mdc deleted file mode 100644 index 16676e5..0000000 --- a/.cursor/rules/copyright-header.mdc +++ /dev/null @@ -1,158 +0,0 @@ ---- -description: -globs: -alwaysApply: true ---- -# Copyright and Attribution Header Requirements - -**MANDATORY**: Every file that is created or modified by Cursor must include a copyright and attribution header at the top of the file. - -## Required Header Format - -### For TypeScript/JavaScript files (.ts, .js, .mjs): -```typescript -/** - * Copyright IBM Corp. 2025 - * Assisted by CursorAI - */ -``` - -### For JSON files (.json): -```json -{ - "_copyright": "Copyright IBM Corp. 2025", - "_attribution": "Assisted by CursorAI", - // ... rest of JSON content -} -``` - -### For Markdown files (.md): -```markdown - - -# Document Title - -Document content goes here... - ---- - -*Portions of the Content may be generated with the assistance of CursorAI* -``` - -**Note**: Markdown files require both: -1. **Copyright header** (HTML comment at the top) -2. **User-visible footer** at the end of the document - -### For GraphQL files (.graphql): -```graphql -# Copyright IBM Corp. 2025 -# Assisted by CursorAI -``` - -### For Configuration files (.mjs, .js config files): -```javascript -/** - * Copyright IBM Corp. 2025 - * Assisted by CursorAI - */ -``` - -## Implementation Rules - -1. **Always add the header** when creating new files -2. **Always add the header** when making substantial modifications to existing files -3. **Place the header at the very top** of the file, before any other content -4. **Use the exact text**: "Copyright IBM Corp. 2025" and "Assisted by CursorAI" -5. **Use appropriate comment syntax** for the file type -6. **Do not modify existing copyright headers** - add the new header above them if needed - -## Examples - -### New TypeScript file: -```typescript -/** - * Copyright IBM Corp. 2025 - * Assisted by CursorAI - */ - -import * as vscode from "vscode"; -import { services } from "../services"; - -export function newFunction() { - // Implementation -} -``` - -### Existing file being modified: -```typescript -/** - * Copyright IBM Corp. 2025 - * Assisted by CursorAI - */ - -// Existing file content continues here... -import * as vscode from "vscode"; -``` - -### Test files: -```typescript -/** - * Copyright IBM Corp. 2025 - * Assisted by CursorAI - */ - -import * as assert from "assert"; -import * as vscode from "vscode"; - -suite("Test Suite", () => { - // Tests -}); -``` - -### Markdown files: -```markdown - - -# StepZen Extension Documentation - -This document describes the features and usage of the StepZen extension. - -## Features - -- Initialize StepZen projects -- Deploy to StepZen endpoints -- Run GraphQL requests - -## Usage - -Follow these steps to get started... - ---- - -*Portions of the Content may be generated with the assistance of CursorAI* -``` - -## Special Cases - -- **Package.json**: Add as JSON comments at the top -- **Configuration files**: Use JavaScript-style comments -- **Generated files**: Still include the header -- **Fixture files**: Include the header appropriate to the file type - -## Enforcement - -This rule applies to ALL file modifications, including: -- New file creation -- Existing file edits -- Refactoring changes -- Bug fixes -- Feature additions -- Test file modifications - -**No exceptions** - every file touched by Cursor must have this header. diff --git a/.cursor/rules/vscode-stepzen-project.mdc b/.cursor/rules/vscode-stepzen-project.mdc deleted file mode 100644 index 2bd4cae..0000000 --- a/.cursor/rules/vscode-stepzen-project.mdc +++ /dev/null @@ -1,83 +0,0 @@ ---- -description: -globs: -alwaysApply: true ---- -# VSCode StepZen Extension Architecture Rules - -**CRITICAL**: Before making any architectural decisions, read `docs/architecture.md` for the complete layered design and service registry pattern. - -## Layered Architecture - -Follow this strict import hierarchy: - -``` -Extension Layer (Commands, Panels, Utils) - ↓ (can import from) -Service Registry (CLI, Logger, ProjectResolver, SchemaIndex, Request) - ↓ (can import from) -Schema Processing Layer (Indexer, Linker, Parser) - ↓ (can import from) -Types (Pure data structures) -``` - -**ESLint enforces these boundaries automatically.** - -## Core Patterns - -### Service Usage -```typescript -// Always use the service registry -import { services } from "../services"; - -services.logger.info("Message"); -services.cli.deploy(); -``` - -### Error Handling -```typescript -import { handleError, ValidationError } from "../errors"; - -try { - // risky operation -} catch (err) { - handleError(err); // Logs and shows user notification -} -``` - -### Command Structure -```typescript -export async function commandName() { - // 1. Check workspace trust if needed - if (!vscode.workspace.isTrusted) { - vscode.window.showWarningMessage("Feature not available in untrusted workspaces"); - return; - } - - // 2. Validate preconditions - const editor = vscode.window.activeTextEditor; - if (!editor) { - vscode.window.showErrorMessage("No active editor"); - return; - } - - // 3. Main logic with error handling - try { - services.logger.info("Command started"); - // Implementation - } catch (err) { - handleError(err); - } -} -``` - -## Code Standards - -- **No console statements**: Use `services.logger` instead -- **TypeScript strict mode**: All type checking enabled -- **Dependency injection**: Use service registry for testability -- **Constants**: Import from `utils/constants` (shared configuration) - ---- - -*Portions of the Content may be generated with the assistance of CursorAI* diff --git a/.gitignore b/.gitignore index de8b54d..ca2b826 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ coverage directives.graphql vsc-extension-quickstart.md + +# cursor rules +.cursor