Skip to content

chore: Add AI rulesets #1475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .cursor/rules/build-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
description: HubSpot CLI Build/Lint/Test Commands
alwaysApply: true
---

# HubSpot CLI Build Commands

Use these commands when working with this codebase:

- Build: `yarn build`
- Lint: `yarn lint` (eslint + prettier check)
- Format code: `yarn prettier:write`
- Run all tests: `yarn test`
- Run specific test: `yarn test commands/__tests__/specific-file.test.ts`
- Check circular dependencies: `yarn circular-deps`
- Run CLI acceptance tests: `yarn test-cli`
- Debug CLI: `yarn hs-debug`

Always run linting and tests before committing changes.
25 changes: 25 additions & 0 deletions .cursor/rules/code-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: HubSpot CLI Code Style Guidelines
globs: "**/*.{js,ts,jsx,tsx}"
alwaysApply: true
---

# HubSpot CLI Code Style Guidelines

Follow these guidelines when working with code in this repository:

- Use TypeScript with strict type checking
- All new log statements should use the uiLogger
- Follow Unix philosophy: small, focused modules that do one thing well
- Always check similar files for patterns and conventions before modifying
- Use functional patterns, avoid classes where possible
- Always use descriptive variable names that clearly indicate purpose
- When writing logger statements, always put strings in the en.ts file
- Write tests in `__tests__` directories using Jest
- Use single quotes, 2-space indentation, trailing commas
- Keep lines under 80 characters, except in special files like lyaml
- No console.log in production code
- Prefer early returns for readability
- Use ESM modules (Node.js 18+ support)
- Keep type definitions in separate `/types` directory
- Never commit or push to main branch without permission
17 changes: 17 additions & 0 deletions .cursor/rules/formatting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Code Formatting Guidelines
globs: "**/*.{js,ts,jsx,tsx}"
alwaysApply: false
---

# Code Formatting Guidelines

Follow these formatting rules:

- Use single quotes for strings
- Use 2-space indentation
- Include trailing commas in arrays and objects
- Keep lines under 80 characters
- Exception: lyaml files can exceed this limit
- Use `yarn prettier:write` to format code automatically
- Use `yarn lint` to check for formatting and linting issues
16 changes: 16 additions & 0 deletions .cursor/rules/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
description: Testing Guidelines
globs: "**/__tests__/**/*.{js,ts}"
alwaysApply: false
---

# Testing Guidelines

When working with test files:

- Tests should be in `__tests__` directories
- Use Jest for testing
- Follow the naming convention of `[file-being-tested].test.ts`
- Run tests with `yarn test` or `yarn test [specific-file-path]`
- Run acceptance tests with `yarn test-cli`
- Debug tests with `yarn hs-debug`
22 changes: 22 additions & 0 deletions .cursor/rules/typescript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
description: TypeScript Code Guidelines
globs: "**/*.ts"
alwaysApply: false
---

# TypeScript Guidelines

When working with TypeScript files:

- Use strict type checking
- Follow functional programming patterns
- Avoid classes where possible
- Use descriptive variable names
- Keep module size small and focused (Unix philosophy)
- Use single quotes for strings
- Use 2-space indentation
- Use trailing commas in arrays and objects
- Keep lines under 80 characters
- Use early returns for readability
- Store type definitions in the `/types` directory
- Use ESM modules syntax
30 changes: 30 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build/Lint/Test Commands
- Build: `yarn build`
- Lint: `yarn lint` (eslint + prettier check)
- Format code: `yarn prettier:write`
- Run all tests: `yarn test`
- Run specific test: `yarn test commands/__tests__/specific-file.test.ts`
- Check circular dependencies: `yarn circular-deps`
- Run CLI acceptance tests: `yarn test-cli`
- Debug CLI: `yarn hs-debug`

## Code Style Guidelines
- TypeScript with strict type checking
- Follow Unix philosophy: small, focused modules that do one thing well
- Always check similar files for patterns and conventions before modifying
- Use functional patterns, avoid classes where possible
- Always use descriptive variable names that clearly indicate purpose
- When writing logger statements, always put strings in the en.ts file
- All new log statements should use the uiLogger
- Tests in `__tests__` directories using Jest
- Single quotes, 2-space indentation, trailing commas
- 80 character line limit, except in special files like lyaml
- No console.log in production code
- Early returns preferred for readability
- ESM modules (Node.js 18+ support)
- Type definitions in separate `/types` directory
- Never commit or push to main branch without permission