@wabot-dev/create 0.0.4 → 2.0.0-beta.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/README.md CHANGED
@@ -1,189 +1,90 @@
1
1
  # `@wabot-dev/create`
2
2
 
3
- CLI para:
3
+ CLI para crear un nuevo proyecto Wabot desde el template oficial e instalar las
4
+ skills de agente que **vienen empaquetadas con `@wabot-dev/framework`**.
4
5
 
5
- - crear un nuevo proyecto Wabot desde el template oficial
6
- - instalar skills empaquetadas en distintos homes o targets de agentes
6
+ > Las skills ya no viven en este paquete: son propiedad de `@wabot-dev/framework`
7
+ > y se versionan junto con su API. Este CLI las descubre desde el framework
8
+ > instalado en el proyecto y las copia a `.claude/`, `.codex/` y/o `.agents/`.
7
9
 
8
- ## Instalación
10
+ ## Uso rápido
9
11
 
10
12
  ```bash
11
- npm install
13
+ npm create @wabot-dev my-wabot-app
14
+ # o
15
+ npx @wabot-dev/create my-wabot-app
12
16
  ```
13
17
 
14
- Para probar el binario local:
18
+ El asistente pregunta: nombre, almacenamiento (memoria/postgres), proveedores de
19
+ IA e instalación de skills de agente (por defecto sí). Luego:
15
20
 
16
- ```bash
17
- node ./bin/create-wabot.mjs --help
18
- ```
21
+ 1. clona el template oficial,
22
+ 2. corre `npm install` (deja `@wabot-dev/framework` en `node_modules`),
23
+ 3. copia las skills de ese framework a las carpetas de agente elegidas.
19
24
 
20
- ## Comando principal
25
+ Si no pasás `project-directory`, se pregunta el nombre en modo interactivo.
21
26
 
22
- Crear un proyecto nuevo:
23
-
24
- ```bash
25
- create-wabot <project-directory>
26
- ```
27
-
28
- Ejemplo:
29
-
30
- ```bash
31
- create-wabot my-wabot-app
32
- ```
33
-
34
- Variaciones:
27
+ Opciones:
35
28
 
36
29
  ```bash
37
30
  create-wabot my-wabot-app --db-url "postgres://localhost:5432/wabot"
38
- create-wabot my-wabot-app --llm-url "http://localhost:3000"
39
- create-wabot my-wabot-app --api-key "my-api-key"
40
- create-wabot my-wabot-app --db-url "postgres://localhost:5432/wabot" --llm-url "http://localhost:3000" --api-key "my-api-key"
41
- ```
42
-
43
- Si no pasás `project-directory`, el CLI pregunta el nombre del proyecto en modo interactivo.
44
-
45
- ## Comando de skills
46
-
47
- Instalar una skill empaquetada:
48
-
49
- ```bash
50
- create-wabot skill add <skill-name>
31
+ create-wabot my-wabot-app --lang es
51
32
  ```
52
33
 
53
- Skill disponible actualmente:
34
+ ## Canal beta
54
35
 
55
- ```bash
56
- create-wabot skill add wabot-framework
57
- ```
58
-
59
- ## Variaciones de `skill add`
36
+ Las builds beta de `@wabot-dev/create` (versión `X.Y.Z-beta.N`) scaffoldean desde
37
+ la rama **`beta`** del template (`wabot-dev/wabot-template#beta`), que fija la
38
+ versión beta del framework. Las builds estables usan la rama por defecto.
60
39
 
61
- ### 1. Instalación global por defecto
62
-
63
- Usa el home del sistema y, si no se indica target, instala para `codex`.
40
+ Para forzar una fuente concreta del template (p. ej. probar una rama antes de
41
+ publicar) usá la variable de entorno:
64
42
 
65
43
  ```bash
66
- create-wabot skill add wabot-framework
44
+ WABOT_TEMPLATE_REF="wabot-dev/wabot-template#beta" create-wabot my-app
67
45
  ```
68
46
 
69
- Resultado esperado:
70
-
71
- - `<os.homedir()>/.codex/skills/wabot-framework`
47
+ ## Skills en un proyecto existente
72
48
 
73
- ### 2. Instalación local al proyecto
74
-
75
- Instala en el workspace actual:
49
+ Las skills se instalan solas al crear el proyecto. Para **agregarlas o
50
+ actualizarlas** más tarde (por ejemplo tras subir la versión del framework), usá
51
+ el bin que ships el propio framework:
76
52
 
