MCPcopy
hub / github.com/codeaashu/claude-code / extractUserMessages

Function extractUserMessages

src/skills/bundled/skillify.ts:6–20  ·  view source on GitHub ↗
(messages: Message[])

Source from the content-addressed store, hash-verified

4import { registerBundledSkill } from '../bundledSkills.js'
5
6function extractUserMessages(messages: Message[]): string[] {
7 return messages
8 .filter((m): m is Extract<typeof m, { type: 'user' }> => m.type === 'user')
9 .map(m => {
10 const content = m.message.content
11 if (typeof content === 'string') return content
12 return content
13 .filter(
14 (b): b is Extract<typeof b, { type: 'text' }> => b.type === 'text',
15 )
16 .map(b => b.text)
17 .join('\n')
18 })
19 .filter(text => text.trim().length > 0)
20}
21
22const SKILLIFY_PROMPT = `# Skillify {{userDescriptionBlock}}
23

Callers 1

getPromptForCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected