mit einem Klick
cli-code-check
// Review code changes in current branch for adherence to team guidelines and conventions
// Review code changes in current branch for adherence to team guidelines and conventions
Generate a changelog for npm releases by analyzing git commits and categorizing changes
Design and refine HubSpot CLI commands, copy, and interaction patterns against established design guidelines and industry best practices (clig.dev, Heroku, Atlassian, HotCoA). Use when an engineer needs help with CLI design decisions — command/flag/arg structure, error messages, help text, prompts, success messages, warnings, progress output, configuration conventions, environment variables, interactivity patterns, naming, or accessibility. Trigger on "help me design this command", "review this CLI text", "write an error message for", "what should this prompt say", "how should I structure these flags", or any request about HubSpot CLI design, wording, tone, or behavior.
| name | cli:code-check |
| description | Review code changes in current branch for adherence to team guidelines and conventions |
| disable-model-invocation | false |
| allowed-tools | Bash(git:*), Read, Grep, Glob |
| argument-hint | [base-branch] |
Review all code changes in the current branch to ensure they follow the team's coding standards, conventions, and organizational guidelines.
Scope: This skill focuses on architectural patterns, code organization, and conventions that require human judgment. Basic formatting (quotes, indentation, line length, trailing commas) should be checked with yarn lint:local and yarn prettier:write.
When this skill is invoked:
yarn lint:local to catch formatting and linting issuesmain)/code-style-check develop), use that branch as the basegit diff --name-only <base-branch>...HEAD to get list of changed filesgit diff <base-branch>...HEAD to see the actual changesnode_modules/, dist/, and other non-source directoriesCheck each modified file for compliance with these guidelines:
Note: This skill focuses on architectural patterns and conventions that require human judgment. Run yarn lint:local and yarn prettier:write for automated style checks (quotes, indentation, line length, etc.).
data, info, temp)any type (should be rare and well-justified)/types directory@ts-ignore comments (use proper types or @ts-expect-error with explanation)/commands/<domain>/<feature>.ts structure/lib/<domain>/ directories/types/<domain>.ts files/lang/en.ts files (e.g., /lang/en.ts)/ui/ directory (see UI README)__tests__ directories co-located with source<source-file>.test.tsuiLogger (imported from lib/ui/logger.js)/lang/en.tsimport { uiLogger } from '<path-to>/lib/ui/logger.js' (adjust relative path as needed)import { commands } from '<path-to>/lang/en.js' (adjust relative path as needed)log(), error(), warn(), success(), info(), debug(), group(), json()command, describe, builder, handlertrackCommandUsage() for analyticsexit() only in command handler functionslib/enums/exitCodes.tslang/en.tsYargsCommandModule<T, U> from types/Yargs.tsverboseDescribe for comprehensive --help textbuilder uses makeYargsBuilder utility with appropriate use<X>Options flags (e.g., useAccountOptions, useEnvironmentOptions)Unit/Integration Tests (__tests__ directories):
__tests__ directories<source-file>.test.ts (or .test.tsx for UI components in /ui directory)yarn testAcceptance Tests (/acceptance-tests directory):
/acceptance-tests directory (not co-located)yarn test-cliGeneral Testing Rules:
expect().toThrow() instead).skip() or xit())lang/en.ts fileyarn build)package.json and challenge whether they're necessarymain branchProvide a structured report with these sections:
# Code Style Review for Branch: <branch-name>
**Base:** <base-branch>
**Files Changed:** <count>
## Summary
_Brief overview of changes and overall code quality assessment (2-3 sentences)_
## Linter Results
**Status:** ✓ Passed / ✗ Failed
_If failed, include the relevant linter errors in the Critical Issues section below_
## Issues Found
### Critical Issues
_Issues that MUST be fixed before merging:_
- Linter/build failures
- Missing `trackCommandUsage()` call in command handler
- User-facing strings hardcoded instead of using `lang/en.ts`
- Using `process.exit`
- Using `exit()` outside of command handler function
- Test file that doesn't build
- Committing directly to `main` branch
- [ ] **<file-path>:<line>** - <description>
- [ ] **<file-path>:<line>** - <description>
### Pattern Violations
_Issues that violate codebase conventions and should be fixed before merging:_
- Type definitions in wrong place (not in `/types` directory)
- Not using `uiLogger` (using `console.log()` instead)
- Wrong directory structure (command file in wrong location)
- Missing tests for new functionality
- Try/catch in tests (should use `expect().toThrow()`)
- [ ] **<file-path>:<line>** - <description>
- [ ] **<file-path>:<line>** - <description>
### Suggestions
_Optional improvements that would enhance code quality:_
- Variable naming could be more descriptive (but not critically vague)
- Early return opportunities (when nesting is manageable)
- Refactoring opportunities for readability
- **<file-path>:<line>** - <description>
## Guideline Adherence
- [x] All user-facing strings in en.ts
- [x] Uses uiLogger for logging
- [x] Types defined in /types directory
- [x] Commands call trackCommandUsage()
- [x] Descriptive variable names
- [x] Proper file organization
- ...
## Files Reviewed
- `<file-path>` - <brief assessment>
- `<file-path>` - <brief assessment>
## Next Steps
**Before merging:**
1. Fix all Critical Issues (blocking)
2. Fix all Pattern Violations (maintain codebase standards)
3. Consider addressing Suggestions for code quality
_Additional specific recommendations based on the issues found_
yarn lint:local runs first, include those results to avoid duplicate concernsCRITICAL: You MUST end your response with one of these exact status lines:
STATUS: PASSED - No issues found
or
STATUS: FAILED - [brief summary of critical issues]
This status line is used by automated workflows. Do not modify this format.
Determining Status:
After presenting the review report and status line, if any issues were found, ask the user:
"Would you like me to fix any of these issues? If so, please tell me which specific items you'd like me to address."
Wait for the user to specify which issues to fix before making any changes. The user may:
Only make changes after receiving explicit consent and direction from the user.