ai-tool-elements welcomes contributions — new connectors, bug fixes, component improvements, and test coverage. This guide covers the development workflow from initial setup through opening a pull request, following the conventions documented inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/omavashia2005/ai-tool-elements/llms.txt
Use this file to discover all available pages before exploring further.
CONTRIBUTING.md and SETUP.md.
Development setup
Clone and install
Clone the repository and install dependencies with
npm ci to use the exact versions recorded in the lockfile.Run tests
Verify the environment is working before making any changes.
npm test builds the package, generates type declarations and CSS, then runs the Node test suite. A clean pass confirms that the build toolchain and your Node version (18 or later) are compatible.Start the showcase
For visual and component changes, run the editable Next.js showcase alongside your editor.Then edit
examples/basic/app/page.tsx to see live changes reflected in the browser. The showcase is a full Next.js app wired to the local build output, so changes to src/ take effect after the next npm run build (or re-running npm run example).Project conventions
Follow these conventions when preparing a contribution. They keep the library small, stable, and easy to consume across different stacks.- Keep the public API vendor-neutral. Do not introduce abstractions that tie the library to a specific AI provider, framework, or backend.
- Reuse the existing
Tool,ToolField, andToolImagetypes. Adding new top-level types requires a strong justification. - Keep connector IDs stable and unique. IDs are kebab-case slugs (e.g.
"google-sheets"). Once published, an ID must not change — consumers depend on it to identify connectors. - Prefer per-icon
@thesvg/icons/<slug>imports over barrel imports. Import the exact subpath (@thesvg/icons/slack) rather than the package root to avoid pulling in all icons at build time. - Add dependencies only when the existing stack cannot do the job. The goal is a lean dependency tree; evaluate whether
clsx,tailwind-merge, or standard browser APIs can cover the use case first. - Include a small regression test for behavior changes. The
test/directory contains Node test suite files. New behavior should be covered so future changes do not silently regress it.
Useful commands
npm run build produces dist/index.js (ESM), dist/index.cjs (CJS), dist/index.d.ts (type declarations), and dist/index.css (minified Tailwind CSS). Always run npm test rather than npm run build alone before opening a PR, because npm test also executes the test suite.
Pull requests
- Open development pull requests against the
devbranch, notmain. - Explain what changed and why in the PR description — a one-liner is fine for small fixes, but connector additions and API changes warrant more detail.
- Keep unrelated formatting changes, generated catalog updates, and dependency bumps out of the pull request. These are easier to review and revert when isolated.
mainrequires theTeststatus check to pass before a PR can be merged. Make surenpm testpasses locally on a clean install before pushing.
Release workflow
Releases are managed by the maintainers and follow a structured branch-and-tag process.- Create a release branch from
dev: - Bump the version and run tests:
- Open a pull request from
release/vX.Y.Ztomain. AfterTestpasses, merge without squashing. - Create a GitHub Release targeting
mainwith tagvX.Y.Zand publish it. Thepublish.ymlGitHub Actions workflow verifies the tag and publishes the package to npm automatically — no npm token is required in the workflow. - Fast-forward
devto the released commit so the default branch stays in sync withmain.
All contributions are licensed under the MIT License.