Commit Guidelines: Conventional Commits
Guidelines for writing clear, semantic commit messages.
Format
Section titled “Format”<type>(<scope>): <subject>
<body>
<footer>Components
Section titled “Components”Type (required)
Section titled “Type (required)”What kind of change is this?
feat: A new featurefix: A bug fixdocs: Documentation onlystyle: Code style changes (formatting, semicolons, etc.)refactor: Code refactoring without feature changeperf: Performance improvementtest: Test additions or updateschore: Build, CI/CD, dependencies, package.jsonci: CI/CD configuration changesScope (optional)
Section titled “Scope (optional)”What part of the codebase is affected?
feat(executor): add HTTP executorfix(schema): handle missing required fieldsdocs(api): update API referencetest(loader): add tool loader testsCommon scopes:
executor: Executor implementationsschema: Schema validationloader: Tool loadercli: Command-line interfacemcp: MCP servertypes: Type definitionserror: Error handlingtool: Tool definitionstest: Testing infrastructuredocs: Documentation
Subject (required)
Section titled “Subject (required)”Short description of the change (50 characters max).
✓ add HTTP executor with response validation✓ fix schema validation for missing fields✓ update API reference documentation✓ improve error messages
✗ added executor✗ fixed things✗ refactored code a lotRules:
- Imperative mood: “add” not “added” or “adds”
- Lowercase first letter
- No period at end
- Clear and specific
Body (optional)
Section titled “Body (optional)”Detailed explanation of the change (72 characters per line).
The HTTP executor now validates responses against the output_schemadefined in the tool. This ensures that:
- API responses match the expected format- Type safety is maintained across executions- Invalid responses throw SchemaValidationError
Implementation uses Zod for schema validation, consistent withthe rest of the codebase.Guidelines:
- Explain WHAT and WHY, not HOW
- Reference relevant issues
- Wrap at 72 characters
- Separate paragraphs with blank lines
Footer (optional)
Section titled “Footer (optional)”Reference issues and breaking changes.
Closes #123Refs #456, #789
BREAKING CHANGE: Tool YAML format changed (see migration guide)Format:
Closes #<issue>: Automatically close issue when PR mergesRefs #<issue>: Reference without closingBREAKING CHANGE:: Document breaking changes
Examples
Section titled “Examples”Feature
Section titled “Feature”feat(executor): add HTTP executor with response validation
Implement HttpExecutor class to make HTTP requests with:- Automatic parameter templating- Response validation against output_schema- Support for API authentication (bearer, api_key, basic)- Timeout and error recovery
This enables defining tools that call external APIs and validateresponses, with full type safety.
Closes #42Bug Fix
Section titled “Bug Fix”fix(schema): handle missing required fields in tool definition
Previously, the schema validation would crash if a tool was missingrequired fields. Now it returns a clear validation error with thelist of missing fields.
This improves error messages for developers writing tools and makesdebugging YAML syntax issues much easier.
Closes #38Documentation
Section titled “Documentation”docs(api-reference): document tool discovery methods
Add comprehensive API documentation for:- MatimoInstance.listTools()- MatimoInstance.getTool()- MatimoInstance.searchTools()
Include parameter types, return values, error codes, and examplesfor each method.
Refs #45Refactoring
Section titled “Refactoring”refactor(error-handling): consolidate error classes
Move all error handling logic to MatimoError base class withstructured error codes. This reduces duplication and makes errorhandling consistent across the codebase.
Changes:- Create ErrorCode enum for standard codes- Extend MatimoError for all error types- Update all throw statements to use structured errors- Add context objects to error messagestest(command-executor): add parameter templating tests
Add comprehensive test coverage for parameter substitution incommand execution:- Single parameter: {param}- Multiple parameters: {a} {b} {c}- Parameter in nested strings: "--op={op}"- Escaped parameters- Missing parameters
Closes #51chore: upgrade TypeScript to 5.3
- Update package.json to use TypeScript 5.3- Update tsconfig.json for new strict mode settings- Fix type errors discovered by stricter checking- Run full test suite to verify no regressionsBreaking Change
Section titled “Breaking Change”refactor(schema): change tool YAML format
BREAKING CHANGE: Tool YAML files must now include execution_typefield. Update existing tools:
Before: execution: command: node script.js
After: execution: type: command command: node script.js
See migration guide at docs/MIGRATION_v2.mdBest Practices
Section titled “Best Practices”✓ Write in imperative mood✓ Keep subject under 50 characters✓ Wrap body at 72 characters✓ Explain WHY the change was made✓ Reference related issues✓ Use semantic types (feat, fix, etc.)✓ Be specific and descriptive✓ Keep commits focused (one thing per commit)✗ Use past tense ("added", "fixed")✗ Make the subject too long✗ Forget the type✗ Combine multiple features in one commit✗ Leave out important details✗ Use vague descriptions ("fixes stuff")✗ Write in passive voice✗ Include multiple types in one commitCommit Scope Guide
Section titled “Commit Scope Guide”When to Use Scopes
Section titled “When to Use Scopes”Good (clear and specific):
feat(executor): add HTTP method supportfix(loader): handle YAML parse errorsdocs(api): document error codestest(schema): add validation testsUnclear (too broad):
feat(src): add new codefix(test): update testsdocs: various documentationScope Examples by Area
Section titled “Scope Examples by Area”Core Components
Section titled “Core Components”feat(executor) # Executor implementationsfeat(loader) # Tool loaderfeat(schema) # Schema validationfeat(registry) # Tool registryIntegration
Section titled “Integration”feat(mcp) # MCP serverfeat(cli) # CLI toolsfeat(decorators) # Decorator supportInfrastructure
Section titled “Infrastructure”chore(build) # Build configurationchore(ci) # CI/CD pipelinechore(deps) # Dependencieschore(types) # Type definitionsDocumentation & Testing
Section titled “Documentation & Testing”docs(api) # API documentationdocs(guide) # User guidestest(unit) # Unit teststest(integration) # Integration testsCommit Workflow
Section titled “Commit Workflow”Before Committing
Section titled “Before Committing”- Make sure changes are focused (one feature/fix)
- Stage relevant files:
git add <files> - Review changes:
git diff --staged - Run tests:
pnpm test - Check format:
pnpm lint && pnpm format
# Stage specific filesgit add src/executors/http-executor.ts test/unit/http-executor.test.ts
# Review changesgit diff --staged
# Verify everything workspnpm build && pnpm test && pnpm lintWriting the Commit
Section titled “Writing the Commit”- Use
git commit(notgit commit -mfor longer messages) - Follow the format: type(scope): subject
- Add body if needed (blank line after subject)
- Reference issues in footer
# Commits with detailed messagegit commit
# Opens editor with template:# feat(scope): subject## Detailed body explaining the change.# Multiple paragraphs separated by blank lines.## Closes #123Example Workflow
Section titled “Example Workflow”# Create feature branchgit checkout -b feature/http-executor
# Make changes# ... edit files ...
# Stage changesgit add src/executors/http-executor.tsgit add test/unit/http-executor.test.ts
# Verifygit diff --stagedpnpm test
# Commit with detailed messagegit commit
# In editor:# feat(executor): add HTTP executor with response validation## Implement HttpExecutor class for making HTTP requests to APIs with:# - Automatic parameter templating# - Response validation against output_schema# - Support for various authentication types# - Built-in timeout and retry logic## This enables defining tools that call external REST APIs while# maintaining type safety and validation.## Closes #42
# Push to remotegit push origin feat/http-executorCommon Mistakes
Section titled “Common Mistakes”Too Vague
Section titled “Too Vague”feat: update codefix: bug fixesdocs: update docschore: maintenanceBetter:
feat(executor): add HTTP method parameter supportfix(schema): validate enum values in parametersdocs(api): document all executor public methodschore(deps): upgrade TypeScript to 5.3Multiple Changes
Section titled “Multiple Changes”feat(executor): add HTTP support and fix timeout bugBetter (two commits):
feat(executor): add HTTP executor with response validationfix(executor): handle timeout edge cases correctlyUnclear Scope
Section titled “Unclear Scope”feat(src): add new featuresfix(test): improve testsdocs(docs): update documentationBetter:
feat(executor): add HTTP supportfix(loader): improve error messagesdocs(api): document parameter validationFuture Tense
Section titled “Future Tense”feat(executor): will add HTTP supportfix(schema): will fix validationBetter:
feat(executor): add HTTP supportfix(schema): validate enum valuesGit Aliases
Section titled “Git Aliases”Create aliases for faster committing:
# Add to ~/.gitconfig
[alias] co = checkout br = branch ci = commit st = status unstage = reset HEAD -- last = log -1 HEAD visual = log --graph --oneline --allUsage:
git co -b feat/my-featuregit ci # Opens commit editorgit visual # See commit graphTools & Helpers
Section titled “Tools & Helpers”commitizen (Guided Commits)
Section titled “commitizen (Guided Commits)”Interactively create commits:
pnpm add -D commitizennpx cz # Interactive commit prompthusky (Pre-commit Hooks)
Section titled “husky (Pre-commit Hooks)”Prevent bad commits:
pnpm add -D huskynpx husky installnpx husky add .husky/commit-msg 'pnpm lint-staged'lint-staged
Section titled “lint-staged”Lint before committing:
pnpm add -D lint-staged
# In package.json:{ "lint-staged": { "*.ts": ["eslint --fix", "prettier --write"], "*.md": ["prettier --write"] }}See Also
Section titled “See Also”- CONTRIBUTING.md: Full contribution guide
- DEVELOPMENT_STANDARDS.md: Code quality standards
- Conventional Commits: Full specification
Quick Reference
Section titled “Quick Reference”feat: New featurefix: Bug fixdocs: Documentationstyle: Formatting (no code change)refactor: Code restructuringperf: Performance improvementtest: Test changeschore: Build, CI, dependenciesci: CI configuration
Format: <type>(<scope>): <subject>
Rules:- Imperative mood ("add" not "added")- Lowercase first letter- No period at end- 50 chars for subject, 72 for body- Reference issues: Closes #123