| name | checking-quality |
| description | Ensures code quality through comprehensive checks including TDD practices, lint/test/build validation, and prevention of common mistakes. Use after completing implementations, fixing bugs, refactoring, or before committing code. |
Checking Quality
Comprehensive code quality assurance through systematic validation and common mistake prevention.
Table of Contents
- Quick Start Checklist
- Quality Gates
- Test-First Development
- Common Mistakes
- Workflows
- Error Recovery
Quick Start Checklist
Before committing any code changes, verify all quality gates pass:
cd frontend
npm run lint && npm run test && npm run build
cd backend
npm run lint && npm run test && npm run build
Commit only when all checks pass:
Quality Gates
When to Run Quality Checks
Execute complete quality validation after:
Frontend Validation
cd frontend
npm run lint
npm run test
npm run build
Backend Validation
cd backend
npm run lint
npm run test
npm run build
Test-First Development
Critical Rule: Always modify tests before implementation.
Correct Modification Sequence
When changing implementation:
- Modify tests first
- Verify tests fail (proving test validity)
- Update implementation
- Verify tests pass
Red-Green-Refactor Cycle
For new features and bug fixes:
- RED: Write failing test
- GREEN: Minimal code to pass test
- REFACTOR: Improve while tests stay green
See TDD Practices for detailed guidelines and examples.
Common Mistakes
Most Frequent Errors
- Forgetting test updates when modifying implementation
- Missing related file updates after interface changes
- Overlooking lint warnings before committing
- Skipping quality checks when rushed
Detailed Patterns
For comprehensive coverage of common mistakes with examples, see Common Mistakes Guide.
Quick Prevention
Workflows
New Feature Implementation
1. Write failing test (RED)
2. Run test to confirm failure
3. Write minimal implementation (GREEN)
4. Run test to confirm pass
5. Refactor while keeping tests green
6. Run quality checks (lint/test/build)
7. Commit when all checks pass
Bug Fixing
1. Write test reproducing the bug
2. Confirm test fails
3. Fix implementation
4. Confirm test passes
5. Check for related file updates
6. Run quality checks (lint/test/build)
7. Commit when all checks pass
Responding to Feedback
1. Understand the feedback
2. Modify tests first (critical!)
3. Update implementation
4. Verify related files
5. Run quality checks (lint/test/build)
6. Commit when all checks pass
Error Recovery
Lint Errors
- Read error message carefully
- Check tests first (may have same issue)
- Fix implementation
- Re-run
npm run lint
Test Failures
- Identify failing test
- Determine if implementation or test expectations changed
- Apply appropriate fix
- Re-run
npm run test
Build Errors
- Check type errors
- Verify dependencies
- Fix issues
- Re-run
npm run build
Best Practices
Small, Frequent Commits
- Commit after each completed feature
- Break large changes into incremental steps
- Keep each commit focused and self-contained
Automation
- Configure pre-commit hooks for automatic validation
- Use CI/CD pipelines to enforce quality gates
- Automate repetitive quality checks
Self-Review
- Re-read code changes before committing
- List modified files and their dependencies
- Verify test coverage for changes
Integration with Development
Quality checking should be seamless:
- During development: Run specific tests frequently
- Before breaks: Run full test suite
- Before committing: Run complete quality validation
- After merging: Verify integration tests pass
This systematic approach prevents quality issues from reaching the codebase while maintaining development velocity.