@pixpilot/scaffoldfy 0.19.0 → 0.19.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/scaffoldfy",
3
3
  "type": "module",
4
- "version": "0.19.0",
4
+ "version": "0.19.2",
5
5
  "author": "PixPilot <m.doaie@hotmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -50,8 +50,8 @@
50
50
  "@internal/eslint-config": "0.3.0",
51
51
  "@internal/tsconfig": "0.1.0",
52
52
  "@internal/prettier-config": "0.0.1",
53
- "@internal/tsdown-config": "0.1.0",
54
- "@internal/vitest-config": "0.1.0"
53
+ "@internal/vitest-config": "0.1.0",
54
+ "@internal/tsdown-config": "0.1.0"
55
55
  },
56
56
  "prettier": "@internal/prettier-config",
57
57
  "scripts": {
@@ -3,9 +3,13 @@
3
3
  "title": "Template Tasks Configuration",
4
4
  "description": "Configuration for template task automation and cleanup",
5
5
  "type": "object",
6
- "required": ["name"],
6
+ "required": ["$schema", "name"],
7
7
  "additionalProperties": false,
8
8
  "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "JSON Schema dialect identifier"
12
+ },
9
13
  "name": {
10
14
  "type": "string",
11
15
  "description": "Unique identifier name for this template. Must contain only lowercase letters, digits, and hyphens. Cannot start or end with a hyphen.",
@@ -41,184 +45,18 @@
41
45
  "variables": {
42
46
  "type": "array",
43
47
  "description": "Top-level global variables available to all tasks. Variables are resolved once at startup and do not require user interaction.",
44
- "items": {
45
- "type": "object",
46
- "required": ["id", "value"],
47
- "additionalProperties": false,
48
- "properties": {
49
- "id": {
50
- "type": "string",
51
- "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
52
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
53
- },
54
- "value": {
55
- "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
56
- "oneOf": [
57
- {
58
- "description": "Static value (string, number, or boolean)"
59
- },
60
- {
61
- "type": "object",
62
- "description": "Value configuration for static or executable values",
63
- "required": ["type", "value"],
64
- "properties": {
65
- "type": {
66
- "type": "string",
67
- "enum": ["static", "exec"],
68
- "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
69
- },
70
- "value": {
71
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
72
- }
73
- }
74
- }
75
- ]
76
- },
77
- "override": {
78
- "type": "string",
79
- "enum": ["merge", "replace"],
80
- "description": "Strategy for merging with base variable when extending templates. 'merge' (default) replaces the value, 'replace' completely replaces the variable. Must be specified when variable ID conflicts with base template."
81
- }
82
- }
83
- }
48
+ "items": { "$ref": "#/$defs/variableItem" }
84
49
  },
85
50
  "prompts": {
86
51
  "type": "array",
87
52
  "description": "Top-level global prompts collected once upfront and available to all tasks.",
88
- "items": {
89
- "type": "object",
90
- "required": ["id", "type", "message"],
91
- "additionalProperties": false,
92
- "properties": {
93
- "id": {
94
- "type": "string",
95
- "description": "Unique identifier for the prompt value (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
96
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
97
- },
98
- "type": {
99
- "type": "string",
100
- "enum": ["input", "select", "confirm", "password", "number"],
101
- "description": "Type of prompt to display"
102
- },
103
- "message": {
104
- "type": "string",
105
- "description": "Prompt message to display to the user"
106
- },
107
- "required": {
108
- "type": "boolean",
109
- "description": "Whether the prompt value is required (cannot be empty)"
110
- },
111
- "enabled": {
112
- "description": "Whether this prompt should be displayed. Can be a boolean, a string expression, or a conditional expression based on variables or other prompt values.",
113
- "oneOf": [
114
- {
115
- "type": "boolean",
116
- "description": "Static enabled state"
117
- },
118
- {
119
- "type": "string",
120
- "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Prompt only displays if expression evaluates to true."
121
- },
122
- {
123
- "type": "object",
124
- "description": "Conditional enabled configuration",
125
- "required": ["condition"],
126
- "properties": {
127
- "condition": {
128
- "type": "string",
129
- "description": "JavaScript expression to evaluate. Prompt only displays if condition evaluates to true. Has access to all variables and previously collected prompts."
130
- }
131
- }
132
- }
133
- ]
134
- },
135
- "default": {
136
- "description": "Default value for the prompt. Can be a static value, an object with 'type' and 'value' properties for executable defaults, or a conditional default configuration.",
137
- "oneOf": [
138
- {
139
- "description": "Static default value (string, number, or boolean)"
140
- },
141
- {
142
- "type": "object",
143
- "description": "Default value configuration for static or executable values",
144
- "required": ["type", "value"],
145
- "properties": {
146
- "type": {
147
- "type": "string",
148
- "enum": ["static", "exec"],
149
- "description": "Type of default value. 'static' for explicit static values, 'exec' for command execution."
150
- },
151
- "value": {
152
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
153
- }
154
- }
155
- },
156
- {
157
- "type": "object",
158
- "description": "Conditional default value configuration",
159
- "required": ["type", "condition", "ifTrue", "ifFalse"],
160
- "properties": {
161
- "type": {
162
- "type": "string",
163
- "enum": ["conditional"],
164
- "description": "Type of default value. 'conditional' for condition-based defaults."
165
- },
166
- "condition": {
167
- "type": "string",
168
- "description": "JavaScript expression to evaluate. Can reference variables, prompts, and config values."
169
- },
170
- "ifTrue": {
171
- "description": "Value to use if condition evaluates to true. Can be a static value or a template string with {{variables}}."
172
- },
173
- "ifFalse": {
174
- "description": "Value to use if condition evaluates to false. Can be a static value or a template string with {{variables}}."
175
- }
176
- }
177
- }
178
- ]
179
- },
180
- "placeholder": {
181
- "type": "string",
182
- "description": "Placeholder text (for input prompts)"
183
- },
184
- "min": {
185
- "type": "number",
186
- "description": "Minimum value (for number prompts)"
187
- },
188
- "max": {
189
- "type": "number",
190
- "description": "Maximum value (for number prompts)"
191
- },
192
- "choices": {
193
- "type": "array",
194
- "description": "Available choices (for select prompts)",
195
- "items": {
196
- "type": "object",
197
- "required": ["name", "value"],
198
- "properties": {
199
- "name": {
200
- "type": "string",
201
- "description": "Display name for the choice"
202
- },
203
- "value": {
204
- "description": "Value to use when this choice is selected"
205
- }
206
- }
207
- }
208
- },
209
- "override": {
210
- "type": "string",
211
- "enum": ["merge", "replace"],
212
- "description": "Strategy for merging with base prompt when extending templates. 'merge' (default) intelligently merges properties, 'replace' completely replaces the base prompt. Must be specified when prompt ID conflicts with base template."
213
- }
214
- }
215
- }
53
+ "items": { "$ref": "#/$defs/promptItem" }
216
54
  },
217
55
  "tasks": {
218
56
  "type": "array",
219
57
  "items": {
220
58
  "type": "object",
221
- "required": ["id", "name", "type"],
59
+ "required": ["id", "name", "type", "config"],
222
60
  "additionalProperties": false,
223
61
  "properties": {
224
62
  "id": {
@@ -242,208 +80,31 @@
242
80
  "description": "Whether this task should be executed. Can be a boolean, a string expression, or a conditional expression based on variables or prompt values (optional, defaults to true).",
243
81
  "default": true,
244
82
  "oneOf": [
245
- {
246
- "type": "boolean",
247
- "description": "Static enabled state"
248
- },
249
- {
250
- "type": "string",
251
- "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Task only executes if expression evaluates to true."
252
- },
83
+ { "type": "boolean", "description": "Static enabled state" },
84
+ { "type": "string", "description": "JavaScript expression to evaluate" },
253
85
  {
254
86
  "type": "object",
255
87
  "description": "Conditional enabled configuration",
256
88
  "required": ["condition"],
257
- "properties": {
258
- "condition": {
259
- "type": "string",
260
- "description": "JavaScript expression to evaluate. Task only executes if condition evaluates to true. Has access to all variables and prompt values."
261
- }
262
- }
89
+ "properties": { "condition": { "type": "string" } }
263
90
  }
264
91
  ]
265
92
  },
266
93
  "dependencies": {
267
94
  "type": "array",
268
- "items": {
269
- "type": "string"
270
- },
95
+ "items": { "type": "string" },
271
96
  "description": "IDs of tasks that must run before this one"
272
97
  },
273
98
  "override": {
274
99
  "type": "string",
275
100
  "enum": ["merge", "replace"],
276
- "description": "Strategy for merging with base task when extending templates. 'merge' (default) intelligently merges properties, 'replace' completely replaces the base task. Must be specified when task ID conflicts with base template."
277
- },
278
- "$sourceUrl": {
279
- "type": "string",
280
- "description": "Internal: URL or path of the template file this task came from (for resolving relative paths). This property is automatically added by the template inheritance system."
281
- },
282
- "prompts": {
283
- "type": "array",
284
- "description": "Task-specific prompts collected when the task is executed. These values are only available to this task.",
285
- "items": {
286
- "type": "object",
287
- "required": ["id", "type", "message"],
288
- "additionalProperties": false,
289
- "properties": {
290
- "id": {
291
- "type": "string",
292
- "description": "Unique identifier for the prompt value (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
293
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
294
- },
295
- "type": {
296
- "type": "string",
297
- "enum": ["input", "select", "confirm", "password", "number"],
298
- "description": "Type of prompt to display"
299
- },
300
- "message": {
301
- "type": "string",
302
- "description": "Prompt message to display to the user"
303
- },
304
- "required": {
305
- "type": "boolean",
306
- "description": "Whether the prompt value is required (cannot be empty)"
307
- },
308
- "enabled": {
309
- "description": "Whether this prompt should be displayed. Can be a boolean, a string expression, or a conditional expression based on variables or other prompt values.",
310
- "oneOf": [
311
- {
312
- "type": "boolean",
313
- "description": "Static enabled state"
314
- },
315
- {
316
- "type": "string",
317
- "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Prompt only displays if expression evaluates to true."
318
- },
319
- {
320
- "type": "object",
321
- "description": "Conditional enabled configuration",
322
- "required": ["condition"],
323
- "properties": {
324
- "condition": {
325
- "type": "string",
326
- "description": "JavaScript expression to evaluate. Prompt only displays if condition evaluates to true. Has access to all variables and previously collected prompts."
327
- }
328
- }
329
- }
330
- ]
331
- },
332
- "default": {
333
- "description": "Default value for the prompt. Can be a static value, an object with 'type' and 'value' properties for executable defaults, or a conditional default configuration.",
334
- "oneOf": [
335
- {
336
- "description": "Static default value (string, number, or boolean)"
337
- },
338
- {
339
- "type": "object",
340
- "description": "Default value configuration for static or executable values",
341
- "required": ["type", "value"],
342
- "properties": {
343
- "type": {
344
- "type": "string",
345
- "enum": ["static", "exec"],
346
- "description": "Type of default value. 'static' for explicit static values, 'exec' for command execution."
347
- },
348
- "value": {
349
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
350
- }
351
- }
352
- },
353
- {
354
- "type": "object",
355
- "description": "Conditional default value configuration",
356
- "required": ["type", "condition", "ifTrue", "ifFalse"],
357
- "properties": {
358
- "type": {
359
- "type": "string",
360
- "enum": ["conditional"],
361
- "description": "Type of default value. 'conditional' for condition-based defaults."
362
- },
363
- "condition": {
364
- "type": "string",
365
- "description": "JavaScript expression to evaluate. Can reference variables, prompts, and config values."
366
- },
367
- "ifTrue": {
368
- "description": "Value to use if condition evaluates to true. Can be a static value or a template string with {{variables}}."
369
- },
370
- "ifFalse": {
371
- "description": "Value to use if condition evaluates to false. Can be a static value or a template string with {{variables}}."
372
- }
373
- }
374
- }
375
- ]
376
- },
377
- "placeholder": {
378
- "type": "string",
379
- "description": "Placeholder text (for input prompts)"
380
- },
381
- "min": {
382
- "type": "number",
383
- "description": "Minimum value (for number prompts)"
384
- },
385
- "max": {
386
- "type": "number",
387
- "description": "Maximum value (for number prompts)"
388
- },
389
- "choices": {
390
- "type": "array",
391
- "description": "Available choices (for select prompts)",
392
- "items": {
393
- "type": "object",
394
- "required": ["name", "value"],
395
- "properties": {
396
- "name": {
397
- "type": "string",
398
- "description": "Display name for the choice"
399
- },
400
- "value": {
401
- "description": "Value to use when this choice is selected"
402
- }
403
- }
404
- }
405
- }
406
- }
407
- }
101
+ "description": "Strategy for merging with base task when extending templates"
408
102
  },
103
+ "$sourceUrl": { "type": "string" },
104
+ "prompts": { "type": "array", "items": { "$ref": "#/$defs/promptItem" } },
409
105
  "variables": {
410
106
  "type": "array",
411
- "description": "Task-scoped variables available only to this specific task. Variables are resolved once at startup and do not require user interaction. For variables shared across tasks, use top-level variables instead.",
412
- "items": {
413
- "type": "object",
414
- "required": ["id", "value"],
415
- "additionalProperties": false,
416
- "properties": {
417
- "id": {
418
- "type": "string",
419
- "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
420
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
421
- },
422
- "value": {
423
- "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
424
- "oneOf": [
425
- {
426
- "description": "Static value (string, number, or boolean)"
427
- },
428
- {
429
- "type": "object",
430
- "description": "Value configuration for static or executable values",
431
- "required": ["type", "value"],
432
- "properties": {
433
- "type": {
434
- "type": "string",
435
- "enum": ["static", "exec"],
436
- "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
437
- },
438
- "value": {
439
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
440
- }
441
- }
442
- }
443
- ]
444
- }
445
- }
446
- }
107
+ "items": { "$ref": "#/$defs/taskVariableItem" }
447
108
  },
448
109
  "type": {
449
110
  "type": "string",
@@ -462,222 +123,499 @@
462
123
  },
463
124
  "config": {
464
125
  "type": "object",
465
- "description": "Task-specific configuration",
466
- "oneOf": [
467
- {
468
- "title": "Update JSON Config",
469
- "properties": {
470
- "file": {
471
- "type": "string",
472
- "description": "Path to the JSON file to update"
473
- },
474
- "updates": {
475
- "type": "object",
476
- "description": "Key-value pairs to update (supports nested paths with dot notation)"
477
- },
478
- "condition": {
479
- "type": "string",
480
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
481
- }
482
- },
483
- "required": ["file", "updates"]
484
- },
485
- {
486
- "title": "Template Config",
487
- "properties": {
488
- "file": {
489
- "type": "string",
490
- "description": "Path to the file to create or overwrite"
491
- },
492
- "template": {
493
- "type": "string",
494
- "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
495
- },
496
- "templateFile": {
497
- "type": "string",
498
- "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
499
- },
500
- "condition": {
501
- "type": "string",
502
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
503
- }
504
- },
505
- "required": ["file"],
506
- "oneOf": [
507
- {
508
- "required": ["template"]
509
- },
510
- {
511
- "required": ["templateFile"]
512
- }
513
- ]
514
- },
515
- {
516
- "title": "Create Config",
517
- "properties": {
518
- "file": {
519
- "type": "string",
520
- "description": "Path to the file to create (will not overwrite if file already exists)"
521
- },
522
- "template": {
523
- "type": "string",
524
- "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
525
- },
526
- "templateFile": {
527
- "type": "string",
528
- "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
529
- },
530
- "condition": {
531
- "type": "string",
532
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
533
- }
126
+ "description": "Task-specific configuration"
127
+ }
128
+ },
129
+ "oneOf": [
130
+ {
131
+ "properties": {
132
+ "type": { "const": "update-json" },
133
+ "config": { "$ref": "#/$defs/config-update-json" }
134
+ }
135
+ },
136
+ {
137
+ "properties": {
138
+ "type": { "const": "template" },
139
+ "config": { "$ref": "#/$defs/config-template" }
140
+ }
141
+ },
142
+ {
143
+ "properties": {
144
+ "type": { "const": "create" },
145
+ "config": { "$ref": "#/$defs/config-create" }
146
+ }
147
+ },
148
+ {
149
+ "properties": {
150
+ "type": { "const": "regex-replace" },
151
+ "config": { "$ref": "#/$defs/config-regex-replace" }
152
+ }
153
+ },
154
+ {
155
+ "properties": {
156
+ "type": { "const": "replace-in-file" },
157
+ "config": { "$ref": "#/$defs/config-replace-in-file" }
158
+ }
159
+ },
160
+ {
161
+ "properties": {
162
+ "type": { "const": "delete" },
163
+ "config": { "$ref": "#/$defs/config-delete" }
164
+ }
165
+ },
166
+ {
167
+ "properties": {
168
+ "type": { "const": "rename" },
169
+ "config": { "$ref": "#/$defs/config-rename" }
170
+ }
171
+ },
172
+ {
173
+ "properties": {
174
+ "type": { "const": "git-init" },
175
+ "config": { "$ref": "#/$defs/config-git-init" }
176
+ }
177
+ },
178
+ {
179
+ "properties": {
180
+ "type": { "const": "exec" },
181
+ "config": { "$ref": "#/$defs/config-exec" }
182
+ }
183
+ }
184
+ ]
185
+ }
186
+ }
187
+ },
188
+ "$defs": {
189
+ "promptItem": {
190
+ "type": "object",
191
+ "required": ["id", "type", "message"],
192
+ "additionalProperties": false,
193
+ "properties": {
194
+ "id": {
195
+ "type": "string",
196
+ "description": "Unique identifier for the prompt value (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
197
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
198
+ },
199
+ "type": {
200
+ "type": "string",
201
+ "enum": ["input", "select", "confirm", "password", "number"],
202
+ "description": "Type of prompt to display"
203
+ },
204
+ "message": {
205
+ "type": "string",
206
+ "description": "Prompt message to display to the user"
207
+ },
208
+ "required": {
209
+ "type": "boolean",
210
+ "description": "Whether the prompt value is required (cannot be empty)"
211
+ },
212
+ "enabled": {
213
+ "description": "Whether this prompt should be displayed. Can be a boolean, a string expression, or a conditional expression based on variables or other prompt values.",
214
+ "oneOf": [
215
+ {
216
+ "type": "boolean",
217
+ "description": "Static enabled state"
218
+ },
219
+ {
220
+ "type": "string",
221
+ "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Prompt only displays if expression evaluates to true."
222
+ },
223
+ {
224
+ "type": "object",
225
+ "description": "Conditional enabled configuration",
226
+ "required": ["condition"],
227
+ "properties": {
228
+ "condition": {
229
+ "type": "string",
230
+ "description": "JavaScript expression to evaluate. Prompt only displays if condition evaluates to true. Has access to all variables and previously collected prompts."
231
+ }
232
+ }
233
+ }
234
+ ]
235
+ },
236
+ "default": {
237
+ "description": "Default value for the prompt. Can be a static value, an object with 'type' and 'value' properties for executable defaults, or a conditional default configuration.",
238
+ "oneOf": [
239
+ {
240
+ "description": "Static default value (string, number, or boolean)"
241
+ },
242
+ {
243
+ "type": "object",
244
+ "description": "Default value configuration for static or executable values",
245
+ "required": ["type", "value"],
246
+ "properties": {
247
+ "type": {
248
+ "type": "string",
249
+ "enum": ["static", "exec"],
250
+ "description": "Type of default value. 'static' for explicit static values, 'exec' for command execution."
534
251
  },
535
- "required": ["file"],
536
- "oneOf": [
537
- {
538
- "required": ["template"]
539
- },
540
- {
541
- "required": ["templateFile"]
542
- }
543
- ]
544
- },
545
- {
546
- "title": "Regex Replace Config",
547
- "properties": {
548
- "file": {
549
- "type": "string",
550
- "description": "Path to the file to modify"
551
- },
552
- "pattern": {
553
- "type": "string",
554
- "description": "Regular expression pattern to find"
555
- },
556
- "flags": {
557
- "type": "string",
558
- "description": "Regex flags (e.g., 'g', 'gm', 'gi')"
559
- },
560
- "replacement": {
561
- "type": "string",
562
- "description": "String to replace matches with"
563
- },
564
- "condition": {
565
- "type": "string",
566
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
567
- }
252
+ "value": {
253
+ "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "type": "object",
259
+ "description": "Conditional default value configuration",
260
+ "required": ["type", "condition", "ifTrue", "ifFalse"],
261
+ "properties": {
262
+ "type": {
263
+ "type": "string",
264
+ "enum": ["conditional"],
265
+ "description": "Type of default value. 'conditional' for condition-based defaults."
568
266
  },
569
- "required": ["file", "pattern", "replacement"]
570
- },
571
- {
572
- "title": "Replace In File Config",
573
- "properties": {
574
- "file": {
575
- "type": "string",
576
- "description": "Path to the file to modify"
577
- },
578
- "replacements": {
579
- "type": "array",
580
- "items": {
581
- "type": "object",
582
- "properties": {
583
- "find": {
584
- "type": "string",
585
- "description": "String to find"
586
- },
587
- "replace": {
588
- "type": "string",
589
- "description": "String to replace with"
590
- }
591
- },
592
- "required": ["find", "replace"]
593
- }
594
- },
595
- "condition": {
596
- "type": "string",
597
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
598
- }
267
+ "condition": {
268
+ "type": "string",
269
+ "description": "JavaScript expression to evaluate. Can reference variables, prompts, and config values."
599
270
  },
600
- "required": ["file", "replacements"]
601
- },
602
- {
603
- "title": "Delete Config",
604
- "properties": {
605
- "paths": {
606
- "type": "array",
607
- "items": {
608
- "type": "string"
609
- },
610
- "description": "Array of file or directory paths to delete"
611
- },
612
- "condition": {
613
- "type": "string",
614
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
615
- }
271
+ "ifTrue": {
272
+ "description": "Value to use if condition evaluates to true. Can be a static value or a template string with {{variables}}."
616
273
  },
617
- "required": ["paths"]
274
+ "ifFalse": {
275
+ "description": "Value to use if condition evaluates to false. Can be a static value or a template string with {{variables}}."
276
+ }
277
+ }
278
+ }
279
+ ]
280
+ },
281
+ "placeholder": {
282
+ "type": "string",
283
+ "description": "Placeholder text (for input prompts)"
284
+ },
285
+ "min": {
286
+ "type": "number",
287
+ "description": "Minimum value (for number prompts)"
288
+ },
289
+ "max": {
290
+ "type": "number",
291
+ "description": "Maximum value (for number prompts)"
292
+ },
293
+ "choices": {
294
+ "type": "array",
295
+ "description": "Available choices (for select prompts)",
296
+ "items": {
297
+ "type": "object",
298
+ "required": ["name", "value"],
299
+ "properties": {
300
+ "name": {
301
+ "type": "string",
302
+ "description": "Display name for the choice"
618
303
  },
619
- {
620
- "title": "Rename Config",
621
- "properties": {
622
- "from": {
623
- "type": "string",
624
- "description": "Current file or directory path"
625
- },
626
- "to": {
627
- "type": "string",
628
- "description": "New file or directory path"
629
- },
630
- "condition": {
631
- "type": "string",
632
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
633
- }
304
+ "value": {
305
+ "description": "Value to use when this choice is selected"
306
+ }
307
+ }
308
+ }
309
+ },
310
+ "override": {
311
+ "type": "string",
312
+ "enum": ["merge", "replace"],
313
+ "description": "Strategy for merging with base prompt when extending templates. 'merge' (default) intelligently merges properties, 'replace' completely replaces the base prompt. Must be specified when prompt ID conflicts with base template."
314
+ }
315
+ }
316
+ },
317
+ "variableItem": {
318
+ "type": "object",
319
+ "required": ["id", "value"],
320
+ "additionalProperties": false,
321
+ "properties": {
322
+ "id": {
323
+ "type": "string",
324
+ "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
325
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
326
+ },
327
+ "value": {
328
+ "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
329
+ "oneOf": [
330
+ {
331
+ "description": "Static value (string, number, or boolean)"
332
+ },
333
+ {
334
+ "type": "object",
335
+ "description": "Value configuration for static or executable values",
336
+ "required": ["type", "value"],
337
+ "properties": {
338
+ "type": {
339
+ "type": "string",
340
+ "enum": ["static", "exec"],
341
+ "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
634
342
  },
635
- "required": ["from", "to"]
636
- },
637
- {
638
- "title": "Git Init Config",
639
- "properties": {
640
- "removeExisting": {
641
- "type": "boolean",
642
- "description": "Whether to remove existing .git directory"
643
- },
644
- "initialCommit": {
645
- "type": "boolean",
646
- "description": "Whether to create an initial commit"
647
- },
648
- "message": {
649
- "type": "string",
650
- "description": "Initial commit message"
651
- },
652
- "condition": {
653
- "type": "string",
654
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
655
- }
343
+ "value": {
344
+ "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
345
+ }
346
+ }
347
+ }
348
+ ]
349
+ },
350
+ "override": {
351
+ "type": "string",
352
+ "enum": ["merge", "replace"],
353
+ "description": "Strategy for merging with base variable when extending templates. 'merge' (default) replaces the value, 'replace' completely replaces the variable. Must be specified when variable ID conflicts with base template."
354
+ }
355
+ }
356
+ },
357
+ "taskVariableItem": {
358
+ "type": "object",
359
+ "required": ["id", "value"],
360
+ "additionalProperties": false,
361
+ "properties": {
362
+ "id": {
363
+ "type": "string",
364
+ "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
365
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
366
+ },
367
+ "value": {
368
+ "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
369
+ "oneOf": [
370
+ {
371
+ "description": "Static value (string, number, or boolean)"
372
+ },
373
+ {
374
+ "type": "object",
375
+ "description": "Value configuration for static or executable values",
376
+ "required": ["type", "value"],
377
+ "properties": {
378
+ "type": {
379
+ "type": "string",
380
+ "enum": ["static", "exec"],
381
+ "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
656
382
  },
657
- "required": ["removeExisting", "initialCommit"]
383
+ "value": {
384
+ "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
385
+ }
386
+ }
387
+ }
388
+ ]
389
+ }
390
+ }
391
+ },
392
+ "config-update-json": {
393
+ "title": "Update JSON Config",
394
+ "type": "object",
395
+ "additionalProperties": false,
396
+ "properties": {
397
+ "file": {
398
+ "type": "string",
399
+ "description": "Path to the JSON file to update"
400
+ },
401
+ "updates": {
402
+ "type": "object",
403
+ "description": "Key-value pairs to update (supports nested paths with dot notation)"
404
+ },
405
+ "condition": {
406
+ "type": "string",
407
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
408
+ }
409
+ },
410
+ "required": ["file", "updates"]
411
+ },
412
+ "config-template": {
413
+ "title": "Template Config",
414
+ "type": "object",
415
+ "additionalProperties": false,
416
+ "properties": {
417
+ "file": {
418
+ "type": "string",
419
+ "description": "Path to the file to create or overwrite"
420
+ },
421
+ "template": {
422
+ "type": "string",
423
+ "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
424
+ },
425
+ "templateFile": {
426
+ "type": "string",
427
+ "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
428
+ },
429
+ "condition": {
430
+ "type": "string",
431
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
432
+ }
433
+ },
434
+ "required": ["file"],
435
+ "oneOf": [
436
+ {
437
+ "required": ["template"]
438
+ },
439
+ {
440
+ "required": ["templateFile"]
441
+ }
442
+ ]
443
+ },
444
+ "config-create": {
445
+ "title": "Create Config",
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "properties": {
449
+ "file": {
450
+ "type": "string",
451
+ "description": "Path to the file to create (will not overwrite if file already exists)"
452
+ },
453
+ "template": {
454
+ "type": "string",
455
+ "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
456
+ },
457
+ "templateFile": {
458
+ "type": "string",
459
+ "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
460
+ },
461
+ "condition": {
462
+ "type": "string",
463
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
464
+ }
465
+ },
466
+ "required": ["file"],
467
+ "oneOf": [
468
+ {
469
+ "required": ["template"]
470
+ },
471
+ {
472
+ "required": ["templateFile"]
473
+ }
474
+ ]
475
+ },
476
+ "config-regex-replace": {
477
+ "title": "Regex Replace Config",
478
+ "type": "object",
479
+ "additionalProperties": false,
480
+ "properties": {
481
+ "file": {
482
+ "type": "string",
483
+ "description": "Path to the file to modify"
484
+ },
485
+ "pattern": {
486
+ "type": "string",
487
+ "description": "Regular expression pattern to find"
488
+ },
489
+ "flags": {
490
+ "type": "string",
491
+ "description": "Regex flags (e.g., 'g', 'gm', 'gi')"
492
+ },
493
+ "replacement": {
494
+ "type": "string",
495
+ "description": "String to replace matches with"
496
+ },
497
+ "condition": {
498
+ "type": "string",
499
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
500
+ }
501
+ },
502
+ "required": ["file", "pattern", "replacement"]
503
+ },
504
+ "config-replace-in-file": {
505
+ "title": "Replace In File Config",
506
+ "type": "object",
507
+ "additionalProperties": false,
508
+ "properties": {
509
+ "file": {
510
+ "type": "string",
511
+ "description": "Path to the file to modify"
512
+ },
513
+ "replacements": {
514
+ "type": "array",
515
+ "items": {
516
+ "type": "object",
517
+ "properties": {
518
+ "find": {
519
+ "type": "string",
520
+ "description": "String to find"
658
521
  },
659
- {
660
- "title": "Exec Config",
661
- "properties": {
662
- "command": {
663
- "type": "string",
664
- "description": "Shell command to execute"
665
- },
666
- "cwd": {
667
- "type": "string",
668
- "description": "Working directory for the command"
669
- },
670
- "condition": {
671
- "type": "string",
672
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
673
- }
674
- },
675
- "required": ["command"]
522
+ "replace": {
523
+ "type": "string",
524
+ "description": "String to replace with"
676
525
  }
677
- ]
526
+ },
527
+ "required": ["find", "replace"]
678
528
  }
529
+ },
530
+ "condition": {
531
+ "type": "string",
532
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
679
533
  }
680
- }
534
+ },
535
+ "required": ["file", "replacements"]
536
+ },
537
+ "config-delete": {
538
+ "title": "Delete Config",
539
+ "type": "object",
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "paths": {
543
+ "type": "array",
544
+ "items": {
545
+ "type": "string"
546
+ },
547
+ "description": "Array of file or directory paths to delete"
548
+ },
549
+ "condition": {
550
+ "type": "string",
551
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
552
+ }
553
+ },
554
+ "required": ["paths"]
555
+ },
556
+ "config-rename": {
557
+ "title": "Rename Config",
558
+ "type": "object",
559
+ "additionalProperties": false,
560
+ "properties": {
561
+ "from": {
562
+ "type": "string",
563
+ "description": "Current file or directory path"
564
+ },
565
+ "to": {
566
+ "type": "string",
567
+ "description": "New file or directory path"
568
+ },
569
+ "condition": {
570
+ "type": "string",
571
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
572
+ }
573
+ },
574
+ "required": ["from", "to"]
575
+ },
576
+ "config-git-init": {
577
+ "title": "Git Init Config",
578
+ "type": "object",
579
+ "additionalProperties": false,
580
+ "properties": {
581
+ "removeExisting": {
582
+ "type": "boolean",
583
+ "description": "Whether to remove existing .git directory"
584
+ },
585
+ "initialCommit": {
586
+ "type": "boolean",
587
+ "description": "Whether to create an initial commit"
588
+ },
589
+ "message": {
590
+ "type": "string",
591
+ "description": "Initial commit message"
592
+ },
593
+ "condition": {
594
+ "type": "string",
595
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
596
+ }
597
+ },
598
+ "required": ["removeExisting", "initialCommit"]
599
+ },
600
+ "config-exec": {
601
+ "title": "Exec Config",
602
+ "additionalProperties": false,
603
+ "type": "object",
604
+ "properties": {
605
+ "command": {
606
+ "type": "string",
607
+ "description": "Shell command to execute"
608
+ },
609
+ "cwd": {
610
+ "type": "string",
611
+ "description": "Working directory for the command"
612
+ },
613
+ "condition": {
614
+ "type": "string",
615
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
616
+ }
617
+ },
618
+ "required": ["command"]
681
619
  }
682
620
  }
683
621
  }