Add agent-skills module: SKILL.md folders loaded by the Skill tool

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Lm655hdgDo5xsSLNomgdsy
This commit is contained in:
2026-10-13 02:48:07 +00:00
co-authored by Claude Sonnet 5.5
parent e79b75a105
commit c13195295d
21 changed files with 665 additions and 0 deletions
@@ -0,0 +1,44 @@
package com.ankurm.agentskills;
import java.util.List;
import org.springaicommunity.agent.tools.SkillsTool;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.ToolCallingAdvisor;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.model.tool.ToolCallingChatOptions;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
/**
* The wiring from the article, in one place so the tests exercise exactly what an application would run.
* Skills ship inside the jar, so they are loaded from the classpath rather than from a directory on disk.
*/
public final class SkillClients {
private SkillClients() {
}
/** The one tool the model gets for skills: {@code Skill}, with every skill's name and description in its description. */
public static ToolCallback skillsTool(Resource... skillRoots) {
SkillsTool.Builder builder = SkillsTool.builder();
for (Resource root : skillRoots) {
builder.addSkillsResource(root);
}
return builder.build();
}
public static ToolCallback bundledSkills() {
return skillsTool(new ClassPathResource("skills"));
}
public static ChatClient client(ChatModel model, List<ToolCallback> tools) {
return ChatClient.builder(model)
.defaultOptions(ToolCallingChatOptions.builder())
.defaultToolCallbacks(tools)
.defaultAdvisors(ToolCallingAdvisor.builder().build())
.build();
}
}
@@ -0,0 +1,9 @@
---
name: incident-summary
description: Summarise an incident timeline into impact, cause, and follow-ups for a status page or postmortem.
---
# Incident summary
State impact first (who, how long), then the proximate cause, then the follow-ups with owners.
Keep the timeline to the five events that changed what responders did.
@@ -0,0 +1,15 @@
---
name: release-notes
description: Write release notes for a software version from a list of merged changes. Use when asked to draft, tidy or summarise release notes or a changelog entry.
---
# Release notes
Turn a list of merged changes into release notes a user can act on.
1. Group the changes under **Breaking**, **Added**, **Fixed** and **Internal**, in that order.
2. Lead every **Breaking** item with what the reader must change, not with what the team did.
3. Read `references/style-guide.md` (in this skill's directory) before writing the final text.
4. Never invent a ticket number. If a change has none, leave the reference out.
Return the notes as Markdown with one bullet per change.
@@ -0,0 +1,5 @@
# Release notes style guide
- Present tense, active voice: "Fixes a crash when the cache is empty", not "A crash was fixed".
- One sentence per bullet. A second sentence belongs in the migration guide, not the notes.
- Name the setting, class or endpoint in backticks so it can be searched for.
@@ -0,0 +1,12 @@
---
name: sql-review
description: Review a SQL migration for locking, data-loss and rollback problems. Use when asked to check, review or approve a database migration script.
allowed-tools: Bash
---
# SQL migration review
1. Run `scripts/lint.sh <file>` from this skill's directory and quote its output.
2. Flag any `DROP`, `TRUNCATE` or `ALTER ... TYPE` as data-loss risk.
3. Flag any `CREATE INDEX` without `CONCURRENTLY` as a table lock on PostgreSQL.
4. State whether a rollback script exists. If it does not, say so first.
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# A deliberately tiny linter: it only counts the statements the review skill cares about.
file="${1:?usage: lint.sh <file>}"
echo "drop/truncate : $(grep -ciE '^\s*(drop|truncate)\b' "$file")"
echo "index w/o CONCURRENTLY : $(grep -iE 'create (unique )?index' "$file" | grep -vciE 'concurrently')"