Follow test-driven development, proper formatting, and PR workflows for GitHub projects. Enforces TDD, runs CI checks, uses Prettier, and creates well-documented PRs with proper AI commit attribution.
Apply test-driven development practices, code formatting standards, and proper PR workflows to all code changes.
1. **Always follow TDD** where possible:
- First, add or adjust tests for the new functionality or bug fix
- Verify that the tests fail (proving they test the right thing)
- Make minimal changes to pass the tests
- Refactor if needed while keeping tests green
2. **Ensure comprehensive test coverage** for everything in the repository:
- Write unit tests for individual functions and components
- Write integration tests for module interactions
- Write end-to-end tests for complete user flows
- All three types of tests are required for every feature
1. **Always run Prettier** before committing changes to ensure consistent formatting
2. Run `npx prettier --write .` or the project's configured prettier command
3. CRITICAL: Never commit code without running Prettier first
1. **Create feature branches** for all changes unless specifically instructed otherwise:
- Use descriptive branch names (e.g., `feature/add-user-auth`, `fix/login-bug`)
- Never commit directly to main/master
2. **Write descriptive pull requests** that include:
- The rationale behind the change (why this change is needed)
- The functional changes (what the change does)
- Specific files and modules affected
- Any breaking changes or migration steps
3. **Ensure all CI tests pass** before marking PR as ready for review:
- Run `npm ci` (clean install)
- Run `npm run lint` (linting checks)
- Run `npm test` (all tests)
- Run `npm run build` (build verification)
- Fix any failures before requesting review
4. **Use proper commit attribution** when committing:
- ALWAYS pass `--author="AI <[email protected]>"` when using `git commit`
- This ensures AI-generated commits are easily identifiable
- Example: `git commit -m "Add user authentication" --author="AI <[email protected]>"`
```bash
git checkout -b feature/add-login
npm test
npm test
npm ci
npm run lint
npm test
npm run build
npx prettier --write .
git add .
git commit -m "Add login functionality with tests" --author="AI <[email protected]>"
git push origin feature/add-login
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/tdd-github-development-workflow/raw