Contributing to Agentic Node TypeScript Starter
August 28, 2025 ยท View on GitHub
Thank you for your interest in contributing! This guide will help you get started with contributing to this project.
๐ Prerequisites
- Node.js 22+ (managed via mise)
- pnpm 10+ (managed via mise)
- Git
๐ Getting Started
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/agentic-node-ts-starter.git cd agentic-node-ts-starter -
Install tools via mise
mise install -
Install dependencies
pnpm install -
Run tests to verify setup
pnpm test
๐ Development Workflow
1. Create a Feature Branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-fix-name
2. Make Your Changes
- Write your code following the existing patterns
- Add tests for new functionality
- Update documentation as needed
3. Use Structured Logging
When adding logging to your code:
import { logger, createChildLogger } from './logger.js';
// Use module-specific loggers
const log = createChildLogger('module-name');
// Include context in logs
log.info({ userId, action }, 'User action performed');
// Handle errors properly
log.error({ err: error, context }, 'Operation failed');
// Never log sensitive data directly
// These fields are automatically redacted: password, token, api_key, etc.
Logging Guidelines:
- Use appropriate log levels (debug, info, warn, error, fatal)
- Include relevant context as structured data (first parameter)
- Keep log messages descriptive but concise (second parameter)
- Use child loggers for module-specific logging
- Never use console.log in production code
4. Run Quality Checks
Before committing, you can manually run all checks:
pnpm verify # Runs all checks: audit, typecheck, lint, format, test
Note: The pre-commit hook will automatically run all these checks when you commit.
Individual checks:
pnpm typecheck- Type checkingpnpm lint- ESLintpnpm format- Prettier formatting checkpnpm test- Run tests with coverage
5. Add a Changeset
Required: Every PR must include a changeset. The CI will fail without one.
pnpm changeset
This will prompt you to:
- Select the type of change (patch/minor/major)
- Provide a description of the change
The changeset will be used to:
- Generate changelog entries
- Determine version bumps
- Create release notes
Types of Changes
- patch: Bug fixes, documentation updates, internal changes
- minor: New features, non-breaking improvements
- major: Breaking changes
When NOT to Add a Changeset
For changes that don't affect users (like CI updates, tests, internal refactoring):
pnpm changeset --empty
6. Commit Your Changes
This project uses Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Test additions or changeschore:Maintenance tasksperf:Performance improvements
Example:
git add .
git commit -m "feat: add new validation for user input"
Pre-commit hooks will automatically:
- Run security audit
- Type check your code
- Run ESLint checks
- Run Prettier format checks
- Run all tests
- Validate commit message format (via commit-msg hook)
Note: The pre-commit hook runs pnpm precommit which executes ALL quality checks. This ensures code quality but may take longer than typical pre-commit hooks.
7. Push and Create a Pull Request
git push origin your-branch-name
Then create a PR on GitHub with:
- Clear title following conventional commit format
- Description of what changed and why
- Link to any related issues
๐ฆ Changesets Guide
What are Changesets?
Changesets help us:
- Track what changes in each PR
- Automatically generate changelogs
- Manage version bumps
- Create release notes
Creating a Changeset
# Interactive mode - recommended
pnpm changeset
# For empty changeset (no release needed)
pnpm changeset --empty
Changeset File Format
Changesets are stored in .changeset/ as markdown files:
---
'agentic-node-ts-starter': patch
---
Fixed issue with validation logic in user input handler
Examples
Bug Fix (Patch)
pnpm changeset
# Select: patch
# Summary: "Fixed memory leak in event handler"
New Feature (Minor)
pnpm changeset
# Select: minor
# Summary: "Added support for custom validators"
Breaking Change (Major)
pnpm changeset
# Select: major
# Summary: "Changed API response format - returns array instead of object"
๐งช Testing
Running Tests
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverage
# Generate coverage report
pnpm coverage:report
Writing Tests
- Unit tests:
tests/*.spec.ts - Property-based tests:
tests/*.property.spec.ts
Example test:
import { describe, it, expect } from 'vitest';
import { myFunction } from '../src/myModule.js';
describe('myFunction', () => {
it('should return expected value', () => {
expect(myFunction(input)).toBe(expected);
});
});
๐๏ธ Project Structure
src/ # Source code
tests/ # Test files
*.spec.ts # Unit tests
*.property.spec.ts # Property-based tests
docs/ # Documentation
.changeset/ # Changeset files
๐ Code Style
- TypeScript with strict mode
- ESLint for linting
- Prettier for formatting
- ES modules with
.jsextensions in imports
๐ PR Review Process
- CI checks must pass
- Changeset must be included (or explicitly empty)
- Tests must cover new functionality
- Documentation must be updated if needed
- Code review approval required
๐ข Release Process
Releases are fully automated with zero manual intervention:
- You merge your PR with a changeset to main
- Version PR is created automatically by changesets
- Auto-merge is enabled on the version PR
- CI runs and passes โ PR merges automatically
- Release is created with:
- Git tag for the version
- GitHub release with changelog
- SBOM attached as release asset
- Build attestations for verification
What You Need to Do
Just merge your PR! The rest is automatic. The release will happen without any manual steps.
Monitoring Releases
You can watch the progress:
- Check the Actions tab to see workflows running
- The version PR will show "Auto-merge enabled" status
- Once merged, a GitHub release will appear in Releases
Stopping a Release
If you need to prevent an automatic release:
# Find the version PR number and disable auto-merge
gh pr merge --disable-auto PR_NUMBER
โ ๏ธ Important: Repository Configuration
For maintainers, ensure the following repository setting is enabled:
- Go to Settings โ Actions โ General
- Under "Workflow permissions", check:
- โ "Allow GitHub Actions to create and approve pull requests"
This is required for the automated release workflow to create version PRs.
๐ก Tips
- Keep PRs focused and small
- Write descriptive commit messages
- Add tests for new features
- Update documentation
- Use changesets for tracking changes
- Run
pnpm verifybefore pushing
๐ค Getting Help
- Check existing issues and PRs
- Read the documentation
- Ask questions in issues
- Review CLAUDE.md for AI-assisted development
๐ License
By contributing, you agree that your contributions will be licensed under the same license as the project.