This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
SOLAPI SDK for Elixir - provides SMS, LMS, MMS, 카카오 알림톡/친구톡 messaging capabilities via the SOLAPI REST API.
# Install dependencies
mix deps.get
# Run all tests
mix test
# Run a single test file
mix test test/solapi/auth/hmac_test.exs
# Run a specific test by line number
mix test test/solapi_test.exs:27
# Format code
mix format
# Static analysis
mix dialyzer
# Code linting
mix credo
# Generate documentation
mix docsSolapi(lib/solapi.ex) - Main facade module providingclient/1andsend/1,2functionsSolapi.Http.Client(lib/solapi/http/client.ex) - Req-based HTTP client with automatic retry (exponential backoff), HMAC authentication, and JSON handlingSolapi.Message.Service(lib/solapi/message/service.ex) - Message sending service; all messages route through/messages/v4/send-many/detailendpointSolapi.Auth.Hmac(lib/solapi/auth/hmac.ex) - HMAC-SHA256 authentication header generation (format:HMAC-SHA256 apiKey=..., date=..., salt=..., signature=...)Solapi.Config(lib/solapi/config.ex) - Application configuration wrapper
Solapi.Error.ApiError- API response errors (status, code, message)Solapi.Error.ValidationError- Input validation errors (message, field)Solapi.Error.NetworkError- Transport/connection errors (reason, retries_exhausted)
Two ways to use the SDK:
-
Application config (reads from
:solapiapp config):Solapi.send(%{to: "...", from: "...", text: "..."})
-
Explicit client (runtime credentials):
client = Solapi.client(api_key: "key", api_secret: "secret") Solapi.send(client, %{to: "...", from: "...", text: "..."})
Set via environment variables in config/runtime.exs:
SOLAPI_API_KEY- API keySOLAPI_API_SECRET- API secret
Or programmatically via Solapi.Config.put/2.
Tests use Bypass to mock HTTP responses. See test/solapi_test.exs for integration test patterns.
Tidy First principles are automatically applied when implementing new features, refactoring, or making code changes. Claude Code will proactively invoke the tidy-first agent to:
- Analyze code for tidying opportunities before changes
- Separate structural changes from behavioral changes
- Follow TDD workflow (Red → Green → Refactor)
- Detect risk signals (scope creep, unnecessary complexity)
See .claude/agents/tidy-first/AGENT.md for detailed guidelines.
- Structural changes (tidyings): Guard Clauses, Extract Helper, Rename, etc.
- Behavioral changes (features): Actual functionality changes
- Rule: These MUST be in separate commits