Skip to content

Commit 8ba205d

Browse files
authored
chore: Add AI rulesets (#1475)
1 parent e13504f commit 8ba205d

File tree

6 files changed

+129
-0
lines changed

6 files changed

+129
-0
lines changed

.cursor/rules/build-commands.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
description: HubSpot CLI Build/Lint/Test Commands
3+
alwaysApply: true
4+
---
5+
6+
# HubSpot CLI Build Commands
7+
8+
Use these commands when working with this codebase:
9+
10+
- Build: `yarn build`
11+
- Lint: `yarn lint` (eslint + prettier check)
12+
- Format code: `yarn prettier:write`
13+
- Run all tests: `yarn test`
14+
- Run specific test: `yarn test commands/__tests__/specific-file.test.ts`
15+
- Check circular dependencies: `yarn circular-deps`
16+
- Run CLI acceptance tests: `yarn test-cli`
17+
- Debug CLI: `yarn hs-debug`
18+
19+
Always run linting and tests before committing changes.

.cursor/rules/code-style.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
description: HubSpot CLI Code Style Guidelines
3+
globs: "**/*.{js,ts,jsx,tsx}"
4+
alwaysApply: true
5+
---
6+
7+
# HubSpot CLI Code Style Guidelines
8+
9+
Follow these guidelines when working with code in this repository:
10+
11+
- Use TypeScript with strict type checking
12+
- All new log statements should use the uiLogger
13+
- Follow Unix philosophy: small, focused modules that do one thing well
14+
- Always check similar files for patterns and conventions before modifying
15+
- Use functional patterns, avoid classes where possible
16+
- Always use descriptive variable names that clearly indicate purpose
17+
- When writing logger statements, always put strings in the en.ts file
18+
- Write tests in `__tests__` directories using Jest
19+
- Use single quotes, 2-space indentation, trailing commas
20+
- Keep lines under 80 characters, except in special files like lyaml
21+
- No console.log in production code
22+
- Prefer early returns for readability
23+
- Use ESM modules (Node.js 18+ support)
24+
- Keep type definitions in separate `/types` directory
25+
- Never commit or push to main branch without permission

.cursor/rules/formatting.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
description: Code Formatting Guidelines
3+
globs: "**/*.{js,ts,jsx,tsx}"
4+
alwaysApply: false
5+
---
6+
7+
# Code Formatting Guidelines
8+
9+
Follow these formatting rules:
10+
11+
- Use single quotes for strings
12+
- Use 2-space indentation
13+
- Include trailing commas in arrays and objects
14+
- Keep lines under 80 characters
15+
- Exception: lyaml files can exceed this limit
16+
- Use `yarn prettier:write` to format code automatically
17+
- Use `yarn lint` to check for formatting and linting issues

.cursor/rules/testing.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Testing Guidelines
3+
globs: "**/__tests__/**/*.{js,ts}"
4+
alwaysApply: false
5+
---
6+
7+
# Testing Guidelines
8+
9+
When working with test files:
10+
11+
- Tests should be in `__tests__` directories
12+
- Use Jest for testing
13+
- Follow the naming convention of `[file-being-tested].test.ts`
14+
- Run tests with `yarn test` or `yarn test [specific-file-path]`
15+
- Run acceptance tests with `yarn test-cli`
16+
- Debug tests with `yarn hs-debug`

.cursor/rules/typescript.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
description: TypeScript Code Guidelines
3+
globs: "**/*.ts"
4+
alwaysApply: false
5+
---
6+
7+
# TypeScript Guidelines
8+
9+
When working with TypeScript files:
10+
11+
- Use strict type checking
12+
- Follow functional programming patterns
13+
- Avoid classes where possible
14+
- Use descriptive variable names
15+
- Keep module size small and focused (Unix philosophy)
16+
- Use single quotes for strings
17+
- Use 2-space indentation
18+
- Use trailing commas in arrays and objects
19+
- Keep lines under 80 characters
20+
- Use early returns for readability
21+
- Store type definitions in the `/types` directory
22+
- Use ESM modules syntax

CLAUDE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Build/Lint/Test Commands
6+
- Build: `yarn build`
7+
- Lint: `yarn lint` (eslint + prettier check)
8+
- Format code: `yarn prettier:write`
9+
- Run all tests: `yarn test`
10+
- Run specific test: `yarn test commands/__tests__/specific-file.test.ts`
11+
- Check circular dependencies: `yarn circular-deps`
12+
- Run CLI acceptance tests: `yarn test-cli`
13+
- Debug CLI: `yarn hs-debug`
14+
15+
## Code Style Guidelines
16+
- TypeScript with strict type checking
17+
- Follow Unix philosophy: small, focused modules that do one thing well
18+
- Always check similar files for patterns and conventions before modifying
19+
- Use functional patterns, avoid classes where possible
20+
- Always use descriptive variable names that clearly indicate purpose
21+
- When writing logger statements, always put strings in the en.ts file
22+
- All new log statements should use the uiLogger
23+
- Tests in `__tests__` directories using Jest
24+
- Single quotes, 2-space indentation, trailing commas
25+
- 80 character line limit, except in special files like lyaml
26+
- No console.log in production code
27+
- Early returns preferred for readability
28+
- ESM modules (Node.js 18+ support)
29+
- Type definitions in separate `/types` directory
30+
- Never commit or push to main branch without permission

0 commit comments

Comments
 (0)