Skip to main content
TouchAI welcomes contributions. This page explains the workflow, code-style rules, and commit conventions that keep the codebase consistent.

Contribution workflow

1

Fork and clone

Fork the repository on GitHub, then clone your fork:
git clone https://github.com/<your-username>/touchai.git
cd touchai
2

Install dependencies

pnpm install
This also runs husky via the prepare lifecycle script, which installs the pre-commit hooks.
3

Create a feature branch

Branch off main (or the current development branch) with a descriptive name:
git checkout -b feat/my-new-feature
# or
git checkout -b fix/issue-123
4

Make your changes

Write code, add tests where appropriate, and verify everything passes:
pnpm run type:check      # TypeScript
pnpm run lint:check      # ESLint
pnpm run format:check    # Prettier
pnpm run check:rust      # Rust compile check
pnpm run test:run        # Vitest
5

Commit your changes

Commits are validated by commitlint using the Conventional Commits specification. See the commit format section below.
git add .
git commit -m "feat(search): add keyboard navigation to results list"
6

Open a pull request

Push your branch and open a PR against the upstream main branch:
git push origin feat/my-new-feature
Describe what the PR changes and reference any related issues.

Commit message format

TouchAI uses the Conventional Commits specification enforced by @commitlint/config-conventional.
<type>(<scope>): <description>

[optional body]

[optional footer(s)]

Types

TypeWhen to use
featA new feature
fixA bug fix
docsDocumentation changes only
styleFormatting changes that do not affect logic
refactorCode restructuring with no feature or bug change
perfPerformance improvements
testAdding or updating tests
choreBuild process, tooling, or dependency updates
revertReverting a previous commit

Examples

# New feature
git commit -m "feat(mcp): add SSE transport support"

# Bug fix with scope
git commit -m "fix(window): correct resize calculation on HiDPI displays"

# Documentation update
git commit -m "docs: add architecture overview page"

# Breaking change (add ! after type/scope)
git commit -m "feat(settings)!: remove legacy provider config format"

# Chore with body
git commit -m "chore(deps): upgrade tauri to 2.8.0"
Commits that do not follow the Conventional Commits format will be rejected by the commit-msg Husky hook.

Pre-commit hooks

Husky runs lint-staged on every commit. The following checks run automatically on staged files:
File patternActions
*.{js,ts,vue}eslint --fix then prettier --write
*.{json,md,html,css}prettier --write
src-tauri/**/*.rscargo fmt --manifest-path src-tauri/Cargo.toml
You do not need to run formatters manually before committing — lint-staged handles it.

Code style

TypeScript / Vue

Code style is enforced by ESLint and Prettier. The active configuration:
  • ESLint extends eslint:recommended, typescript-eslint/recommended, vue/flat/recommended, and prettier/recommended
  • Import order is enforced by eslint-plugin-simple-import-sort (simple-import-sort/imports and simple-import-sort/exports are both error)
  • vue/no-v-html is disabled to allow trusted HTML rendering
Prettier settings (from .prettierrc):
OptionValue
semitrue
tabWidth4
singleQuotetrue
trailingComma"es5"
printWidth100
endOfLine"lf"
vueIndentScriptAndStyletrue
Pluginprettier-plugin-tailwindcss
Run the formatter manually:
pnpm run format:fix

Rust

All Rust code must be formatted with rustfmt using the project manifest:
cargo fmt --manifest-path src-tauri/Cargo.toml --all
Or via the npm script:
pnpm run format:rust:fix
Running pnpm run format:fix formats both the TypeScript/Vue sources and all Rust files in one command.

Testing

TouchAI uses Vitest for frontend unit and integration tests.
pnpm test
New features should include corresponding tests where practical. test:run is used in CI and will pass even when no test files exist (--passWithNoTests).

License

TouchAI is released under the GNU General Public License v3.0. By contributing you agree that your changes will be distributed under the same licence.

Build docs developers (and LLMs) love