@elizaos/skills 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -0
- package/dist/formatter.d.ts +44 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +182 -0
- package/dist/frontmatter.d.ts +39 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +105 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/loader.d.ts +33 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +362 -0
- package/dist/resolver.d.ts +18 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +90 -0
- package/dist/types.d.ts +201 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +57 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +96 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/bird/SKILL.md +224 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +203 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +284 -0
- package/skills/discord/SKILL.md +578 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/food-order/SKILL.md +48 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +77 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +74 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +102 -0
- package/skills/local-places/pyproject.toml +21 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/nano-banana-pro/SKILL.md +58 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/notion/SKILL.md +172 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +89 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +51 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/security-ask-questions-if-underspecified/.claude-plugin/plugin.json +10 -0
- package/skills/security-ask-questions-if-underspecified/README.md +24 -0
- package/skills/security-ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-ask-questions-if-underspecified/skills/ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-audit-context-building/.claude-plugin/plugin.json +10 -0
- package/skills/security-audit-context-building/README.md +58 -0
- package/skills/security-audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/commands/audit-context.md +21 -0
- package/skills/security-audit-context-building/skills/audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/COMPLETENESS_CHECKLIST.md +47 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md +355 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/OUTPUT_REQUIREMENTS.md +71 -0
- package/skills/security-building-secure-contracts/.claude-plugin/plugin.json +10 -0
- package/skills/security-building-secure-contracts/README.md +241 -0
- package/skills/security-building-secure-contracts/SKILL.md +67 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md +284 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +405 -0
- package/skills/security-building-secure-contracts/skills/audit-prep-assistant/SKILL.md +409 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md +329 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +722 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/SKILL.md +218 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/ASSESSMENT_CRITERIA.md +355 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/EXAMPLE_REPORT.md +248 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/REPORT_FORMAT.md +33 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md +334 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +740 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/SKILL.md +252 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/ASSESSMENT_AREAS.md +329 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/DELIVERABLES.md +118 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/EXAMPLE_REPORT.md +298 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/SKILL.md +161 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/EXAMPLE_REPORT.md +279 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/WORKFLOW_STEPS.md +132 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md +389 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +669 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md +298 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +791 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/SKILL.md +362 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/ASSESSMENT_CATEGORIES.md +571 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/REPORT_TEMPLATES.md +141 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md +388 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +595 -0
- package/skills/security-differential-review/.claude-plugin/plugin.json +10 -0
- package/skills/security-differential-review/README.md +109 -0
- package/skills/security-differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/commands/diff-review.md +21 -0
- package/skills/security-differential-review/skills/differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/skills/differential-review/adversarial.md +203 -0
- package/skills/security-differential-review/skills/differential-review/methodology.md +234 -0
- package/skills/security-differential-review/skills/differential-review/patterns.md +300 -0
- package/skills/security-differential-review/skills/differential-review/reporting.md +369 -0
- package/skills/security-entry-point-analyzer/.claude-plugin/plugin.json +10 -0
- package/skills/security-entry-point-analyzer/README.md +74 -0
- package/skills/security-entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/commands/entry-points.md +18 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md +182 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md +107 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md +87 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solana.md +155 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solidity.md +135 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/ton.md +185 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/vyper.md +141 -0
- package/skills/security-fix-review/.claude-plugin/plugin.json +13 -0
- package/skills/security-fix-review/README.md +118 -0
- package/skills/security-fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/commands/fix-review.md +24 -0
- package/skills/security-fix-review/skills/fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/skills/fix-review/references/bug-detection.md +408 -0
- package/skills/security-fix-review/skills/fix-review/references/finding-matching.md +298 -0
- package/skills/security-fix-review/skills/fix-review/references/report-parsing.md +398 -0
- package/skills/security-insecure-defaults/.claude-plugin/plugin.json +10 -0
- package/skills/security-insecure-defaults/README.md +45 -0
- package/skills/security-insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/security-modern-python/.claude-plugin/plugin.json +10 -0
- package/skills/security-modern-python/README.md +58 -0
- package/skills/security-modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/hooks/hooks.json +16 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.bats +388 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.sh +109 -0
- package/skills/security-modern-python/hooks/test_helper.bash +75 -0
- package/skills/security-modern-python/skills/modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/skills/modern-python/references/dependabot.md +43 -0
- package/skills/security-modern-python/skills/modern-python/references/migration-checklist.md +141 -0
- package/skills/security-modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
- package/skills/security-modern-python/skills/modern-python/references/prek.md +211 -0
- package/skills/security-modern-python/skills/modern-python/references/pyproject.md +254 -0
- package/skills/security-modern-python/skills/modern-python/references/ruff-config.md +240 -0
- package/skills/security-modern-python/skills/modern-python/references/security-setup.md +255 -0
- package/skills/security-modern-python/skills/modern-python/references/testing.md +284 -0
- package/skills/security-modern-python/skills/modern-python/references/uv-commands.md +200 -0
- package/skills/security-modern-python/skills/modern-python/templates/dependabot.yml +36 -0
- package/skills/security-modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
- package/skills/security-property-based-testing/.claude-plugin/plugin.json +9 -0
- package/skills/security-property-based-testing/README.md +47 -0
- package/skills/security-property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/README.md +88 -0
- package/skills/security-property-based-testing/skills/property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/design.md +191 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/generating.md +200 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
- package/skills/semgrep-rule-creator/.claude-plugin/plugin.json +8 -0
- package/skills/semgrep-rule-creator/README.md +43 -0
- package/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/commands/semgrep-rule.md +26 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/quick-reference.md +203 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sharp-edges/.claude-plugin/plugin.json +10 -0
- package/skills/sharp-edges/README.md +48 -0
- package/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +370 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +46 -0
- package/skills/spec-to-code-compliance/.claude-plugin/plugin.json +10 -0
- package/skills/spec-to-code-compliance/README.md +67 -0
- package/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/commands/spec-compliance.md +22 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/static-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/static-analysis/README.md +59 -0
- package/skills/static-analysis/SKILL.md +91 -0
- package/skills/static-analysis/skills/codeql/SKILL.md +315 -0
- package/skills/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/static-analysis/skills/semgrep/SKILL.md +337 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/testing-handbook-skills/.claude-plugin/plugin.json +8 -0
- package/skills/testing-handbook-skills/README.md +241 -0
- package/skills/testing-handbook-skills/SKILL.md +104 -0
- package/skills/testing-handbook-skills/scripts/pyproject.toml +8 -0
- package/skills/testing-handbook-skills/scripts/validate-skills.py +657 -0
- package/skills/testing-handbook-skills/skills/address-sanitizer/SKILL.md +341 -0
- package/skills/testing-handbook-skills/skills/aflpp/SKILL.md +640 -0
- package/skills/testing-handbook-skills/skills/atheris/SKILL.md +515 -0
- package/skills/testing-handbook-skills/skills/cargo-fuzz/SKILL.md +454 -0
- package/skills/testing-handbook-skills/skills/codeql/SKILL.md +549 -0
- package/skills/testing-handbook-skills/skills/constant-time-testing/SKILL.md +507 -0
- package/skills/testing-handbook-skills/skills/coverage-analysis/SKILL.md +607 -0
- package/skills/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md +297 -0
- package/skills/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/harness-writing/SKILL.md +614 -0
- package/skills/testing-handbook-skills/skills/libafl/SKILL.md +625 -0
- package/skills/testing-handbook-skills/skills/libfuzzer/SKILL.md +795 -0
- package/skills/testing-handbook-skills/skills/ossfuzz/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/ruzzy/SKILL.md +443 -0
- package/skills/testing-handbook-skills/skills/semgrep/SKILL.md +601 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md +372 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/agent-prompt.md +280 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/discovery.md +452 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/domain-skill.md +504 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/fuzzer-skill.md +454 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/technique-skill.md +527 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/tool-skill.md +366 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/testing.md +482 -0
- package/skills/testing-handbook-skills/skills/wycheproof/SKILL.md +533 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +135 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/variant-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/variant-analysis/README.md +41 -0
- package/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/commands/variants.md +23 -0
- package/skills/variant-analysis/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @elizaos/skills
|
|
2
|
+
|
|
3
|
+
Bundled skills and skill loading utilities for elizaOS agents.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Skills are markdown files that provide specialized instructions for AI agents to perform specific tasks. Each skill contains:
|
|
8
|
+
|
|
9
|
+
- **Frontmatter**: YAML metadata including name, description, and configuration
|
|
10
|
+
- **Body**: Detailed instructions, examples, and references
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @elizaos/skills
|
|
16
|
+
# or
|
|
17
|
+
pnpm add @elizaos/skills
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Get Bundled Skills Path
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { getSkillsDir } from "@elizaos/skills";
|
|
26
|
+
|
|
27
|
+
const skillsPath = getSkillsDir();
|
|
28
|
+
// Returns absolute path to bundled skills directory
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Load Skills
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { loadSkills, loadSkillsFromDir } from "@elizaos/skills";
|
|
35
|
+
|
|
36
|
+
// Load from all default locations (bundled + managed + project)
|
|
37
|
+
const { skills, diagnostics } = loadSkills();
|
|
38
|
+
|
|
39
|
+
// Load from a specific directory
|
|
40
|
+
const result = loadSkillsFromDir({
|
|
41
|
+
dir: "/path/to/skills",
|
|
42
|
+
source: "custom",
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Format for LLM Prompt
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { formatSkillsForPrompt } from "@elizaos/skills";
|
|
50
|
+
|
|
51
|
+
const prompt = formatSkillsForPrompt(skills);
|
|
52
|
+
// Returns XML-formatted skills section for system prompt
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Build Command Specs
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { loadSkillEntries, buildSkillCommandSpecs } from "@elizaos/skills";
|
|
59
|
+
|
|
60
|
+
const entries = loadSkillEntries();
|
|
61
|
+
const commands = buildSkillCommandSpecs(entries);
|
|
62
|
+
// Returns array of command specs for chat interfaces
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Skill Discovery
|
|
66
|
+
|
|
67
|
+
Skills are loaded from multiple locations in precedence order (later overrides earlier):
|
|
68
|
+
|
|
69
|
+
1. **Bundled skills** - Included in this package (`skills/`)
|
|
70
|
+
2. **Managed skills** - User-installed skills (`~/.elizaos/skills/`)
|
|
71
|
+
3. **Project skills** - Project-local skills (`<cwd>/.elizaos/skills/`)
|
|
72
|
+
4. **Explicit paths** - Via `skillPaths` option
|
|
73
|
+
|
|
74
|
+
## Skill Format
|
|
75
|
+
|
|
76
|
+
Skills are markdown files with YAML frontmatter:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
---
|
|
80
|
+
name: my-skill
|
|
81
|
+
description: A brief description of what this skill does
|
|
82
|
+
primary-env: node
|
|
83
|
+
required-bins:
|
|
84
|
+
- node
|
|
85
|
+
- npm
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
# My Skill
|
|
89
|
+
|
|
90
|
+
Detailed instructions for the AI agent...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Frontmatter Fields
|
|
94
|
+
|
|
95
|
+
| Field | Type | Description |
|
|
96
|
+
|-------|------|-------------|
|
|
97
|
+
| `name` | string | Skill name (should match directory name) |
|
|
98
|
+
| `description` | string | Human-readable description (required) |
|
|
99
|
+
| `disable-model-invocation` | boolean | If true, skill won't appear in prompts |
|
|
100
|
+
| `user-invocable` | boolean | If false, can't be invoked via commands |
|
|
101
|
+
| `primary-env` | string | Primary runtime (node, python, etc.) |
|
|
102
|
+
| `required-os` | string[] | Required operating systems |
|
|
103
|
+
| `required-bins` | string[] | Required binaries in PATH |
|
|
104
|
+
| `required-env` | string[] | Required environment variables |
|
|
105
|
+
|
|
106
|
+
## API Reference
|
|
107
|
+
|
|
108
|
+
### Types
|
|
109
|
+
|
|
110
|
+
- `Skill` - Loaded skill with metadata
|
|
111
|
+
- `SkillFrontmatter` - Parsed frontmatter
|
|
112
|
+
- `SkillEntry` - Full skill entry with all metadata
|
|
113
|
+
- `LoadSkillsResult` - Result from loading skills
|
|
114
|
+
|
|
115
|
+
### Functions
|
|
116
|
+
|
|
117
|
+
- `getSkillsDir()` - Get bundled skills path
|
|
118
|
+
- `loadSkills(options?)` - Load from all locations
|
|
119
|
+
- `loadSkillsFromDir(options)` - Load from single directory
|
|
120
|
+
- `loadSkillEntries(options?)` - Load with full metadata
|
|
121
|
+
- `formatSkillsForPrompt(skills)` - Format for LLM prompt
|
|
122
|
+
- `buildSkillCommandSpecs(entries)` - Build command specs
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Skill, SkillCommandSpec, SkillEntry } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Format skills for inclusion in a system prompt.
|
|
4
|
+
* Uses XML format per Agent Skills standard.
|
|
5
|
+
* See: https://agentskills.io/integrate-skills
|
|
6
|
+
*
|
|
7
|
+
* Skills with disableModelInvocation=true are excluded from the prompt
|
|
8
|
+
* (they can only be invoked explicitly via /skill:name commands).
|
|
9
|
+
*
|
|
10
|
+
* @param skills - Array of skills to format
|
|
11
|
+
* @returns Formatted skills prompt section
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatSkillsForPrompt(skills: Skill[]): string;
|
|
14
|
+
/**
|
|
15
|
+
* Format skill entries for prompt (filters by invocation policy)
|
|
16
|
+
*
|
|
17
|
+
* @param entries - Skill entries to format
|
|
18
|
+
* @returns Formatted skills prompt section
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatSkillEntriesForPrompt(entries: SkillEntry[]): string;
|
|
21
|
+
/**
|
|
22
|
+
* Build command specifications from skill entries.
|
|
23
|
+
* Creates sanitized, unique command names for each user-invocable skill.
|
|
24
|
+
*
|
|
25
|
+
* @param entries - Skill entries to process
|
|
26
|
+
* @param reservedNames - Set of reserved command names to avoid
|
|
27
|
+
* @returns Array of skill command specifications
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildSkillCommandSpecs(entries: SkillEntry[], reservedNames?: Set<string>): SkillCommandSpec[];
|
|
30
|
+
/**
|
|
31
|
+
* Format a single skill for display (minimal format)
|
|
32
|
+
*
|
|
33
|
+
* @param skill - Skill to format
|
|
34
|
+
* @returns Formatted skill string
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatSkillSummary(skill: Skill): string;
|
|
37
|
+
/**
|
|
38
|
+
* Format skills as a simple list
|
|
39
|
+
*
|
|
40
|
+
* @param skills - Skills to format
|
|
41
|
+
* @returns Newline-separated list of skills
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatSkillsList(skills: Skill[]): string;
|
|
44
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAkBtE;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA8B7D;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAMzE;AAyDD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,UAAU,EAAE,EACrB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAC1B,gBAAgB,EAAE,CAgEpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape special XML characters
|
|
3
|
+
*
|
|
4
|
+
* @param str - String to escape
|
|
5
|
+
* @returns XML-escaped string
|
|
6
|
+
*/
|
|
7
|
+
function escapeXml(str) {
|
|
8
|
+
const s = typeof str === "string" ? str : String(str ?? "");
|
|
9
|
+
return s
|
|
10
|
+
.replace(/&/g, "&")
|
|
11
|
+
.replace(/</g, "<")
|
|
12
|
+
.replace(/>/g, ">")
|
|
13
|
+
.replace(/"/g, """)
|
|
14
|
+
.replace(/'/g, "'");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Format skills for inclusion in a system prompt.
|
|
18
|
+
* Uses XML format per Agent Skills standard.
|
|
19
|
+
* See: https://agentskills.io/integrate-skills
|
|
20
|
+
*
|
|
21
|
+
* Skills with disableModelInvocation=true are excluded from the prompt
|
|
22
|
+
* (they can only be invoked explicitly via /skill:name commands).
|
|
23
|
+
*
|
|
24
|
+
* @param skills - Array of skills to format
|
|
25
|
+
* @returns Formatted skills prompt section
|
|
26
|
+
*/
|
|
27
|
+
export function formatSkillsForPrompt(skills) {
|
|
28
|
+
const visibleSkills = skills.filter((s) => !s.disableModelInvocation);
|
|
29
|
+
if (visibleSkills.length === 0) {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
const lines = [
|
|
33
|
+
"\n\nThe following skills provide specialized instructions for specific tasks.",
|
|
34
|
+
"Use the read tool to load a skill's file when the task matches its description.",
|
|
35
|
+
"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.",
|
|
36
|
+
"",
|
|
37
|
+
"<available_skills>",
|
|
38
|
+
];
|
|
39
|
+
for (const skill of visibleSkills) {
|
|
40
|
+
lines.push(" <skill>");
|
|
41
|
+
lines.push(` <name>${escapeXml(skill.name)}</name>`);
|
|
42
|
+
lines.push(` <description>${escapeXml(skill.description)}</description>`);
|
|
43
|
+
if (skill.filePath) {
|
|
44
|
+
lines.push(` <location>${escapeXml(skill.filePath)}</location>`);
|
|
45
|
+
}
|
|
46
|
+
lines.push(" </skill>");
|
|
47
|
+
}
|
|
48
|
+
lines.push("</available_skills>");
|
|
49
|
+
return lines.join("\n");
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Format skill entries for prompt (filters by invocation policy)
|
|
53
|
+
*
|
|
54
|
+
* @param entries - Skill entries to format
|
|
55
|
+
* @returns Formatted skills prompt section
|
|
56
|
+
*/
|
|
57
|
+
export function formatSkillEntriesForPrompt(entries) {
|
|
58
|
+
const visibleSkills = entries
|
|
59
|
+
.filter((entry) => entry.invocation?.disableModelInvocation !== true)
|
|
60
|
+
.map((entry) => entry.skill);
|
|
61
|
+
return formatSkillsForPrompt(visibleSkills);
|
|
62
|
+
}
|
|
63
|
+
/** Maximum length for skill command names */
|
|
64
|
+
const SKILL_COMMAND_MAX_LENGTH = 32;
|
|
65
|
+
/** Fallback command name if sanitization produces empty string */
|
|
66
|
+
const SKILL_COMMAND_FALLBACK = "skill";
|
|
67
|
+
/** Maximum length for command descriptions (Discord limit) */
|
|
68
|
+
const SKILL_COMMAND_DESCRIPTION_MAX_LENGTH = 100;
|
|
69
|
+
/**
|
|
70
|
+
* Sanitize a skill name for use as a command name.
|
|
71
|
+
* Converts to lowercase, replaces invalid characters with underscores.
|
|
72
|
+
*
|
|
73
|
+
* @param raw - Raw skill name
|
|
74
|
+
* @returns Sanitized command name
|
|
75
|
+
*/
|
|
76
|
+
function sanitizeSkillCommandName(raw) {
|
|
77
|
+
const normalized = raw
|
|
78
|
+
.toLowerCase()
|
|
79
|
+
.replace(/[^a-z0-9_]+/g, "_")
|
|
80
|
+
.replace(/_+/g, "_")
|
|
81
|
+
.replace(/^_+|_+$/g, "");
|
|
82
|
+
const trimmed = normalized.slice(0, SKILL_COMMAND_MAX_LENGTH);
|
|
83
|
+
return trimmed || SKILL_COMMAND_FALLBACK;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Resolve a unique command name by appending a numeric suffix if needed.
|
|
87
|
+
*
|
|
88
|
+
* @param base - Base command name
|
|
89
|
+
* @param used - Set of already-used command names (lowercase)
|
|
90
|
+
* @returns Unique command name
|
|
91
|
+
*/
|
|
92
|
+
function resolveUniqueSkillCommandName(base, used) {
|
|
93
|
+
const normalizedBase = base.toLowerCase();
|
|
94
|
+
if (!used.has(normalizedBase)) {
|
|
95
|
+
return base;
|
|
96
|
+
}
|
|
97
|
+
for (let index = 2; index < 1000; index += 1) {
|
|
98
|
+
const suffix = `_${index}`;
|
|
99
|
+
const maxBaseLength = Math.max(1, SKILL_COMMAND_MAX_LENGTH - suffix.length);
|
|
100
|
+
const trimmedBase = base.slice(0, maxBaseLength);
|
|
101
|
+
const candidate = `${trimmedBase}${suffix}`;
|
|
102
|
+
const candidateKey = candidate.toLowerCase();
|
|
103
|
+
if (!used.has(candidateKey)) {
|
|
104
|
+
return candidate;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const fallback = `${base.slice(0, Math.max(1, SKILL_COMMAND_MAX_LENGTH - 2))}_x`;
|
|
108
|
+
return fallback;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Build command specifications from skill entries.
|
|
112
|
+
* Creates sanitized, unique command names for each user-invocable skill.
|
|
113
|
+
*
|
|
114
|
+
* @param entries - Skill entries to process
|
|
115
|
+
* @param reservedNames - Set of reserved command names to avoid
|
|
116
|
+
* @returns Array of skill command specifications
|
|
117
|
+
*/
|
|
118
|
+
export function buildSkillCommandSpecs(entries, reservedNames) {
|
|
119
|
+
// Filter to user-invocable skills
|
|
120
|
+
const userInvocable = entries.filter((entry) => entry.invocation?.userInvocable !== false);
|
|
121
|
+
const used = new Set();
|
|
122
|
+
for (const reserved of reservedNames ?? []) {
|
|
123
|
+
used.add(reserved.toLowerCase());
|
|
124
|
+
}
|
|
125
|
+
const specs = [];
|
|
126
|
+
for (const entry of userInvocable) {
|
|
127
|
+
const rawName = entry.skill.name;
|
|
128
|
+
const base = sanitizeSkillCommandName(rawName);
|
|
129
|
+
const unique = resolveUniqueSkillCommandName(base, used);
|
|
130
|
+
used.add(unique.toLowerCase());
|
|
131
|
+
const rawDescription = entry.skill.description?.trim() || rawName;
|
|
132
|
+
const description = rawDescription.length > SKILL_COMMAND_DESCRIPTION_MAX_LENGTH
|
|
133
|
+
? `${rawDescription.slice(0, SKILL_COMMAND_DESCRIPTION_MAX_LENGTH - 1)}…`
|
|
134
|
+
: rawDescription;
|
|
135
|
+
// Parse dispatch configuration from frontmatter
|
|
136
|
+
const dispatch = (() => {
|
|
137
|
+
const kindRaw = (entry.frontmatter?.["command-dispatch"] ??
|
|
138
|
+
entry.frontmatter?.command_dispatch ??
|
|
139
|
+
"")
|
|
140
|
+
.toString()
|
|
141
|
+
.trim()
|
|
142
|
+
.toLowerCase();
|
|
143
|
+
if (!kindRaw || kindRaw !== "tool") {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
const toolName = (entry.frontmatter?.["command-tool"] ??
|
|
147
|
+
entry.frontmatter?.command_tool ??
|
|
148
|
+
"")
|
|
149
|
+
.toString()
|
|
150
|
+
.trim();
|
|
151
|
+
if (!toolName) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
return { kind: "tool", toolName, argMode: "raw" };
|
|
155
|
+
})();
|
|
156
|
+
specs.push({
|
|
157
|
+
name: unique,
|
|
158
|
+
skillName: rawName,
|
|
159
|
+
description,
|
|
160
|
+
...(dispatch ? { dispatch } : {}),
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return specs;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Format a single skill for display (minimal format)
|
|
167
|
+
*
|
|
168
|
+
* @param skill - Skill to format
|
|
169
|
+
* @returns Formatted skill string
|
|
170
|
+
*/
|
|
171
|
+
export function formatSkillSummary(skill) {
|
|
172
|
+
return `${skill.name}: ${skill.description}`;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Format skills as a simple list
|
|
176
|
+
*
|
|
177
|
+
* @param skills - Skills to format
|
|
178
|
+
* @returns Newline-separated list of skills
|
|
179
|
+
*/
|
|
180
|
+
export function formatSkillsList(skills) {
|
|
181
|
+
return skills.map(formatSkillSummary).join("\n");
|
|
182
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SkillFrontmatter, SkillInvocationPolicy, SkillMetadata } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Result of parsing frontmatter from a file
|
|
4
|
+
*/
|
|
5
|
+
export interface ParsedFrontmatter<T extends Record<string, unknown>> {
|
|
6
|
+
/** Parsed frontmatter object */
|
|
7
|
+
frontmatter: T;
|
|
8
|
+
/** Remaining body content after frontmatter */
|
|
9
|
+
body: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parse YAML frontmatter from markdown content
|
|
13
|
+
*
|
|
14
|
+
* @param content - Raw file content with optional YAML frontmatter
|
|
15
|
+
* @returns Parsed frontmatter object and remaining body
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseFrontmatter<T extends Record<string, unknown> = Record<string, unknown>>(content: string): ParsedFrontmatter<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Strip frontmatter from content and return only the body
|
|
20
|
+
*
|
|
21
|
+
* @param content - Raw file content with optional YAML frontmatter
|
|
22
|
+
* @returns Content without frontmatter
|
|
23
|
+
*/
|
|
24
|
+
export declare function stripFrontmatter(content: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve Otto-specific metadata from skill frontmatter
|
|
27
|
+
*
|
|
28
|
+
* @param frontmatter - Parsed skill frontmatter
|
|
29
|
+
* @returns Normalized metadata object
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSkillMetadata(frontmatter: SkillFrontmatter): SkillMetadata;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve skill invocation policy from frontmatter
|
|
34
|
+
*
|
|
35
|
+
* @param frontmatter - Parsed skill frontmatter
|
|
36
|
+
* @returns Invocation policy
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveSkillInvocationPolicy(frontmatter: SkillFrontmatter): SkillInvocationPolicy;
|
|
39
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAClE,gCAAgC;IAChC,WAAW,EAAE,CAAC,CAAC;IACf,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;CACd;AAkCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAOvC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,gBAAgB,GAC5B,aAAa,CAmCf;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,gBAAgB,GAC5B,qBAAqB,CAmBvB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { parse } from "yaml";
|
|
2
|
+
/**
|
|
3
|
+
* Normalize line endings to Unix-style LF
|
|
4
|
+
*/
|
|
5
|
+
function normalizeNewlines(value) {
|
|
6
|
+
return value.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Extract YAML frontmatter block from content
|
|
10
|
+
* Frontmatter must start with --- on the first line and end with --- on its own line
|
|
11
|
+
*/
|
|
12
|
+
function extractFrontmatter(content) {
|
|
13
|
+
const normalized = normalizeNewlines(content);
|
|
14
|
+
if (!normalized.startsWith("---")) {
|
|
15
|
+
return { yamlString: null, body: normalized };
|
|
16
|
+
}
|
|
17
|
+
const endIndex = normalized.indexOf("\n---", 3);
|
|
18
|
+
if (endIndex === -1) {
|
|
19
|
+
return { yamlString: null, body: normalized };
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
yamlString: normalized.slice(4, endIndex),
|
|
23
|
+
body: normalized.slice(endIndex + 4).trim(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse YAML frontmatter from markdown content
|
|
28
|
+
*
|
|
29
|
+
* @param content - Raw file content with optional YAML frontmatter
|
|
30
|
+
* @returns Parsed frontmatter object and remaining body
|
|
31
|
+
*/
|
|
32
|
+
export function parseFrontmatter(content) {
|
|
33
|
+
const { yamlString, body } = extractFrontmatter(content);
|
|
34
|
+
if (!yamlString) {
|
|
35
|
+
return { frontmatter: {}, body };
|
|
36
|
+
}
|
|
37
|
+
const parsed = parse(yamlString);
|
|
38
|
+
return { frontmatter: (parsed ?? {}), body };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Strip frontmatter from content and return only the body
|
|
42
|
+
*
|
|
43
|
+
* @param content - Raw file content with optional YAML frontmatter
|
|
44
|
+
* @returns Content without frontmatter
|
|
45
|
+
*/
|
|
46
|
+
export function stripFrontmatter(content) {
|
|
47
|
+
return parseFrontmatter(content).body;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolve Otto-specific metadata from skill frontmatter
|
|
51
|
+
*
|
|
52
|
+
* @param frontmatter - Parsed skill frontmatter
|
|
53
|
+
* @returns Normalized metadata object
|
|
54
|
+
*/
|
|
55
|
+
export function resolveSkillMetadata(frontmatter) {
|
|
56
|
+
const metadata = {};
|
|
57
|
+
// Primary environment
|
|
58
|
+
const primaryEnv = frontmatter["primary-env"] ?? frontmatter.primary_env;
|
|
59
|
+
if (typeof primaryEnv === "string" && primaryEnv.trim()) {
|
|
60
|
+
metadata.primaryEnv = primaryEnv.trim();
|
|
61
|
+
}
|
|
62
|
+
// Required operating systems
|
|
63
|
+
const requiredOs = frontmatter["required-os"] ?? frontmatter.required_os;
|
|
64
|
+
if (Array.isArray(requiredOs)) {
|
|
65
|
+
metadata.requiredOs = requiredOs
|
|
66
|
+
.filter((os) => typeof os === "string")
|
|
67
|
+
.map((os) => os.trim().toLowerCase());
|
|
68
|
+
}
|
|
69
|
+
// Required binaries
|
|
70
|
+
const requiredBins = frontmatter["required-bins"] ?? frontmatter.required_bins;
|
|
71
|
+
if (Array.isArray(requiredBins)) {
|
|
72
|
+
metadata.requiredBins = requiredBins
|
|
73
|
+
.filter((bin) => typeof bin === "string")
|
|
74
|
+
.map((bin) => bin.trim());
|
|
75
|
+
}
|
|
76
|
+
// Required environment variables
|
|
77
|
+
const requiredEnv = frontmatter["required-env"] ?? frontmatter.required_env;
|
|
78
|
+
if (Array.isArray(requiredEnv)) {
|
|
79
|
+
metadata.requiredEnv = requiredEnv
|
|
80
|
+
.filter((env) => typeof env === "string")
|
|
81
|
+
.map((env) => env.trim());
|
|
82
|
+
}
|
|
83
|
+
return metadata;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Resolve skill invocation policy from frontmatter
|
|
87
|
+
*
|
|
88
|
+
* @param frontmatter - Parsed skill frontmatter
|
|
89
|
+
* @returns Invocation policy
|
|
90
|
+
*/
|
|
91
|
+
export function resolveSkillInvocationPolicy(frontmatter) {
|
|
92
|
+
const policy = {};
|
|
93
|
+
// Disable model invocation (snake_case and kebab-case)
|
|
94
|
+
const disableModelInvocation = frontmatter["disable-model-invocation"] ??
|
|
95
|
+
frontmatter.disable_model_invocation;
|
|
96
|
+
if (disableModelInvocation === true) {
|
|
97
|
+
policy.disableModelInvocation = true;
|
|
98
|
+
}
|
|
99
|
+
// User invocable (snake_case and kebab-case)
|
|
100
|
+
const userInvocable = frontmatter["user-invocable"] ?? frontmatter.user_invocable;
|
|
101
|
+
if (userInvocable === false) {
|
|
102
|
+
policy.userInvocable = false;
|
|
103
|
+
}
|
|
104
|
+
return policy;
|
|
105
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elizaos/skills - Bundled skills and skill loading utilities for elizaOS agents
|
|
3
|
+
*
|
|
4
|
+
* This package provides:
|
|
5
|
+
* - Bundled skills (markdown files with instructions for specific tasks)
|
|
6
|
+
* - Skill loading and discovery utilities
|
|
7
|
+
* - Prompt formatting for LLM integration
|
|
8
|
+
* - Command specification building for chat interfaces
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { getSkillsDir, loadSkills, formatSkillsForPrompt } from "@elizaos/skills";
|
|
13
|
+
*
|
|
14
|
+
* // Get path to bundled skills
|
|
15
|
+
* const skillsPath = getSkillsDir();
|
|
16
|
+
*
|
|
17
|
+
* // Load all skills from default locations
|
|
18
|
+
* const { skills, diagnostics } = loadSkills();
|
|
19
|
+
*
|
|
20
|
+
* // Format for LLM prompt
|
|
21
|
+
* const prompt = formatSkillsForPrompt(skills);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export { buildSkillCommandSpecs, formatSkillEntriesForPrompt, formatSkillSummary, formatSkillsForPrompt, formatSkillsList, } from "./formatter.js";
|
|
25
|
+
export { type ParsedFrontmatter, parseFrontmatter, resolveSkillInvocationPolicy, resolveSkillMetadata, stripFrontmatter, } from "./frontmatter.js";
|
|
26
|
+
export { loadSkillEntries, loadSkills, loadSkillsFromDir } from "./loader.js";
|
|
27
|
+
export { clearSkillsDirCache, getSkillsDir } from "./resolver.js";
|
|
28
|
+
export type { LoadSkillsFromDirOptions, LoadSkillsOptions, LoadSkillsResult, Skill, SkillActionDefinition, SkillCommandSpec, SkillDiagnostic, SkillEntry, SkillFrontmatter, SkillInvocationPolicy, SkillMetadata, SkillProviderDefinition, SkillToolDefinition, } from "./types.js";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,4BAA4B,EAC5B,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElE,YAAY,EACV,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elizaos/skills - Bundled skills and skill loading utilities for elizaOS agents
|
|
3
|
+
*
|
|
4
|
+
* This package provides:
|
|
5
|
+
* - Bundled skills (markdown files with instructions for specific tasks)
|
|
6
|
+
* - Skill loading and discovery utilities
|
|
7
|
+
* - Prompt formatting for LLM integration
|
|
8
|
+
* - Command specification building for chat interfaces
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { getSkillsDir, loadSkills, formatSkillsForPrompt } from "@elizaos/skills";
|
|
13
|
+
*
|
|
14
|
+
* // Get path to bundled skills
|
|
15
|
+
* const skillsPath = getSkillsDir();
|
|
16
|
+
*
|
|
17
|
+
* // Load all skills from default locations
|
|
18
|
+
* const { skills, diagnostics } = loadSkills();
|
|
19
|
+
*
|
|
20
|
+
* // Format for LLM prompt
|
|
21
|
+
* const prompt = formatSkillsForPrompt(skills);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
// Prompt formatting
|
|
25
|
+
export { buildSkillCommandSpecs, formatSkillEntriesForPrompt, formatSkillSummary, formatSkillsForPrompt, formatSkillsList, } from "./formatter.js";
|
|
26
|
+
// Frontmatter parsing
|
|
27
|
+
export { parseFrontmatter, resolveSkillInvocationPolicy, resolveSkillMetadata, stripFrontmatter, } from "./frontmatter.js";
|
|
28
|
+
// Skill loading
|
|
29
|
+
export { loadSkillEntries, loadSkills, loadSkillsFromDir } from "./loader.js";
|
|
30
|
+
// Path resolution
|
|
31
|
+
export { clearSkillsDirCache, getSkillsDir } from "./resolver.js";
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { LoadSkillsFromDirOptions, LoadSkillsOptions, LoadSkillsResult, SkillEntry } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Load skills from a single directory.
|
|
4
|
+
*
|
|
5
|
+
* Discovery rules:
|
|
6
|
+
* - Direct .md children in the root
|
|
7
|
+
* - Recursive SKILL.md under subdirectories
|
|
8
|
+
*
|
|
9
|
+
* @param options - Loading options
|
|
10
|
+
* @returns Loaded skills and diagnostics
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult;
|
|
13
|
+
/**
|
|
14
|
+
* Load skills from all configured locations.
|
|
15
|
+
*
|
|
16
|
+
* Sources are loaded in precedence order (later sources override earlier):
|
|
17
|
+
* 1. Bundled skills (from this package)
|
|
18
|
+
* 2. User/managed skills (~/.elizaos/skills)
|
|
19
|
+
* 3. Project skills (<cwd>/.elizaos/skills)
|
|
20
|
+
* 4. Explicit skill paths
|
|
21
|
+
*
|
|
22
|
+
* @param options - Loading options
|
|
23
|
+
* @returns Loaded skills and diagnostics
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadSkills(options?: LoadSkillsOptions): LoadSkillsResult;
|
|
26
|
+
/**
|
|
27
|
+
* Load skill entries with full metadata parsing
|
|
28
|
+
*
|
|
29
|
+
* @param options - Loading options
|
|
30
|
+
* @returns Skill entries with parsed metadata
|
|
31
|
+
*/
|
|
32
|
+
export declare function loadSkillEntries(options?: LoadSkillsOptions): SkillEntry[];
|
|
33
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAGhB,UAAU,EAEX,MAAM,YAAY,CAAC;AAkMpB;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,gBAAgB,CAGlB;AA8CD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CA0H5E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,iBAAsB,GAC9B,UAAU,EAAE,CAuBd"}
|