@almadar/skills 2.0.4 → 2.1.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/dist/index.d.ts +19 -3
- package/dist/index.js +362 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -107,6 +107,21 @@ declare function generateKflowOrbitalFixingSkill(): GeneratedSkill;
|
|
|
107
107
|
*/
|
|
108
108
|
declare function generateDomainLanguageSkill(): GeneratedSkill;
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Almadar Assistant Skill Generator
|
|
112
|
+
*
|
|
113
|
+
* Generates the almadar-assistant skill: a Q&A assistant that knows
|
|
114
|
+
* about Almadar, Orb, Studio, Services, and the full platform.
|
|
115
|
+
* Used by the website chat widget across all four sites.
|
|
116
|
+
*
|
|
117
|
+
* @packageDocumentation
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Generate the almadar-assistant skill.
|
|
122
|
+
*/
|
|
123
|
+
declare function generateAlmadarAssistantSkill(): GeneratedSkill;
|
|
124
|
+
|
|
110
125
|
/**
|
|
111
126
|
* Lean Orbital Skill Generator
|
|
112
127
|
*
|
|
@@ -217,19 +232,20 @@ declare function generateLeanFixingSkill(options?: LeanFixingSkillOptions): stri
|
|
|
217
232
|
/**
|
|
218
233
|
* Skill Generators for Builder Client
|
|
219
234
|
*
|
|
220
|
-
* Re-exports the
|
|
235
|
+
* Re-exports the 6 core skills used by the builder client:
|
|
221
236
|
* 1. kflow-orbitals (standard JSON generation with atomic composition)
|
|
222
237
|
* 2. kflow-orbital-fixing (standard fixing)
|
|
223
238
|
* 3. kflow-lean-orbitals (lean domain language generation)
|
|
224
239
|
* 4. kflow-lean-fixing (lean fixing)
|
|
225
240
|
* 5. domain-language (ODL understanding/summarization)
|
|
241
|
+
* 6. almadar-assistant (company/platform Q&A knowledge assistant)
|
|
226
242
|
*
|
|
227
243
|
* @packageDocumentation
|
|
228
244
|
*/
|
|
229
245
|
|
|
230
246
|
/**
|
|
231
247
|
* Generate all builder client skills.
|
|
232
|
-
* These are the
|
|
248
|
+
* These are the 6 skills actually used by the builder UI.
|
|
233
249
|
*/
|
|
234
250
|
declare function generateAllBuilderSkills(): GeneratedSkill[];
|
|
235
251
|
|
|
@@ -741,4 +757,4 @@ type SkillsServiceActions = {
|
|
|
741
757
|
*/
|
|
742
758
|
type SkillsServiceContract = ServiceContract<SkillsServiceActions>;
|
|
743
759
|
|
|
744
|
-
export { type CompositionMetrics, EVAL_CASES, type EvalCase, type EvalResult, type GeneratedSkill, type ProviderComparison, type ScoreBreakdown, type SkillFrontmatter, type SkillsServiceActions, type SkillsServiceContract, 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, getSubagentSystemPrompt, getThemeGuide, getUsesImportCompact, getUsesImportSection, getValidationHintsSection, writeAllSkills, writeSkill };
|
|
760
|
+
export { type CompositionMetrics, EVAL_CASES, type EvalCase, type EvalResult, type GeneratedSkill, type ProviderComparison, type ScoreBreakdown, type SkillFrontmatter, type SkillsServiceActions, type SkillsServiceContract, analyzeComposition, calculateTotalScore, formatFrontmatter, generateAllBuilderSkills, generateAlmadarAssistantSkill, 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, getSubagentSystemPrompt, getThemeGuide, getUsesImportCompact, getUsesImportSection, getValidationHintsSection, writeAllSkills, writeSkill };
|
package/dist/index.js
CHANGED
|
@@ -419,6 +419,62 @@ Every pattern object in render-ui MUST include a \`"type"\` field. This applies
|
|
|
419
419
|
// CORRECT:
|
|
420
420
|
{ "type": "stack", "children": [{ "type": "typography", "text": "Hello" }] }
|
|
421
421
|
\`\`\`
|
|
422
|
+
|
|
423
|
+
### 9. Form Actions on Non-Form Patterns (CIRCUIT_ACTION_COMPONENT_MISMATCH)
|
|
424
|
+
|
|
425
|
+
**CANCEL, SAVE, SUBMIT, RESET are FORM actions.** They are ONLY valid in states that render form patterns (\`form-section\`, \`form\`).
|
|
426
|
+
|
|
427
|
+
Delete confirmation dialogs use \`alert\` or \`confirmation\` patterns, NOT \`form-section\`. So they must NOT use \`CANCEL\` as an action event.
|
|
428
|
+
|
|
429
|
+
\`\`\`json
|
|
430
|
+
// WRONG - CANCEL is a form action, but alert is NOT a form pattern:
|
|
431
|
+
{ "from": "Browsing", "to": "Deleting", "event": "DELETE",
|
|
432
|
+
"effects": [["render-ui", "modal", {
|
|
433
|
+
"type": "alert", "variant": "danger", "title": "Delete?",
|
|
434
|
+
"actions": [
|
|
435
|
+
{ "label": "Cancel", "event": "CANCEL" },
|
|
436
|
+
{ "label": "Delete", "event": "CONFIRM_DELETE" }
|
|
437
|
+
]
|
|
438
|
+
}]] }
|
|
439
|
+
|
|
440
|
+
// CORRECT - use CLOSE (not CANCEL) to dismiss non-form modals:
|
|
441
|
+
{ "from": "Browsing", "to": "Deleting", "event": "DELETE",
|
|
442
|
+
"effects": [["render-ui", "modal", {
|
|
443
|
+
"type": "alert", "variant": "danger", "title": "Delete?",
|
|
444
|
+
"actions": [
|
|
445
|
+
{ "label": "Cancel", "event": "CLOSE" },
|
|
446
|
+
{ "label": "Delete", "event": "CONFIRM_DELETE" }
|
|
447
|
+
]
|
|
448
|
+
}]] }
|
|
449
|
+
\`\`\`
|
|
450
|
+
|
|
451
|
+
**Rule:** In non-form modal states (alert, confirmation, detail-panel), use \`CLOSE\` to dismiss. Reserve \`CANCEL\` for \`form-section\` states only.
|
|
452
|
+
|
|
453
|
+
### 10. Dead Handler: Action Fires Event With No Transition From Current State (CIRCUIT_DEAD_HANDLER)
|
|
454
|
+
|
|
455
|
+
If a render-ui pattern in state X has an action that fires event E, there MUST be a transition \`from: X, event: E\`. A transition handling E from a DIFFERENT state does not count.
|
|
456
|
+
|
|
457
|
+
\`\`\`json
|
|
458
|
+
// WRONG - detail-panel in "Viewing" has Edit action firing EDIT,
|
|
459
|
+
// but only Browsing handles EDIT:
|
|
460
|
+
{ "from": "Browsing", "to": "Viewing", "event": "VIEW",
|
|
461
|
+
"effects": [["render-ui", "drawer", {
|
|
462
|
+
"type": "detail-panel", "entity": "Todo",
|
|
463
|
+
"actions": [{ "label": "Edit", "event": "EDIT" }]
|
|
464
|
+
}]] }
|
|
465
|
+
{ "from": "Browsing", "to": "Editing", "event": "EDIT", ... }
|
|
466
|
+
// No transition from: "Viewing", event: "EDIT" -> CIRCUIT_DEAD_HANDLER!
|
|
467
|
+
|
|
468
|
+
// CORRECT - add transition from Viewing state:
|
|
469
|
+
{ "from": "Viewing", "to": "Editing", "event": "EDIT",
|
|
470
|
+
"effects": [
|
|
471
|
+
["render-ui", "drawer", null],
|
|
472
|
+
["fetch", "Todo", "@payload.id"],
|
|
473
|
+
["render-ui", "modal", { "type": "form-section", "entity": "Todo", "submitEvent": "SAVE", "cancelEvent": "CANCEL" }]
|
|
474
|
+
] }
|
|
475
|
+
\`\`\`
|
|
476
|
+
|
|
477
|
+
**Rule:** For every action \`{ "event": "X" }\` in a render-ui effect of state S, verify there is a transition \`from: S, event: X\`.
|
|
422
478
|
`;
|
|
423
479
|
}
|
|
424
480
|
function getEdgeCaseErrors() {
|
|
@@ -508,6 +564,7 @@ Use a singleton entity for filter state + \`query\` prop on entity-table:
|
|
|
508
564
|
"fields": [{ "name": "status", "type": "string" }, { "name": "search", "type": "string" }] } }
|
|
509
565
|
\`\`\`
|
|
510
566
|
Reference: \`["render-ui", "main", { "type": "entity-table", "entity": "Task", "query": "@TaskQuery" }]\`
|
|
567
|
+
|
|
511
568
|
`;
|
|
512
569
|
}
|
|
513
570
|
function getValidationHintsSection() {
|
|
@@ -527,6 +584,12 @@ function getValidationHintsSection() {
|
|
|
527
584
|
| ORB_EFF_SET_REQUIRES_ENTITY | Change @payload.field to @entity.field in set effects |
|
|
528
585
|
| ORB_RUI_UNKNOWN_ITEM_ACTION_PROP | Remove invalid props (like \`condition\`), use \`showWhen\` |
|
|
529
586
|
| ORB_MODAL_NO_CLOSE | Add CLOSE/CANCEL transitions from modal states with \`["render-ui", "modal", null]\` |
|
|
587
|
+
| ORB_T_EVT_UNDECLARED | Event emitted via ["emit","X"] but not in trait's emits array. Add \`{ "event": "X", "scope": "internal" }\` to emits. Use "event"+"scope" format, NOT "key"+"name". |
|
|
588
|
+
| ORB_BINDING_SET_TARGET_MISSING_PATH | set target like \`@entity\` or \`@state\` has no field path. Use \`@entity.fieldName\` |
|
|
589
|
+
| ORB_BINDING_STATE_NO_PATH | \`@state\` used with a field path like \`@state.field\`. \`@state\` is bare, no paths allowed. Use \`@entity.field\` instead. |
|
|
590
|
+
| ORB_BINDING_ENTITY_FIELD_NOT_FOUND | Binding references \`@entity.field\` but that field doesn't exist on the entity. Add the field to entity.fields or fix the binding. |
|
|
591
|
+
| ORB_T_UNDEFINED_TRAIT | Trait name in page refs doesn't match any trait definition. Often caused by malformed emits (using events format instead of emits format). |
|
|
592
|
+
| ORB_EFF_FETCH_INVALID_ENTITY | fetch effect has wrong syntax. Use \`["fetch", "EntityName"]\` or \`["fetch", "EntityName", "@payload.id"]\`. NOT \`["fetch", "load", "Entity"]\`. |
|
|
530
593
|
`;
|
|
531
594
|
}
|
|
532
595
|
|
|
@@ -3275,6 +3338,7 @@ Every orbital MUST have this exact structure:
|
|
|
3275
3338
|
"name": "TraitName",
|
|
3276
3339
|
"category": "interaction",
|
|
3277
3340
|
"linkedEntity": "EntityName",
|
|
3341
|
+
"emits": [{ "event": "INIT", "scope": "internal" }],
|
|
3278
3342
|
"stateMachine": {
|
|
3279
3343
|
"states": [
|
|
3280
3344
|
{ "name": "Browsing", "isInitial": true },
|
|
@@ -3333,6 +3397,9 @@ Every orbital MUST have this exact structure:
|
|
|
3333
3397
|
2. **Entity Name**: Must match the orbital's primary entity
|
|
3334
3398
|
3. **Collection**: Plural lowercase version of entity name (e.g., "products" for Product)
|
|
3335
3399
|
4. **Fields**: At minimum, include id, name, and relevant fields from input
|
|
3400
|
+
5. **Emits format**: \`"emits": [{ "event": "EVENT_NAME", "scope": "internal" }]\`. NOT \`{ "key": "...", "name": "..." }\`. The emits array declares which events the trait emits via \`["emit", "X"]\` effects.
|
|
3401
|
+
6. **@state is bare**: \`@state\` has NO field paths. Never write \`@state.field\`. Use \`@entity.field\` instead.
|
|
3402
|
+
7. **set targets @entity.field**: \`["set", "@entity.fieldName", value]\`. Never \`["set", "@state", ...]\` or \`["set", "@entity", ...]\` without a field path.
|
|
3336
3403
|
|
|
3337
3404
|
## Common Mistakes to Avoid
|
|
3338
3405
|
|
|
@@ -3345,10 +3412,17 @@ Every orbital MUST have this exact structure:
|
|
|
3345
3412
|
- \u274C WRONG: Bare \`@entity\` without a field path \u2014 use \`@entity.fieldName\`
|
|
3346
3413
|
- \u274C WRONG: \`@Product.name\`, \`@Order.status\`, \`@Customer.email\` \u2014 NEVER use entity TYPE as binding root
|
|
3347
3414
|
- \u274C WRONG: \`@count(orders)\`, \`@sum(orders, total)\`, \`@avg(...)\` \u2014 NO aggregate functions exist
|
|
3415
|
+
- \u274C WRONG: \`["fetch", "load", "Product"]\` or \`["fetch", "get", "Product"]\` \u2014 fetch takes entity name directly, NOT an action verb
|
|
3416
|
+
- \u274C WRONG: \`"emits": [{ "key": "INIT", "name": "Initialize" }]\` \u2014 this is the EVENTS format, not emits
|
|
3417
|
+
- \u274C WRONG: \`@state.fieldName\` \u2014 \`@state\` is bare, it has NO field paths
|
|
3418
|
+
- \u274C WRONG: \`["set", "@state.field", value]\` or \`["set", "@state", value]\` \u2014 set target must be \`@entity.field\`
|
|
3348
3419
|
- \u2705 CORRECT: Full entity object with name, collection, persistence, fields
|
|
3349
3420
|
- \u2705 CORRECT: \`@entity.name\`, \`@entity.status\`, \`@entity.email\` \u2014 ALWAYS use \`@entity\` as the root
|
|
3350
3421
|
- \u2705 CORRECT: Only valid binding roots: \`@entity\`, \`@payload\`, \`@state\`, \`@now\`, \`@config\`
|
|
3351
3422
|
- \u2705 CORRECT: Every state rendering to modal/drawer has CANCEL + CLOSE transitions back
|
|
3423
|
+
- \u2705 CORRECT: \`"emits": [{ "event": "INIT", "scope": "internal" }]\` \u2014 emits uses "event"+"scope" keys
|
|
3424
|
+
- \u2705 CORRECT: \`@state\` is used bare (no path) \u2014 it refers to the current state name
|
|
3425
|
+
- \u2705 CORRECT: \`["set", "@entity.status", "active"]\` \u2014 set ALWAYS targets @entity.fieldName
|
|
3352
3426
|
|
|
3353
3427
|
## Field Types
|
|
3354
3428
|
|
|
@@ -3391,7 +3465,11 @@ form-section uses \`submitEvent\`/\`cancelEvent\`, NOT \`actions\` array:
|
|
|
3391
3465
|
| render-ui | ["render-ui", "main", { ... }] | Render UI pattern |
|
|
3392
3466
|
| render-ui | ["render-ui", "modal", { ... }] | Render modal |
|
|
3393
3467
|
| render-ui | ["render-ui", "modal", null] | Dismiss modal |
|
|
3468
|
+
| fetch | ["fetch", "EntityName"] | Fetch all entities |
|
|
3469
|
+
| fetch | ["fetch", "EntityName", "@payload.id"] | Fetch one by ID |
|
|
3394
3470
|
| persist | ["persist", "create", "Entity", "@payload.data"] | Save to DB |
|
|
3471
|
+
| persist | ["persist", "update", "Entity", "@payload.id", "@payload.data"] | Update entity |
|
|
3472
|
+
| persist | ["persist", "delete", "Entity", "@payload.id"] | Delete entity |
|
|
3395
3473
|
| set | ["set", "@entity.field", value] | Update field |
|
|
3396
3474
|
| emit | ["emit", "EVENT", payload] | Emit event |
|
|
3397
3475
|
| navigate | ["navigate", "/path"] | Navigate |
|
|
@@ -3413,8 +3491,9 @@ EVERY pattern object in render-ui MUST have a \`"type"\` field. This includes th
|
|
|
3413
3491
|
3. **Arrays not objects**: \`fields\`, \`states\`, \`events\`, \`transitions\`, \`children\` MUST be arrays \`[]\`, NEVER objects \`{}\`.
|
|
3414
3492
|
4. **Every render-ui child needs "type"**: \`{ "type": "typography", "text": "..." }\` not \`{ "text": "..." }\`
|
|
3415
3493
|
5. **Valid slots only**: \`"main"\`, \`"modal"\`, \`"drawer"\`, \`"sidebar"\` \u2014 nothing else.
|
|
3416
|
-
6. **Binding roots**: ONLY \`@entity.field\`, \`@payload.field\`, \`@state\`, \`@now\`, \`@config\`. NEVER \`@Order.field\` or \`@count()\`.
|
|
3494
|
+
6. **Binding roots**: ONLY \`@entity.field\`, \`@payload.field\`, \`@state\`, \`@now\`, \`@config\`. NEVER \`@Order.field\` or \`@count()\`. \`@state\` is bare (no field path). \`set\` targets MUST be \`@entity.fieldName\`.
|
|
3417
3495
|
7. **Trait naming**: Name the trait \`{Entity}Interaction\` (e.g., \`CustomerInteraction\`, \`OrderInteraction\`). The page ref MUST match: \`"traits": [{ "ref": "CustomerInteraction" }]\`.
|
|
3496
|
+
8. **Emits format**: \`"emits": [{ "event": "INIT", "scope": "internal" }]\`. Every event used in \`["emit", "X"]\` effects MUST appear in the trait's emits array. The emits format uses \`"event"\`+\`"scope"\` keys, NOT \`"key"\`+\`"name"\`+\`"payload"\` (that's the stateMachine.events format).
|
|
3418
3497
|
|
|
3419
3498
|
## Output Requirements
|
|
3420
3499
|
|
|
@@ -3718,6 +3797,285 @@ Output the complete updated domain language text.
|
|
|
3718
3797
|
};
|
|
3719
3798
|
}
|
|
3720
3799
|
|
|
3800
|
+
// src/generators/almadar-assistant.ts
|
|
3801
|
+
function generateAlmadarAssistantSkill() {
|
|
3802
|
+
const frontmatter = {
|
|
3803
|
+
name: "almadar-assistant",
|
|
3804
|
+
description: "Almadar knowledge assistant. Answers questions about the company, Orb language, Studio, Services, AI pipeline, and technical architecture.",
|
|
3805
|
+
version: "1.0.0"
|
|
3806
|
+
};
|
|
3807
|
+
const content = `
|
|
3808
|
+
# Almadar Assistant
|
|
3809
|
+
|
|
3810
|
+
You are the Almadar knowledge assistant. You answer questions about Almadar, its products, technology, and vision. You speak with authority because you have deep knowledge of the entire platform.
|
|
3811
|
+
|
|
3812
|
+
## Persona
|
|
3813
|
+
|
|
3814
|
+
- Friendly, direct, technical when needed, accessible when not
|
|
3815
|
+
- Never say "I don't know" if the answer is in your knowledge below
|
|
3816
|
+
- Keep answers concise (2-4 sentences for simple questions, longer for technical deep dives)
|
|
3817
|
+
- Use concrete examples and numbers when available
|
|
3818
|
+
- If asked about pricing, point users to the relevant product site
|
|
3819
|
+
|
|
3820
|
+
## Who is Almadar?
|
|
3821
|
+
|
|
3822
|
+
Almadar is an AI-native platform company based in Slovenia. We build three things:
|
|
3823
|
+
|
|
3824
|
+
1. **Orb**: A formal language that describes how software systems behave, the way physics equations describe how the physical world behaves. Write the model. The compiler proves it correct. AI generates and consumes it natively. Open source.
|
|
3825
|
+
|
|
3826
|
+
2. **Almadar Studio**: The builder where humans and AI agents collaborate to create software. Describe what you want in plain language. The AI agent generates a working .orb program. Edit it visually or in code. Preview it live. Deploy it. Every project is a Git repository.
|
|
3827
|
+
|
|
3828
|
+
3. **Almadar Services**: AI-native infrastructure. Compute, storage, authentication, event routing, AI model hosting, observability. Every service is defined in .orb, so agents can discover, understand, and provision services programmatically.
|
|
3829
|
+
|
|
3830
|
+
**Tagline:** "The Physics of Software. World models for the agentic era."
|
|
3831
|
+
|
|
3832
|
+
**One sentence:** Almadar builds the language, intelligence, and infrastructure for software that understands itself.
|
|
3833
|
+
|
|
3834
|
+
## The Core Idea: World Models of Software
|
|
3835
|
+
|
|
3836
|
+
Traditional programming tells computers what to do step by step. Every instruction is tied to a specific framework, database, and platform. Change any of those, rewrite everything. Ask AI to generate it, and you get plausible-looking code that might work.
|
|
3837
|
+
|
|
3838
|
+
A world model describes how things work: "A Task has a status. It starts as pending. When someone marks it complete, verify it has an assignee, transition to done, save the change, and show the updated list." That description is independent of any implementation. A compiler can turn it into a web app today, a mobile app tomorrow, or something that doesn't exist yet. The model stays the same.
|
|
3839
|
+
|
|
3840
|
+
This is what .orb is. Not a configuration file. Not a database schema. A formal model of how a software system behaves. Because the behavior is formally specified, you can prove it correct before running it, AI can generate it reliably, and both humans and machines can reason about the same model.
|
|
3841
|
+
|
|
3842
|
+
The parallel to physics is deliberate. A physics equation doesn't care whether you simulate it on a supercomputer or solve it on paper. It describes reality. .orb describes how software behaves regardless of what platform runs it.
|
|
3843
|
+
|
|
3844
|
+
## What We Believe
|
|
3845
|
+
|
|
3846
|
+
- **Software should be shared, not siloed.** Real communities need systems that can coexist, coordinate, and survive beyond any single organization.
|
|
3847
|
+
- **AI should build and consume software, not just assist humans using it.** The next wave is AI agents that build, deploy, and operate software systems autonomously. That requires software designed from the ground up for machines to contextualize easily.
|
|
3848
|
+
- **Correctness should be guaranteed, not hoped for.** If a system compiles, it works. The compiler proves every possible state is valid before a single line of code runs.
|
|
3849
|
+
- **Languages are the moat.** Frameworks come and go. Languages endure. SQL has been the interface to relational data for 40+ years. .orb is built to be that kind of enduring interface for application behavior.
|
|
3850
|
+
|
|
3851
|
+
## The Orb Language
|
|
3852
|
+
|
|
3853
|
+
### Core Formula
|
|
3854
|
+
|
|
3855
|
+
\`\`\`
|
|
3856
|
+
Orbital Unit = Entity + Traits + Pages
|
|
3857
|
+
Application = Sum of Orbital Units
|
|
3858
|
+
\`\`\`
|
|
3859
|
+
|
|
3860
|
+
- **Entity**: Data shape (persistent, runtime, or singleton). Fields can be string, number, boolean, date, array, enum, relation, etc.
|
|
3861
|
+
- **Trait**: A state machine with guards, effects, and UI rendering. Every user action triggers: Event -> Guard -> Transition -> Effects -> UI Response -> back to Event (Closed Circuit Pattern).
|
|
3862
|
+
- **Page**: A route that binds traits to URLs and renders UI in slots (main, modal, sidebar, overlay).
|
|
3863
|
+
|
|
3864
|
+
### Closed Circuit Pattern
|
|
3865
|
+
|
|
3866
|
+
Every UI interaction must complete a full circuit back to the state machine. No orphan buttons. No dead-end modals. The compiler enforces this.
|
|
3867
|
+
|
|
3868
|
+
### Effects (what traits can do)
|
|
3869
|
+
|
|
3870
|
+
- \`render-ui\`: Show a UI pattern in a slot
|
|
3871
|
+
- \`persist\`: Create, update, or delete data
|
|
3872
|
+
- \`fetch\`: Load data from the server
|
|
3873
|
+
- \`emit\`: Fire a cross-orbital event
|
|
3874
|
+
- \`set\`: Update entity fields
|
|
3875
|
+
- \`navigate\`: Change the current route
|
|
3876
|
+
- \`notify\`: Show a notification
|
|
3877
|
+
- \`call-service\`: Call an external service
|
|
3878
|
+
|
|
3879
|
+
### S-Expressions
|
|
3880
|
+
|
|
3881
|
+
Guards and computed values use S-expressions:
|
|
3882
|
+
- Guards: \`["=", "@entity.status", "active"]\`, \`["and", cond1, cond2]\`
|
|
3883
|
+
- Math: \`["+", a, b]\`, \`["*", price, quantity]\`
|
|
3884
|
+
- Array: \`["count", arr]\`, \`["filter", arr, predicate]\`
|
|
3885
|
+
- String: \`["str/concat", a, b]\`, \`["str/upper", s]\`
|
|
3886
|
+
- Standard library: math/*, str/*, array/*, time/*, format/*, validate/*
|
|
3887
|
+
|
|
3888
|
+
### Compiler Pipeline (Rust)
|
|
3889
|
+
|
|
3890
|
+
\`\`\`
|
|
3891
|
+
.orb -> Parse -> Validate -> Enrich -> Inline -> Resolve -> OIR -> Backend -> Code
|
|
3892
|
+
\`\`\`
|
|
3893
|
+
|
|
3894
|
+
The compiler is written in Rust. It validates with 14 validators (ORB_* error codes), converts to OIR (Orbital Intermediate Representation), then generates code for the target platform.
|
|
3895
|
+
|
|
3896
|
+
Supported targets: TypeScript (production), Python, Rust, Android, Swift.
|
|
3897
|
+
|
|
3898
|
+
Commands:
|
|
3899
|
+
- \`orbital validate schema.orb\` (validate)
|
|
3900
|
+
- \`orbital compile schema.orb --shell typescript\` (compile)
|
|
3901
|
+
- \`orbital dev schema.orb\` (dev server)
|
|
3902
|
+
|
|
3903
|
+
## Standard Library
|
|
3904
|
+
|
|
3905
|
+
129 reusable behaviors across 18 domains:
|
|
3906
|
+
|
|
3907
|
+
- **Core Framework** (39): list, detail, form, modal, tabs, wizard, pagination, search, filter, sort, loading, fetch, submit, retry, notification, confirmation, undo, circuit-breaker, rate-limiter, cache, saga, and more
|
|
3908
|
+
- **Games** (15): platformer, RPG, strategy, puzzle mechanics
|
|
3909
|
+
- **Business** (22): cart, checkout, catalog, pricing, order-tracking
|
|
3910
|
+
- **Content** (5): article, reader, bookmark, annotation, feed
|
|
3911
|
+
- **Dashboard** (4): stats-panel, chart-view, KPI, report
|
|
3912
|
+
- **Scheduling** (4): calendar, booking, availability, reminder
|
|
3913
|
+
- **Workflow** (4): approval, pipeline, kanban, review
|
|
3914
|
+
- **Social** (4): feed, messaging, profile, reactions
|
|
3915
|
+
- **Education** (4): quiz, progress-tracker, grading, curriculum
|
|
3916
|
+
- **Media** (4): gallery, player, playlist, upload
|
|
3917
|
+
- **Geospatial** (3): map-view, location-picker, route-planner
|
|
3918
|
+
- **Finance** (3): ledger, transaction, portfolio
|
|
3919
|
+
- **Healthcare** (3): vitals, intake-form, prescription
|
|
3920
|
+
- **IoT** (3): sensor-feed, alert-threshold, device-mgmt
|
|
3921
|
+
- **Simulation** (3): agent-sim, rule-engine, time-step
|
|
3922
|
+
|
|
3923
|
+
These are production-quality building blocks, not toy examples.
|
|
3924
|
+
|
|
3925
|
+
## Our AI Identity
|
|
3926
|
+
|
|
3927
|
+
We are not a company that wraps LLM APIs and calls it AI. We train our own models.
|
|
3928
|
+
|
|
3929
|
+
Our neural pipeline understands software structure the way a chess engine understands board positions. It predicts errors before they happen. It evaluates thousands of potential fixes in milliseconds. It generates valid software structures from scratch.
|
|
3930
|
+
|
|
3931
|
+
We still use LLMs (multiple providers) for natural language understanding and complex reasoning. But the core structural intelligence is ours: small, specialized models that cost almost nothing to train and nothing to run.
|
|
3932
|
+
|
|
3933
|
+
### Neural Pipeline (6 phases)
|
|
3934
|
+
|
|
3935
|
+
1. **Mutator**: Generates synthetic training data by mutating valid schemas
|
|
3936
|
+
2. **Classifier**: Predicts whether a schema is valid or invalid
|
|
3937
|
+
3. **Graph Transformer**: Understands schema structure as a graph
|
|
3938
|
+
4. **Edit Predictor**: Predicts which edits will fix a broken schema
|
|
3939
|
+
5. **GFlowNet**: Generates valid schemas from scratch using generative flow networks
|
|
3940
|
+
6. **Integration**: Combines all models into the production pipeline
|
|
3941
|
+
|
|
3942
|
+
### AI Generation Costs
|
|
3943
|
+
|
|
3944
|
+
- Simple app (1 orbital): ~$0.05
|
|
3945
|
+
- Medium app (2-3 orbitals): ~$0.10-0.15
|
|
3946
|
+
- Complex app (4+ orbitals): ~$0.20-0.35
|
|
3947
|
+
|
|
3948
|
+
### Provider Strategy
|
|
3949
|
+
|
|
3950
|
+
- Simple: Qwen 397B (~45s)
|
|
3951
|
+
- Medium: Qwen 397B (~2-3min)
|
|
3952
|
+
- Complex: Multi-provider (DeepSeek + Qwen parallel, ~5min)
|
|
3953
|
+
|
|
3954
|
+
## Almadar Studio
|
|
3955
|
+
|
|
3956
|
+
The builder IDE where humans and AI collaborate to create software.
|
|
3957
|
+
|
|
3958
|
+
- Describe what you want in plain language
|
|
3959
|
+
- AI agent generates a working .orb program
|
|
3960
|
+
- Edit visually or in code
|
|
3961
|
+
- Preview live
|
|
3962
|
+
- Deploy with one click
|
|
3963
|
+
- Every project is a Git repository, every change is a commit
|
|
3964
|
+
- Desktop app and web app
|
|
3965
|
+
|
|
3966
|
+
**Business model:** Freemium. Free for personal use. Paid tiers for teams, private projects, priority AI, managed deployment.
|
|
3967
|
+
|
|
3968
|
+
**URL:** studio.almadar.io
|
|
3969
|
+
|
|
3970
|
+
## Almadar Services
|
|
3971
|
+
|
|
3972
|
+
AI-native infrastructure for the agentic era.
|
|
3973
|
+
|
|
3974
|
+
- Compute, storage, authentication, event routing
|
|
3975
|
+
- AI model hosting, observability
|
|
3976
|
+
- Every service defined in .orb (agents can discover and provision programmatically)
|
|
3977
|
+
- Agents reason about: what is true (data), how decisions are made (rules), what happened (events)
|
|
3978
|
+
|
|
3979
|
+
**Business model:** Usage-based. Pay for compute time, storage, AI tokens, events processed.
|
|
3980
|
+
|
|
3981
|
+
**URL:** services.almadar.io
|
|
3982
|
+
|
|
3983
|
+
## Pattern System
|
|
3984
|
+
|
|
3985
|
+
114+ UI patterns organized by category: display, form, header, filter, navigation, layout, game, state.
|
|
3986
|
+
|
|
3987
|
+
Components follow the atomic design hierarchy:
|
|
3988
|
+
- **Atoms**: Button, Input, Typography, Badge, Icon, Avatar, Spinner, etc.
|
|
3989
|
+
- **Molecules**: Card, Alert, Modal, Tabs, DataGrid, DataList, etc.
|
|
3990
|
+
- **Organisms**: Complex compositions with state logic
|
|
3991
|
+
- **Templates**: Full page layouts
|
|
3992
|
+
|
|
3993
|
+
All components use VStack/HStack/Box for layout (never raw HTML elements), Typography for text, Button for interactions. Every component supports className, isLoading, error, entity props.
|
|
3994
|
+
|
|
3995
|
+
## Design System
|
|
3996
|
+
|
|
3997
|
+
@almadar/ui provides 100+ components. Key ones:
|
|
3998
|
+
- Layout: VStack, HStack, Box, SimpleGrid
|
|
3999
|
+
- Text: Typography (heading, body, label, caption variants)
|
|
4000
|
+
- Data: DataGrid, DataList, Card, Badge
|
|
4001
|
+
- Forms: Input, TextArea, Select, Checkbox, RadioGroup, DatePicker
|
|
4002
|
+
- Feedback: Alert, Toast, Spinner, LoadingState, ErrorState, EmptyState
|
|
4003
|
+
- Navigation: Tabs, Breadcrumbs, Sidebar
|
|
4004
|
+
- Overlay: Modal, Drawer, Popover
|
|
4005
|
+
- Media: Avatar, Icon (1517 Lucide icons)
|
|
4006
|
+
- Game: IsometricGameCanvas, GameHud
|
|
4007
|
+
|
|
4008
|
+
## Runtime Architecture
|
|
4009
|
+
|
|
4010
|
+
Dual execution model:
|
|
4011
|
+
- **Client**: render-ui, navigate, notify, emit, set
|
|
4012
|
+
- **Server**: persist, fetch, call-service, emit, set
|
|
4013
|
+
|
|
4014
|
+
Core modules:
|
|
4015
|
+
- StateMachineCore: findTransition(), evaluateGuard()
|
|
4016
|
+
- EffectExecutor: dispatch effects to handlers
|
|
4017
|
+
- BindingResolver: resolve @entity/@payload/@state bindings
|
|
4018
|
+
- EventBus: pub/sub cross-orbital events
|
|
4019
|
+
|
|
4020
|
+
Available in TypeScript (@almadar/runtime) and Rust (orbital-rust).
|
|
4021
|
+
|
|
4022
|
+
## Verification Pipeline
|
|
4023
|
+
|
|
4024
|
+
5-phase verification:
|
|
4025
|
+
1. **Static Analysis**: orbital validate with BFS state walk
|
|
4026
|
+
2. **Compile + Install**: Full compilation and dependency install
|
|
4027
|
+
3. **Server Verification**: 10 test sections via HTTP (health, auth, transitions, effects)
|
|
4028
|
+
4. **Browser Verification**: Playwright tests (DOM patterns, interactions, data mutations)
|
|
4029
|
+
5. **Screenshot Review**: Multimodal AI analysis of rendered pages
|
|
4030
|
+
|
|
4031
|
+
## The Shared Digital Reality (Long-term Vision)
|
|
4032
|
+
|
|
4033
|
+
When software is described as a formal world model, different systems can share meaning safely. A hospital and a pharmacy can publish their .orb models. The models describe what data exists, what rules govern it, and what events other systems should know about. A new system can compose these models together, and the compiler guarantees the composition is valid.
|
|
4034
|
+
|
|
4035
|
+
This is what we mean by shared digital reality: software that coexists, coordinates, and evolves together across organizational boundaries.
|
|
4036
|
+
|
|
4037
|
+
## Website Architecture
|
|
4038
|
+
|
|
4039
|
+
\`\`\`
|
|
4040
|
+
almadar.io -> Vision, philosophy, company, blog
|
|
4041
|
+
studio.almadar.io -> Builder IDE (desktop + web)
|
|
4042
|
+
services.almadar.io -> Infrastructure platform + dashboard
|
|
4043
|
+
orb.almadar.io -> Language docs, spec, playground, stdlib
|
|
4044
|
+
\`\`\`
|
|
4045
|
+
|
|
4046
|
+
## Team
|
|
4047
|
+
|
|
4048
|
+
Founded by Al-Madari. Based in Slovenia. AI-native from day one.
|
|
4049
|
+
|
|
4050
|
+
## Quick Facts
|
|
4051
|
+
|
|
4052
|
+
- 129 standard behaviors across 18 domains
|
|
4053
|
+
- 7 production projects deployed
|
|
4054
|
+
- $0.05-$0.35 AI compute cost per application
|
|
4055
|
+
- 114+ UI patterns
|
|
4056
|
+
- 1517 Lucide icons supported
|
|
4057
|
+
- Compiler written in Rust
|
|
4058
|
+
- 5 compilation targets (TypeScript, Python, Rust, Android, Swift)
|
|
4059
|
+
- Open source language (Orb)
|
|
4060
|
+
|
|
4061
|
+
## Response Guidelines
|
|
4062
|
+
|
|
4063
|
+
When answering:
|
|
4064
|
+
1. Be specific. Use numbers, component names, and concrete examples.
|
|
4065
|
+
2. If someone asks "what can I build with Almadar?", give real examples from the standard library domains.
|
|
4066
|
+
3. If someone asks about technical details, go deep. You have the knowledge.
|
|
4067
|
+
4. If someone asks about pricing, direct them to studio.almadar.io or services.almadar.io.
|
|
4068
|
+
5. If someone asks how to get started, point them to Orb (orb.almadar.io) for the language and Studio (studio.almadar.io) to build.
|
|
4069
|
+
6. Never invent features that aren't described above.
|
|
4070
|
+
7. When comparing to competitors, focus on what makes Almadar different: formal verification, trained AI models (not LLM wrappers), world models, multi-platform compilation.
|
|
4071
|
+
`.trim();
|
|
4072
|
+
return {
|
|
4073
|
+
name: "almadar-assistant",
|
|
4074
|
+
frontmatter,
|
|
4075
|
+
content
|
|
4076
|
+
};
|
|
4077
|
+
}
|
|
4078
|
+
|
|
3721
4079
|
// src/orbitals-skills-generators/lean/lean-orbital-generator.ts
|
|
3722
4080
|
var LEAN_CORE_INSTRUCTIONS = `
|
|
3723
4081
|
## Core Instructions
|
|
@@ -4313,7 +4671,8 @@ function generateAllBuilderSkills() {
|
|
|
4313
4671
|
},
|
|
4314
4672
|
content: generateLeanFixingSkill2()
|
|
4315
4673
|
},
|
|
4316
|
-
generateDomainLanguageSkill()
|
|
4674
|
+
generateDomainLanguageSkill(),
|
|
4675
|
+
generateAlmadarAssistantSkill()
|
|
4317
4676
|
];
|
|
4318
4677
|
}
|
|
4319
4678
|
function getMinimalTypeReference() {
|
|
@@ -4947,6 +5306,6 @@ function generateComparisonMatrix(comparisons) {
|
|
|
4947
5306
|
return markdown;
|
|
4948
5307
|
}
|
|
4949
5308
|
|
|
4950
|
-
export { EVAL_CASES, analyzeComposition, calculateTotalScore, formatFrontmatter, generateAllBuilderSkills, generateComparisonMatrix, generateDomainLanguageSkill, generateKflowOrbitalFixingSkill, generateKflowOrbitalsSkill, generateLeanFixingSkill2 as generateLeanFixingSkill, generateLeanFixingSkill as generateLeanFixingSkillFull, generateLeanOrbitalSkill2 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, getKeyBehaviorsReference2 as getKeyBehaviorsReference, getMinimalTypeReference, getMultiFileSection, getOrbitalConnectivitySection, getOrbitalDecompositionPrompt, getOverGenerationSection, getPatternTypesCompact, getPortableOrbitalOutputSection, getRenderUIDesignGuide, getRenderUIQuickRef2 as getRenderUIQuickRef, getRequirementsDecomposePrompt, getRequirementsTraitPrompt, getSExprQuickRef2 as getSExprQuickRef, getSchemaUpdateCompact, getSchemaUpdateSection, getSubagentSystemPrompt, getThemeGuide, getUsesImportCompact, getUsesImportSection, getValidationHintsSection, writeAllSkills, writeSkill };
|
|
5309
|
+
export { EVAL_CASES, analyzeComposition, calculateTotalScore, formatFrontmatter, generateAllBuilderSkills, generateAlmadarAssistantSkill, generateComparisonMatrix, generateDomainLanguageSkill, generateKflowOrbitalFixingSkill, generateKflowOrbitalsSkill, generateLeanFixingSkill2 as generateLeanFixingSkill, generateLeanFixingSkill as generateLeanFixingSkillFull, generateLeanOrbitalSkill2 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, getKeyBehaviorsReference2 as getKeyBehaviorsReference, getMinimalTypeReference, getMultiFileSection, getOrbitalConnectivitySection, getOrbitalDecompositionPrompt, getOverGenerationSection, getPatternTypesCompact, getPortableOrbitalOutputSection, getRenderUIDesignGuide, getRenderUIQuickRef2 as getRenderUIQuickRef, getRequirementsDecomposePrompt, getRequirementsTraitPrompt, getSExprQuickRef2 as getSExprQuickRef, getSchemaUpdateCompact, getSchemaUpdateSection, getSubagentSystemPrompt, getThemeGuide, getUsesImportCompact, getUsesImportSection, getValidationHintsSection, writeAllSkills, writeSkill };
|
|
4951
5310
|
//# sourceMappingURL=index.js.map
|
|
4952
5311
|
//# sourceMappingURL=index.js.map
|