This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
IMPORTANT: You should act as a manager, delegating implementation work to specialized subagents while focusing on coordination and review.
| Subagent | Use For |
|---|---|
api-feature-developer |
New SDK operations, API features, sync/async implementations |
mkdocs-documentation-writer |
Guides, API docs, README updates, changelog |
code-quality-reviewer |
Quality gates (ruff, pyright, pytest), code review |
sdk-test-engineer |
Writing tests, debugging failures, coverage |
version-control-engineer |
Commits, PRs, version bumping, releases |
- PROACTIVELY delegate to subagents for their specialized domains
- Chain workflows: e.g., implement feature → write tests → review → commit
- Review outputs rather than implementing directly
- Use parallel agents when tasks are independent (e.g., tests + docs simultaneously)
- "Add new API operation" →
api-feature-developer→sdk-test-engineer→code-quality-reviewer - "Document feature" →
mkdocs-documentation-writer→code-quality-reviewer - "Release new version" →
code-quality-reviewer→version-control-engineer
# Install dependencies
uv sync --all-extras
# Run all tests with coverage
uv run pytest
# Run a single test file
uv run pytest tests/test_users.py
# Run a specific test
uv run pytest tests/test_users.py::test_user_details -v
# Format code
uv run ruff format .
# Lint and auto-fix
uv run ruff check . --fix
# Type checking (strict mode)
uv run pyright
# Build documentation
uv run mkdocs serveThe Bloomy Python SDK is organized as a client-based architecture where all API operations are accessed through a central Client instance. The client handles authentication and provides access to operation-specific classes.
-
Client (
src/bloomy/client.py):- Central entry point for the SDK
- Initializes httpx client with authentication headers
- Creates instances of all operation classes
- Supports context manager protocol
-
Configuration (
src/bloomy/configuration.py):- Manages API key from multiple sources (direct, env var, config file)
- Can fetch API key using username/password via
/Tokenendpoint - Stores configuration in
~/.bloomy/config.yaml
-
Operations Pattern:
- Each API resource has its own operations class (e.g.,
UserOperations,MeetingOperations) - Sync operations in
src/bloomy/operations/inherit fromBaseOperations - Async operations in
src/bloomy/operations/async_/inherit fromAsyncBaseOperations - Both inherit from
AbstractOperationswhich provides shared logic - Response transformation is handled by mixins in
src/bloomy/operations/mixins/(e.g.,UserOperationsMixin,MeetingOperationsMixin) - Mixins use
_transformsuffix naming convention (e.g.,goals_transform.py,users_transform.py) - Generic bulk operations logic is provided in base classes (
_validate_bulk_item,_process_bulk_sync,_process_bulk_async) - Operations are accessed via client attributes:
client.user,client.meeting, etc.
- Each API resource has its own operations class (e.g.,
-
Models (
src/bloomy/models.py):- Pydantic models for type-safe API responses
- All models inherit from
BloomyBaseModelwith common config - Field aliases map PascalCase API responses to snake_case Python attributes
- Reusable annotated types:
OptionalDatetimeandOptionalFloatusing Pydantic'sBeforeValidator - Some models are type aliases for backward compatibility (e.g.,
HeadlineListItem = HeadlineDetails)
-
API Endpoints:
- Base URL:
https://app.bloomgrowth.com/api/v1 - Authentication: Bearer token in Authorization header
- All responses are JSON
- Base URL:
-
User ID Handling: The
BaseOperationsclass provides auser_idproperty that lazy-loads the current user's ID from/users/mineendpoint. This is used as default in many operations. -
Response Transformation: API responses are transformed into Python dictionaries with snake_case keys. The Ruby API uses PascalCase.
-
Error Handling:
- Custom exception hierarchy rooted at
BloomyError APIErrorincludes status code- All operations consistently use
response.raise_for_status()for error handling
- Custom exception hierarchy rooted at
-
Type Annotations: Uses Python 3.12+ union syntax (
|) and Pydantic models for structured return types. -
Testing: Mock-based testing with
unittest.mock. Fixtures intests/conftest.pyprovide sample data and mock HTTP client. Usepytest-asynciofor async tests.
- Users: Get details, search, list all users, get direct reports/positions
- Meetings: CRUD operations, get attendees/issues/todos/metrics
- Todos: CRUD operations for user or meeting todos
- Goals (aka Rocks): CRUD operations, archive/restore functionality
- Scorecard: Get current week, list/update scores
- Issues: Create, list, solve issues
- Headlines: CRUD operations for meeting headlines
- Optional Parameters: Many list operations accept either
user_idormeeting_idbut not both - Default User: When
user_idis not provided, operations default to the authenticated user - Include Flags: Some operations have
include_closedor similar flags to control filtering