- Update all packages to latest versions via pnpm update --latest - Downgrade Prisma 7 to 6 (v7 requires schema migration) - Downgrade Tailwind CSS 4 to 3 (v4 requires PostCSS migration) - Downgrade Storybook 10 to 8 (addons not available in v10) - Pin cheerio to 1.0.0-rc.12 via pnpm override (type exports changed) - Fix AI SDK tool definitions: parameters -> inputSchema - Fix cheerio types in extract-meta and table-extract tools - Add explicit type annotations to tool execute functions - Migrate biome config to v2.3.11 schema All type-checks, tests, and builds pass. |
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
@tpmjs/tools-conventional-commit-suggest
Suggests conventional commit messages from descriptions or file changes following the Conventional Commits specification.
Installation
npm install @tpmjs/tools-conventional-commit-suggest
Usage
import { conventionalCommitSuggest } from '@tpmjs/tools-conventional-commit-suggest';
import { generateText } from 'ai';
const result = await generateText({
model: yourModel,
tools: {
conventionalCommitSuggest,
},
prompt: 'Suggest a commit message for adding a new login feature',
});
Tool Details
conventionalCommitSuggest
Suggests a conventional commit message based on a description of changes and optionally a list of changed files.
Parameters:
description(string, required) - Description of the changes madefiles(array of strings, optional) - Changed file paths to help determine scope
Returns:
{
message: string; // The commit message subject line
type: CommitType; // feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
scope: string | null; // The scope (usually derived from files)
breaking: boolean; // Whether this is a breaking change
body: string | null; // Optional commit body
fullMessage: string; // Complete commit message with body
explanation: string; // Explanation of the commit type
}
Example Output
Input:
{
description: "added dark mode toggle to settings page",
files: ["src/components/settings/ThemeToggle.tsx", "src/components/settings/Settings.tsx"]
}
Output:
{
message: "feat(settings): add dark mode toggle to settings page",
type: "feat",
scope: "settings",
breaking: false,
body: "Files changed:\n- src/components/settings/ThemeToggle.tsx\n- src/components/settings/Settings.tsx",
fullMessage: "feat(settings): add dark mode toggle to settings page\n\nFiles changed:\n- src/components/settings/ThemeToggle.tsx\n- src/components/settings/Settings.tsx",
explanation: "A new feature"
}
Conventional Commits Specification
This tool follows the Conventional Commits specification:
Commit Types
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that don't affect code meaning (formatting, whitespace)
- refactor: Code change that neither fixes a bug nor adds a feature
- perf: Performance improvement
- test: Adding or updating tests
- build: Changes to build system or dependencies
- ci: Changes to CI/CD configuration
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
Format
<type>(<scope>): <subject>
<body>
<footer>
Breaking Changes
Breaking changes are indicated with ! after the type/scope:
feat(api)!: remove deprecated endpoints
Features
- Automatically determines commit type from description
- Extracts scope from file paths
- Detects breaking changes
- Generates commit body with file list
- Follows Conventional Commits specification
- Provides explanation for suggested type
License
MIT