0.4.0 — Declarative capabilities
Capstead 0.4.0
Declarative capabilities — Capstead can now write and govern your AI capability, not just observe a hand-written one.
✨ Highlights
Declarative capabilities (@CapabilityClient)
Annotate a bodyless interface method with a prompt; Capstead renders it, routes the model, calls Spring AI's ChatClient, and binds the response to your return type — while the existing @Capability advisor governs it (recording, cost, budgets, execution tree, dashboard, catalog).
@CapabilityClient
@ModelProfile("reasoning")
public interface LessonCapability {
@Capability(name = "Generate Lesson", domain = "Learning")
@Prompt("Generate a Java lesson for {{topic}}")
Lesson execute(String topic); // no body — Capstead writes it
}Model routing is config-driven, so capability code never names a model:
capstead:
ai:
profiles:
reasoning: { model: us.anthropic.claude-sonnet-4-6, temperature: 0.2 }New annotations: @CapabilityClient, @Prompt, @SystemPrompt, @ModelProfile, @P. Requires capstead-spring-ai + Spring AI's ChatClient. Full guide: docs/DECLARATIVE-CAPABILITIES.md.
Dashboard: domain grouping
Capabilities are now grouped into domain cards (from the catalog), with click-to-filter — on top of the Models column and execution drill-down added in 0.3.3.
🔧 Notes
- Declarative capabilities appear in
/actuator/capabilities, on the dashboard, and in domain grouping exactly like annotation- and config-declared ones. - No breaking changes to existing APIs.
📦 Get it
<dependency>
<groupId>io.capstead</groupId>
<artifactId>capstead-starter</artifactId>
<version>0.4.0</version>
</dependency>
<!-- declarative capabilities also need: -->
<dependency>
<groupId>io.capstead</groupId>
<artifactId>capstead-spring-ai</artifactId>
<version>0.4.0</version>
</dependency>Runnable example (no API keys): samples/.