Thank you for your interest in contributing to tweakcc! This document provides guidelines and workflows for contributing to the project.
- Node.js: 22.x (20.0.0 or higher required)
- pnpm: 10.13.1 or higher
pnpm install# Build for development (no minification)
pnpm build:dev
# Watch mode for iterative development
pnpm watch
# Run the CLI locally after building
pnpm startThis project uses ESLint and Prettier for code formatting and linting.
- Quotes: Single quotes
- Print Width: 80 characters
- Semicolons: Yes
- Indentation: 2 spaces (no tabs)
- Arrow Function Parentheses: Avoid when possible
- Trailing Commas: ES5
# Lint and type-check
pnpm lint
# Format code
pnpm format
# Check formatting without modifying files (used in CI)
pnpm prettier --check srcPre-commit hooks are configured via Husky and lint-staged to automatically format staged files before commit.
- Use strict type checking (enabled in
tsconfig.json) - Avoid
anytypes - preferunknownwith type guards - Use
@/alias for imports within thesrc/directory - Define interfaces for all configuration objects (see
src/types.ts)
- Components: PascalCase (e.g.,
ThinkingVerbsView) - Functions: camelCase (e.g.,
findClaudeInstallation) - Constants: UPPER_SNAKE_CASE (e.g.,
DEFAULT_CONFIG_PATH) - Files: camelCase (e.g.,
systemPromptSync.ts) or PascalCase for React components (e.g.,MainView.tsx)
-
Create a new branch from
mainfor your feature or fix:git checkout -b your-branch-name
-
Branch naming conventions:
feature/your-feature-namefix/your-fix-descriptiondocs/your-documentation-update
- Make your changes following the code style guidelines
- Run linting and tests locally:
pnpm lint pnpm run test - Build your changes:
pnpm build:dev
- Test your changes by running the CLI locally:
pnpm start
Run tests before submitting:
# Run all tests once
pnpm run test
# Run tests in watch mode for development
pnpm run test:devTest files are located in:
src/tests/*.test.ts- Unit tests for core functionalitysrc/patches/*.test.ts- Tests for specific patches
Testing patterns:
- Use Vitest globals (
describe,it,expect,beforeEach,afterEach) - Mock dependencies using
vi.mock() - Test edge cases and error conditions
Follow these conventions for clear, meaningful commit messages:
<type> <subject> (#<issue-number>)
<body>
Types:
Add- New featuresFix- Bug fixesPrompts for- Update for new Claude versionSort- Sorting or reorganization changesUpdate- Updates to existing featuresRefactor- Code refactoring (no functional changes)
Examples:
Add support for dangerously bypassing permissionsFix remaining patching errorsPrompts for 2.1.34Add auto-accept plan mode patch
- Ensure all tests pass:
pnpm run test - Ensure linting passes:
pnpm lint - Ensure formatting is correct:
pnpm format - Rebuild the project:
pnpm build:dev - Test your changes locally with
pnpm start
## Summary
<Brief description of what this PR changes>
## Changes
- Change 1
- Change 2
## Testing
- [ ] Tests added/updated
- [ ] Manual testing completed
- [ ] All existing tests pass
## Related Issues
Closes #(issue-number) or Relates to #(issue-number)- PRs will be reviewed by maintainers
- Address review feedback promptly
- Keep the PR focused on a single change if possible
- Ensure commit history is clean (squash/rebase as needed)
- Your changes will be included in the next release
- You'll be credited in the changelog
- Your contribution is greatly appreciated! 🎉
- Bug fixes - Help squash issues
- New features - Propose new patches or customizations
- Documentation improvements - Clarify usage or add examples
- Test coverage - Add tests for existing functionality
- Performance improvements - Optimize CLI startup or execution
- Prompt updates - Contribute prompts for new Claude versions
When reporting bugs, please include:
- Version:
tweakcc --version - Operating System: macOS / Linux / WSL
- Node.js version:
node --version - Steps to reproduce: Clear reproduction steps
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Logs: Relevant error messages or logs
- Check existing Issues for similar problems
- Read the README for usage documentation
- Ask questions in a new issue with the
questionlabel
Thank you for contributing! 🙌