Docs · Getting Started
Quickstart
Get to a working agent in five minutes. We'll scaffold a project, load a skill, and call an LLM.
Following along?
You'll need an
OPENAI_API_KEYin your environment. Skillarc itself doesn't require any keys — it's just a skill registry.Scaffold a project
terminal
mkdir my-agent && cd my-agent
pnpm init
pnpm add @skillarc/sdk openai dotenvLoad a skill
Skills are referenced by slug. The SDK fetches the MDX file, parses the frontmatter, and gives you a typed handle:
agent.ts
import "dotenv/config";
import { loadSkill } from "@skillarc/sdk";
import OpenAI from "openai";
const client = new OpenAI();
const prompt = await loadSkill("rag-retrieval-prompt");Call an LLM
The skill exposes a render() method that fills frontmatter variables in a type-safe way:
agent.ts
const message = prompt.render({
retrieved_chunks: [
"[1] Transformers replaced RNNs in 2017.",
"[2] Self-attention scales to long sequences.",
],
question: "What replaced RNNs?",
});
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: message }],
});
console.log(response.choices[0].message.content);Compose with tools
Tools follow the same pattern. Convert to the format your runtime expects with toOpenAI(), toAnthropic() or toGemini():
agent.ts
import { loadTool } from "@skillarc/sdk";
const search = await loadTool("web-search-tool");
const response = await client.responses.create({
model: "gpt-4o",
input: "What's the latest stable Python release?",
tools: [search.toOpenAI()],
});