Skip to content

Commit 159b315

Browse files
committed
specstory stuff
1 parent a60c0c8 commit 159b315

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
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+
33+
34+
## WORKFLOW & RELEASE RULES
35+
- Before running the CLI, build the TypeScript code using `npm run build`.
36+
- Version updates will be managed using semantic versioning. (Further details on versioning strategy needed)
37+
- 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.
38+
- 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`.
39+
- Address deprecation warnings related to `fs.Stats` constructor.
40+
41+
42+
## REFERENCE EXAMPLES
43+
- Running the CLI from source: See instructions in `2025-03-11_12-54-running-a-package-from-source-instructions.md`
44+
- Fixing TypeScript errors and missing modules: See `2025-03-12_14-21-fixing-typescript-errors-and-missing-modules.md`
45+
46+
47+
## PROJECT DOCUMENTATION & CONTEXT SYSTEM
48+
Documentation will be maintained using markdown files and integrated into the repository.
49+
50+
## DEBUGGING
51+
- Ensure the TypeScript code is built (`npm run build`) before running the CLI.
52+
- The error "command i not found" indicates that the TypeScript code needs to be compiled.
53+
- `'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.
54+
- Missing module errors (e.g., "Cannot find module 'zod'") indicate missing dependencies. Use `npm install` to install required packages.
55+
- Test failures often indicate a mismatch between test expectations and actual command output. Refactor tests to reflect actual command behavior.
56+
- Deprecation warnings related to `fs.Stats` constructor indicate outdated code. Update the relevant code sections.
57+
- Use `npm run lint -- --fix` to automatically fix many linting errors.
58+
59+
60+
## FINAL DOs AND DON'Ts
61+
- **DO** use TypeScript.
62+
- **DO** write unit tests that accurately reflect command functionality.
63+
- **DO** build the project using `npm run build` before running.
64+
- **DO** follow the folder organization guidelines.
65+
- **DO** install all necessary dependencies using `npm install`.
66+
- **DON'T** run the CLI without building the TypeScript code first.
67+
- **DON'T** leave variables untyped; ensure proper type declarations to avoid runtime errors.
68+
- **DON'T** write tests that rely on simple string matching of command output. Focus on verifying actual command behavior.
69+
- **DON'T** ignore deprecation warnings; address them promptly to maintain code quality and avoid future compatibility issues.
70+
- **DON'T** ignore linting errors; address them using `npm run lint -- --fix` or manually.

.cursorignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore SpecStory derived-cursor-rules.mdc backup files
2+
.specstory/cursor_rules_backups/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ yarn.lock
1010
pnpm-lock.yaml
1111
*.tsbuildinfo
1212
.vscode/
13+
.specstory

0 commit comments

Comments
 (0)