Ruletypescript
Development Workflow Rule
**Always use Bun** for all package management:
Development Workflow
Package Manager
Always use Bun for all package management:
# Install dependencies
bun install
# Add a package
bun add <package>
# Add a dev dependency
bun add -d <package>
# Remove a package
bun remove <package>
Common Commands
Development
# Run tests for all packages
bun test
# Run tests for specific package
bun test packages/core
# Type checking
bun run check-types
# Linting
bun run lint
# Formatting
bun run format
CI Pipeline
# Run all checks (format, lint, type-check, test)
bun run ci-check
Building
# Build all packages
bun run build
Test-Driven Development (TDD)
This project follows strict TDD practices:
- Write tests first - Before implementing any feature
- Red → Green → Refactor cycle
- 95%+ coverage target - Comprehensive test coverage required
- Test behavior, not implementation - Focus on observable outcomes
TDD Workflow
- Write a failing test that describes the expected behavior
- Write the minimum code to make the test pass
- Refactor while keeping tests green
- Repeat
Git Workflow
Conventional Commits
All commits must follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Formatting changesrefactor: Code restructuringtest: Test additions/changeschore: Maintenance tasks
Examples:
feat(core): add zone shuffling operation
fix(lorcana): correct damage calculation for resist
test(cards): add tests for keyword abilities
Pre-commit Hooks
Lefthook runs automatically on commit:
- Biome formatting check
- Biome lint check
- Type checking
Branch Strategy
main- Production-ready code- Feature branches for new work
- PRs require passing CI checks
Directory Navigation
Always use absolute paths or run commands from project root:
# Good - from project root
bun test packages/core
# Good - with absolute path
bun test /path/to/tcg-engines/packages/core
# Avoid - changing directories
cd packages/core && bun test
CI Requirements
Before merging any PR:
- ✅
bun run format- Code is formatted - ✅
bun run lint- No lint errors - ✅
bun run check-types- TypeScript compiles - ✅
bun test- All tests pass
Reference
- Setup guide:
agents.md - Development process:
agent-os/product/development-process.md