@almadar/skills 1.1.3 → 1.2.1

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.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { OrbitalSchema } from '@almadar/core';
2
+
1
3
  /**
2
4
  * Skill Generator Types
3
5
  *
@@ -105,35 +107,6 @@ declare function generateKflowOrbitalFixingSkill(): GeneratedSkill;
105
107
  */
106
108
  declare function generateDomainLanguageSkill(): GeneratedSkill;
107
109
 
108
- /**
109
- * KFlow Design Skill Generator
110
- *
111
- * Generates the kflow-design skill for render-ui authoring.
112
- * This is a focused ~10K skill that operates at the transition level,
113
- * producing rich render-ui effects using the full pattern catalog.
114
- *
115
- * Unlike kflow-orbitals (which focuses on structure), this skill
116
- * focuses entirely on UI design decisions: pattern selection,
117
- * slot composition, layout nesting, and domain-aware styling.
118
- *
119
- * @packageDocumentation
120
- */
121
-
122
- /**
123
- * Generate the kflow-design skill.
124
- *
125
- * Produces a focused ~10K skill for render-ui authoring.
126
- * Used by the design_transition tool to produce rich UI effects.
127
- */
128
- declare function generateKflowDesignSkill(): GeneratedSkill;
129
- /**
130
- * Get design skill stats for comparison.
131
- */
132
- declare function getDesignSkillStats(): {
133
- lines: number;
134
- chars: number;
135
- };
136
-
137
110
  /**
138
111
  * Lean Orbital Skill Generator
139
112
  *
@@ -238,20 +211,19 @@ declare function generateLeanFixingSkill(options?: LeanFixingSkillOptions): stri
238
211
  /**
239
212
  * Skill Generators for Builder Client
240
213
  *
241
- * Re-exports the 6 core skills used by the builder client:
242
- * 1. kflow-orbitals (standard JSON generation)
214
+ * Re-exports the 5 core skills used by the builder client:
215
+ * 1. kflow-orbitals (standard JSON generation with atomic composition)
243
216
  * 2. kflow-orbital-fixing (standard fixing)
244
217
  * 3. kflow-lean-orbitals (lean domain language generation)
245
218
  * 4. kflow-lean-fixing (lean fixing)
246
219
  * 5. domain-language (ODL understanding/summarization)
247
- * 6. kflow-design (render-ui design for transitions)
248
220
  *
249
221
  * @packageDocumentation
250
222
  */
251
223
 
252
224
  /**
253
225
  * Generate all builder client skills.
254
- * These are the 6 skills actually used by the builder UI.
226
+ * These are the 5 skills actually used by the builder UI.
255
227
  */
256
228
  declare function generateAllBuilderSkills(): GeneratedSkill[];
257
229
 
@@ -328,22 +300,38 @@ declare function getPortableOrbitalOutputSection(): string;
328
300
  declare function getOrbitalConnectivitySection(): string;
329
301
 
330
302
  /**
331
- * Pattern Design Guide Section
303
+ * Atomic Composition Design Guide (v5.0)
332
304
  *
333
- * Replaces the 380-char getRenderUIQuickRef() with actionable guidance
334
- * on pattern selection, composition recipes, and slot strategy.
305
+ * Teaches the LLM to compose sophisticated views using atomic design principles.
306
+ * Every render-ui effect must satisfy the Five Rules of Sophisticated Composition.
335
307
  *
336
- * Target: ~2,500 chars focused entirely on helping the LLM produce
337
- * rich, varied render-ui effects instead of defaulting to entity-table.
308
+ * v5.0: Added mandatory composition rules, validation checklist, and theme enforcement.
338
309
  *
339
310
  * @packageDocumentation
340
311
  */
341
312
  /**
342
- * Get the render-ui design guide.
343
- * Covers syntax, slot strategy, pattern-by-intent, and composition recipes.
313
+ * Get the render-ui atomic composition guide with mandatory rules.
344
314
  */
345
315
  declare function getRenderUIDesignGuide(): string;
346
316
 