77
53
  ```bash
78
- create-wabot skill add wabot-framework --local
54
+ npx wabot-skills list # lista las skills empaquetadas
55
+ npx wabot-skills sync # refresca las skills del proyecto a la
56
+ # versión de framework instalada
57
+ npx wabot-skills sync --agents claude,codex
79
58
  ```
80
59
 
81
- Resultado esperado:
82
-
83
- - `./.agents/skills/wabot-framework`
60
+ `sync` sobrescribe en el lugar (resync); detecta las carpetas de agente ya
61
+ presentes en el proyecto (`.claude`, `.codex`, `.agents`) o usá `--agents`.
84
62
 
85
- ### 3. Instalación global con home explícito
63
+ ## `create-wabot skill add` (instalación puntual)
86
64
 
87
- Instala usando un home root manual:
65
+ También podés instalar una skill suelta con este CLI. La fuente es el
66
+ `@wabot-dev/framework` resoluble desde el proyecto/entorno actual.
88
67
 
89
68
  ```bash
90
- create-wabot skill add wabot-framework --global --home "/Users/demo"
91
- create-wabot skill add wabot-framework --global --home "C:\\Users\\demo"
92
- ```
93
-
94
- ### 4. Instalación global para un target único
95
-
96
- ```bash
97
- create-wabot skill add wabot-framework --global --target codex
69
+ create-wabot skill add wabot-framework --local # ./.agents/skills/...
98
70
  create-wabot skill add wabot-framework --global --target claude
99
- create-wabot skill add wabot-framework --global --target agents
100
- ```
101
-
102
- Con `--home`:
103
-
104
- ```bash
105
- create-wabot skill add wabot-framework --global --home "C:\\Users\\demo" --target codex
106
- create-wabot skill add wabot-framework --global --home "C:\\Users\\demo" --target claude
107
- create-wabot skill add wabot-framework --global --home "C:\\Users\\demo" --target agents
71
+ create-wabot skill add wabot-framework --global --targets agents,codex,claude --home "/Users/demo"
108
72
  ```
109
73
 
110
- Rutas esperadas:
111
-
112
- - `codex` -> `<home>/.codex/skills/wabot-framework`
113
- - `claude` -> `<home>/.claude/skills/wabot-framework`
114
- - `agents` -> `<home>/.agents/skills/wabot-framework`
115
-
116
- ### 5. Instalación global para múltiples targets
117
-
118
- ```bash
119
- create-wabot skill add wabot-framework --global --targets codex,claude
120
- create-wabot skill add wabot-framework --global --targets agents,codex,claude
121
- ```
122
-
123
- Con `--home`:
124
-
125
- ```bash
126
- create-wabot skill add wabot-framework --global --home "C:\\Users\\demo" --targets agents,codex,claude
127
- ```
128
-
129
- Esto instala la misma skill en múltiples destinos dentro del mismo home root.
130
-
131
- ## Reglas útiles
74
+ Reglas:
132
75
 
133
76
  - `--local` y `--global` son excluyentes.
134
77
  - `--home`, `--target` y `--targets` aplican solo con `--global`.
135
- - Si no se pasa `--target` ni `--targets`, el default es `codex`.
136
- - Si el destino ya existe, el comando falla y no sobreescribe.
137
- - Si el target no existe en la lista soportada, el comando falla.
138
-
139
- ## Targets soportados
140
-
141
- ```text
142
- agents
143
- codex
144
- claude
145
- ```
146
-
147
- ## Ejemplos completos
148
-
149
- Crear un proyecto:
150
-
151
- ```bash
152
- create-wabot my-bot
153
- ```
78
+ - Si no se pasa `--target`/`--targets`, el default es `codex`.
79
+ - Si el destino ya existe, falla y no sobrescribe (usá `wabot-skills sync` para refrescar).
154
80
 
155
- Crear un proyecto con variables iniciales:
156
-
157
- ```bash
158
- create-wabot my-bot \
159
- --db-url "postgres://localhost:5432/mybot" \
160
- --llm-url "http://localhost:3000" \
161
- --api-key "secret"
162
- ```
163
-
164
- Instalar la skill local al repo:
165
-
166
- ```bash
167
- create-wabot skill add wabot-framework --local
168
- ```
169
-
170
- Instalar la skill para Claude en otro home:
171
-
172
- ```bash
173
- create-wabot skill add wabot-framework --global --home "C:\\Users\\another-user" --target claude
174
- ```
175
-
176
- Instalar la skill para varios agentes en el mismo home:
177
-
178
- ```bash
179
- create-wabot skill add wabot-framework --global --home "C:\\Users\\another-user" --targets agents,codex,claude
180
- ```
81
+ Targets soportados: `agents`, `codex`, `claude`.
181
82
 
