Day 11
Advanced Patterns
Conditional instructions, role-specific contexts, and CI/CD integration.
0 / 8 tasks
File-type conditional rules
markdown
## File-Type Rules
When editing `*.test.ts` or `*.spec.ts` files:
- Use `describe/it` blocks (not `test()`)
- Mock external services, never real HTTP calls
- Use `beforeEach` to reset state
When editing `*.py` files:
- Use pytest fixtures, not unittest.TestCase
- Prefer `assert` over `assertEqual`
When editing `*.sql` files:
- Always include an `IF NOT EXISTS` guard for DDL
- Never use `SELECT *` in production queries
- Add an `EXPLAIN` comment above complex queries
CI/CD context
markdown
## CI/CD Context
### GitHub Actions
- Workflows are in `.github/workflows/`
- Use `ubuntu-latest` runners
- Cache pip dependencies with `actions/cache@v4`
- Always pin action versions (e.g. `@v4` not `@main`)
### Deployment
- Staging auto-deploys from `develop` branch
- Production deploys require a version tag `v*.*.*`
- Environment secrets are in GitHub Secrets, not env files
### Pre-commit Hooks
- ruff for linting
- mypy for type checking
- pytest with --tb=short for tests
- Never suggest skipping hooks