317
+ /**
318
+ * Theme Variable System Guide
319
+ *
320
+ * Teaches the LLM to use CSS theme variables for all visual properties.
321
+ * Enforces consistent theming across all generated schemas.
322
+ *
323
+ * @packageDocumentation
324
+ */
325
+ /**
326
+ * Get the theme variable system guide.
327
+ * Covers colors, spacing, radius, and shadows with mandatory enforcement rules.
328
+ */
329
+ declare function getThemeGuide(): string;
330
+ /**
331
+ * Get banned properties that should never be used.
332
+ */
333
+ declare function getBannedProps(): string;
334
+
347
335
  /**
348
336
  * Custom Trait Guidance Section
349
337
  *
@@ -500,6 +488,28 @@ declare function getUsesImportSection(): string;
500
488
  */
501
489
  declare function getUsesImportCompact(): string;
502
490
 
491
+ /**
492
+ * Bindings Guide
493
+ *
494
+ * Generates binding documentation from the source of truth in @almadar/core.
495
+ * This ensures the skill guidance matches the actual compiler validation.
496
+ *
497
+ * @packageDocumentation
498
+ */
499
+ /**
500
+ * Generate binding documentation for skill prompts.
501
+ * Derived from BINDING_DOCS in @almadar/core - single source of truth.
502
+ */
503
+ declare function getBindingsGuide(): string;
504
+ /**
505
+ * Get compact binding reference (one-liner for tables).
506
+ */
507
+ declare function getBindingsCompact(): string;
508
+ /**
509
+ * Get binding validation rules for specific contexts.
510
+ */
511
+ declare function getBindingContextRules(): string;
512
+
503
513
  /**
504
514
  * Generation Prompts
505
515
  *
@@ -572,4 +582,82 @@ declare function getFieldTypesCompact(): string;
572
582
  */
573
583
  declare function getKeyBehaviorsReference(): string;
574
584
 
