You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Cursor rules derived by SpecStory from the project AI interaction history
3
+
globs: *
4
+
---
5
+
6
+
## PROJECT OVERVIEW
7
+
This project is a Node.js based CLI tool. The source code is written in TypeScript.
8
+
9
+
## CODE STYLE
10
+
Adhere to standard TypeScript coding conventions. Use Prettier for formatting.
11
+
12
+
## FOLDER ORGANIZATION
13
+
The project follows a standard structure:
14
+
- `src`: Source code.
15
+
- `test`: Unit tests.
16
+
- `cli`: Contains the CLI application's entry point and related files.
17
+
18
+
19
+
## TECH STACK
20
+
- Node.js
21
+
- TypeScript
22
+
- npm
23
+
- shx (used in build script)
24
+
- OCLIF (used for CLI framework)
25
+
- zod (added 2025-03-12)
26
+
27
+
28
+
## PROJECT-SPECIFIC STANDARDS
29
+
- All commands should be defined in the `src/commands` directory.
30
+
- Unit tests should be written for every command. Tests should accurately reflect command functionality. Avoid simple string matching in tests; instead verify behavior.
31
+
- The `package.json` file should clearly define the entry point for the CLI.
32
+
- Avoid using `any` type; explicitly define types for all variables to prevent runtime errors. (Added 2025-03-12)
33
+
- Interface properties should be sorted alphabetically to satisfy `perfectionist/sort-object-types` linting rule. (Added 2025-03-12)
34
+
35
+
36
+
## WORKFLOW & RELEASE RULES
37
+
- Before running the CLI, build the TypeScript code using `npm run build`.
38
+
- Version updates will be managed using semantic versioning. (Further details on versioning strategy needed)
39
+
- To resolve TypeScript errors and missing modules, follow the steps outlined in `2025-03-12_14-21-fixing-typescript-errors-and-missing-modules.md`. This includes installing `zod` and correctly typing variables to avoid `'value' is of type 'unknown'` errors. The `npm install zod` command will install the necessary dependency. Type assertions like `as [string, EnvVariable][]` may be necessary to resolve type errors related to 'unknown' types.
40
+
- To run tests, use `npm run test`. Tests should be updated to reflect actual command behavior, not simple string matching. Remove tests for commands that do not exist. Use `npm run lint -- --fix` to automatically fix many linting errors. To run tests without linting, use `npm test --no-posttest`.
41
+
- Address deprecation warnings related to `fs.Stats` constructor.
42
+
43
+
44
+
## REFERENCE EXAMPLES
45
+
- Running the CLI from source: See instructions in `2025-03-11_12-54-running-a-package-from-source-instructions.md`
46
+
- Fixing TypeScript errors and missing modules: See `2025-03-12_14-21-fixing-typescript-errors-and-missing-modules.md`
47
+
- Fixing type issues in `uninstall.ts`: See `2025-03-12_15-33-fixing-type-issues-in-uninstall-ts.md`
48
+
49
+
50
+
## PROJECT DOCUMENTATION & CONTEXT SYSTEM
51
+
Documentation will be maintained using markdown files and integrated into the repository.
52
+
53
+
## DEBUGGING
54
+
- Ensure the TypeScript code is built (`npm run build`) before running the CLI.
55
+
- The error "command i not found" indicates that the TypeScript code needs to be compiled.
56
+
- `'value' is of type 'unknown'` errors in TypeScript indicate improperly typed variables. Refer to `2025-03-12_14-21-fixing-typescript-errors-and-missing-modules.md` for solutions.
57
+
- Missing module errors (e.g., "Cannot find module 'zod'") indicate missing dependencies. Use `npm install` to install required packages.
58
+
- Test failures often indicate a mismatch between test expectations and actual command output. Refactor tests to reflect actual command behavior.
59
+
- Deprecation warnings related to `fs.Stats` constructor indicate outdated code. Update the relevant code sections.
60
+
- Use `npm run lint -- --fix` to automatically fix many linting errors.
61
+
- `any` type errors indicate a need for explicit type definitions. Properly type variables to resolve these errors. (Added 2025-03-12)
0 commit comments