@fugood/bricks-ctor 2.24.0-beta.40

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.
Files changed (129) hide show
  1. package/compile/action-name-map.ts +988 -0
  2. package/compile/index.ts +1245 -0
  3. package/compile/util.ts +358 -0
  4. package/index.ts +6 -0
  5. package/package.json +28 -0
  6. package/skills/bricks-design/LICENSE.txt +180 -0
  7. package/skills/bricks-design/SKILL.md +66 -0
  8. package/skills/bricks-project/SKILL.md +32 -0
  9. package/skills/bricks-project/rules/animation.md +159 -0
  10. package/skills/bricks-project/rules/architecture-patterns.md +69 -0
  11. package/skills/bricks-project/rules/automations.md +221 -0
  12. package/skills/bricks-project/rules/buttress.md +156 -0
  13. package/skills/bricks-project/rules/data-calculation.md +208 -0
  14. package/skills/bricks-project/rules/local-sync.md +129 -0
  15. package/skills/bricks-project/rules/media-flow.md +158 -0
  16. package/skills/bricks-project/rules/remote-data-bank.md +196 -0
  17. package/skills/bricks-project/rules/standby-transition.md +124 -0
  18. package/skills/rive-marketplace/SKILL.md +99 -0
  19. package/tools/deploy.ts +151 -0
  20. package/tools/icons/.gitattributes +1 -0
  21. package/tools/icons/fa6pro-glyphmap.json +4686 -0
  22. package/tools/icons/fa6pro-meta.json +3671 -0
  23. package/tools/mcp-server.ts +28 -0
  24. package/tools/mcp-tools/compile.ts +91 -0
  25. package/tools/mcp-tools/huggingface.ts +762 -0
  26. package/tools/mcp-tools/icons.ts +70 -0
  27. package/tools/mcp-tools/lottie.ts +102 -0
  28. package/tools/mcp-tools/media.ts +110 -0
  29. package/tools/postinstall.ts +229 -0
  30. package/tools/preview-main.mjs +293 -0
  31. package/tools/preview.ts +143 -0
  32. package/tools/pull.ts +116 -0
  33. package/tsconfig.json +16 -0
  34. package/types/animation.ts +100 -0
  35. package/types/automation.ts +235 -0
  36. package/types/brick-base.ts +80 -0
  37. package/types/bricks/Camera.ts +246 -0
  38. package/types/bricks/Chart.ts +372 -0
  39. package/types/bricks/GenerativeMedia.ts +276 -0
  40. package/types/bricks/Icon.ts +98 -0
  41. package/types/bricks/Image.ts +114 -0
  42. package/types/bricks/Items.ts +476 -0
  43. package/types/bricks/Lottie.ts +168 -0
  44. package/types/bricks/Maps.ts +262 -0
  45. package/types/bricks/QrCode.ts +117 -0
  46. package/types/bricks/Rect.ts +150 -0
  47. package/types/bricks/RichText.ts +128 -0
  48. package/types/bricks/Rive.ts +220 -0
  49. package/types/bricks/Slideshow.ts +201 -0
  50. package/types/bricks/Svg.ts +99 -0
  51. package/types/bricks/Text.ts +148 -0
  52. package/types/bricks/TextInput.ts +242 -0
  53. package/types/bricks/Video.ts +175 -0
  54. package/types/bricks/VideoStreaming.ts +112 -0
  55. package/types/bricks/WebRtcStream.ts +65 -0
  56. package/types/bricks/WebView.ts +168 -0
  57. package/types/bricks/index.ts +21 -0
  58. package/types/canvas.ts +82 -0
  59. package/types/common.ts +144 -0
  60. package/types/data-calc-command.ts +7005 -0
  61. package/types/data-calc-script.ts +21 -0
  62. package/types/data-calc.ts +11 -0
  63. package/types/data.ts +95 -0
  64. package/types/generators/AlarmClock.ts +110 -0
  65. package/types/generators/Assistant.ts +621 -0
  66. package/types/generators/BleCentral.ts +247 -0
  67. package/types/generators/BlePeripheral.ts +208 -0
  68. package/types/generators/CanvasMap.ts +74 -0
  69. package/types/generators/CastlesPay.ts +87 -0
  70. package/types/generators/DataBank.ts +160 -0
  71. package/types/generators/File.ts +432 -0
  72. package/types/generators/GraphQl.ts +132 -0
  73. package/types/generators/Http.ts +222 -0
  74. package/types/generators/HttpServer.ts +176 -0
  75. package/types/generators/Information.ts +103 -0
  76. package/types/generators/Intent.ts +168 -0
  77. package/types/generators/Iterator.ts +108 -0
  78. package/types/generators/Keyboard.ts +105 -0
  79. package/types/generators/LlmAnthropicCompat.ts +212 -0
  80. package/types/generators/LlmAppleBuiltin.ts +159 -0
  81. package/types/generators/LlmGgml.ts +861 -0
  82. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  83. package/types/generators/LlmMlx.ts +227 -0
  84. package/types/generators/LlmOnnx.ts +213 -0
  85. package/types/generators/LlmOpenAiCompat.ts +244 -0
  86. package/types/generators/LlmQualcommAiEngine.ts +247 -0
  87. package/types/generators/Mcp.ts +637 -0
  88. package/types/generators/McpServer.ts +289 -0
  89. package/types/generators/MediaFlow.ts +170 -0
  90. package/types/generators/MqttBroker.ts +141 -0
  91. package/types/generators/MqttClient.ts +141 -0
  92. package/types/generators/Question.ts +408 -0
  93. package/types/generators/RealtimeTranscription.ts +279 -0
  94. package/types/generators/RerankerGgml.ts +191 -0
  95. package/types/generators/SerialPort.ts +151 -0
  96. package/types/generators/SoundPlayer.ts +94 -0
  97. package/types/generators/SoundRecorder.ts +130 -0
  98. package/types/generators/SpeechToTextGgml.ts +415 -0
  99. package/types/generators/SpeechToTextOnnx.ts +236 -0
  100. package/types/generators/SpeechToTextPlatform.ts +85 -0
  101. package/types/generators/SqLite.ts +159 -0
  102. package/types/generators/Step.ts +107 -0
  103. package/types/generators/SttAppleBuiltin.ts +130 -0
  104. package/types/generators/Tcp.ts +126 -0
  105. package/types/generators/TcpServer.ts +147 -0
  106. package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
  107. package/types/generators/TextToSpeechGgml.ts +221 -0
  108. package/types/generators/TextToSpeechOnnx.ts +178 -0
  109. package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
  110. package/types/generators/ThermalPrinter.ts +191 -0
  111. package/types/generators/Tick.ts +83 -0
  112. package/types/generators/Udp.ts +120 -0
  113. package/types/generators/VadGgml.ts +250 -0
  114. package/types/generators/VadOnnx.ts +231 -0
  115. package/types/generators/VadTraditional.ts +138 -0
  116. package/types/generators/VectorStore.ts +257 -0
  117. package/types/generators/Watchdog.ts +107 -0
  118. package/types/generators/WebCrawler.ts +103 -0
  119. package/types/generators/WebRtc.ts +181 -0
  120. package/types/generators/WebSocket.ts +148 -0
  121. package/types/generators/index.ts +57 -0
  122. package/types/index.ts +13 -0
  123. package/types/subspace.ts +59 -0
  124. package/types/switch.ts +51 -0
  125. package/types/system.ts +707 -0
  126. package/utils/calc.ts +126 -0
  127. package/utils/data.ts +497 -0
  128. package/utils/event-props.ts +836 -0
  129. package/utils/id.ts +80 -0
