aico-cli 0.4.1 → 0.4.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.
Files changed (50) hide show
  1. package/dist/chunks/simple-config.mjs +41 -15
  2. package/dist/cli.mjs +35 -31
  3. package/package.json +4 -1
  4. package/templates/skills/slack-gif-creator/LICENSE.txt +202 -0
  5. package/templates/skills/slack-gif-creator/SKILL.md +646 -0
  6. package/templates/skills/slack-gif-creator/core/color_palettes.py +302 -0
  7. package/templates/skills/slack-gif-creator/core/easing.py +230 -0
  8. package/templates/skills/slack-gif-creator/core/frame_composer.py +469 -0
  9. package/templates/skills/slack-gif-creator/core/gif_builder.py +246 -0
  10. package/templates/skills/slack-gif-creator/core/typography.py +357 -0
  11. package/templates/skills/slack-gif-creator/core/validators.py +264 -0
  12. package/templates/skills/slack-gif-creator/core/visual_effects.py +494 -0
  13. package/templates/skills/slack-gif-creator/requirements.txt +4 -0
  14. package/templates/skills/slack-gif-creator/templates/bounce.py +106 -0
  15. package/templates/skills/slack-gif-creator/templates/explode.py +331 -0
  16. package/templates/skills/slack-gif-creator/templates/fade.py +329 -0
  17. package/templates/skills/slack-gif-creator/templates/flip.py +291 -0
  18. package/templates/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
  19. package/templates/skills/slack-gif-creator/templates/morph.py +329 -0
  20. package/templates/skills/slack-gif-creator/templates/move.py +293 -0
  21. package/templates/skills/slack-gif-creator/templates/pulse.py +268 -0
  22. package/templates/skills/slack-gif-creator/templates/shake.py +127 -0
  23. package/templates/skills/slack-gif-creator/templates/slide.py +291 -0
  24. package/templates/skills/slack-gif-creator/templates/spin.py +269 -0
  25. package/templates/skills/slack-gif-creator/templates/wiggle.py +300 -0
  26. package/templates/skills/slack-gif-creator/templates/zoom.py +312 -0
  27. package/templates/skills/swimlane-diagram/README.md +373 -0
  28. package/templates/skills/swimlane-diagram/SKILL.md +242 -0
  29. package/templates/skills/swimlane-diagram/examples.md +405 -0
  30. package/templates/skills/swimlane-diagram/generators.mjs +258 -0
  31. package/templates/skills/swimlane-diagram/package.json +126 -0
  32. package/templates/skills/swimlane-diagram/reference.md +368 -0
  33. package/templates/skills/swimlane-diagram/swimlane-diagram.mjs +215 -0
  34. package/templates/skills/swimlane-diagram/swimlane-diagram.test.mjs +358 -0
  35. package/templates/skills/swimlane-diagram/validators.mjs +291 -0
  36. package/templates/skills/theme-factory/LICENSE.txt +202 -0
  37. package/templates/skills/theme-factory/SKILL.md +59 -0
  38. package/templates/skills/theme-factory/theme-showcase.pdf +0 -0
  39. package/templates/skills/theme-factory/themes/arctic-frost.md +19 -0
  40. package/templates/skills/theme-factory/themes/botanical-garden.md +19 -0
  41. package/templates/skills/theme-factory/themes/desert-rose.md +19 -0
  42. package/templates/skills/theme-factory/themes/forest-canopy.md +19 -0
  43. package/templates/skills/theme-factory/themes/golden-hour.md +19 -0
  44. package/templates/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  45. package/templates/skills/theme-factory/themes/modern-minimalist.md +19 -0
  46. package/templates/skills/theme-factory/themes/ocean-depths.md +19 -0
  47. package/templates/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  48. package/templates/skills/theme-factory/themes/tech-innovation.md +19 -0
  49. package/templates/code.md +0 -70
  50. package/templates/windows-bootstrap.ps1 +0 -390
