Context
ClaudeProvider at lib/providers/llm.ts:42-46 is a mock. Per AGENTS.md routing, Claude is the default for orchestration, script, compliance, humanization (and fallback for caption / translation).
Goal
Replace the mock with a real adapter against the Anthropic API. Use the claude-api skill guidance: import @anthropic-ai/sdk, default to the latest model (claude-opus-4-7 for high-quality / claude-sonnet-4-6 for cost-sensitive), enable prompt caching on the system message and brand context.
Acceptance criteria
Files
lib/providers/llm.ts:42-46 (ClaudeProvider)
package.json (new dep)
Depends on
- #provider-mocks-isolation (cleaner ground)
- #env-loader (env loaded consistently — see Sprint 0 acceptance)
Context
ClaudeProvideratlib/providers/llm.ts:42-46is a mock. Per AGENTS.md routing, Claude is the default fororchestration,script,compliance,humanization(and fallback forcaption/translation).Goal
Replace the mock with a real adapter against the Anthropic API. Use the
claude-apiskill guidance: import@anthropic-ai/sdk, default to the latest model (claude-opus-4-7for high-quality /claude-sonnet-4-6for cost-sensitive), enable prompt caching on the system message and brand context.Acceptance criteria
npm i @anthropic-ai/sdkClaudeProvider.generatecalls the Messages API with the correct model per task (compliance/script→ opus-4-7;caption/humanization→ sonnet-4-6)cache_control: { type: 'ephemeral' }) on stable preamble blocks: brand voice, persona, channel rulesGenerationResultwith realtokens,cost_usd,latency_msANTHROPIC_API_KEYfrom process env (loaded by CLI)scriptDRY_RUN=true(mock variant used; see #provider-mocks)Files
lib/providers/llm.ts:42-46(ClaudeProvider)package.json(new dep)Depends on