@almadar/skills 2.0.5 → 2.2.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.js CHANGED
@@ -564,6 +564,7 @@ Use a singleton entity for filter state + \`query\` prop on entity-table:
564
564
  "fields": [{ "name": "status", "type": "string" }, { "name": "search", "type": "string" }] } }
565
565
  \`\`\`
566
566
  Reference: \`["render-ui", "main", { "type": "entity-table", "entity": "Task", "query": "@TaskQuery" }]\`
567
+
567
568
  `;
568
569
  }
569
570
  function getValidationHintsSection() {
@@ -583,6 +584,12 @@ function getValidationHintsSection() {
583
584
  | ORB_EFF_SET_REQUIRES_ENTITY | Change @payload.field to @entity.field in set effects |
584
585
  | ORB_RUI_UNKNOWN_ITEM_ACTION_PROP | Remove invalid props (like \`condition\`), use \`showWhen\` |
585
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"]\`. |
586
593
  `;
587
594
  }
588
595
 
@@ -3331,6 +3338,7 @@ Every orbital MUST have this exact structure:
3331
3338
  "name": "TraitName",
3332
3339
  "category": "interaction",
3333
3340
  "linkedEntity": "EntityName",
3341
+ "emits": [{ "event": "INIT", "scope": "internal" }],
3334
3342
  "stateMachine": {
3335
3343
  "states": [
3336
3344
  { "name": "Browsing", "isInitial": true },
@@ -3389,6 +3397,9 @@ Every orbital MUST have this exact structure:
3389
3397
  2. **Entity Name**: Must match the orbital's primary entity
3390
3398
  3. **Collection**: Plural lowercase version of entity name (e.g., "products" for Product)
3391
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.
3392
3403
 
3393
3404
  ## Common Mistakes to Avoid
3394
3405
 
@@ -3401,10 +3412,17 @@ Every orbital MUST have this exact structure:
3401
3412
  - \u274C WRONG: Bare \`@entity\` without a field path \u2014 use \`@entity.fieldName\`
3402
3413
  - \u274C WRONG: \`@Product.name\`, \`@Order.status\`, \`@Customer.email\` \u2014 NEVER use entity TYPE as binding root
3403
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\`
3404
3419
  - \u2705 CORRECT: Full entity object with name, collection, persistence, fields
3405
3420
  - \u2705 CORRECT: \`@entity.name\`, \`@entity.status\`, \`@entity.email\` \u2014 ALWAYS use \`@entity\` as the root
3406
3421
  - \u2705 CORRECT: Only valid binding roots: \`@entity\`, \`@payload\`, \`@state\`, \`@now\`, \`@config\`
3407
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
3408
3426
 
3409
3427
  ## Field Types
3410
3428
 
@@ -3447,7 +3465,11 @@ form-section uses \`submitEvent\`/\`cancelEvent\`, NOT \`actions\` array:
3447
3465
  | render-ui | ["render-ui", "main", { ... }] | Render UI pattern |
3448
3466
  | render-ui | ["render-ui", "modal", { ... }] | Render modal |
3449
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 |
3450
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 |
3451
3473
  | set | ["set", "@entity.field", value] | Update field |
3452
3474
  | emit | ["emit", "EVENT", payload] | Emit event |
3453
3475
  | navigate | ["navigate", "/path"] | Navigate |
@@ -3469,8 +3491,9 @@ EVERY pattern object in render-ui MUST have a \`"type"\` field. This includes th
3469
3491
  3. **Arrays not objects**: \`fields\`, \`states\`, \`events\`, \`transitions\`, \`children\` MUST be arrays \`[]\`, NEVER objects \`{}\`.
3470
3492
  4. **Every render-ui child needs "type"**: \`{ "type": "typography", "text": "..." }\` not \`{ "text": "..." }\`
3471
3493
  5. **Valid slots only**: \`"main"\`, \`"modal"\`, \`"drawer"\`, \`"sidebar"\` \u2014 nothing else.
3472
- 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\`.
3473
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).
3474
3497
 
3475
3498
  ## Output Requirements
3476
3499
 
@@ -3774,6 +3797,926 @@ Output the complete updated domain language text.
3774
3797
  };
3775
3798
  }
3776
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
+
4079
+ // src/generators/orb.ts
4080
+ function generateOrbSkill() {
4081
+ const frontmatter = {
4082
+ name: "orb",
4083
+ description: "Generate .orb programs using molecule-first composition. Atoms + molecules only, no organisms.",
4084
+ allowedTools: ["Read", "Write", "Edit", "generate_orbital", "generate_schema_orchestrated", "finish_task", "query_schema_structure", "extract_chunk", "apply_chunk"],
4085
+ version: "1.0.0"
4086
+ };
4087
+ const content = generateOrbSkillContent();
4088
+ return {
4089
+ name: "orb",
4090
+ frontmatter,
4091
+ content
4092
+ };
4093
+ }
4094
+ function generateOrbSkillContent() {
4095
+ return `# Orb Generation Skill (Molecule-First)
4096
+
4097
+ > Generate .orb programs using Orbital Units: Entity x Traits x Patterns
4098
+ > Pattern vocabulary: atoms + molecules only. No organisms.
4099
+
4100
+ ${getArchitectureSection()}
4101
+
4102
+ ---
4103
+
4104
+ ${getSExprQuickRef()}
4105
+
4106
+ ---
4107
+
4108
+ ${getMoleculeFirstDesignGuide()}
4109
+
4110
+ ---
4111
+
4112
+ ${getThemeGuide()}
4113
+
4114
+ ---
4115
+
4116
+ ${getBannedProps()}
4117
+
4118
+ ---
4119
+
4120
+ ${getFlowPatternSection()}
4121
+
4122
+ ---
4123
+
4124
+ ${getDecompositionCompact()}
4125
+
4126
+ ---
4127
+
4128
+ ${getPortableOrbitalOutputSection()}
4129
+
4130
+ ---
4131
+
4132
+ ${getConnectivityCompact()}
4133
+
4134
+ ---
4135
+
4136
+ ${getContextUsageCompact()}
4137
+
4138
+ ---
4139
+
4140
+ ${getCommonErrorsSection("top6")}
4141
+
4142
+ ${getToolWorkflowSection2()}
4143
+
4144
+ ${getCriticalOutputRequirements2()}
4145
+
4146
+ ${getMoleculeFirstExample()}
4147
+ `;
4148
+ }
4149
+ function getMoleculeFirstDesignGuide() {
4150
+ return `## Render-UI Molecule-First Design Guide
4151
+
4152
+ ### The Five Rules of Composition (MANDATORY)
4153
+
4154
+ | Rule | Requirement |
4155
+ |------|-------------|
4156
+ | **1** | **Single Render-UI** per transition |
4157
+ | **2** | **Two Levels**: Atoms (2+) + Molecules (1+) |
4158
+ | **3** | **Layout Wrapper**: Root must be \`stack\`, \`card\`, \`box\`, or \`simple-grid\` |
4159
+ | **4** | **Theme Variables**: ALL visual props use CSS vars |
4160
+ | **5** | **Composable**: Build from small pieces, never use rigid organisms |
4161
+
4162
+ ---
4163
+
4164
+ ### Pattern Vocabulary
4165
+
4166
+ These are the ONLY patterns you may use. They are derived from 104 production behaviors across 18 domains.
4167
+
4168
+ #### Atoms (Basic UI Elements)
4169
+
4170
+ | Pattern | Purpose | Key Props |
4171
+ |---------|---------|-----------|
4172
+ | \`typography\` | All text content | \`variant\` (h1-h6, body, caption), \`text\`, \`color\` |
4173
+ | \`button\` | User actions | \`label\`, \`event\`, \`variant\` (primary, secondary, ghost, destructive) |
4174
+ | \`icon\` | Lucide icons | \`name\`, \`size\`, \`color\` |
4175
+ | \`badge\` | Status indicators | \`text\`, \`variant\` (primary, success, warning, error) |
4176
+ | \`divider\` | Visual separation | \`orientation\` |
4177
+ | \`avatar\` | User/entity images | \`src\`, \`name\`, \`size\` |
4178
+ | \`progress-bar\` | Progress indicators | \`value\`, \`max\`, \`label\` |
4179
+ | \`status-dot\` | Status indicator dots | \`status\`, \`label\` |
4180
+ | \`star-rating\` | Rating display | \`value\`, \`max\` |
4181
+
4182
+ #### Layout Molecules
4183
+
4184
+ | Pattern | Purpose | Key Props |
4185
+ |---------|---------|-----------|
4186
+ | \`stack\` | Flex layout (V/H) | \`direction\` (vertical/horizontal), \`gap\`, \`align\`, \`justify\`, \`wrap\` |
4187
+ | \`card\` | Content grouping | \`padding\`, \`border\`, \`rounded\`, \`shadow\`, \`children\` |
4188
+ | \`box\` | Visual container | \`padding\`, \`bg\`, \`border\`, \`rounded\`, \`shadow\`, \`children\` |
4189
+ | \`simple-grid\` | Grid layout | \`cols\`, \`gap\`, \`children\` |
4190
+
4191
+ #### Data Molecules
4192
+
4193
+ | Pattern | Purpose | Key Props |
4194
+ |---------|---------|-----------|
4195
+ | \`data-grid\` | Tabular data display | \`entity\`, \`fields\`, \`itemActions\`, \`cols\`, \`gap\` |
4196
+ | \`data-list\` | Vertical list display | \`entity\`, \`fields\`, \`itemActions\` |
4197
+ | \`form-section\` | Form input groups | \`entity\`, \`fields\`, \`submitEvent\`, \`cancelEvent\` |
4198
+ | \`search-input\` | Search fields | \`placeholder\`, \`event\` |
4199
+ | \`filter-group\` | Filter controls | \`filters\`, \`event\` |
4200
+ | \`tabs\` | Tabbed content | \`tabs\`, \`activeTab\` |
4201
+
4202
+ #### Metric/Chart Molecules
4203
+
4204
+ | Pattern | Purpose | Key Props |
4205
+ |---------|---------|-----------|
4206
+ | \`stat-display\` | Single KPI display | \`label\`, \`value\`, \`icon\` |
4207
+ | \`stats\` | Multiple stat cards | \`entity\`, \`items\` |
4208
+ | \`stat-badge\` | Stat with badge | \`label\`, \`value\`, \`variant\` |
4209
+ | \`meter\` | Metric gauge | \`value\`, \`max\`, \`label\` |
4210
+ | \`line-chart\` | Line chart | \`entity\`, \`xField\`, \`yField\` |
4211
+ | \`chart\` | Generic chart | \`entity\`, \`type\`, \`fields\` |
4212
+ | \`trend-indicator\` | Trend up/down | \`value\`, \`direction\` |
4213
+ | \`score-display\` | Score/count | \`value\`, \`label\` |
4214
+
4215
+ #### State Molecules
4216
+
4217
+ | Pattern | Purpose | Key Props |
4218
+ |---------|---------|-----------|
4219
+ | \`empty-state\` | No data fallback | \`title\`, \`description\`, \`icon\` |
4220
+ | \`loading-state\` | Loading spinner | \`message\` |
4221
+
4222
+ #### Form Molecules
4223
+
4224
+ | Pattern | Purpose | Key Props |
4225
+ |---------|---------|-----------|
4226
+ | \`textarea\` | Multi-line input | \`placeholder\`, \`rows\` |
4227
+ | \`range-slider\` | Range input | \`min\`, \`max\`, \`step\`, \`value\` |
4228
+ | \`upload-drop-zone\` | File upload | \`accept\`, \`maxSize\` |
4229
+ | \`calendar-grid\` | Date picker grid | \`selectedDate\`, \`event\` |
4230
+
4231
+ #### Navigation Molecules
4232
+
4233
+ | Pattern | Purpose | Key Props |
4234
+ |---------|---------|-----------|
4235
+ | \`wizard-progress\` | Multi-step progress | \`steps\`, \`currentStep\` |
4236
+ | \`wizard-navigation\` | Step navigation | \`steps\`, \`currentStep\` |
4237
+ | \`action-buttons\` | Action button group | \`actions\` |
4238
+
4239
+ #### Specialty Molecules
4240
+
4241
+ | Pattern | Purpose | Key Props |
4242
+ |---------|---------|-----------|
4243
+ | \`lightbox\` | Image/media viewer | \`src\`, \`alt\` |
4244
+ | \`map-view\` | Map display | \`center\`, \`zoom\`, \`markers\` |
4245
+ | \`health-bar\` | Health/HP bar | \`value\`, \`max\` |
4246
+ | \`d-pad\` | Directional pad | \`events\` |
4247
+ | \`combat-log\` | Event log | \`entries\` |
4248
+ | \`dialogue-box\` | Dialogue/chat | \`speaker\`, \`text\` |
4249
+
4250
+ #### Game Canvas Molecules
4251
+
4252
+ | Pattern | Purpose | Key Props |
4253
+ |---------|---------|-----------|
4254
+ | \`isometric-canvas\` | 3D isometric canvas | \`tiles\`, \`units\` |
4255
+ | \`platformer-canvas\` | 2D platformer | \`entities\`, \`viewport\` |
4256
+ | \`simulation-canvas\` | Simulation display | \`entities\`, \`viewport\` |
4257
+ | \`canvas-effect\` | Canvas visual effects | \`effect\`, \`duration\` |
4258
+ | \`game-hud\` | Game HUD overlay | \`stats\`, \`actions\` |
4259
+ | \`game-menu\` | Game menu | \`items\` |
4260
+ | \`game-over-screen\` | End screen | \`score\`, \`message\` |
4261
+ | \`inventory-panel\` | Inventory display | \`items\`, \`slots\` |
4262
+
4263
+ ---
4264
+
4265
+ ### BANNED Patterns (NEVER USE)
4266
+
4267
+ These organism-level patterns are deprecated. Use the molecule equivalents:
4268
+
4269
+ | Banned Pattern | Use Instead |
4270
+ |---------------|-------------|
4271
+ | \`entity-table\` | \`data-grid\` with \`entity\`, \`fields\`, \`itemActions\` |
4272
+ | \`entity-list\` | \`data-list\` with \`entity\`, \`fields\`, \`itemActions\` |
4273
+ | \`entity-cards\` | \`data-grid\` with \`cols: 3\`, or compose with \`card\` children in a \`simple-grid\` |
4274
+ | \`page-header\` | Compose with \`stack\` (horizontal) + \`typography\` (h1) + \`button\` |
4275
+ | \`detail-panel\` | Compose with \`stack\` (vertical) + \`typography\` + \`badge\` + \`divider\` |
4276
+ | \`timeline\` | Compose with \`data-list\` or \`stack\` + timestamp items |
4277
+ | \`crud-template\` | Compose from \`data-grid\` + \`form-section\` + layout molecules |
4278
+ | \`list-template\` | Compose from \`data-list\` + \`search-input\` + layout molecules |
4279
+ | \`detail-template\` | Compose from \`stack\` + \`typography\` + \`badge\` + \`button\` |
4280
+
4281
+ ---
4282
+
4283
+ ### Layout-First Structure (Rule 3)
4284
+
4285
+ Root element MUST be a layout molecule:
4286
+
4287
+ \`\`\`json
4288
+ { "type": "stack", "direction": "vertical", "gap": "lg", "children": [...] }
4289
+ { "type": "stack", "direction": "horizontal", "gap": "md", "children": [...] }
4290
+ { "type": "box", "padding": "lg", "bg": "var(--color-card)", "children": [...] }
4291
+ { "type": "simple-grid", "cols": 3, "gap": "md", "children": [...] }
4292
+ \`\`\`
4293
+
4294
+ #### Layout Props Reference
4295
+
4296
+ **Stack (VStack/HStack)**
4297
+ \`\`\`json
4298
+ {
4299
+ "type": "stack",
4300
+ "direction": "vertical" | "horizontal",
4301
+ "gap": "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl",
4302
+ "align": "start" | "center" | "end" | "stretch",
4303
+ "justify": "start" | "center" | "end" | "between" | "around",
4304
+ "wrap": true | false
4305
+ }
4306
+ \`\`\`
4307
+
4308
+ **Box**
4309
+ \`\`\`json
4310
+ {
4311
+ "type": "box",
4312
+ "padding": "none" | "xs" | "sm" | "md" | "lg" | "xl",
4313
+ "bg": "var(--color-card)" | "var(--color-muted)" | "var(--color-primary)",
4314
+ "border": true | false,
4315
+ "rounded": "var(--radius-md)" | "var(--radius-lg)",
4316
+ "shadow": "var(--shadow-sm)" | "var(--shadow-md)"
4317
+ }
4318
+ \`\`\`
4319
+
4320
+ ---
4321
+
4322
+ ### Composition Pattern: Header Row
4323
+
4324
+ Instead of \`page-header\`, compose with atoms:
4325
+
4326
+ \`\`\`json
4327
+ {
4328
+ "type": "stack", "direction": "horizontal", "justify": "between", "align": "center",
4329
+ "children": [
4330
+ { "type": "typography", "variant": "h1", "text": "Tasks" },
4331
+ { "type": "button", "label": "New Task", "event": "CREATE", "variant": "primary", "icon": "plus" }
4332
+ ]
4333
+ }
4334
+ \`\`\`
4335
+
4336
+ ### Composition Pattern: Stat Cards
4337
+
4338
+ \`\`\`json
4339
+ {
4340
+ "type": "stack", "direction": "horizontal", "gap": "md", "wrap": true,
4341
+ "children": [
4342
+ { "type": "stat-display", "label": "Total", "value": "--", "icon": "list" },
4343
+ { "type": "stat-display", "label": "Active", "value": "--", "icon": "activity" },
4344
+ { "type": "stat-display", "label": "Done", "value": "--", "icon": "check-circle" }
4345
+ ]
4346
+ }
4347
+ \`\`\`
4348
+
4349
+ ### Composition Pattern: Data View with Actions
4350
+
4351
+ \`\`\`json
4352
+ {
4353
+ "type": "data-grid", "entity": "Task", "fields": ["title", "status", "priority"],
4354
+ "itemActions": [
4355
+ { "event": "VIEW", "label": "View" },
4356
+ { "event": "EDIT", "label": "Edit" },
4357
+ { "event": "DELETE", "label": "Delete" }
4358
+ ]
4359
+ }
4360
+ \`\`\`
4361
+
4362
+ ---
4363
+
4364
+ ### Critical Validation Rules
4365
+
4366
+ | Element | Correct Format | Wrong Format | Error |
4367
+ |---------|----------------|--------------|-------|
4368
+ | **Events** | \`{ "key": "INIT", "name": "Init" }\` | \`"INIT"\` | ORB_T_EVT_INVALID_FORMAT |
4369
+ | **Emits** | \`[{ "event": "INIT", "scope": "internal" }]\` | \`["INIT"]\` | ORB_T_UNDEFINED_TRAIT |
4370
+ | **Payload events** | \`{ "key": "SAVE", "payload": [...] }\` | No payload | ORB_BINDING_PAYLOAD_FIELD_UNDECLARED |
4371
+ | **Page traits** | \`{ "ref": "TraitName" }\` | With linkedEntity | ORB_P_INVALID_TRAIT_REF |
4372
+ | **Category** | \`"category": "interaction"\` | Missing | ORB_T_MISSING_CATEGORY |
4373
+
4374
+ ---
4375
+
4376
+ ### Composition Quality Checklist
4377
+
4378
+ Before calling \`finish_task\`, verify:
4379
+
4380
+ \`\`\`
4381
+ [] Single render-ui per transition
4382
+ [] Root element is layout (stack/box/simple-grid)
4383
+ [] Contains 2+ atoms (typography, badge, button, icon)
4384
+ [] Contains 1+ data molecules (data-grid, data-list, form-section, stats)
4385
+ [] NO organism patterns (entity-table, entity-list, page-header, etc.)
4386
+ [] Uses theme variables for ALL visual properties
4387
+ [] Matches production quality from standard behaviors
4388
+ [] Passes orbital validate with zero errors and zero warnings
4389
+ \`\`\`
4390
+
4391
+ ---
4392
+
4393
+ ### BANNED Patterns (Additional)
4394
+
4395
+ | Wrong | Correct |
4396
+ |-------|---------|
4397
+ | Multiple flat render-ui calls | Single composed render-ui |
4398
+ | Root organism without layout | Layout wrapper required |
4399
+ | Hex colors | Theme CSS variables |
4400
+ | Pixel values | Theme spacing variables |
4401
+ | Events as strings \`"INIT"\` | Event objects \`{ "key": "INIT" }\` |
4402
+ | Emits as strings \`["INIT"]\` | Emit objects \`[{ "event": "INIT" }]\` |
4403
+ | \`onSubmit\` / \`onCancel\` | \`submitEvent\` / \`cancelEvent\` |
4404
+ | \`headerActions\` | \`actions\` |
4405
+ | \`entity-table\` | \`data-grid\` |
4406
+ | \`entity-list\` | \`data-list\` |
4407
+ | \`page-header\` | \`stack\` + \`typography\` + \`button\` |
4408
+
4409
+ ---
4410
+
4411
+ ${getBindingsGuide()}
4412
+ `;
4413
+ }
4414
+ function getToolWorkflowSection2() {
4415
+ return `---
4416
+
4417
+ ## Tool Workflow
4418
+
4419
+ ### Phase 1: DECOMPOSE
4420
+ Break requirements into OrbitalUnits (pure reasoning, no tools).
4421
+
4422
+ ### Phase 2: GENERATE
4423
+
4424
+ **Option A: Orchestrated Generation (RECOMMENDED for 3+ orbitals)**
4425
+ Use \`generate_schema_orchestrated\` for automatic complexity-based routing:
4426
+
4427
+ \`\`\`
4428
+ generate_schema_orchestrated({ prompt: "Full app description with all entities and features" })
4429
+ \`\`\`
4430
+
4431
+ **Option B: Per-Orbital Generation (for simple cases or fine-grained control)**
4432
+ Call \`generate_orbital\` for each orbital:
4433
+
4434
+ \`\`\`
4435
+ generate_orbital({ orbital: {...}, orbitalIndex: 0, totalOrbitals: N })
4436
+ \`\`\`
4437
+
4438
+ ### Phase 3: COMBINE
4439
+ Call \`finish_task\` to auto-combine orbitals into schema.orb:
4440
+
4441
+ \`\`\`
4442
+ finish_task({ appName: "App" })
4443
+ \`\`\`
4444
+
4445
+ ### Phase 4: VALIDATE (CRITICAL)
4446
+ After combining, validate the schema:
4447
+
4448
+ \`\`\`
4449
+ validate_schema()
4450
+ \`\`\`
4451
+
4452
+ ### Phase 5: VERIFY COMPOSITION QUALITY
4453
+
4454
+ Before calling \`finish_task\`, verify each INIT transition:
4455
+
4456
+ 1. **Uses a single \`render-ui\` call** with top-level \`stack\` and \`children\`
4457
+ 2. **Has 3+ composed sections**: header (HStack: title + action), metrics (stat-display/stats), data (data-grid/data-list)
4458
+ 3. **Uses domain-appropriate atoms**: \`badge\` for status, \`typography\` for labels/values, \`button\` for actions
4459
+ 4. **NO organisms**: Never \`entity-table\`, \`entity-list\`, \`page-header\`, \`detail-panel\`
4460
+ 5. **Props are correct**: \`submitEvent\` not \`onSubmit\`, \`fields\` not \`fieldNames\`
4461
+ `;
4462
+ }
4463
+ function getCriticalOutputRequirements2() {
4464
+ return `---
4465
+
4466
+ ## CRITICAL: Output Requirements
4467
+
4468
+ Every orbital MUST include:
4469
+
4470
+ ### 1. domainContext (REQUIRED)
4471
+ \`\`\`json
4472
+ "domainContext": {
4473
+ "request": "<original user request>",
4474
+ "requestFragment": "<what part produced THIS orbital>",
4475
+ "category": "business",
4476
+ "vocabulary": { "item": "Task", "create": "Add", "delete": "Remove" }
4477
+ }
4478
+ \`\`\`
4479
+
4480
+ ### 2. design (REQUIRED)
4481
+ \`\`\`json
4482
+ "design": {
4483
+ "style": "modern",
4484
+ "uxHints": {
4485
+ "flowPattern": "crud-cycle",
4486
+ "listPattern": "data-grid",
4487
+ "formPattern": "modal"
4488
+ }
4489
+ }
4490
+ \`\`\`
4491
+
4492
+ ### 3. Business Rule Guards on SAVE (when rules exist)
4493
+ If the user specifies validation constraints, add S-expression guards:
4494
+ \`\`\`json
4495
+ {
4496
+ "from": "Creating", "to": "Browsing", "event": "SAVE",
4497
+ "guard": ["<=", "@payload.data.score", 100],
4498
+ "effects": [["persist", "create", "Entry", "@payload.data"], ...]
4499
+ }
4500
+ \`\`\`
4501
+
4502
+ ### 4. ONE Orbital Per Entity
4503
+
4504
+ ### 5. Entity Field is REQUIRED (CRITICAL)
4505
+ Every orbital MUST have an entity field. No exceptions.`;
4506
+ }
4507
+ function getMoleculeFirstExample() {
4508
+ return `---
4509
+
4510
+ ## Example: Task Manager (Molecule-First - VALIDATED)
4511
+
4512
+ This example passes \`orbital validate\` with zero errors and zero warnings.
4513
+ Uses only atoms and molecules. No organisms.
4514
+
4515
+ \`\`\`json
4516
+ {
4517
+ "name": "Taskly",
4518
+ "version": "1.0.0",
4519
+ "orbitals": [{
4520
+ "name": "Task Management",
4521
+ "entity": {
4522
+ "name": "Task",
4523
+ "collection": "tasks",
4524
+ "fields": [
4525
+ { "name": "title", "type": "string", "required": true },
4526
+ { "name": "description", "type": "string" },
4527
+ { "name": "status", "type": "enum", "values": ["todo", "in-progress", "done"] },
4528
+ { "name": "priority", "type": "enum", "values": ["low", "medium", "high"] }
4529
+ ]
4530
+ },
4531
+ "traits": [{
4532
+ "name": "TaskInteraction",
4533
+ "category": "interaction",
4534
+ "linkedEntity": "Task",
4535
+ "emits": [{ "event": "INIT", "scope": "internal" }],
4536
+ "stateMachine": {
4537
+ "states": [
4538
+ { "name": "Browsing", "isInitial": true },
4539
+ { "name": "Creating" },
4540
+ { "name": "Editing" },
4541
+ { "name": "Viewing" }
4542
+ ],
4543
+ "events": [
4544
+ { "key": "INIT", "name": "Initialize" },
4545
+ { "key": "CREATE", "name": "Create" },
4546
+ { "key": "VIEW", "name": "View", "payload": [{ "name": "id", "type": "string" }] },
4547
+ { "key": "EDIT", "name": "Edit", "payload": [{ "name": "id", "type": "string" }] },
4548
+ { "key": "DELETE", "name": "Delete", "payload": [{ "name": "id", "type": "string" }] },
4549
+ { "key": "SAVE", "name": "Save", "payload": [{ "name": "data", "type": "object" }] },
4550
+ { "key": "CANCEL", "name": "Cancel" },
4551
+ { "key": "CLOSE", "name": "Close" }
4552
+ ],
4553
+ "transitions": [
4554
+ {
4555
+ "from": "Browsing", "to": "Browsing", "event": "INIT",
4556
+ "effects": [
4557
+ ["fetch", "Task"],
4558
+ ["render-ui", "main", {
4559
+ "type": "stack", "direction": "vertical", "gap": "lg",
4560
+ "children": [
4561
+ {
4562
+ "type": "stack", "direction": "horizontal", "justify": "between", "align": "center",
4563
+ "children": [
4564
+ { "type": "typography", "variant": "h1", "text": "Task Management" },
4565
+ { "type": "button", "label": "New Task", "event": "CREATE", "variant": "primary", "icon": "plus" }
4566
+ ]
4567
+ },
4568
+ {
4569
+ "type": "stack", "direction": "horizontal", "gap": "md", "wrap": true,
4570
+ "children": [
4571
+ { "type": "stat-display", "label": "Total Tasks", "value": "--", "icon": "list" },
4572
+ { "type": "stat-display", "label": "In Progress", "value": "--", "icon": "clock" },
4573
+ { "type": "stat-display", "label": "Completed", "value": "--", "icon": "check-circle" }
4574
+ ]
4575
+ },
4576
+ {
4577
+ "type": "search-input", "placeholder": "Search tasks..."
4578
+ },
4579
+ {
4580
+ "type": "data-grid", "entity": "Task",
4581
+ "fields": ["title", "status", "priority"],
4582
+ "itemActions": [
4583
+ { "event": "VIEW", "label": "View" },
4584
+ { "event": "EDIT", "label": "Edit" },
4585
+ { "event": "DELETE", "label": "Delete" }
4586
+ ]
4587
+ }
4588
+ ]
4589
+ }]
4590
+ ]
4591
+ },
4592
+ {
4593
+ "from": "Browsing", "to": "Creating", "event": "CREATE",
4594
+ "effects": [
4595
+ ["render-ui", "modal", {
4596
+ "type": "form-section", "entity": "Task",
4597
+ "fields": ["title", "description", "status", "priority"],
4598
+ "submitEvent": "SAVE", "cancelEvent": "CANCEL"
4599
+ }]
4600
+ ]
4601
+ },
4602
+ {
4603
+ "from": "Browsing", "to": "Viewing", "event": "VIEW",
4604
+ "effects": [
4605
+ ["fetch", "Task", "@payload.id"],
4606
+ ["render-ui", "modal", {
4607
+ "type": "stack", "direction": "vertical", "gap": "md",
4608
+ "children": [
4609
+ { "type": "typography", "variant": "h2", "text": "@entity.title" },
4610
+ { "type": "badge", "text": "@entity.status", "variant": "primary" },
4611
+ { "type": "badge", "text": "@entity.priority", "variant": "secondary" },
4612
+ { "type": "divider" },
4613
+ { "type": "typography", "variant": "body", "text": "@entity.description" },
4614
+ { "type": "stack", "direction": "horizontal", "gap": "sm", "justify": "end",
4615
+ "children": [
4616
+ { "type": "button", "label": "Edit", "event": "EDIT", "variant": "secondary" },
4617
+ { "type": "button", "label": "Close", "event": "CLOSE", "variant": "ghost" }
4618
+ ]
4619
+ }
4620
+ ]
4621
+ }]
4622
+ ]
4623
+ },
4624
+ {
4625
+ "from": "Browsing", "to": "Editing", "event": "EDIT",
4626
+ "effects": [
4627
+ ["fetch", "Task", "@payload.id"],
4628
+ ["render-ui", "modal", {
4629
+ "type": "form-section", "entity": "Task",
4630
+ "fields": ["title", "description", "status", "priority"],
4631
+ "submitEvent": "SAVE", "cancelEvent": "CANCEL"
4632
+ }]
4633
+ ]
4634
+ },
4635
+ {
4636
+ "from": "Creating", "to": "Browsing", "event": "SAVE",
4637
+ "effects": [
4638
+ ["persist", "create", "Task", "@payload.data"],
4639
+ ["render-ui", "modal", null],
4640
+ ["emit", "INIT"]
4641
+ ]
4642
+ },
4643
+ {
4644
+ "from": "Editing", "to": "Browsing", "event": "SAVE",
4645
+ "effects": [
4646
+ ["persist", "update", "Task", "@entity.id", "@payload.data"],
4647
+ ["render-ui", "modal", null],
4648
+ ["emit", "INIT"]
4649
+ ]
4650
+ },
4651
+ {
4652
+ "from": "Creating", "to": "Browsing", "event": "CANCEL",
4653
+ "effects": [["render-ui", "modal", null]]
4654
+ },
4655
+ {
4656
+ "from": "Creating", "to": "Browsing", "event": "CLOSE",
4657
+ "effects": [["render-ui", "modal", null]]
4658
+ },
4659
+ {
4660
+ "from": "Editing", "to": "Browsing", "event": "CANCEL",
4661
+ "effects": [["render-ui", "modal", null]]
4662
+ },
4663
+ {
4664
+ "from": "Editing", "to": "Browsing", "event": "CLOSE",
4665
+ "effects": [["render-ui", "modal", null]]
4666
+ },
4667
+ {
4668
+ "from": "Viewing", "to": "Browsing", "event": "CLOSE",
4669
+ "effects": [["render-ui", "modal", null]]
4670
+ },
4671
+ {
4672
+ "from": "Viewing", "to": "Browsing", "event": "CANCEL",
4673
+ "effects": [["render-ui", "modal", null]]
4674
+ },
4675
+ {
4676
+ "from": "Viewing", "to": "Editing", "event": "EDIT",
4677
+ "effects": [
4678
+ ["render-ui", "modal", {
4679
+ "type": "form-section", "entity": "Task",
4680
+ "fields": ["title", "description", "status", "priority"],
4681
+ "submitEvent": "SAVE", "cancelEvent": "CANCEL"
4682
+ }]
4683
+ ]
4684
+ },
4685
+ {
4686
+ "from": "Browsing", "to": "Browsing", "event": "DELETE",
4687
+ "effects": [
4688
+ ["persist", "delete", "Task", "@payload.id"],
4689
+ ["emit", "INIT"]
4690
+ ]
4691
+ }
4692
+ ]
4693
+ }
4694
+ }],
4695
+ "pages": [{
4696
+ "name": "TasksPage",
4697
+ "path": "/tasks",
4698
+ "viewType": "list",
4699
+ "isInitial": true,
4700
+ "entity": "Task",
4701
+ "traits": [{ "ref": "TaskInteraction" }]
4702
+ }],
4703
+ "emits": [],
4704
+ "listens": []
4705
+ }]
4706
+ }
4707
+ \`\`\`
4708
+
4709
+ **Key points (molecule-first composition):**
4710
+ - **Header**: \`stack\` (horizontal) + \`typography\` (h1) + \`button\` (composed, NOT \`page-header\`)
4711
+ - **Stats**: \`stat-display\` molecules in a horizontal \`stack\` (NOT \`stats\` organism)
4712
+ - **Search**: \`search-input\` molecule
4713
+ - **Data**: \`data-grid\` with \`entity\`, \`fields\`, \`itemActions\` (NOT \`entity-table\`)
4714
+ - **Detail view**: \`stack\` + \`typography\` + \`badge\` + \`divider\` (NOT \`detail-panel\`)
4715
+ - **Forms**: \`form-section\` with \`submitEvent\`/\`cancelEvent\`
4716
+ - **Theme**: All visual props use CSS variables
4717
+ `;
4718
+ }
4719
+
3777
4720
  // src/orbitals-skills-generators/lean/lean-orbital-generator.ts
3778
4721
  var LEAN_CORE_INSTRUCTIONS = `
3779
4722
  ## Core Instructions
@@ -4349,6 +5292,7 @@ Example workflow:
4349
5292
  // src/generators/index.ts
4350
5293
  function generateAllBuilderSkills() {
4351
5294
  return [
5295
+ generateOrbSkill(),
4352
5296
  generateKflowOrbitalsSkill(),
4353
5297
  generateKflowOrbitalFixingSkill(),
4354
5298
  {
@@ -4369,7 +5313,8 @@ function generateAllBuilderSkills() {
4369
5313
  },
4370
5314
  content: generateLeanFixingSkill2()
4371
5315
  },
4372
- generateDomainLanguageSkill()
5316
+ generateDomainLanguageSkill(),
5317
+ generateAlmadarAssistantSkill()
4373
5318
  ];
4374
5319
  }
4375
5320
  function getMinimalTypeReference() {
@@ -5003,6 +5948,6 @@ function generateComparisonMatrix(comparisons) {
5003
5948
  return markdown;
5004
5949
  }
5005
5950
 
5006
- 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 };
5951
+ export { EVAL_CASES, analyzeComposition, calculateTotalScore, formatFrontmatter, generateAllBuilderSkills, generateAlmadarAssistantSkill, generateComparisonMatrix, generateDomainLanguageSkill, generateKflowOrbitalFixingSkill, generateKflowOrbitalsSkill, generateLeanFixingSkill2 as generateLeanFixingSkill, generateLeanFixingSkill as generateLeanFixingSkillFull, generateLeanOrbitalSkill2 as generateLeanOrbitalSkill, generateLeanOrbitalSkill as generateLeanOrbitalSkillFull, generateOrbSkill, 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 };
5007
5952
  //# sourceMappingURL=index.js.map
5008
5953
  //# sourceMappingURL=index.js.map