575
- export { type GeneratedSkill, type SkillFrontmatter, formatFrontmatter, generateAllBuilderSkills, generateDomainLanguageSkill, generateKflowDesignSkill, generateKflowOrbitalFixingSkill, generateKflowOrbitalsSkill, generateLeanFixingSkill$1 as generateLeanFixingSkill, generateLeanFixingSkill as generateLeanFixingSkillFull, generateLeanOrbitalSkill$1 as generateLeanOrbitalSkill, generateLeanOrbitalSkill as generateLeanOrbitalSkillFull, getArchitectureSection, getAssetRefSection, getCommonErrorsSection, getCommonFixPatternsSection, getCompletionRulesSection, getConnectivityCompact, getContextUsageCompact, getContextUsageSection, getCustomTraitCompact, getCustomTraitSection, getDecompositionChecklist, getDecompositionCompact, getDecompositionSection, getDesignErrorsCompact, getDesignErrorsSection, getDesignSkillStats, getEfficiencySection, getFieldTypesCompact, getFixingWorkflowSection, getFlowPatternSection, getFullOrbitalPrompt, getGameAsOrbitalsSection, getGameEntityTemplatesSection, getGamePatternsSection, getGameTraitsSection, getGameTypesSection, getIconLibraryCompact, getIconLibrarySection, getKeyBehaviorsReference, getMinimalTypeReference, getMultiFileSection, getOrbitalConnectivitySection, getOrbitalDecompositionPrompt, getOverGenerationSection, getPatternTypesCompact, getPortableOrbitalOutputSection, getRenderUIDesignGuide, getRenderUIQuickRef, getRequirementsDecomposePrompt, getRequirementsTraitPrompt, getSExprQuickRef, getSchemaUpdateCompact, getSchemaUpdateSection, getUsesImportCompact, getUsesImportSection, getValidationHintsSection, writeAllSkills, writeSkill };
585
+ /**
586
+ * Composition Quality Evaluation Framework
587
+ *
588
+ * Evaluates LLM providers' ability to generate sophisticated render-ui effects
589
+ * that meet the Five Rules of Sophisticated Composition.
590
+ *
591
+ * @packageDocumentation
592
+ */
593
+
594
+ interface EvalCase {
595
+ name: string;
596
+ description: string;
597
+ prompt: string;
598
+ expectedPatterns: string[];
599
+ minScore: number;
600
+ domain: 'general' | 'healthcare' | 'ecommerce' | 'project-management';
601
+ rubric?: {
602
+ structure: Record<string, number>;
603
+ composition: Record<string, number>;
604
+ theme: Record<string, number>;
605
+ quality: Record<string, number>;
606
+ };
607
+ }
608
+ interface EvalResult {
609
+ caseName: string;
610
+ provider: string;
611
+ score: number;
612
+ passed: boolean;
613
+ breakdown: ScoreBreakdown;
614
+ validationErrors: string[];
615
+ validationWarnings: string[];
616
+ schema?: OrbitalSchema;
617
+ }
618
+ interface ScoreBreakdown {
619
+ structure: number;
620
+ composition: number;
621
+ theme: number;
622
+ quality: number;
623
+ }
624
+ interface CompositionMetrics {
625
+ renderUICount: number;
626
+ atomTypes: string[];
627
+ moleculeTypes: string[];
628
+ organismTypes: string[];
629
+ layoutRoot: string | null;
630
+ nestingDepth: number;
631
+ sectionCount: number;
632
+ themeVariableUsage: number;
633
+ hardcodedValues: string[];
634
+ }
635
+ declare const EVAL_CASES: EvalCase[];
636
+ /**
637
+ * Analyze the composition metrics of a schema.
638
+ */
639
+ declare function analyzeComposition(schema: OrbitalSchema): CompositionMetrics;
640
+ /**
641
+ * Calculate total score (0-100)
642
+ */
643
+ declare function calculateTotalScore(schema: OrbitalSchema, testCase: EvalCase, validationErrors: string[]): {
644
+ score: number;
645
+ breakdown: ScoreBreakdown;
646
+ };
647
+ interface ProviderComparison {
648
+ provider: string;
649
+ averageScore: number;
650
+ cases: {
651
+ caseName: string;
652
+ score: number;
653
+ passed: boolean;
654
+ }[];
655
+ strengths: string[];
656
+ weaknesses: string[];
657
+ }
658
+ /**
659
+ * Generate comparison matrix for all providers.
660
+ */
661
+ declare function generateComparisonMatrix(comparisons: ProviderComparison[]): string;
662
+
663
+ export { type CompositionMetrics, EVAL_CASES, type EvalCase, type EvalResult, type GeneratedSkill, type ProviderComparison, type ScoreBreakdown, type SkillFrontmatter, analyzeComposition, calculateTotalScore, formatFrontmatter, generateAllBuilderSkills, generateComparisonMatrix, generateDomainLanguageSkill, generateKflowOrbitalFixingSkill, generateKflowOrbitalsSkill, generateLeanFixingSkill$1 as generateLeanFixingSkill, generateLeanFixingSkill as generateLeanFixingSkillFull, generateLeanOrbitalSkill$1 as generateLeanOrbitalSkill, generateLeanOrbitalSkill as generateLeanOrbitalSkillFull, getArchitectureSection, getAssetRefSection, getBannedProps, getBindingContextRules, getBindingsCompact, getBindingsGuide, getCommonErrorsSection, getCommonFixPatternsSection, getCompletionRulesSection, getConnectivityCompact, getContextUsageCompact, getContextUsageSection, getCustomTraitCompact, getCustomTraitSection, getDecompositionChecklist, getDecompositionCompact, getDecompositionSection, getDesignErrorsCompact, getDesignErrorsSection, getEfficiencySection, getFieldTypesCompact, getFixingWorkflowSection, getFlowPatternSection, getFullOrbitalPrompt, getGameAsOrbitalsSection, getGameEntityTemplatesSection, getGamePatternsSection, getGameTraitsSection, getGameTypesSection, getIconLibraryCompact, getIconLibrarySection, getKeyBehaviorsReference, getMinimalTypeReference, getMultiFileSection, getOrbitalConnectivitySection, getOrbitalDecompositionPrompt, getOverGenerationSection, getPatternTypesCompact, getPortableOrbitalOutputSection, getRenderUIDesignGuide, getRenderUIQuickRef, getRequirementsDecomposePrompt, getRequirementsTraitPrompt, getSExprQuickRef, getSchemaUpdateCompact, getSchemaUpdateSection, getThemeGuide, getUsesImportCompact, getUsesImportSection, getValidationHintsSection, writeAllSkills, writeSkill };