@@ -87,6 +87,151 @@ import { RecommendationEngine, analyzeProject } from '@skillkit/core/recommend'
8787const engine = new RecommendationEngine ()
8888const profile = await analyzeProject (' ./my-project' )
8989const recommendations = engine .recommend (profile )
90+
91+ // Recommendations with scores and reasons
92+ recommendations .forEach (rec => {
93+ console .log (` ${rec .score }% - ${rec .skill .name } ` )
94+ console .log (` Reasons: ${rec .reasons .join (' , ' )} ` )
95+ })
96+ ```
97+
98+ ## Primer (Auto-Generate Instructions)
99+
100+ ``` typescript
101+ import { promises as fs } from ' node:fs'
102+ import { analyzeProject , generateInstructions } from ' @skillkit/core'
103+
104+ // Analyze project
105+ const analysis = await analyzeProject (' ./my-project' )
106+ console .log (analysis .techStack )
107+ // { framework: 'Next.js', language: 'TypeScript', styling: 'Tailwind' }
108+
109+ // Generate instructions for specific agents
110+ const instructions = await generateInstructions (analysis , {
111+ agents: [' claude' , ' cursor' , ' windsurf' ],
112+ includeExamples: true ,
113+ tone: ' detailed' ,
114+ })
115+
116+ // Write to files
117+ for (const [agent, content] of Object .entries (instructions )) {
118+ await fs .writeFile (` .${agent }/instructions.md ` , content )
119+ }
120+ ```
121+
122+ ## Mesh Network
123+
124+ ``` typescript
125+ import { MeshHost , PeerIdentity } from ' @skillkit/mesh'
126+
127+ // Generate identity
128+ const identity = await PeerIdentity .generate ()
129+
130+ // Create mesh host
131+ const host = new MeshHost ({
132+ hostId: ' my-workstation' ,
133+ identity ,
134+ security: { mode: ' secure' },
135+ })
136+
137+ await host .start ()
138+
139+ // Send message to peer
140+ await host .send (' peer-fingerprint' , {
141+ type: ' skill-sync' ,
142+ payload: { skills: [' react-patterns' ] },
143+ })
144+
145+ // Listen for messages
146+ host .on (' message' , (msg ) => {
147+ console .log (' Received:' , msg .type , ' from' , msg .from )
148+ })
149+ ```
150+
151+ ## Inter-Agent Messaging
152+
153+ ``` typescript
154+ import { MessagingClient } from ' @skillkit/messaging'
155+
156+ // Create messaging client (host is a MeshHost instance from the example above)
157+ const messaging = new MessagingClient ({
158+ meshHost: host , // See MeshHost setup in "Mesh Network" section above
159+ storagePath: ' ~/.skillkit/messages' ,
160+ })
161+
162+ await messaging .init ()
163+
164+ // Send a message
165+ await messaging .send ({
166+ to: ' claude@laptop' ,
167+ subject: ' Code review completed' ,
168+ body: ' I reviewed the auth module...' ,
169+ priority: ' normal' ,
170+ })
171+
172+ // Listen for new messages
173+ messaging .on (' message' , (msg ) => {
174+ console .log (' New message from:' , msg .from )
175+ console .log (' Subject:' , msg .subject )
176+ })
177+
178+ // Get inbox
179+ const inbox = await messaging .getInbox ({ unread: true })
180+ ```
181+
182+ ## Workflow Orchestration
183+
184+ ``` typescript
185+ import { WorkflowEngine , WorkflowStep } from ' @skillkit/core'
186+
187+ // Define workflow
188+ const workflow = {
189+ name: ' feature-development' ,
190+ steps: [
191+ { skill: ' tdd-workflow' , action: ' write-tests' },
192+ { skill: ' code-implementation' , action: ' implement' },
193+ { skill: ' code-review' , action: ' review' },
194+ { skill: ' documentation' , action: ' update-docs' },
195+ ],
196+ }
197+
198+ // Execute workflow
199+ const engine = new WorkflowEngine ()
200+ const result = await engine .run (workflow )
201+
202+ console .log (' Workflow completed:' , result .status )
203+ console .log (' Steps executed:' , result .steps .length )
204+ ```
205+
206+ ## Skill Testing
207+
208+ ``` typescript
209+ import { SkillTestRunner , SkillTest } from ' @skillkit/core'
210+
211+ // Define test
212+ const test: SkillTest = {
213+ name: ' pdf-processing' ,
214+ setup : async () => {
215+ // Setup test environment
216+ },
217+ assertions: [
218+ {
219+ type: ' file_exists' ,
220+ path: ' ./output.pdf' ,
221+ },
222+ {
223+ type: ' content_includes' ,
224+ text: ' Expected content' ,
225+ },
226+ ],
227+ }
228+
229+ // Run test
230+ const runner = new SkillTestRunner ()
231+ const result = await runner .run (test )
232+
233+ console .log (' Test passed:' , result .passed )
234+ console .log (' Assertions:' , result .assertions )
90235```
91236
92237## Types
@@ -99,6 +244,15 @@ interface Skill {
99244 content: string
100245 metadata: SkillMetadata
101246 enabled: boolean
247+ agent: string
248+ }
249+
250+ interface SkillMetadata {
251+ version? : string
252+ author? : string
253+ tags? : string []
254+ dependencies? : string []
255+ quality? : QualityScore
102256}
103257
104258interface QualityScore {
@@ -114,4 +268,155 @@ interface Recommendation {
114268 score: number
115269 reasons: string []
116270}
271+
272+ interface ProjectAnalysis {
273+ techStack: {
274+ framework? : string
275+ language: string
276+ styling? : string
277+ testing? : string
278+ packageManager: string
279+ }
280+ patterns: {
281+ architecture: string
282+ codeStyle: Record <string , any >
283+ directory: string
284+ }
285+ dependencies: Record <string , string >
286+ }
287+
288+ interface MeshMessage {
289+ from: string
290+ to: string
291+ type: string
292+ payload: any
293+ timestamp: number
294+ signature? : string
295+ }
296+
297+ interface WorkflowResult {
298+ status: ' success' | ' failure'
299+ steps: WorkflowStepResult []
300+ duration: number
301+ }
302+ ```
303+
304+ ## Package Exports
305+
306+ ### @skillkit/core
307+
308+ ``` typescript
309+ export {
310+ // Discovery
311+ findAllSkills ,
312+ findSkill ,
313+
314+ // Quality
315+ evaluateSkillContent ,
316+ getQualityGrade ,
317+
318+ // Translation
319+ translateSkill ,
320+
321+ // Memory
322+ MemoryCompressor ,
323+ LearningStore ,
324+
325+ // Recommendations
326+ RecommendationEngine ,
327+ analyzeProject ,
328+
329+ // Primer
330+ generateInstructions ,
331+
332+ // Workflows
333+ WorkflowEngine ,
334+
335+ // Testing
336+ SkillTestRunner ,
337+ }
117338```
339+
340+ ### @skillkit/mesh
341+
342+ ``` typescript
343+ export {
344+ MeshHost ,
345+ PeerIdentity ,
346+ PeerRegistry ,
347+ SecureTransport ,
348+ }
349+ ```
350+
351+ ### @skillkit/messaging
352+
353+ ``` typescript
354+ export {
355+ MessagingClient ,
356+ MessageBuilder ,
357+ MessageRouter ,
358+ }
359+ ```
360+
361+ ### @skillkit/memory
362+
363+ ``` typescript
364+ export {
365+ MemoryStore ,
366+ TierManager ,
367+ EmbeddingEncoder ,
368+ }
369+ ```
370+
371+ ## Full Example: Custom Build Pipeline
372+
373+ ``` typescript
374+ import { promises as fs } from ' node:fs'
375+ import {
376+ analyzeProject ,
377+ generateInstructions ,
378+ RecommendationEngine ,
379+ translateSkill ,
380+ } from ' @skillkit/core'
381+
382+ async function setupProject() {
383+ // 1. Analyze project
384+ const analysis = await analyzeProject (' ./my-project' )
385+
386+ // 2. Generate base instructions
387+ const instructions = await generateInstructions (analysis , {
388+ agents: [' claude' , ' cursor' , ' windsurf' ],
389+ })
390+
391+ // 3. Get recommendations
392+ const engine = new RecommendationEngine ()
393+ const recommendations = engine .recommend (analysis )
394+
395+ // 4. Install top recommendations
396+ const topSkills = recommendations .slice (0 , 5 )
397+ for (const rec of topSkills ) {
398+ console .log (` Installing ${rec .skill .name } (${rec .score }% match) ` )
399+ }
400+
401+ // 5. Translate skills to all agents
402+ for (const agent of [' claude' , ' cursor' , ' windsurf' ]) {
403+ const translated = await translateSkill (
404+ topSkills [0 ].skill .content ,
405+ agent
406+ )
407+ await fs .writeFile (` .${agent }/skills/${translated .filename } ` , translated .content )
408+ }
409+
410+ console .log (' ✅ Project setup complete!' )
411+ }
412+
413+ setupProject ()
414+ ```
415+
416+ ## Next Steps
417+
418+ - [ Commands Reference] ( /docs/commands ) - CLI commands
419+ - [ Memory System] ( /docs/memory ) - Persistent learning
420+ - [ Mesh Network] ( /docs/mesh ) - Multi-machine setup
421+ - [ Workflows] ( /docs/workflows ) - Automation
422+ - [ Testing] ( /docs/testing ) - Skill validation
0 commit comments