@skillkit/core 1.3.1 → 1.4.0
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 +188 -16
- package/dist/index.d.ts +2173 -1
- package/dist/index.js +5662 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# @skillkit/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@skillkit/core)
|
|
4
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
|
+
|
|
6
|
+
**Core engine for SkillKit** - skill discovery, cross-agent translation, recommendations, session memory, testing, and workflow orchestration.
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
@@ -8,34 +11,203 @@ Core functionality for SkillKit - skill discovery, parsing, translation, and con
|
|
|
8
11
|
npm install @skillkit/core
|
|
9
12
|
```
|
|
10
13
|
|
|
11
|
-
## Features
|
|
14
|
+
## Key Features
|
|
12
15
|
|
|
13
|
-
- **Skill Discovery**: Find and parse SKILL.md files
|
|
14
|
-
- **
|
|
15
|
-
- **Project Context Detection**: Analyze project stack and
|
|
16
|
-
- **
|
|
16
|
+
- **Skill Discovery**: Find and parse SKILL.md files from any source
|
|
17
|
+
- **Cross-Agent Translation**: Convert skills between 17 agent formats (Claude Code, Cursor, Windsurf, etc.)
|
|
18
|
+
- **Project Context Detection**: Analyze project stack, dependencies, and configurations
|
|
19
|
+
- **Smart Recommendations**: AI-powered skill suggestions based on project profile
|
|
20
|
+
- **Session Memory**: Capture and persist learnings across AI coding sessions
|
|
21
|
+
- **Skill Testing**: Test framework with assertions for skill validation
|
|
22
|
+
- **Workflow Orchestration**: Compose skills into multi-step workflows
|
|
23
|
+
- **Marketplace Aggregation**: Browse and search curated skill repositories
|
|
17
24
|
|
|
18
25
|
## Usage
|
|
19
26
|
|
|
27
|
+
### Skill Discovery
|
|
28
|
+
|
|
20
29
|
```typescript
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
import { findAllSkills, discoverSkills, parseSkill } from '@skillkit/core';
|
|
31
|
+
|
|
32
|
+
// Find all installed skills
|
|
33
|
+
const skills = findAllSkills(['.claude/skills', '.cursor/skills']);
|
|
34
|
+
|
|
35
|
+
// Discover skills from a repository
|
|
36
|
+
const repoSkills = await discoverSkills('anthropics/skills');
|
|
37
|
+
|
|
38
|
+
// Parse a single skill file
|
|
39
|
+
const skill = parseSkill('./my-skill/SKILL.md');
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Cross-Agent Translation
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { translateSkill, translateSkillFile, TranslatorRegistry } from '@skillkit/core';
|
|
46
|
+
|
|
47
|
+
// Translate skill content to Cursor format
|
|
48
|
+
const result = translateSkill(skillContent, 'cursor');
|
|
49
|
+
console.log(result.content); // MDC format for Cursor
|
|
50
|
+
|
|
51
|
+
// Translate a skill file
|
|
52
|
+
const translated = await translateSkillFile('./skill.md', 'windsurf');
|
|
53
|
+
|
|
54
|
+
// Get available translators
|
|
55
|
+
const registry = new TranslatorRegistry();
|
|
56
|
+
const formats = registry.getSupportedFormats();
|
|
57
|
+
```
|
|
28
58
|
|
|
29
|
-
|
|
30
|
-
|
|
59
|
+
### Project Context & Recommendations
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { ProjectDetector, RecommendationEngine, ContextManager } from '@skillkit/core';
|
|
31
63
|
|
|
32
64
|
// Detect project context
|
|
33
65
|
const detector = new ProjectDetector();
|
|
34
66
|
const profile = await detector.analyze('./my-project');
|
|
67
|
+
// profile.stack includes: languages, frameworks, libraries, testing tools, etc.
|
|
35
68
|
|
|
36
69
|
// Get skill recommendations
|
|
37
70
|
const engine = new RecommendationEngine();
|
|
38
|
-
const recommendations =
|
|
71
|
+
const recommendations = engine.recommend(profile, availableSkills);
|
|
72
|
+
// Returns skills sorted by match score
|
|
73
|
+
|
|
74
|
+
// Manage project context
|
|
75
|
+
const ctx = new ContextManager('./my-project');
|
|
76
|
+
await ctx.init();
|
|
77
|
+
const context = ctx.getContext();
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Session Memory
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import {
|
|
84
|
+
createMemoryCompressor,
|
|
85
|
+
createMemoryInjector,
|
|
86
|
+
LearningStore,
|
|
87
|
+
ObservationStore,
|
|
88
|
+
} from '@skillkit/core';
|
|
89
|
+
|
|
90
|
+
// Compress observations into learnings
|
|
91
|
+
const compressor = createMemoryCompressor('./my-project');
|
|
92
|
+
const learnings = compressor.compress();
|
|
93
|
+
|
|
94
|
+
// Inject relevant memories into prompts
|
|
95
|
+
const injector = createMemoryInjector('./my-project');
|
|
96
|
+
const memories = injector.search('authentication patterns');
|
|
97
|
+
|
|
98
|
+
// Manage learnings directly
|
|
99
|
+
const store = new LearningStore('./my-project');
|
|
100
|
+
const learning = store.add({
|
|
101
|
+
title: 'React hooks best practices',
|
|
102
|
+
content: 'Always cleanup effects...',
|
|
103
|
+
tags: ['react', 'hooks'],
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Skill Testing
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
import { SkillTestRunner, parseTestCases } from '@skillkit/core';
|
|
111
|
+
|
|
112
|
+
// Run skill tests
|
|
113
|
+
const runner = new SkillTestRunner('./my-project');
|
|
114
|
+
const results = await runner.runAll();
|
|
115
|
+
|
|
116
|
+
// Run specific tests
|
|
117
|
+
const result = await runner.run('./my-skill', {
|
|
118
|
+
tags: ['unit'],
|
|
119
|
+
verbose: true,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Parse test cases from skill
|
|
123
|
+
const testCases = parseTestCases(skillContent);
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Workflow Orchestration
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import { WorkflowOrchestrator, parseWorkflow, WorkflowStore } from '@skillkit/core';
|
|
130
|
+
|
|
131
|
+
// Parse and run a workflow
|
|
132
|
+
const workflow = parseWorkflow('./workflow.yaml');
|
|
133
|
+
const orchestrator = new WorkflowOrchestrator(workflow);
|
|
134
|
+
await orchestrator.execute();
|
|
135
|
+
|
|
136
|
+
// Manage workflows
|
|
137
|
+
const store = new WorkflowStore('./my-project');
|
|
138
|
+
const workflows = store.list();
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Marketplace
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import { createMarketplaceAggregator, MarketplaceSource } from '@skillkit/core';
|
|
145
|
+
|
|
146
|
+
// Browse skill marketplace
|
|
147
|
+
const marketplace = createMarketplaceAggregator();
|
|
148
|
+
const results = await marketplace.search({ query: 'react' });
|
|
149
|
+
|
|
150
|
+
// Filter by tags
|
|
151
|
+
const filtered = await marketplace.search({
|
|
152
|
+
query: 'authentication',
|
|
153
|
+
tags: ['security', 'auth'],
|
|
154
|
+
limit: 10,
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Supported Agents
|
|
159
|
+
|
|
160
|
+
The translator supports all 17 SkillKit-compatible agents:
|
|
161
|
+
|
|
162
|
+
| Agent | Format |
|
|
163
|
+
|-------|--------|
|
|
164
|
+
| Claude Code | SKILL.md |
|
|
165
|
+
| Cursor | MDC (.mdc) |
|
|
166
|
+
| Codex | SKILL.md |
|
|
167
|
+
| Gemini CLI | SKILL.md |
|
|
168
|
+
| Windsurf | Markdown |
|
|
169
|
+
| GitHub Copilot | Markdown |
|
|
170
|
+
| OpenCode, Antigravity, Amp, Goose, Kilo, Kiro, Roo, Trae | SKILL.md |
|
|
171
|
+
| Universal | SKILL.md |
|
|
172
|
+
|
|
173
|
+
## API Reference
|
|
174
|
+
|
|
175
|
+
### Skill Types
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
interface CanonicalSkill {
|
|
179
|
+
name: string;
|
|
180
|
+
description?: string;
|
|
181
|
+
version?: string;
|
|
182
|
+
author?: string;
|
|
183
|
+
tags?: string[];
|
|
184
|
+
globs?: string[];
|
|
185
|
+
alwaysApply?: boolean;
|
|
186
|
+
content: string;
|
|
187
|
+
metadata?: Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface TranslationResult {
|
|
191
|
+
content: string;
|
|
192
|
+
format: string;
|
|
193
|
+
warnings?: string[];
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Context Types
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
interface ProjectProfile {
|
|
201
|
+
name: string;
|
|
202
|
+
type: 'web-app' | 'api' | 'cli' | 'library' | 'unknown';
|
|
203
|
+
stack: {
|
|
204
|
+
languages: Detection[];
|
|
205
|
+
frameworks: Detection[];
|
|
206
|
+
libraries: Detection[];
|
|
207
|
+
testing: Detection[];
|
|
208
|
+
databases: Detection[];
|
|
209
|
+
};
|
|
210
|
+
}
|
|
39
211
|
```
|
|
40
212
|
|
|
41
213
|
## Documentation
|