Skip to content

The SDK

The @sypnia/skills package for your own tools: read and check skills, search the registry, resolve and verify.

Applies to EngineCloud
View as Markdown
On this page
  1. Offline: reading and checking
  2. The registry
Terminal
npm install @sypnia/skills

Offline: reading and checking

TypeScript
import { readSkill, checkSkill, verifyInstalled } from '@sypnia/skills';

const skill = await readSkill('./espiga-pos-import');
// { name: 'espiga-pos-import', version: '1.0.0', description: '…', touches: { scripts: ['scripts/convert.py'], … }, labels: ['scripts'] }

const findings = await checkSkill('./espiga-pos-import');
// [] when it passes; otherwise [{ check: 'manifest', file: 'scripts/clean.sh', message: 'not declared in touches.scripts' }]

const report = await verifyInstalled('.');
// { ok: true, skills: [{ id: 'sypnia/sypnia-design-guide', version: '1.4.0', hash: 'ok', signature: 'ok', edited: [] }] }

checkSkill runs every automatic check that needs no server: format, manifest, versions against a given previous version, hidden text and secrets.

The registry

TypeScript
import { createSkills } from '@sypnia/skills/registry';

const skills = createSkills({ token: process.env.SYPNIA_SKILLS_TOKEN });

const { items } = await skills.search({ q: 'design guide', label: 'instructions' });
const resolved = await skills.resolve({ 'sypnia/sypnia-design-guide': '^1.4.0' });
const files = await skills.download('sypnia/sypnia-design-guide', resolved['sypnia/sypnia-design-guide'].version);
MethodDoes
search({ q, kind, label, publisher, cursor })search; public skills without a token
get(id), version(id, version)a skill, or one version with its manifest, hash, signature and review
resolve(ranges)the versions a set of ranges resolves to, with their needs
download(id, version)the package’s files, after checking its hash and signature
publish(dir, { visibility, tag })publish; returns the version and its state
yank(id, version, reason)yank a version

download throws HashError or SignatureError and never returns files that did not verify. Every other failure is a SkillsError whose code is the API’s error code (API reference).

  1. Offline: reading and checking
  2. The registry

    Search pages, sections and terms