@stacksjs/skills 0.70.23

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/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{join as s,resolve as k}from"@stacksjs/path";import{existsSync as r,readFileSync as f,readdirSync as d,statSync as h}from"fs";var o=k(s(import.meta.dir,"..","..","..","..","..",".claude","skills"));function p(n){let t=n.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(!t)return{metadata:{name:"",description:""},body:n};let[,i,a]=t,l={};for(let e of(i??"").split(`
3
+ `)){let c=e.indexOf(":");if(c===-1)continue;let u=e.slice(0,c).trim(),m=e.slice(c+1).trim();l[u]=m}return{metadata:l,body:a??""}}function y(){if(!r(o))return[];return d(o).filter((n)=>{let t=s(o,n);return h(t).isDirectory()&&r(s(t,"SKILL.md"))})}function S(n){let t=s(o,n,"SKILL.md");if(!r(t))return null;let i=f(t,"utf-8"),{metadata:a,body:l}=p(i),e=s(o,n),c=r(s(e,"scripts"))?d(s(e,"scripts")):[],u=r(s(e,"references"))?d(s(e,"references")):[],m=r(s(e,"assets"))?d(s(e,"assets")):[];return{metadata:a,instructions:l,path:t,scripts:c,references:u,assets:m}}function g(n){return S(n)?.metadata??null}function b(n){let t=[],i=s(o,n);if(!r(i))return t.push(`Skill directory not found: ${i}`),{valid:!1,errors:t};let a=s(i,"SKILL.md");if(!r(a))return t.push(`SKILL.md not found in ${i}`),{valid:!1,errors:t};let l=f(a,"utf-8"),{metadata:e}=p(l);if(!e.name)t.push("Missing required field: name");else{if(e.name.length>64)t.push("Name must be 1-64 characters");if(!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(e.name))t.push("Name must be lowercase letters, numbers, and hyphens only");if(e.name!==n)t.push(`Name "${e.name}" must match directory name "${n}"`)}if(!e.description)t.push("Missing required field: description");else if(e.description.length>1024)t.push("Description must be 1-1024 characters");return{valid:t.length===0,errors:t}}export{b as validateSkill,g as loadSkillMetadata,y as listSkills,S as getSkill};
@@ -0,0 +1,2 @@
1
+ export type { Skill, SkillMetadata, SkillManifest } from './types';
2
+ export { listSkills, getSkill, validateSkill, loadSkillMetadata } from './skills';
@@ -0,0 +1,5 @@
1
+ import type { Skill, SkillMetadata } from './types';
2
+ export declare function listSkills(): string[];
3
+ export declare function getSkill(name: string): Skill | null;
4
+ export declare function loadSkillMetadata(name: string): SkillMetadata | null;
5
+ export declare function validateSkill(name: string): { valid: boolean, errors: string[] };
@@ -0,0 +1,28 @@
1
+ export declare interface SkillMetadata {
2
+ name: string
3
+ description: string
4
+ license?: string
5
+ compatibility?: string
6
+ metadata?: Record<string, unknown>
7
+ 'allowed-tools'?: string
8
+ 'disable-model-invocation'?: boolean
9
+ 'user-invocable'?: boolean
10
+ context?: 'fork'
11
+ agent?: 'Explore' | 'Plan' | 'general-purpose'
12
+ 'argument-hint'?: string
13
+ model?: string
14
+ effort?: 'low' | 'medium' | 'high' | 'max'
15
+ }
16
+ export declare interface Skill {
17
+ metadata: SkillMetadata
18
+ instructions: string
19
+ path: string
20
+ scripts?: string[]
21
+ references?: string[]
22
+ assets?: string[]
23
+ }
24
+ export declare interface SkillManifest {
25
+ skills: Skill[]
26
+ version: string
27
+ framework: string
28
+ }
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@stacksjs/skills",
3
+ "type": "module",
4
+ "version": "0.70.23",
5
+ "description": "Agent skills for the Stacks framework, following the agentskills.io standard.",
6
+ "author": "Chris Breuer",
7
+ "contributors": [
8
+ "Chris Breuer <chris@stacksjs.com>"
9
+ ],
10
+ "license": "MIT",
11
+ "funding": "https://github.com/sponsors/chrisbbreuer",
12
+ "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/skills#readme",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/stacksjs/stacks.git",
16
+ "directory": "./storage/framework/core/skills"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/stacksjs/stacks/issues"
20
+ },
21
+ "keywords": [
22
+ "skills",
23
+ "agent",
24
+ "ai",
25
+ "agentskills",
26
+ "stacks"
27
+ ],
28
+ "exports": {
29
+ ".": {
30
+ "bun": "./src/index.ts",
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ },
34
+ "./*": {
35
+ "bun": "./src/*",
36
+ "import": "./dist/*"
37
+ }
38
+ },
39
+ "module": "dist/index.js",
40
+ "types": "dist/index.d.ts",
41
+ "files": [
42
+ "README.md",
43
+ "dist",
44
+ "skills"
45
+ ],
46
+ "scripts": {
47
+ "build": "bun build.ts",
48
+ "typecheck": "bun tsc --noEmit",
49
+ "prepublishOnly": "bun run build"
50
+ },
51
+ "dependencies": {
52
+ "@stacksjs/path": "0.70.23",
53
+ "@stacksjs/storage": "0.70.23"
54
+ },
55
+ "devDependencies": {
56
+ "better-dx": "^0.2.12",
57
+ "@stacksjs/types": "0.70.23"
58
+ }
59
+ }