@almadar/skills 1.0.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/LICENSE ADDED
@@ -0,0 +1,72 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: Almadar FZE
6
+ Licensed Work: KFlow Builder / Almadar
7
+ The Licensed Work is (c) 2025-2026 Almadar FZE.
8
+ Additional Use Grant: You may make production use of the Licensed Work for
9
+ non-commercial purposes and for internal evaluation.
10
+ Production use for commercial purposes requires a
11
+ commercial license from the Licensor.
12
+ Change Date: 2030-02-01
13
+ Change License: Apache License, Version 2.0
14
+
15
+ Terms
16
+
17
+ The Licensor hereby grants you the right to copy, modify, create derivative
18
+ works, redistribute, and make non-production use of the Licensed Work. The
19
+ Licensor may make an Additional Use Grant, above, permitting limited
20
+ production use.
21
+
22
+ Effective on the Change Date, or the fourth anniversary of the first publicly
23
+ available distribution of a specific version of the Licensed Work under this
24
+ License, whichever comes first, the Licensor hereby grants you rights under
25
+ the terms of the Change License, and the rights granted in the paragraph
26
+ above terminate.
27
+
28
+ If your use of the Licensed Work does not comply with the requirements
29
+ currently in effect as described in this License, you must purchase a
30
+ commercial license from the Licensor, its affiliated entities, or authorized
31
+ resellers, or you must refrain from using the Licensed Work.
32
+
33
+ All copies of the original and modified Licensed Work, and derivative works
34
+ of the Licensed Work, are subject to this License. This License applies
35
+ separately for each version of the Licensed Work and the Change Date may vary
36
+ for each version of the Licensed Work released by Licensor.
37
+
38
+ You must conspicuously display this License on each original or modified copy
39
+ of the Licensed Work. If you receive the Licensed Work in original or
40
+ modified form from a third party, the terms and conditions set forth in this
41
+ License apply to your use of that work.
42
+
43
+ Any use of the Licensed Work in violation of this License will automatically
44
+ terminate your rights under this License for the current and all other
45
+ versions of the Licensed Work.
46
+
47
+ This License does not grant you any right in any trademark or logo of
48
+ Licensor or its affiliates (provided that you may use a trademark or logo of
49
+ Licensor as expressly required by this License).
50
+
51
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
52
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
53
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
54
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
55
+ TITLE.
56
+
57
+ ---
58
+
59
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
60
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
61
+
62
+ ADDITIONAL TERMS:
63
+
64
+ Documentation (builder/packages/website/docs/) is licensed under CC BY 4.0.
65
+
66
+ TRADEMARKS:
67
+
68
+ "Orbital", "KFlow", "Almadar", and the Almadar logo are trademarks of
69
+ Almadar FZE. You may not use these trademarks without prior written
70
+ permission from Almadar FZE.
71
+
72
+ For licensing inquiries: licensing@almadar.io
package/README.md ADDED
@@ -0,0 +1,238 @@
1
+ # @almadar/skills
2
+
3
+ AI skill generators and prompts for Orbital schema generation.
4
+
5
+ ## Overview
6
+
7
+ This package provides the core skills used by the KFlow Builder client to generate and fix Orbital schemas using AI agents.
8
+
9
+ ## Core Skills
10
+
11
+ ### 1. kflow-orbitals (Standard Generation)
12
+ Generate complete Orbital schemas using JSON output with the Orbital Unit composition model.
13
+
14
+ ### 2. kflow-orbital-fixing (Standard Fixing)
15
+ Fix compilation errors, validation errors, and schema issues using orbital-aware fixing.
16
+
17
+ ### 3. kflow-lean-orbitals (Lean Generation)
18
+ Generate schemas using Domain Language output (~5x fewer tokens than JSON).
19
+
20
+ ### 4. kflow-lean-fixing (Lean Fixing)
21
+ Fix validation errors using Domain Language output.
22
+
23
+ ### 5. domain-language
24
+ Understand, generate, and summarize Orbital Domain Language (ODL).
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pnpm add @almadar/skills
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ### As a Library
35
+
36
+ ```typescript
37
+ import {
38
+ generateKflowOrbitalsSkill,
39
+ generateKflowOrbitalFixingSkill,
40
+ generateDomainLanguageSkill,
41
+ generateLeanOrbitalSkill,
42
+ generateLeanFixingSkill,
43
+ generateAllBuilderSkills
44
+ } from '@almadar/skills';
45
+
46
+ // Generate a single skill
47
+ const skill = generateKflowOrbitalsSkill();
48
+ console.log(skill.frontmatter); // { name, description, allowedTools, version }
49
+ console.log(skill.content); // Full skill markdown content
50
+
51
+ // Generate all builder skills
52
+ const allSkills = generateAllBuilderSkills();
53
+ ```
54
+
55
+ ### CLI Scripts
56
+
57
+ This package includes several npm scripts for managing skills:
58
+
59
+ #### Generate Skills
60
+
61
+ ```bash
62
+ # Generate all skills to .skills/ directory
63
+ pnpm generate
64
+
65
+ # List available skills
66
+ pnpm generate:list
67
+
68
+ # Preview a specific skill
69
+ pnpm generate:preview kflow-orbitals
70
+ ```
71
+
72
+ #### Install to .deepagents
73
+
74
+ ```bash
75
+ # Install skills to ~/.deepagents/kflow/skills/
76
+ pnpm install:skills
77
+
78
+ # Check installation status
79
+ pnpm install:check
80
+
81
+ # Clean and reinstall
82
+ pnpm install:clean
83
+ ```
84
+
85
+ #### Validation
86
+
87
+ ```bash
88
+ # Validate all generated skills
89
+ pnpm validate
90
+ ```
91
+
92
+ #### Development
93
+
94
+ ```bash
95
+ # Sync skills to builder (for monorepo development)
96
+ pnpm sync
97
+
98
+ # Dry run - show what would be synced
99
+ pnpm sync:dry
100
+
101
+ # Clean generated files
102
+ pnpm clean
103
+ ```
104
+
105
+ ## Development Status
106
+
107
+ ✅ **Refactored and Building Successfully**
108
+
109
+ ### Architecture
110
+
111
+ This package now follows a clean architecture:
112
+
113
+ - **Keeps**: Only skill-sections (11 reusable guidance sections)
114
+ - **Imports**: Everything else from @almadar/* packages
115
+ - **Inlines**: Lean-specific constants for domain language skills
116
+
117
+ ### Package Size
118
+
119
+ - **Before**: ~60 prompt files, 16,321 lines
120
+ - **After**: 11 skill-section files, ~4,000 lines
121
+ - **Reduction**: Deleted 12,316 lines, added 729 lines
122
+
123
+ ### Build Status
124
+
125
+ ✅ **ESM Build**: Working (90.68 KB)
126
+ ✅ **TypeScript Declarations**: Working (11.86 KB)
127
+ ✅ **Source Maps**: Working (134.71 KB)
128
+
129
+ Build with: `pnpm build` (requires dependencies to be built first)
130
+
131
+ ### Dependencies
132
+
133
+ ```json
134
+ {
135
+ "@almadar/core": "workspace:*", // Types, schemas
136
+ "@almadar/patterns": "workspace:*", // Pattern registry + helpers
137
+ "@almadar/std": "workspace:*" // Standard library behaviors
138
+ }
139
+ ```
140
+
141
+ ### Helper Functions Added
142
+
143
+ **In @almadar/patterns:**
144
+ - `getPatternsGroupedByCategory()` - Group patterns by category
145
+ - `getPatternPropsCompact()` - Generate compact props table
146
+ - `getPatternActionsRef()` - Generate action props reference
147
+ - `generatePatternDescription()` - Auto-generate from metadata
148
+
149
+ **In @almadar/skills:**
150
+ - `helpers.ts` - Generate prompts from @almadar/std and @almadar/core
151
+
152
+ ### Remaining TODOs
153
+
154
+ 1. ~~Fix TypeScript declaration generation~~ ✅ **DONE**
155
+ 2. ~~Add CLI scripts for skill management~~ ✅ **DONE**
156
+ 3. Test all 5 skills generate correctly from builder
157
+ 4. Add comprehensive tests for skill generation
158
+
159
+ ### Build Notes
160
+
161
+ - Run `pnpm build --filter "@almadar/skills"` from workspace root for best results
162
+ - Direct `pnpm build` in package directory also works once dependencies are built
163
+ - TypeScript declarations successfully generate with proper workspace dependency resolution
164
+
165
+ ## Scripts Reference
166
+
167
+ | Script | Description |
168
+ |--------|-------------|
169
+ | `pnpm build` | Build the package (ESM + TypeScript declarations) |
170
+ | `pnpm build:watch` | Build in watch mode |
171
+ | `pnpm typecheck` | Run TypeScript type checking |
172
+ | `pnpm generate` | Generate all skills to `.skills/` directory |
173
+ | `pnpm generate:list` | List all available skills |
174
+ | `pnpm generate:preview NAME` | Preview a specific skill |
175
+ | `pnpm install:skills` | Install skills to `~/.deepagents/kflow/skills/` |
176
+ | `pnpm install:check` | Check installation status |
177
+ | `pnpm install:clean` | Clean and reinstall skills |
178
+ | `pnpm validate` | Validate all generated skills |
179
+ | `pnpm sync` | Sync skills to builder (monorepo only) |
180
+ | `pnpm sync:dry` | Dry run sync (show what would change) |
181
+ | `pnpm clean` | Remove generated files and build output |
182
+
183
+ ## Workflow Examples
184
+
185
+ ### Generate and Install Skills Locally
186
+
187
+ ```bash
188
+ cd packages/almadar-skills
189
+ pnpm build
190
+ pnpm generate
191
+ pnpm install:skills
192
+ ```
193
+
194
+ ### Development Workflow (Monorepo)
195
+
196
+ ```bash
197
+ # Make changes to skill-sections or generators
198
+ pnpm build
199
+ pnpm generate
200
+ pnpm validate
201
+
202
+ # Sync to builder for testing
203
+ pnpm sync
204
+
205
+ # Check what would be synced first
206
+ pnpm sync:dry
207
+ ```
208
+
209
+ ### Check Installed Skills
210
+
211
+ ```bash
212
+ pnpm install:check
213
+ ```
214
+
215
+ Output:
216
+ ```
217
+ 🔍 Checking installation...
218
+
219
+ ✅ Directories exist
220
+ /Users/you/.deepagents/kflow/skills
221
+
222
+ 📚 Installed skills (5):
223
+ ✅ kflow-orbitals
224
+ ✅ kflow-orbital-fixing
225
+ ✅ kflow-lean-orbitals
226
+ ✅ kflow-lean-fixing
227
+ ✅ domain-language
228
+ ```
229
+
230
+ ## Dependencies
231
+
232
+ - `@almadar/core` - Core schema types
233
+ - `@almadar/patterns` - Pattern registry
234
+ - `@almadar/std` - Standard library
235
+
236
+ ## License
237
+
238
+ MIT