@@ -0,0 +1,358 @@
1
+ import { makeId } from '../utils/id'
2
+
3
+ type ScriptConfig = {
4
+ title?: string
5
+ note?: string
6
+ inputs: Record<string, string>
7
+ enable_async: boolean
8
+ trigger_mode?: 'auto' | 'manual'
9
+ disabled_triggers: Record<string, boolean>
10
+ output: string | null
11
+ outputs: Record<string, string[]>
12
+ error: string | null
13
+ code: string
14
+ }
15
+
16
+ const errorMsg = 'Not allow duplicate set property id between inputs / outputs / output / error.'
17
+
18
+ export const validateConfig = (config: ScriptConfig) => {
19
+ // Skip input/output overlap validation in manual mode (allows same data node in both)
20
+ if (config.trigger_mode === 'manual') return
21
+ if (config.error && config.inputs[config.error]) {
22
+ throw new Error(`${errorMsg}. key: error`)
23
+ }
24
+ if (config.output && config.inputs[config.output]) {
25
+ throw new Error(`${errorMsg}. key: output`)
26
+ }
27
+ if (Object.values(config.outputs).some((value) => value.some((id) => config.inputs[id]))) {
28
+ throw new Error(`${errorMsg}. key: outputs`)
29
+ }
30
+ }
31
+
32
+ const padding = 15
33
+ const layerXInterval = 300
34
+ const layerYInterval = 150
35
+
36
+ export const generateCalulationMap = (config: ScriptConfig, opts?: { snapshotMode?: boolean }) => {
37
+ validateConfig(config)
38
+ const sandboxId = makeId('property_bank_command', opts)
39
+ const sandboxErrorId = makeId('property_bank_command', opts)
40
+ const sandboxResultId = makeId('property_bank_command', opts)
41
+
42
+ const inputs = Object.entries(config.inputs).reduce(
43
+ (acc, [key, value], index) => {
44
+ const commandId = makeId('property_bank_command', opts)
45
+ acc.map[key] = {
46
+ type: 'data-node',
47
+ properties: {},
48
+ in: {
49
+ change: null,
50
+ },
51
+ out: {
52
+ value: [
53
+ {
54
+ id: commandId,
55
+ port: 'value',
56
+ },
57
+ ],
58
+ },
59
+ }
60
+ acc.editorInfo[key] = {
61
+ position: { x: padding, y: index * layerYInterval + padding },
62
+ points: {},
63
+ }
64
+ if (acc.prevCommandId) {
65
+ acc.map[acc.prevCommandId].out.result = [
66
+ {
67
+ id: commandId,
68
+ port: 'obj',
69
+ },
70
+ ]
71
+ }
72
+ acc.map[commandId] = {
73
+ type: 'command-node-object',
74
+ title: 'Command: OBJECT_SET',
75
+ properties: {
76
+ command: 'OBJECT_SET',
77
+ args: {
78
+ path: value,
79
+ },
80
+ },
81
+ in: {
82
+ obj: acc.prevCommandId
83
+ ? [
84
+ {
85
+ id: acc.prevCommandId,
86
+ port: 'result',
87
+ },
88
+ ]
89
+ : null,
90
+ path: null,
91
+ value: [
92
+ {
93
+ id: key,
94
+ port: 'value',
95
+ disable_trigger_command:
96
+ config.trigger_mode === 'manual' || config.disabled_triggers?.[key] || undefined,
97
+ },
98
+ ],
99
+ },
100
+ out: {
101
+ result: [
102
+ {
103
+ id: sandboxId,
104
+ port: 'inputs',
105
+ },
106
+ ],
107
+ },
108
+ }
109
+ acc.editorInfo[commandId] = {
110
+ position: { x: layerXInterval, y: index * layerYInterval + padding },
111
+ points: {},
112
+ }
113
+ acc.prevCommandId = commandId
114
+ return acc
115
+ },
116
+ { map: {}, editorInfo: {}, prevCommandId: null } as {
117
+ map: Record<string, any>
118
+ editorInfo: Record<string, any>
119
+ prevCommandId: string | null
120
+ },
121
+ )
122
+
123
+ let y = 0
124
+ const outputs = Object.entries(config.outputs).reduce(
125
+ (acc, [key, pbList], index) => {
126
+ const commandId = makeId('property_bank_command', opts)
127
+ acc.commandIdList.push(commandId)
128
+ acc.map[commandId] = {
129
+ type: 'command-node-object',
130
+ title: 'Command: OBJECT_GET',
131
+ properties: {
132
+ command: 'OBJECT_GET',
133
+ args: {
134
+ path: key,
135
+ },
136
+ },
137
+ in: {
138
+ obj: [
139
+ {
140
+ id: sandboxResultId,
141
+ port: 'result',
142
+ },
143
+ ],
144
+ path: null,
145
+ },
146
+ out: {
147
+ result: pbList.map((pb) => ({
148
+ id: pb,
149
+ port: 'change',
150
+ })),
151
+ },
152
+ }
153
+ acc.editorInfo[commandId] = {
154
+ position: {
155
+ x: layerXInterval * 3,
156
+ y: index * layerYInterval + padding,
157
+ },
158
+ points: {},
159
+ }
160
+ pbList.forEach((pb, pbIndex) => {
161
+ // Check if this data node already exists (it might be used as both input and output)
162
+ const existingNode = acc.map[pb] || inputs.map[pb]
163
+ acc.map[pb] = {
164
+ type: 'data-node',
165
+ properties: {},
166
+ in: {
167
+ change: [
168
+ {
169
+ id: commandId,
170
+ port: 'result',
171
+ },
172
+ ],
173
+ },
174
+ out: {
175
+ // Preserve existing out.value if node is also used as input
176
+ value: existingNode?.out?.value ?? null,
177
+ },
178
+ }
179
+ acc.editorInfo[pb] = {
180
+ position: {
181
+ x: layerXInterval * 4,
182
+ y: padding + y + index * layerYInterval + pbIndex * layerYInterval,
183
+ },
184
+ points: {},
185
+ }
186
+ if (pbIndex > 0) y += layerYInterval
187
+ })
188
+ return acc
189
+ },
190
+ { map: {}, editorInfo: {}, commandIdList: [] } as {
191
+ map: Record<string, any>
192
+ editorInfo: Record<string, any>
193
+ commandIdList: string[]
194
+ },
195
+ )
196
+
197
+ return {
198
+ map: {
199
+ ...inputs.map,
200
+ [sandboxId]: {
201
+ type: 'command-node-sandbox',
202
+ title: 'Command: SANDBOX_RUN_JAVASCRIPT',
203
+ properties: {
204
+ command: 'SANDBOX_RUN_JAVASCRIPT',
205
+ args: {
206
+ code: config.code,
207
+ enable_async: config.enable_async,
208
+ },
209
+ },
210
+ in: {
211
+ code: null,
212
+ inputs: inputs.prevCommandId
213
+ ? [
214
+ {
215
+ id: inputs.prevCommandId,
216
+ port: 'result',
217
+ },
218
+ ]
219
+ : [],
220
+ },
221
+ out: {
222
+ result: [
223
+ {
224
+ id: sandboxErrorId,
225
+ port: 'result',
226
+ },
227
+ {
228
+ id: sandboxResultId,
229
+ port: 'result',
230
+ },
231
+ ],
232
+ },
233
+ },
234
+ [sandboxErrorId]: {
235
+ type: 'command-node-sandbox',
236
+ title: 'Command: SANDBOX_GET_ERROR',
237
+ properties: {
238
+ command: 'SANDBOX_GET_ERROR',
239
+ },
240
+ in: {
241
+ result: [
242
+ {
243
+ id: sandboxId,
244
+ port: 'result',
245
+ },
246
+ ],
247
+ },
248
+ out: {
249
+ result: config.error
250
+ ? [
251
+ {
252
+ id: config.error,
253
+ port: 'change',
254
+ },
255
+ ]
256
+ : [],
257
+ },
258
+ },
259
+ [sandboxResultId]: {
260
+ type: 'command-node-sandbox',
261
+ title: 'Command: SANDBOX_GET_RETURN_VALUE',
262
+ properties: {
263
+ command: 'SANDBOX_GET_RETURN_VALUE',
264
+ },
265
+ in: {
266
+ result: [
267
+ {
268
+ id: sandboxId,
269
+ port: 'result',
270
+ },
271
+ ],
272
+ },
273
+ out: {
274
+ result: (config.output
275
+ ? [
276
+ {
277
+ id: config.output,
278
+ port: 'change',
279
+ },
280
+ ]
281
+ : []
282
+ ).concat(
283
+ outputs.commandIdList.map((commandId) => ({
284
+ id: commandId,
285
+ port: 'obj',
286
+ })),
287
+ ),
288
+ },
289
+ },
290
+
291
+ ...(config.error && {
292
+ [config.error]: {
293
+ type: 'data-node',
294
+ properties: {},
295
+ in: {
296
+ change: [
297
+ {
298
+ id: sandboxErrorId,
299
+ port: 'result',
300
+ },
301
+ ],
302
+ },
303
+ out: {
304
+ // Preserve existing out.value if node is also used as input
305
+ value: inputs.map[config.error]?.out?.value ?? null,
306
+ },
307
+ },
308
+ }),
309
+ ...(config.output && {
310
+ [config.output]: {
311
+ type: 'data-node',
312
+ properties: {},
313
+ in: {
314
+ change: [
315
+ {
316
+ id: sandboxResultId,
317
+ port: 'result',
318
+ },
319
+ ],
320
+ },
321
+ out: {
322
+ // Preserve existing out.value if node is also used as input
323
+ value: inputs.map[config.output]?.out?.value ?? null,
324
+ },
325
+ },
326
+ }),
327
+ ...outputs.map,
328
+ },
329
+ editor_info: {
330
+ ...inputs.editorInfo,
331
+ [sandboxId]: {
332
+ position: { x: layerXInterval * 2, y: padding },
333
+ points: {},
334
+ },
335
+ [sandboxErrorId]: {
336
+ position: { x: layerXInterval * 2, y: layerYInterval },
337
+ points: {},
338
+ },
339
+ [sandboxResultId]: {
340
+ position: { x: layerXInterval * 2, y: layerYInterval * 2 },
341
+ points: {},
342
+ },
343
+ ...(config.error && {
344
+ [config.error]: {
345
+ position: { x: layerXInterval * 2, y: layerYInterval * 3 },
346
+ points: {},
347
+ },
348
+ }),
349
+ ...(config.output && {
350
+ [config.output]: {
351
+ position: { x: layerXInterval * 2, y: layerYInterval * 4 },
352
+ points: {},
353
+ },
354
+ }),
355
+ ...outputs.editorInfo,
356
+ },
357
+ }
358
+ }
package/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export type * from './types'
2
+
3
+ export { makeId } from './utils/id'
4
+ export { generateDataCalculationMapEditorInfo } from './utils/calc'
5
+ export { linkData, useSystemData, createCanvasIdRef } from './utils/data'
6
+ export { templateEventPropsMap } from './utils/event-props'
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@fugood/bricks-ctor",
3
+ "version": "2.24.0-beta.40",
4
+ "main": "index.ts",
5
+ "scripts": {
6
+ "typecheck": "tsc --noEmit",
7
+ "build": "bun scripts/build.js"
8
+ },
9
+ "dependencies": {
10
+ "@fugood/bricks-cli": "^2.24.0-beta.40",
11
+ "@huggingface/gguf": "^0.3.2",
12
+ "@iarna/toml": "^3.0.0",
13
+ "@modelcontextprotocol/sdk": "^1.15.0",
14
+ "@toon-format/toon": "^2.1.0",
15
+ "@types/bun": "^1.3.9",
16
+ "@types/escodegen": "^0.0.10",
17
+ "@types/lodash": "^4.17.12",
18
+ "acorn": "^8.13.0",
19
+ "escodegen": "2.1.0",
20
+ "fuse.js": "^7.0.0",
21
+ "lodash": "^4.17.4",
22
+ "uuid": "^8.3.1"
23
+ },
24
+ "peerDependencies": {
25
+ "oxfmt": "^0.36.0"
26
+ },
27
+ "gitHead": "c07ad6f9f378a3040385f99bdf0033c834c7d96c"
28
+ }
@@ -0,0 +1,180 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ This skill is a derivative work based on:
179
+ https://github.com/anthropics/skills/blob/main/skills/frontend-design/SKILL.md
180
+ Copyright Anthropic, PBC. Licensed under the Apache License, Version 2.0.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: bricks-design
3
+ description: Create distinctive, production-grade BRICKS application interfaces with high design quality. Use this skill when the user asks to build BRICKS canvases, screens, layouts, or applications. Generates creative, polished BRICKS code that avoids generic aesthetics.
4
+ license: Complete terms in LICENSE.txt (Apache-2.0, based on github.com/anthropics/skills)
5
+ ---
6
+
7
+ This skill guides creation of distinctive, production-grade BRICKS application interfaces that avoid generic aesthetics. Implement working code with exceptional attention to visual design and creative choices.
8
+
9
+ The user provides interface requirements: a screen, layout, application, or component to build. They may include context about the purpose, audience, platform, or technical constraints.
10
+
11
+ ## Design Thinking
12
+
13
+ Before coding, understand the context and commit to a **bold** aesthetic direction:
14
+ - **Purpose**: What problem does this interface solve? Who uses it? What platform(s)?
15
+ - **Tone**: Pick a strong direction: brutally minimal, maximalist, retro-futuristic, organic/natural, luxury/refined, playful, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. Use these for inspiration but design one true to the aesthetic.
16
+ - **Constraints**: Target platform (mobile, TV, desktop, kiosk), screen dimensions, accessibility needs.
17
+ - **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
18
+
19
+ **CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
20
+
21
+ Then implement working BRICKS TypeScript code that is:
22
+ - Production-grade and functional
23
+ - Visually striking and memorable
24
+ - Cohesive with a clear aesthetic point-of-view
25
+ - Meticulously refined in every detail
26
+
27
+ ## Aesthetics Guidelines
28
+
29
+ ### Typography
30
+ Choose fonts that are beautiful, unique, and interesting. Avoid defaulting to system fonts — opt for distinctive choices that elevate the interface. Pair a characterful display font with a refined body font. Create clear typographic hierarchy through weight, size, spacing, and alignment. Use auto-scaling (`fontSizeVector`) when text should fill its container proportionally.
31
+
32
+ ### Color & Theme
33
+ Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Use gradients for rich, atmospheric surfaces — multi-stop linear gradients create far more depth than flat fills. Use Data nodes as a shared color store for consistency across bricks.
34
+
35
+ ### Motion & Animation
36
+ Focus on high-impact moments: one well-orchestrated canvas enter with staggered standby reveals creates more delight than scattered micro-interactions. Use spring animations for natural, bouncy UI elements. Use composed animations (parallel/sequence) for coordinated entrance choreography. Reserve looping animations (`breatheStart`) for attention-drawing elements — overuse dulls their impact.
37
+
38
+ ### Spatial Composition
39
+ Absolute positioning gives total control — use it creatively. Overlap bricks. Create asymmetric layouts. Use generous negative space OR controlled density. Break grid expectations. Consider rotation for diagonal flow and perspective. Vary scale dramatically between elements for visual tension.
40
+
41
+ ### Depth & Atmosphere
42
+ Create atmosphere through layered elements rather than flat solid colors:
43
+ - **Gradients** with multiple color stops for rich backgrounds
44
+ - **Shadows** for elevation and hierarchy
45
+ - **Blur effects** (blur, progressive blur, liquid glass) for glass morphism on native platforms
46
+ - **Opacity layering** — stack semi-transparent rects for texture and depth
47
+ - **Border details** — per-side colors, styles, and widths for decorative framing
48
+
49
+ ### Interactive Polish
50
+ Design interactions that feel tactile and responsive:
51
+ - Scale/opacity animations on press for physical feedback
52
+ - Focus states for TV/controller navigation
53
+ - Outlet-driven switches for state-dependent visual changes
54
+ - Deliberate long-press patterns for secondary actions
55
+
56
+ ## What to NEVER Do
57
+
58
+ - **No generic aesthetics**: Avoid the same tired palette, the same safe layout, the same system font on every screen. Each design should feel distinct and intentional.
59
+ - **No flat sameness**: Don't make every canvas look like the same template with different text. Vary spatial composition, color weight, animation timing, and typographic scale.
60
+ - **No placeholder layouts**: Don't just center everything in a grid. Use the absolute positioning system to create spatial interest — overlap, offset, scale contrast.
61
+
62
+ Vary between light and dark themes, different fonts, different aesthetics across generations. NEVER converge on common choices across designs.
63
+
64
+ **IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate animations, layered rects, and rich gradients. Minimalist designs need restraint, precision in spacing, and carefully chosen typography. Elegance comes from executing the vision well.
65
+
66
+ Remember: The agent is capable of extraordinary creative work. Don't hold back — show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: bricks-ctor
3
+ description: Advanced BRICKS configuration knowledge. Covers Standby Transition, Automations (E2E testing), Data Calculation (JS sandbox libraries), Local Sync, Remote Data Bank, Media Flow, and Buttress (remote inference). Triggers on multi-device sync, cloud data, media assets, AI offloading, E2E testing, or canvas transitions.
4
+ ---
5
+
6
+ # BRICKS Ctor - Advanced Features
7
+
8
+ This skill covers advanced BRICKS features not in the main project instructions.
9
+
10
+ ## Rules Index
11
+
12
+ | Rule | Description |
13
+ |------|-------------|
14
+ | [Architecture Patterns](rules/architecture-patterns.md) | **Read first** — decompose flows and select patterns |
15
+ | [Animation](rules/animation.md) | Animation system for brick transforms and opacity |
16
+ | [Standby Transition](rules/standby-transition.md) | Canvas enter/exit animations |
17
+ | [Automations](rules/automations.md) | E2E testing and scheduled tasks |
18
+ | [Data Calculation](rules/data-calculation.md) | JS sandbox libraries (25+ available) |
19
+ | [Local Sync](rules/local-sync.md) | LAN device synchronization |
20
+ | [Remote Data Bank](rules/remote-data-bank.md) | Cloud data sync and API access |
21
+ | [Media Flow](rules/media-flow.md) | Media asset management |
22
+ | [Buttress](rules/buttress.md) | Remote inference for AI generators |
23
+
24
+ ## Quick Reference
25
+
26
+ - **Complex flows**: See [Architecture Patterns](rules/architecture-patterns.md) for decomposing multi-step workflows
27
+ - **Multi-device**: See [Local Sync](rules/local-sync.md) for LAN coordination
28
+ - **Cloud data**: See [Remote Data Bank](rules/remote-data-bank.md) for sync and API access
29
+ - **Media assets**: See [Media Flow](rules/media-flow.md) for centralized asset management
30
+ - **AI offloading**: See [Buttress](rules/buttress.md) for GPU server delegation
31
+ - **E2E testing**: See [Automations](rules/automations.md) for test automation
32
+ - **Enter animations**: See [Standby Transition](rules/standby-transition.md) for canvas transitions