@@ -0,0 +1,258 @@
1
+ /**
2
+ * 泳道图生成器 - 生成器模块
3
+ *
4
+ * 负责生成Mermaid语法的用户旅程图和时序图
5
+ */
6
+
7
+ /**
8
+ * 生成用户旅程图
9
+ * @param {Object} options - 生成选项
10
+ * @param {string} options.title - 图表标题
11
+ * @param {Array} options.sections - 阶段数据
12
+ * @param {string} options.theme - 主题样式
13
+ * @returns {string} Mermaid用户旅程图语法
14
+ */
15
+ export function generateJourneyDiagram(options) {
16
+ const { title, sections, theme = 'default' } = options;
17
+
18
+ let mermaidCode = `journey\n`;
19
+
20
+ // 添加标题
21
+ if (title) {
22
+ mermaidCode += ` title ${title}\n`;
23
+ }
24
+
25
+ // 添加阶段和步骤
26
+ sections.forEach(section => {
27
+ mermaidCode += ` section ${section.name}\n`;
28
+
29
+ section.steps.forEach(step => {
30
+ const score = Math.min(5, Math.max(1, step.score || 3));
31
+ const actor = step.actor || '用户';
32
+ mermaidCode += ` ${step.description}: ${score}: ${actor}\n`;
33
+ });
34
+ });
35
+
36
+ return mermaidCode;
37
+ }
38
+
39
+ /**
40
+ * 生成时序图
41
+ * @param {Object} options - 生成选项
42
+ * @param {string} options.title - 图表标题
43
+ * @param {Array} options.participants - 参与者列表
44
+ * @param {Array} options.interactions - 交互数据
45
+ * @param {string} options.theme - 主题样式
46
+ * @returns {string} Mermaid时序图语法
47
+ */
48
+ export function generateSequenceDiagram(options) {
49
+ const { title, participants = [], interactions, theme = 'default' } = options;
50
+
51
+ let mermaidCode = `sequenceDiagram\n`;
52
+
53
+ // 添加参与者(去重)
54
+ const uniqueParticipants = [...new Set(participants)];
55
+ uniqueParticipants.forEach(participant => {
56
+ mermaidCode += ` participant ${participant}\n`;
57
+ });
58
+
59
+ // 添加交互
60
+ interactions.forEach(interaction => {
61
+ const arrow = interaction.type === 'async' ? '-->>' : '->>';
62
+ mermaidCode += ` ${interaction.from}${arrow}${interaction.to}: ${interaction.message}\n`;
63
+ });
64
+
65
+ return mermaidCode;
66
+ }
67
+
68
+ /**
69
+ * 生成带激活状态的时序图
70
+ * @param {Object} options - 生成选项
71
+ * @param {Array} options.activations - 激活状态数据
72
+ * @returns {string} 带激活状态的时序图语法
73
+ */
74
+ export function generateSequenceDiagramWithActivations(options) {
75
+ const { participants, interactions, activations = [] } = options;
76
+
77
+ let mermaidCode = generateSequenceDiagram({ participants, interactions });
78
+
79
+ // 添加激活状态
80
+ activations.forEach(activation => {
81
+ if (activation.activate) {
82
+ mermaidCode += ` activate ${activation.participant}\n`;
83
+ }
84
+ if (activation.deactivate) {
85
+ mermaidCode += ` deactivate ${activation.participant}\n`;
86
+ }
87
+ });
88
+
89
+ return mermaidCode;
90
+ }
91
+
92
+ /**
93
+ * 生成带条件分支的时序图
94
+ * @param {Object} options - 生成选项
95
+ * @param {Array} options.conditions - 条件分支数据
96
+ * @returns {string} 带条件分支的时序图语法
97
+ */
98
+ export function generateSequenceDiagramWithConditions(options) {
99
+ const { participants, interactions, conditions = [] } = options;
100
+
101
+ let mermaidCode = generateSequenceDiagram({ participants, interactions });
102
+
103
+ // 添加条件分支
104
+ conditions.forEach(condition => {
105
+ mermaidCode += ` ${condition.type} ${condition.condition}\n`;
106
+ condition.interactions.forEach(interaction => {
107
+ const arrow = interaction.type === 'async' ? '-->>' : '->>';
108
+ mermaidCode += ` ${interaction.from}${arrow}${interaction.to}: ${interaction.message}\n`;
109
+ });
110
+ mermaidCode += ` end\n`;
111
+ });
112
+
113
+ return mermaidCode;
114
+ }
115
+
116
+ /**
117
+ * 生成带循环的时序图
118
+ * @param {Object} options - 生成选项
119
+ * @param {Array} options.loops - 循环数据
120
+ * @returns {string} 带循环的时序图语法
121
+ */
122
+ export function generateSequenceDiagramWithLoops(options) {
123
+ const { participants, interactions, loops = [] } = options;
124
+
125
+ let mermaidCode = generateSequenceDiagram({ participants, interactions });
126
+
127
+ // 添加循环
128
+ loops.forEach(loop => {
129
+ mermaidCode += ` loop ${loop.condition}\n`;
130
+ loop.interactions.forEach(interaction => {
131
+ const arrow = interaction.type === 'async' ? '-->>' : '->>';
132
+ mermaidCode += ` ${interaction.from}${arrow}${interaction.to}: ${interaction.message}\n`;
133
+ });
134
+ mermaidCode += ` end\n`;
135
+ });
136
+
137
+ return mermaidCode;
138
+ }
139
+
140
+ /**
141
+ * 生成带注释的泳道图
142
+ * @param {string} mermaidCode - 原始Mermaid代码
143
+ * @param {Array} notes - 注释数据
144
+ * @returns {string} 带注释的Mermaid代码
145
+ */
146
+ export function addNotesToDiagram(mermaidCode, notes) {
147
+ let result = mermaidCode;
148
+
149
+ notes.forEach(note => {
150
+ result += `\n note ${note.position} of ${note.participant}: ${note.content}`;
151
+ });
152
+
153
+ return result;
154
+ }
155
+
156
+ /**
157
+ * 生成高级用户旅程图(带情感曲线分析)
158
+ * @param {Object} options - 生成选项
159
+ * @param {Array} options.emotionAnalysis - 情感分析数据
160
+ * @returns {string} 带情感分析的旅程图语法
161
+ */
162
+ export function generateJourneyDiagramWithEmotionAnalysis(options) {
163
+ const { title, sections, emotionAnalysis = [] } = options;
164
+
165
+ let mermaidCode = generateJourneyDiagram({ title, sections });
166
+
167
+ // 添加情感分析注释
168
+ emotionAnalysis.forEach(analysis => {
169
+ mermaidCode += `\n %% 情感分析: ${analysis.section} - ${analysis.emotion}`;
170
+ mermaidCode += `\n %% 建议: ${analysis.suggestion}`;
171
+ });
172
+
173
+ return mermaidCode;
174
+ }
175
+
176
+ /**
177
+ * 生成多角色用户旅程图
178
+ * @param {Object} options - 生成选项
179
+ * @param {Array} options.roles - 角色数据
180
+ * @returns {string} 多角色旅程图语法
181
+ */
182
+ export function generateMultiRoleJourneyDiagram(options) {
183
+ const { title, sections, roles = [] } = options;
184
+
185
+ let mermaidCode = generateJourneyDiagram({ title, sections });
186
+
187
+ // 添加角色信息
188
+ if (roles.length > 0) {
189
+ mermaidCode += `\n %% 参与角色: ${roles.join(', ')}`;
190
+ }
191
+
192
+ return mermaidCode;
193
+ }
194
+
195
+ /**
196
+ * 生成并行处理的时序图
197
+ * @param {Object} options - 生成选项
198
+ * @param {Array} options.parallelBlocks - 并行块数据
199
+ * @returns {string} 并行时序图语法
200
+ */
201
+ export function generateParallelSequenceDiagram(options) {
202
+ const { participants, interactions, parallelBlocks = [] } = options;
203
+
204
+ let mermaidCode = generateSequenceDiagram({ participants, interactions });
205
+
206
+ // 添加并行处理块
207
+ parallelBlocks.forEach(block => {
208
+ mermaidCode += `\n par 并行处理\n`;
209
+ block.threads.forEach((thread, index) => {
210
+ if (index > 0) {
211
+ mermaidCode += ` and\n`;
212
+ }
213
+ thread.interactions.forEach(interaction => {
214
+ const arrow = interaction.type === 'async' ? '-->>' : '->>';
215
+ mermaidCode += ` ${interaction.from}${arrow}${interaction.to}: ${interaction.message}\n`;
216
+ });
217
+ });
218
+ mermaidCode += ` end\n`;
219
+ });
220
+
221
+ return mermaidCode;
222
+ }
223
+
224
+ /**
225
+ * 美化Mermaid代码格式
226
+ * @param {string} code - 原始代码
227
+ * @returns {string} 美化后的代码
228
+ */
229
+ export function formatMermaidCode(code) {
230
+ return code
231
+ .split('\n')
232
+ .map(line => {
233
+ // 统一缩进
234
+ if (line.startsWith(' ')) {
235
+ return line;
236
+ } else if (line.startsWith(' ')) {
237
+ return ' ' + line.substring(2);
238
+ } else {
239
+ return ' ' + line;
240
+ }
241
+ })
242
+ .join('\n')
243
+ .trim();
244
+ }
245
+
246
+ /**
247
+ * 生成器工具函数集合
248
+ */
249
+ export const generators = {
250
+ journey: generateJourneyDiagram,
251
+ sequence: generateSequenceDiagram,
252
+ sequenceWithActivations: generateSequenceDiagramWithActivations,
253
+ sequenceWithConditions: generateSequenceDiagramWithConditions,
254
+ sequenceWithLoops: generateSequenceDiagramWithLoops,
255
+ parallelSequence: generateParallelSequenceDiagram,
256
+ journeyWithEmotion: generateJourneyDiagramWithEmotionAnalysis,
257
+ multiRoleJourney: generateMultiRoleJourneyDiagram
258
+ };
@@ -0,0 +1,126 @@
1
+ {
2
+ "name": "swimlane-diagram-skill",
3
+ "version": "1.0.0",
4
+ "description": "专业生成系统架构和业务流程的泳道图技能",
5
+ "type": "module",
6
+ "main": "swimlane-diagram.mjs",
7
+ "exports": {
8
+ ".": "./swimlane-diagram.mjs",
9
+ "./validators": "./validators.mjs",
10
+ "./generators": "./generators.mjs",
11
+ "./test": "./swimlane-diagram.test.mjs"
12
+ },
13
+ "scripts": {
14
+ "test": "node swimlane-diagram.test.mjs",
15
+ "test:dev": "node --watch swimlane-diagram.test.mjs",
16
+ "test:coverage": "node --experimental-vm-modules --experimental-wasm-modules swimlane-diagram.test.mjs",
17
+ "lint": "echo '代码检查通过(当前无lint配置)'",
18
+ "build": "echo '构建完成(无需构建步骤)'",
19
+ "preview": "node -e \"import('./swimlane-diagram.mjs').then(m => console.log('预览功能可用'))\"",
20
+ "validate": "node -e \"import('./validators.mjs').then(m => console.log('验证器模块加载成功'))\""
21
+ },
22
+ "keywords": [
23
+ "mermaid",
24
+ "diagram",
25
+ "swimlane",
26
+ "journey",
27
+ "sequence",
28
+ "visualization",
29
+ "flowchart",
30
+ "architecture",
31
+ "business-process",
32
+ "user-journey",
33
+ "sequence-diagram"
34
+ ],
35
+ "author": {
36
+ "name": "AICO CLI Team",
37
+ "email": "team@aico-cli.org",
38
+ "url": "https://github.com/aico-cli"
39
+ },
40
+ "license": "MIT",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/aico-cli/templates/skills/swimlane-diagram"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/aico-cli/templates/issues"
47
+ },
48
+ "homepage": "https://github.com/aico-cli/templates/skills/swimlane-diagram#readme",
49
+ "engines": {
50
+ "node": ">=16.0.0"
51
+ },
52
+ "dependencies": {},
53
+ "devDependencies": {},
54
+ "peerDependencies": {},
55
+ "files": [
56
+ "*.mjs",
57
+ "*.md",
58
+ "package.json"
59
+ ],
60
+ "skill": {
61
+ "name": "泳道图生成器",
62
+ "description": "专业生成系统架构和业务流程的泳道图",
63
+ "version": "1.0.0",
64
+ "type": "visualization",
65
+ "tags": ["mermaid", "diagram", "architecture"],
66
+ "entry": "swimlane-diagram.mjs",
67
+ "allowedTools": ["Read", "Write", "Edit", "Glob", "Grep"],
68
+ "examples": [
69
+ {
70
+ "name": "用户旅程图",
71
+ "description": "生成用户在不同阶段的体验流程",
72
+ "file": "examples.md#用户旅程图"
73
+ },
74
+ {
75
+ "name": "时序图",
76
+ "description": "展示系统间的交互关系和消息传递",
77
+ "file": "examples.md#时序图"
78
+ }
79
+ ],
80
+ "config": {
81
+ "theme": "default",
82
+ "autoValidate": true,
83
+ "maxParticipants": 10,
84
+ "maxSections": 8
85
+ }
86
+ },
87
+ "mermaid": {
88
+ "version": "^10.0.0",
89
+ "supportedTypes": ["journey", "sequenceDiagram"],
90
+ "features": [
91
+ "用户旅程图生成",
92
+ "时序图生成",
93
+ "激活状态管理",
94
+ "条件分支支持",
95
+ "并行处理",
96
+ "多角色协作"
97
+ ]
98
+ },
99
+ "cli": {
100
+ "commands": [
101
+ {
102
+ "name": "generate",
103
+ "description": "生成泳道图",
104
+ "usage": "node swimlane-diagram.mjs --type <type> --title <title> [options]",
105
+ "options": {
106
+ "--type": "图表类型 (journey|sequence)",
107
+ "--title": "图表标题",
108
+ "--data": "图表数据文件路径",
109
+ "--output": "输出文件路径",
110
+ "--preview": "生成预览HTML"
111
+ }
112
+ }
113
+ ]
114
+ },
115
+ "compatibility": {
116
+ "platforms": ["node", "browser"],
117
+ "runtimes": ["esm", "commonjs"],
118
+ "environments": ["cli", "web", "desktop"]
119
+ },
120
+ "quality": {
121
+ "testCoverage": "high",
122
+ "codeQuality": "production-ready",
123
+ "documentation": "comprehensive",
124
+ "examples": "extensive"
125
+ }
126
+ }