Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 2.97 KB

File metadata and controls

82 lines (56 loc) · 2.97 KB

Agent Guidelines

Commit Message Convention

This project uses Conventional Commits (semver-based) for commit messages.

Format

<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: A new feature (increments MINOR version)
  • fix: A bug fix (increments PATCH version)
  • docs: Documentation only changes
  • style: Code style changes (formatting, missing semi colons, etc.)
  • refactor: Code refactoring without feature changes or bug fixes
  • perf: Performance improvements
  • test: Adding or updating tests
  • build: Changes to build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files (e.g., project setup)
  • revert: Reverts a previous commit

Examples

feat: add user authentication command
fix: resolve parsing error in config file
chore: initial project setup
docs: update README with installation instructions
refactor: extract command handlers into separate modules

Scope (Optional)

The scope should be the area of the codebase affected:

  • cli: CLI-related changes
  • config: Configuration changes
  • deps: Dependency updates

Breaking Changes

For breaking changes, add ! after the type/scope and include BREAKING CHANGE: in the footer:

feat!: change command API structure

BREAKING CHANGE: The command structure has been redesigned. Old commands are no longer supported.

Code Quality Workflow

After completing a task, agents must:

  1. Format code: Run npm run format to format all code files with Prettier
  2. Verify lint errors: Run npm run lint to check for any ESLint errors after formatting
  3. Build the code: Run npm run build to compile TypeScript and verify the build succeeds
  4. Fix build issues: If the build fails, fix any TypeScript compilation errors or other build issues
  5. Ensure clean state: The task is only considered complete when there are no lint errors, all files are properly formatted, and the build succeeds without errors

This ensures consistent code quality, formatting, and that the code compiles successfully across the project.

Code Reusability

When implementing features or fixing bugs, agents must:

  1. Identify duplicate logic: If the same logic or functionality appears in more than one place, it should be extracted into a reusable function or utility
  2. Create library modules: Extract shared logic into appropriate files in the src/lib/ directory
  3. Follow DRY principles: Don't Repeat Yourself - avoid code duplication by creating reusable utilities
  4. Maintain consistency: When refactoring, ensure all places using the duplicated logic are updated to use the new shared function

Example: If URL validation logic appears in multiple command files, extract it into src/lib/command-utils.ts or a dedicated utility module.

This promotes maintainability, reduces bugs from inconsistent implementations, and makes the codebase easier to understand and modify.