@looplia/looplia-cli 0.6.6

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.
Files changed (34) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +33216 -0
  3. package/package.json +55 -0
  4. package/plugins/looplia-core/.claude-plugin/plugin.json +10 -0
  5. package/plugins/looplia-core/commands/build-workflow.md +92 -0
  6. package/plugins/looplia-core/commands/build.md +71 -0
  7. package/plugins/looplia-core/commands/list-workflows.md +55 -0
  8. package/plugins/looplia-core/commands/run.md +50 -0
  9. package/plugins/looplia-core/hooks/hooks.json +27 -0
  10. package/plugins/looplia-core/scripts/hooks/compact-inject-state.sh +36 -0
  11. package/plugins/looplia-core/scripts/hooks/post-write-validate.sh +81 -0
  12. package/plugins/looplia-core/scripts/hooks/stop-guard.sh +56 -0
  13. package/plugins/looplia-core/skills/plugin-registry-scanner/SKILL.md +108 -0
  14. package/plugins/looplia-core/skills/plugin-registry-scanner/scripts/scan-plugins.ts +221 -0
  15. package/plugins/looplia-core/skills/plugin-registry-scanner/test/scan-plugins.test.ts +256 -0
  16. package/plugins/looplia-core/skills/search/SKILL.md +174 -0
  17. package/plugins/looplia-core/skills/skill-capability-matcher/SKILL.md +378 -0
  18. package/plugins/looplia-core/skills/workflow-executor/SKILL.md +469 -0
  19. package/plugins/looplia-core/skills/workflow-executor-inline/SKILL.md +217 -0
  20. package/plugins/looplia-core/skills/workflow-schema-composer/SCHEMA.md +214 -0
  21. package/plugins/looplia-core/skills/workflow-schema-composer/SKILL.md +373 -0
  22. package/plugins/looplia-core/skills/workflow-schema-composer/templates/workflow.md.template +44 -0
  23. package/plugins/looplia-core/skills/workflow-validator/SKILL.md +171 -0
  24. package/plugins/looplia-core/skills/workflow-validator/scripts/validate.ts +244 -0
  25. package/plugins/looplia-writer/.claude-plugin/plugin.json +10 -0
  26. package/plugins/looplia-writer/README.md +107 -0
  27. package/plugins/looplia-writer/skills/content-documenter/SKILL.md +189 -0
  28. package/plugins/looplia-writer/skills/id-generator/SKILL.md +120 -0
  29. package/plugins/looplia-writer/skills/idea-synthesis/SKILL.md +162 -0
  30. package/plugins/looplia-writer/skills/media-reviewer/SKILL.md +105 -0
  31. package/plugins/looplia-writer/skills/user-profile-reader/SKILL.md +94 -0
  32. package/plugins/looplia-writer/skills/writing-enhancer/SKILL.md +34 -0
  33. package/plugins/looplia-writer/skills/writing-kit-assembler/SKILL.md +206 -0
  34. package/plugins/looplia-writer/workflows/writing-kit.md +134 -0
