You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to pre-built skills, Anthropic supports custom skills that you can create for specialized document templates, formatting rules, or domain-specific behaviors.
2029
+
Custom skills are `SKILL.md` files with instructions that you upload to your Anthropic workspace.
2030
+
Once uploaded, you can use them in Spring AI alongside pre-built skills.
2031
+
2032
+
Custom skills are ideal for:
2033
+
2034
+
* **Corporate branding**: Apply consistent headers, footers, logos, and color schemes
* Use `files[]=` (with square brackets), not `files=`
2059
+
* The `filename` parameter must include a directory matching the `name` field in your SKILL.md YAML frontmatter
2060
+
* After uploading, verify your skill appears in the Anthropic Console under **Settings > Capabilities**
2061
+
====
2062
+
2063
+
The response contains your skill ID:
2064
+
2065
+
[source,json]
2066
+
----
2067
+
{
2068
+
"id": "skill_01AbCdEfGhIjKlMnOpQrStUv",
2069
+
"display_title": "My Custom Skill",
2070
+
"source": "custom",
2071
+
"latest_version": "1765845644409101"
2072
+
}
2073
+
----
2074
+
2075
+
==== Using Custom Skills in Spring AI
2076
+
2077
+
Reference your custom skill by its ID using the `.customSkill()` method:
2078
+
2079
+
[source,java]
2080
+
----
2081
+
ChatResponse response = chatModel.call(
2082
+
new Prompt(
2083
+
"Create a quarterly sales report",
2084
+
AnthropicChatOptions.builder()
2085
+
.model("claude-sonnet-4-5")
2086
+
.maxTokens(4096)
2087
+
.customSkill("skill_01AbCdEfGhIjKlMnOpQrStUv")
2088
+
.build()
2089
+
)
2090
+
);
2091
+
----
2092
+
2093
+
==== Combining Pre-built and Custom Skills
2029
2094
2030
-
In addition to the pre-built skills documented above, Anthropic supports custom skills that organizations can create for specialized document templates, formatting rules, or domain-specific behaviors.
2095
+
You can use both pre-built and custom skills in the same request.
2096
+
This allows you to leverage Anthropic's document generation capabilities while applying your organization's specific requirements:
.customSkill("skill_abc123") // Your custom skill ID from Anthropic
2120
+
.anthropicSkill(AnthropicApi.AnthropicSkill.XLSX)
2121
+
.customSkill("skill_01AbCdEfGhIjKlMnOpQrStUv") // Uses latest version
2122
+
.customSkill("skill_02XyZaBcDeFgHiJkLmNoPq", "1765845644409101") // Specific version
2041
2123
.build();
2124
+
2125
+
ChatResponse response = chatModel.call(
2126
+
new Prompt(
2127
+
"Generate the report",
2128
+
AnthropicChatOptions.builder()
2129
+
.model("claude-sonnet-4-5")
2130
+
.maxTokens(8192)
2131
+
.skillContainer(container)
2132
+
.build()
2133
+
)
2134
+
);
2042
2135
----
2043
2136
2044
-
Refer to the https://platform.claude.com/docs/en/build-with-claude/skills-guide[Anthropic Skills API documentation] for details on creating and managing custom skills in your workspace.
2045
-
====
2137
+
==== Updating a Custom Skill
2138
+
2139
+
To update an existing skill, upload a new version to the `/versions` endpoint:
2140
+
2141
+
[source,bash]
2142
+
----
2143
+
curl -X POST "https://api.anthropic.com/v1/skills/YOUR_SKILL_ID/versions" \
0 commit comments