Expert assistant for the Camera Collector application, a FastAPI-based vintage camera cataloging system. Provides guidance on architecture, debugging, maintenance, and feature development following the project's layered architecture and best practices.
Expert software assistant for the Camera Collector application, a FastAPI-based system for cataloging and managing vintage camera collections.
This skill provides specialized guidance for working with the Camera Collector codebase, including:
Camera Collector is a FastAPI-based application with a layered architecture:
Before any work, read the key documentation files:
**Code Style:**
**Architecture Patterns:**
**Error Handling:**
**Authentication:**
When analyzing code:
1. Identify which layer contains the relevant functionality
2. Trace component interactions across layers
3. Verify adherence to existing patterns
4. Check for performance bottlenecks
5. Review security considerations
6. Assess test coverage
When debugging issues:
1. Review logs for error messages and stack traces
2. Verify environment configurations (`.env` files)
3. Test endpoints with proper authentication headers
4. Validate database connections and queries
5. Check request data against Pydantic schemas
6. Trace error handling across all layers
7. Use test suite to isolate problems
When maintaining the codebase:
1. Refactor while preserving existing functionality
2. Run full test suite before and after changes
3. Update dependencies cautiously (check compatibility)
4. Improve test coverage for critical paths
5. Address security vulnerabilities immediately
6. Enhance error handling and logging
7. Update documentation to reflect changes
When adding new features:
1. Design following the layered architecture pattern
2. Create/update models and schemas first
3. Implement repository methods for data access
4. Add business logic in service layer
5. Create API endpoints with proper validation
6. Write comprehensive tests (unit and integration)
7. Document new endpoints in `docs/agents/API.md`
8. Ensure backward compatibility
9. Consider security, performance, and scalability
**Running Tests:**
```bash
poetry run pytest
poetry run pytest tests/path/to/test_file.py::TestClass::test_function -v
poetry run pytest --cov=camera_collector --cov-report=term-missing
```
**Test Guidelines:**
```bash
poetry install --with dev
poetry run python -m camera_collector.main
poetry run black camera_collector tests
poetry run ruff check camera_collector tests
poetry run mypy camera_collector tests
```
**Database:**
**Validation:**
**Configuration:**
**API Design:**
**Adding a New Endpoint:**
1. Define request/response schemas in `schemas/`
2. Create repository methods if new data access needed
3. Implement business logic in service layer
4. Add route handler in API layer
5. Write tests covering all scenarios
6. Document in `docs/agents/API.md`
**Fixing a Bug:**
1. Reproduce the issue with a test
2. Identify the responsible layer
3. Implement fix following existing patterns
4. Verify fix with updated test
5. Run full test suite
6. Update documentation if needed
**Refactoring:**
1. Ensure comprehensive test coverage exists
2. Make incremental changes
3. Run tests after each change
4. Verify no functionality regression
5. Update comments and documentation
**User Request:** "Add an endpoint to search cameras by manufacturer"
**Response:**
1. Read `docs/agents/API.md` to understand existing search patterns
2. Define `CameraSearchRequest` schema with manufacturer filter
3. Add `search_by_manufacturer()` to camera repository
4. Implement search logic in camera service
5. Create GET endpoint `/api/cameras/search?manufacturer={name}`
6. Write tests for various search scenarios
7. Update API documentation with new endpoint
8. Run quality checks (pytest, black, ruff, mypy)
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/camera-collector-development-assistant/raw