@@ -0,0 +1,378 @@
1
+ ---
2
+ name: skill-capability-matcher
3
+ description: |
4
+ This skill should be used when the user wants to find the right looplia skills for a task,
5
+ match requirements to available capabilities, or determine which skills should handle each
6
+ workflow step. Use when someone says "which looplia skill handles X", "find skills for this
7
+ task", "match my requirements to skills", or "/build" (after registry scan).
8
+
9
+ Second step in looplia workflow building: takes user requirements and skill registry,
10
+ recommends skill sequences with missions. Designs one workflow step → one skill-executor
11
+ → multiple skills orchestration pattern.
12
+ model: claude-haiku-4-5-20251001
13
+ ---
14
+
15
+ # Skill Capability Matcher
16
+
17
+ Match natural language requirements to available skills, designing an optimal workflow step sequence.
18
+
19
+ ## Purpose
20
+
21
+ Parse user's workflow description, understand their intent, and recommend which skills should handle each part of the workflow. Output includes step IDs, skill names, missions, and data flow.
22
+
23
+ ## Process
24
+
25
+ ### Step 1: Parse Requirements
26
+
27
+ Extract from the user's description:
28
+
29
+ **Input Types:**
30
+ - video transcript
31
+ - audio transcript
32
+ - article/blog post
33
+ - documentation
34
+ - raw text
35
+ - structured data (JSON/YAML)
36
+
37
+ **Processing Goals:**
38
+ - analyze (deep understanding)
39
+ - summarize (condensation)
40
+ - generate (create new content)
41
+ - transform (change format)
42
+ - extract (pull specific data)
43
+ - validate (check correctness)
44
+
45
+ **Output Format:**
46
+ - JSON structure
47
+ - Markdown document
48
+ - Summary text
49
+ - Structured data
50
+
51
+ ### Step 2: Load Registry
52
+
53
+ Read the plugin registry from plugin-registry-scanner output:
54
+
55
+ ```json
56
+ {
57
+ "plugins": [...],
58
+ "summary": { "totalSkills": N }
59
+ }
60
+ ```
61
+
62
+ Build a capability index from skill descriptions and inferred capabilities.
63
+
64
+ ### Step 3: Match Capabilities
65
+
66
+ Score each skill by:
67
+ 1. **Description match** - Does skill description align with requirements?
68
+ 2. **Capability overlap** - Do inferred capabilities match processing goals?
69
+ 3. **Input/output compatibility** - Can skill handle input type and produce expected output?
70
+
71
+ ### Step 4: Design Step Sequence
72
+
73
+ For each matched skill:
74
+ 1. Create a step ID (kebab-case, descriptive)
75
+ 2. Determine dependencies (`needs:`)
76
+ 3. Write a mission description (what to accomplish)
77
+ 4. Define data flow (input → output)
78
+
79
+ ### Step 5: Recommend Sequence
80
+
81
+ Order skills logically:
82
+ 1. Analysis skills first (understand content)
83
+ 2. Generation/transformation skills second
84
+ 3. Assembly/output skills last
85
+
86
+ Ensure proper data dependencies.
87
+
88
+ ### Step 6: Flag Gaps
89
+
90
+ If requirements can't be fully satisfied:
91
+ - List unmatched capabilities as gaps
92
+ - Suggest creating custom skills if needed
93
+ - Indicate if workflow is partial
94
+
95
+ ## Input
96
+
97
+ Provide:
98
+ 1. User's natural language description
99
+ 2. Registry JSON from plugin-registry-scanner
100
+
101
+ ## Output Schema
102
+
103
+ ```json
104
+ {
105
+ "requirements": {
106
+ "inputType": "video transcript",
107
+ "goals": ["extract key points", "generate outline"],
108
+ "outputFormat": "structured JSON"
109
+ },
110
+ "recommendations": [
111
+ {
112
+ "skill": "media-reviewer",
113
+ "suggestedStepId": "analyze-content",
114
+ "goalId": "analyze",
115
+ "matchScore": 0.92,
116
+ "capabilities": ["content analysis", "theme extraction"],
117
+ "mission": "Deep analysis of video transcript. Extract key themes, quotes, and narrative structure.",
118
+ "rationale": "Primary skill for content understanding"
119
+ },
120
+ {
121
+ "skill": "idea-synthesis",
122
+ "suggestedStepId": "generate-ideas",
123
+ "goalId": "generate",
124
+ "matchScore": 0.85,
125
+ "capabilities": ["idea generation", "hooks and angles"],
126
+ "mission": "Generate hooks, angles, and questions from the analysis. Read user profile for personalization.",
127
+ "rationale": "Creates engaging content ideas from analysis"
128
+ }
129
+ ],
130
+ "suggestedSequence": ["analyze-content", "generate-ideas", "build-output"],
131
+ "dataFlow": {
132
+ "analyze-content": {
133
+ "needs": [],
134
+ "provides": "analysis.json"
135
+ },
136
+ "generate-ideas": {
137
+ "needs": ["analyze-content"],
138
+ "provides": "ideas.json"
139
+ },
140
+ "build-output": {
141
+ "needs": ["analyze-content", "generate-ideas"],
142
+ "provides": "output.json"
143
+ }
144
+ },
145
+ "gaps": [],
146
+ "customSkillNeeded": false,
147
+ "clarificationNeeded": true,
148
+ "clarifications": {
149
+ "sections": [
150
+ {
151
+ "id": "input",
152
+ "title": "Input",
153
+ "completed": false,
154
+ "questions": [
155
+ {
156
+ "id": "content-type",
157
+ "text": "What type of content will this workflow process?",
158
+ "type": "single-select",
159
+ "options": [
160
+ { "id": "video", "label": "Video transcripts", "inferred": true },
161
+ { "id": "audio", "label": "Audio transcripts" },
162
+ { "id": "text", "label": "Text articles" },
163
+ { "id": "web", "label": "Web pages (fetched via search)" }
164
+ ],
165
+ "reason": "Inferred 'video' from description, confirm or change"
166
+ }
167
+ ]
168
+ },
169
+ {
170
+ "id": "goals",
171
+ "title": "Goals",
172
+ "completed": false,
173
+ "questions": [
174
+ {
175
+ "id": "primary-goal",
176
+ "text": "What are the primary goals for this workflow?",
177
+ "type": "multi-select",
178
+ "options": [
179
+ { "id": "analyze", "label": "Analyze and extract key insights" },
180
+ { "id": "summarize", "label": "Create structured summaries" },
181
+ { "id": "generate", "label": "Generate creative content ideas" },
182
+ { "id": "document", "label": "Build comprehensive reports" }
183
+ ]
184
+ },
185
+ {
186
+ "id": "depth",
187
+ "text": "How deep should the analysis be?",
188
+ "type": "single-select",
189
+ "options": [
190
+ { "id": "quick", "label": "Quick overview (1-2 key points)" },
191
+ { "id": "standard", "label": "Standard analysis (5-7 key points)" },
192
+ { "id": "deep", "label": "Deep analysis (comprehensive)" }
193
+ ]
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "id": "output",
199
+ "title": "Output",
200
+ "completed": false,
201
+ "questions": [
202
+ {
203
+ "id": "format",
204
+ "text": "What output format do you need?",
205
+ "type": "single-select",
206
+ "options": [
207
+ { "id": "json", "label": "Structured JSON" },
208
+ { "id": "markdown", "label": "Markdown document" },
209
+ { "id": "both", "label": "Both JSON and Markdown" }
210
+ ]
211
+ }
212
+ ]
213
+ },
214
+ {
215
+ "id": "review",
216
+ "title": "Review",
217
+ "completed": false,
218
+ "questions": []
219
+ }
220
+ ]
221
+ }
222
+ }
223
+ ```
224
+
225
+ ## Scoring Guidelines
226
+
227
+ | Match Type | Score |
228
+ |------------|-------|
229
+ | Exact capability match | 0.9-1.0 |
230
+ | Strong description overlap | 0.7-0.9 |
231
+ | Partial capability match | 0.5-0.7 |
232
+ | Weak/inferred match | 0.3-0.5 |
233
+ | No clear match | < 0.3 |
234
+
235
+ ## Mission Writing Guidelines
236
+
237
+ Each mission should:
238
+ - Start with an action verb (Analyze, Extract, Generate, Create, Transform)
239
+ - Describe the specific goal for this step
240
+ - Mention key outputs expected
241
+ - Reference context from previous steps if applicable
242
+ - Be 2-4 sentences
243
+
244
+ **Good mission example:**
245
+ ```
246
+ Deep analysis of video transcript. Extract key themes, important quotes with timestamps, and narrative structure. Focus on insights that would interest the user based on their profile.
247
+ ```
248
+
249
+ **Bad mission example:**
250
+ ```
251
+ Analyze the content.
252
+ ```
253
+
254
+ ## Important Rules
255
+
256
+ 1. **Skills-first** - Never recommend agents, only skills
257
+ 2. **Include missions** - Every recommendation must have a detailed mission
258
+ 3. **Score realistically** - Don't inflate match scores
259
+ 4. **Complete data flow** - Ensure all dependencies are resolvable
260
+ 5. **Flag gaps honestly** - Report capabilities that can't be matched
261
+ 6. **Include goalId** - Each recommendation must have a `goalId` linking it to a clarification goal
262
+
263
+ ## Clarifications Schema (v0.6.4)
264
+
265
+ When user requirements are ambiguous, include clarifying questions in the response. The wizard UI uses these to gather additional context before generating the final workflow.
266
+
267
+ ### Clarification Fields
268
+
269
+ | Field | Type | Description |
270
+ |-------|------|-------------|
271
+ | `clarificationNeeded` | boolean | Whether clarifying questions should be shown |
272
+ | `clarifications.sections` | Section[] | Tab-based sections for wizard navigation |
273
+
274
+ ### Section Schema
275
+
276
+ ```json
277
+ {
278
+ "id": "goals",
279
+ "title": "Goals",
280
+ "completed": false,
281
+ "questions": [...]
282
+ }
283
+ ```
284
+
285
+ ### Question Schema
286
+
287
+ ```json
288
+ {
289
+ "id": "primary-goal",
290
+ "text": "What are the primary goals for this workflow?",
291
+ "type": "single-select | multi-select | text",
292
+ "options": [
293
+ { "id": "analyze", "label": "Analyze and extract key insights", "inferred": true }
294
+ ],
295
+ "reason": "Optional explanation for why this was inferred"
296
+ }
297
+ ```
298
+
299
+ ### Question Types
300
+
301
+ | Type | Description | Use Case |
302
+ |------|-------------|----------|
303
+ | `single-select` | One option only (●/○) | Content type, depth level |
304
+ | `multi-select` | Multiple options (✓/☐) | Goals, features to include |
305
+ | `text` | Free-form input | Custom names, descriptions |
306
+
307
+ ### Inferred Values
308
+
309
+ Set `inferred: true` on options that match keywords in the user's description:
310
+ - "video" or "youtube" → infer video content type
311
+ - "analyze" → infer analyze goal
312
+ - "summar" → infer summarize goal
313
+ - "generat" or "creat" → infer generate goal
314
+
315
+ ### Recommendation goalId
316
+
317
+ Each recommendation must include a `goalId` that links to a goal option:
318
+
319
+ ```json
320
+ {
321
+ "skill": "media-reviewer",
322
+ "suggestedStepId": "analyze-content",
323
+ "goalId": "analyze",
324
+ "matchScore": 0.92
325
+ }
326
+ ```
327
+
328
+ This allows the wizard to filter recommendations based on selected goals in real-time.
329
+
330
+ ## Structured Preferences for Enriched Prompt (v0.6.4)
331
+
332
+ When wizard answers are included in the enriched prompt (via "User clarifications: Q: ... A: ..."), these become **structured preferences** that MUST be incorporated into the workflow.
333
+
334
+ ### Common Preference Types
335
+
336
+ | Preference Category | Example Questions | How to Use |
337
+ |---------------------|-------------------|------------|
338
+ | **PLATFORMS** | "Which social media platforms?" | Inject into social/output step missions |
339
+ | **ARTICLE_COUNT** | "How many articles/items?" | Inject into search/filter step missions |
340
+ | **FOCUS_AREAS** | "Which topics/areas to focus on?" | Inject into search and analysis missions |
341
+ | **OUTPUT_FORMAT** | "What format should output be?" | Inject into final output step mission |
342
+ | **DEPTH** | "How deep should analysis be?" | Adjust analysis step detail level |
343
+
344
+ ### Preference Extraction from Enriched Prompt
345
+
346
+ When receiving an enriched prompt like:
347
+ ```
348
+ User clarifications: Q: Which platforms? A: twitter, linkedin. Q: How many articles? A: top5. Q: Focus areas? A: llm, adoption.
349
+ ```
350
+
351
+ Extract as structured data:
352
+ ```
353
+ PLATFORMS: twitter, linkedin
354
+ ARTICLE_COUNT: 5
355
+ FOCUS_AREAS: llm, adoption
356
+ ```
357
+
358
+ ### Mission Templates with Preferences
359
+
360
+ **WITHOUT preferences (BAD):**
361
+ ```
362
+ Search for AI news articles.
363
+ ```
364
+
365
+ **WITH preferences (GOOD):**
366
+ ```
367
+ Search for top 5 AI news articles focusing on LLM developments and adoption trends.
368
+ ```
369
+
370
+ **WITHOUT preferences (BAD):**
371
+ ```
372
+ Compile findings into a report.
373
+ ```
374
+
375
+ **WITH preferences (GOOD):**
376
+ ```
377
+ Create engaging social media posts optimized for twitter and linkedin, focusing on LLM and adoption angles.
378
+ ```