-
Notifications
You must be signed in to change notification settings - Fork 66
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
chore: Add AI rulesets #1475
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
25a2722
docs: Add CLAUDE.md with code style and command guidelines
joe-yeager ac1d62d
docs: Add Cursor rules based on CLAUDE.md
joe-yeager 83de1db
docs: Update CLAUDE.md to prohibit main branch changes
joe-yeager 92d02ac
docs: Update Cursor rules with main branch restriction
joe-yeager 5237292
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/claude-md
joe-yeager 8f5af7e
Update to add rule to use new logger
joe-yeager File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.