182
83
  ## Desarrollo
183
84
 
184
- Mostrar ayuda:
185
-
186
85
  ```bash
86
+ npm install # linkea @wabot-dev/framework (file:../wabot-ts) para tests
87
+ npm run test:smoke # smokes del instalador de skills
187
88
  node ./bin/create-wabot.mjs --help
188
89
  node ./bin/create-wabot.mjs skill add --help
189
90
  ```
@@ -6,11 +6,28 @@ import fs from 'fs/promises'
6
6
  import { spawn } from 'child_process'
7
7
 
8
8
  import { installSkillsInProject, listSupportedAgents } from './skills/install.mjs'
9
- import { listSkills } from './skills/registry.mjs'
10
9
  import { createTranslator } from './i18n.mjs'
11
10
 
12
11
  const REQUIRED_NODE_MAJOR = 22
13
12
 
13
+ const TEMPLATE_REPO = 'wabot-dev/wabot-template'
14
+ const TEMPLATE_BETA_BRANCH = 'beta'
15
+
16
+ // Beta builds of @wabot-dev/create scaffold from the matching `beta` branch of the
17
+ // template (which pins the beta framework); stable builds use the default branch.
18
+ // `WABOT_TEMPLATE_REF` overrides both (e.g. to test a branch before release).
19
+ async function resolveTemplateRepo() {
20
+ if (process.env.WABOT_TEMPLATE_REF) {
21
+ return process.env.WABOT_TEMPLATE_REF
22
+ }
23
+
24
+ const pkgRaw = await fs.readFile(new URL('../package.json', import.meta.url), 'utf-8')
25
+ const version = JSON.parse(pkgRaw).version ?? ''
26
+ const isBeta = version.includes('-beta')
27
+
28
+ return isBeta ? `${TEMPLATE_REPO}#${TEMPLATE_BETA_BRANCH}` : TEMPLATE_REPO
29
+ }
30
+
14
31
  const AI_PROVIDERS = [
15
32
  {
16
33
  value: 'openrouter',
@@ -194,13 +211,12 @@ async function collectSetup(options, t) {
194
211
 
195
212
  async function collectSkillsSetup({ onCancel }, t) {
196
213
  const supportedAgents = listSupportedAgents()
197
- const availableSkills = listSkills()
198
214
 
199
215
  const { install } = await prompts(
200
216
  {
201
217
  type: 'confirm',
202
218
  name: 'install',
203
- message: t('skills.installPrompt', availableSkills.length),
219
+ message: t('skills.installPrompt'),
204
220
  initial: true,
205
221
  },
206
222
  { onCancel },
@@ -227,10 +243,12 @@ async function collectSkillsSetup({ onCancel }, t) {
227
243
  { onCancel },
228
244
  )
229
245
 
246
+ // Empty list = install every skill the installed framework ships; the actual
247
+ // set is resolved at install time from @wabot-dev/framework in the new project.
230
248
  return {
231
249
  install: true,
232
250
  agents,
233
- skills: availableSkills.map((skill) => skill.name),
251
+ skills: [],
234
252
  }
235
253
  }
236
254
 
@@ -241,7 +259,12 @@ async function createProject(projectName, setup, t) {
241
259
 
242
260
  console.log(chalk.blue(t('project.creating', chalk.green(targetDir))))
243
261
 
244
- const emitter = degit('wabot-dev/wabot-template', {
262
+ const templateRepo = await resolveTemplateRepo()
263
+ if (templateRepo !== TEMPLATE_REPO) {
264
+ console.log(chalk.gray(t('project.templateSource', templateRepo)))
265
+ }
266
+
267
+ const emitter = degit(templateRepo, {
245
268
  cache: false,
246
269
  force: true,
247
270
  verbose: true,
package/lib/i18n.mjs CHANGED
@@ -19,6 +19,7 @@ const STRINGS = {
19
19
  'project.cancelled': 'Setup cancelled',
20
20
  'project.exists': (name) => `Directory ${name} already exists`,
21
21
  'project.creating': (dir) => `\nCreating a new Wabot project in ${dir}\n`,
22
+ 'project.templateSource': (repo) => ` Using template source: ${repo}`,
22
23
 
23
24
  'storage.prompt': 'How do you want to store data?',
24
25
  'storage.memory': 'In-memory (quickest start, data resets on restart)',
@@ -33,8 +34,7 @@ const STRINGS = {
33
34
  'providers.anthropic': 'Claude models',
34
35
  'providers.google': 'Gemini models',
35
36
 
36
- 'skills.installPrompt': (count) =>
37
- `Install Wabot agent skills (${count}) into the new project?`,
37
+ 'skills.installPrompt': 'Install Wabot agent skills into the new project?',
38
38
  'skills.agentsPrompt': 'Install for which agents? (space to toggle, enter to confirm)',
39
39
  'skills.agentsHint': 'Each adds a folder of <agent>/skills under the project root',
40
40
  'skills.installing': '\nInstalling Wabot agent skills...\n',
@@ -44,7 +44,7 @@ const STRINGS = {
44
44
  ` ⚠ ${count} skill folder(s) already existed and were left untouched.`,
45
45
  'skills.failed': (msg) => ` ✖ Failed to install agent skills: ${msg}`,
46
46
  'skills.installLater':
47
- ' You can install them later with `create-wabot skill add <skill>`.',
47
+ ' You can install/refresh them later with `npx wabot-skills sync`.',
48
48
 
49
49
  'deps.installing': '\nInstalling dependencies with npm...\n',
50
50
  'deps.exitCode': (code) => `npm install exited with code ${code}`,
@@ -89,6 +89,7 @@ const STRINGS = {
89
89
  'project.cancelled': 'Configuración cancelada',
90
90
  'project.exists': (name) => `El directorio ${name} ya existe`,
91
91
  'project.creating': (dir) => `\nCreando un nuevo proyecto Wabot en ${dir}\n`,
92
+ 'project.templateSource': (repo) => ` Usando fuente del template: ${repo}`,
92
93
 
93
94
  'storage.prompt': '¿Cómo deseas almacenar los datos?',
94
95
  'storage.memory': 'En memoria (inicio más rápido, los datos se pierden al reiniciar)',
@@ -106,8 +107,7 @@ const STRINGS = {
106
107
  'providers.anthropic': 'Modelos Claude',
107
108
  'providers.google': 'Modelos Gemini',
108
109
 
109
- 'skills.installPrompt': (count) =>
110
- `¿Instalar las skills de agente de Wabot (${count}) en el nuevo proyecto?`,
110
+ 'skills.installPrompt': '¿Instalar las skills de agente de Wabot en el nuevo proyecto?',
111
111
  'skills.agentsPrompt':
112
112
  '¿Para qué agentes instalarlas? (espacio para alternar, enter para confirmar)',
113
113
  'skills.agentsHint':
@@ -119,7 +119,7 @@ const STRINGS = {
119
119
  ` ⚠ ${count} carpeta(s) de skill ya existían y no se modificaron.`,
120
120
  'skills.failed': (msg) => ` ✖ Fallo al instalar las skills de agente: ${msg}`,
121
121
  'skills.installLater':
122
- ' Puedes instalarlas más tarde con `create-wabot skill add <skill>`.',
122
+ ' Puedes instalarlas/actualizarlas más tarde con `npx wabot-skills sync`.',
123
123
 
124
124
  'deps.installing': '\nInstalando dependencias con npm...\n',
125
125
  'deps.exitCode': (code) => `npm install terminó con código ${code}`,
@@ -0,0 +1,68 @@
1
+ import { createRequire } from 'module'
2
+ import fs from 'fs'
3
+ import path from 'path'
4
+ import { fileURLToPath } from 'url'
5
+
6
+ const require = createRequire(import.meta.url)
7
+
8
+ const FRAMEWORK_PKG = '@wabot-dev/framework'
9
+ const FRAMEWORK_SEGMENTS = FRAMEWORK_PKG.split('/')
10
+
11
+ function packageRootFromEntry(entryPath) {
12
+ let dir = path.dirname(entryPath)
13
+ const { root } = path.parse(dir)
14
+ while (dir && dir !== root) {
15
+ const pkgFile = path.join(dir, 'package.json')
16
+ if (fs.existsSync(pkgFile)) {
17
+ try {
18
+ if (JSON.parse(fs.readFileSync(pkgFile, 'utf8')).name === FRAMEWORK_PKG) {
19
+ return dir
20
+ }
21
+ } catch {
22
+ // ignore malformed package.json and keep walking up
23
+ }
24
+ }
25
+ dir = path.dirname(dir)
26
+ }
27
+ return null
28
+ }
29
+
30
+ // Locate the packaged `skills/` directory shipped by @wabot-dev/framework.
31
+ //
32
+ // The framework owns the skills and versions them with its API. When bootstrapping
33
+ // or resyncing a project, resolve them from the framework installed *in that
34
+ // project* (`fromDir`) so the copied skills match the project's pinned framework
35
+ // version. For standalone use (e.g. `skill add`) fall back to the framework
36
+ // resolvable from this package.
37
+ export function resolveFrameworkSkillsDir(fromDir) {
38
+ const candidates = []
39
+
40
+ if (fromDir) {
41
+ candidates.push(path.join(fromDir, 'node_modules', ...FRAMEWORK_SEGMENTS, 'skills'))
42
+ }
43
+
44
+ try {
45
+ const pkgRoot = packageRootFromEntry(require.resolve(FRAMEWORK_PKG))
46
+ if (pkgRoot) candidates.push(path.join(pkgRoot, 'skills'))
47
+ } catch {
48
+ // framework not resolvable via node resolution; try the node_modules lookups below
49
+ }
50
+
51
+ const createPkgRoot = fileURLToPath(new URL('../../', import.meta.url))
52
+ candidates.push(path.join(createPkgRoot, 'node_modules', ...FRAMEWORK_SEGMENTS, 'skills'))
53
+ candidates.push(path.join(process.cwd(), 'node_modules', ...FRAMEWORK_SEGMENTS, 'skills'))
54
+
55
+ // Monorepo dev fallback: the framework lives beside this package as a sibling
56
+ // checkout (`../wabot-ts`). Used so smoke tests can resolve skills without the
57
+ // framework being installed as a dependency; installed lookups above win.
58
+ candidates.push(path.join(createPkgRoot, '..', 'wabot-ts', 'skills'))
59
+
60
+ for (const dir of candidates) {
61
+ if (dir && fs.existsSync(dir)) return dir
62
+ }
63
+
64
+ throw new Error(
65
+ `Could not locate ${FRAMEWORK_PKG} skills. Ensure ${FRAMEWORK_PKG} is installed ` +
66
+ `(the packaged skills ship with the framework as of the version that added them).`,
67
+ )
68
+ }
@@ -3,6 +3,7 @@ import os from 'os'
3
3
  import path from 'path'
4
4
 
5
5
  import { getSkill, listSkillNames, listSkills } from './registry.mjs'
6
+ import { resolveFrameworkSkillsDir } from './framework-source.mjs'
6
7
 
7
8
  const supportedAgents = {
8
9
  codex: ['.codex', 'skills'],
@@ -28,8 +29,11 @@ export async function installSkillsInProject(projectDir, agents, skillNames) {
28
29
  return agent
29
30
  })
30
31
 
32
+ const skillsDir = resolveFrameworkSkillsDir(projectDir)
31
33
  const skills =
32
- skillNames && skillNames.length > 0 ? skillNames.map((name) => requireSkill(name)) : listSkills()
34
+ skillNames && skillNames.length > 0
35
+ ? skillNames.map((name) => requireSkill(name, skillsDir))
36
+ : listSkills(skillsDir)
33
37
 
34
38
  const installations = []
35
39
 
@@ -59,22 +63,23 @@ export async function installSkillsInProject(projectDir, agents, skillNames) {
59
63
  return { agents: resolvedAgents, skills: skills.map((skill) => skill.name), installations }
60
64
  }
61
65
 
62
- function requireSkill(name) {
63
- const skill = getSkill(name)
66
+ function requireSkill(name, skillsDir) {
67
+ const skill = getSkill(name, skillsDir)
64
68
  if (!skill) {
65
69
  throw new Error(
66
- `Unknown skill "${name}". Available skills: ${listSkillNames().join(', ')}`,
70
+ `Unknown skill "${name}". Available skills: ${listSkillNames(skillsDir).join(', ')}`,
67
71
  )
68
72
  }
69
73
  return skill
70
74
  }
71
75
 
72
76
  export async function installSkill(skillName, options, cwd = process.cwd()) {
73
- const skill = getSkill(skillName)
77
+ const skillsDir = resolveFrameworkSkillsDir(cwd)
78
+ const skill = getSkill(skillName, skillsDir)
74
79
 
75
80
  if (!skill) {
76
81
  throw new Error(
77
- `Unknown skill "${skillName}". Available skills: ${listSkillNames().join(', ')}`,
82
+ `Unknown skill "${skillName}". Available skills: ${listSkillNames(skillsDir).join(', ')}`,
78
83
  )
79
84
  }
80
85
 
@@ -1,64 +1,34 @@
1
- import { fileURLToPath } from 'url'
1
+ import fs from 'fs'
2
+ import path from 'path'
2
3
 
3
- function packagedSkill(name, description) {
4
- return {
5
- name,
6
- description,
7
- sourceDir: fileURLToPath(new URL(`../../skills/${name}`, import.meta.url)),
8
- }
9
- }
4
+ import { resolveFrameworkSkillsDir } from './framework-source.mjs'
10
5
 
11
- const skillDefinitions = {
12
- 'wabot-framework': packagedSkill(
13
- 'wabot-framework',
14
- 'Umbrella skill — project boot, layout, scripts, and where to dive for each subsystem',
15
- ),
16
- 'wabot-di-config': packagedSkill(
17
- 'wabot-di-config',
18
- 'DI lifecycles, Env, and typed config references',
19
- ),
20
- 'wabot-validation': packagedSkill(
21
- 'wabot-validation',
22
- 'Validators, @description, validateAndTransform, Mapper',
23
- ),
24
- 'wabot-persistence': packagedSkill(
25
- 'wabot-persistence',
26
- 'Entities, repositories, query DSL, mem/pg extensions',
27
- ),
28
- 'wabot-mindset': packagedSkill(
29
- 'wabot-mindset',
30
- 'Mindsets, modules, models, ChatOperator',
31
- ),
32
- 'wabot-chat': packagedSkill(
33
- 'wabot-chat',
34
- 'Chat controllers, channels (cmd/socket/telegram/whatsapp/wasender), chat-bot adapters',
35
- ),
36
- 'wabot-rest-socket': packagedSkill(
37
- 'wabot-rest-socket',
38
- 'REST and Socket.IO controllers, middlewares, handshake guards',
39
- ),
40
- 'wabot-async': packagedSkill(
41
- 'wabot-async',
42
- 'Commands, cron handlers, @transaction, the Async service',
43
- ),
44
- 'wabot-auth': packagedSkill(
45
- 'wabot-auth',
46
- 'Auth<D> scope, JWT and API key guards, token issuing',
47
- ),
48
- 'wabot-ops': packagedSkill(
49
- 'wabot-ops',
50
- 'Logger, Locker, CustomError, Password, Random',
51
- ),
52
- }
6
+ // Skills are owned and versioned by @wabot-dev/framework. The registry discovers
7
+ // them from the framework's packaged `skills/` directory rather than bundling its
8
+ // own copy, so adding a skill upstream requires no change here.
53
9
 
54
- export function getSkill(skillName) {
55
- return skillDefinitions[skillName] ?? null
10
+ export function listSkillNames(skillsDir = resolveFrameworkSkillsDir()) {
11
+ return fs
12
+ .readdirSync(skillsDir, { withFileTypes: true })
13
+ .filter(
14
+ (entry) =>
15
+ entry.isDirectory() && fs.existsSync(path.join(skillsDir, entry.name, 'SKILL.md')),
16
+ )
17
+ .map((entry) => entry.name)
18
+ .sort()
56
19
  }
57
20
 
58
- export function listSkillNames() {
59
- return Object.keys(skillDefinitions).sort()
21
+ export function listSkills(skillsDir = resolveFrameworkSkillsDir()) {
22
+ return listSkillNames(skillsDir).map((name) => ({
23
+ name,
24
+ sourceDir: path.join(skillsDir, name),
25
+ }))
60
26
  }
61
27
 
62
- export function listSkills() {
63
- return listSkillNames().map((name) => skillDefinitions[name])
28
+ export function getSkill(name, skillsDir = resolveFrameworkSkillsDir()) {
29
+ const sourceDir = path.join(skillsDir, name)
30
+ if (!fs.existsSync(path.join(sourceDir, 'SKILL.md'))) {
31
+ return null
32
+ }
33
+ return { name, sourceDir }
64
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wabot-dev/create",
3
- "version": "0.0.4",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "Project creator for Wabot Framework",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -11,9 +11,11 @@
11
11
  },
12
12
  "files": [
13
13
  "bin",
14
- "lib",
15
- "skills"
14
+ "lib"
16
15
  ],
16
+ "scripts": {
17
+ "test:smoke": "node scripts/smoke-skills-bulk-install.mjs && node scripts/smoke-skill-installer.mjs"
18
+ },
17
19
  "dependencies": {
18
20
  "chalk": "^5.4.1",
19
21
  "commander": "^14.0.0",