@9d9/openclaw-utils
v0.1.0
Published
Utility functions for OpenClaw plugin and skill development
Maintainers
Readme
@9d9/openclaw-utils
Utility functions for OpenClaw plugin and skill development.
Install
npm install @9d9/openclaw-utilsUsage
import {
createSkillManifest,
extractFrontMatter,
slugify,
formatDate,
truncate,
toJST,
} from "@9d9/openclaw-utils";
// Skill manifest builder
const skill = createSkillManifest("my-skill", "1.0.0", "Does cool stuff");
// Front matter extraction
const fm = extractFrontMatter("---\ntitle: Hello\n---\nContent");
// => { title: "Hello" }
// String utilities
slugify("Hello World!"); // => "hello-world"
truncate("Long text here", 8); // => "Long..."
// Date formatting
formatDate(new Date(), "YYYY-MM-DD HH:mm");
toJST(new Date());API
Skill Management
createSkillManifest(name, version, description)— Build skill metadata
Parsing
parseAgentId(raw)— Parse pipe-delimited agent configextractFrontMatter(content)— Extract YAML front matter from markdown
Messages
createUserMessage(content)/createAssistantMessage(content)— Create session messages
String Utilities
truncate(str, maxLen)— Truncate with ellipsisslugify(text)— URL-safe slug
Date Utilities
formatDate(date, format)— Custom date formatting (YYYY, MM, DD, HH, mm, ss)toJST(date)— Convert to JST string
License
MIT © 9d9 LLC
