aico-cli 2.0.28 → 2.0.30
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/bin/cli/LICENSE.md +1 -0
- package/bin/cli/cli.js +2920 -2457
- package/bin/cli/package.json +1 -1
- package/bin/cli/sdk-tools.d.ts +1216 -3
- package/dist/chunks/simple-config.mjs +527 -43
- package/dist/cli.mjs +126 -481
- package/dist/index.mjs +1 -0
- package/package.json +11 -3
- package/templates/agents/agent-capability-map.json +598 -0
- package/templates/agents/agent-selector.ts +991 -0
- package/templates/agents/auto-task-executor.ts +222 -0
- package/templates/agents/bonus/studio-coach.md +133 -0
- package/templates/agents/core/code-archaeologist.md +89 -0
- package/templates/agents/core/code-reviewer.md +88 -0
- package/templates/agents/core/documentation-specialist.md +100 -0
- package/templates/agents/core/performance-optimizer.md +67 -0
- package/templates/agents/databases/customer-support.md +34 -0
- package/templates/agents/databases/data-engineer.md +31 -0
- package/templates/agents/databases/data-scientist.md +28 -0
- package/templates/agents/databases/database-admin.md +31 -0
- package/templates/agents/databases/database-optimizer.md +31 -0
- package/templates/agents/deployment/debugger.md +29 -0
- package/templates/agents/deployment/deployment-engineer.md +31 -0
- package/templates/agents/deployment/devops-troubleshooter.md +31 -0
- package/templates/agents/deployment/dx-optimizer.md +62 -0
- package/templates/agents/deployment/error-detective.md +31 -0
- package/templates/agents/deployment/legacy-modernizer.md +31 -0
- package/templates/agents/deployment/network-engineer.md +31 -0
- package/templates/agents/deployment/payment-integration.md +31 -0
- package/templates/agents/deployment/performance-engineer.md +31 -0
- package/templates/agents/deployment/prompt-engineer.md +58 -0
- package/templates/agents/deployment/quant-analyst.md +31 -0
- package/templates/agents/deployment/refactor-agent.md +77 -0
- package/templates/agents/deployment/risk-manager.md +40 -0
- package/templates/agents/deployment/sales-automator.md +34 -0
- package/templates/agents/deployment/search-specialist.md +96 -0
- package/templates/agents/deployment/security-auditor.md +31 -0
- package/templates/agents/design/brand-guardian.md +278 -0
- package/templates/agents/design/frontend-analyst.md +42 -0
- package/templates/agents/design/ui-designer.md +157 -0
- package/templates/agents/design/ui-ux-master.md +568 -0
- package/templates/agents/design/ux-researcher.md +210 -0
- package/templates/agents/design/visual-storyteller.md +271 -0
- package/templates/agents/design/whimsy-injector.md +148 -0
- package/templates/agents/engineering/backend/ai-engineer.md +118 -0
- package/templates/agents/engineering/backend/backend-architect.md +95 -0
- package/templates/agents/engineering/backend/senior-backend-architect.md +554 -0
- package/templates/agents/engineering/frontend/frontend-developer.md +105 -0
- package/templates/agents/engineering/frontend/mobile-app-builder.md +108 -0
- package/templates/agents/engineering/frontend/rapid-prototyper.md +114 -0
- package/templates/agents/engineering/frontend/senior-frontend-architect.md +573 -0
- package/templates/agents/engineering/middlend/api-documenter.md +31 -0
- package/templates/agents/engineering/middlend/architect-review.md +41 -0
- package/templates/agents/engineering/middlend/cloud-architect.md +31 -0
- package/templates/agents/engineering/middlend/code-reviewer.md +28 -0
- package/templates/agents/engineering/middlend/devops-automator.md +118 -0
- package/templates/agents/marketing/app-store-optimizer.md +180 -0
- package/templates/agents/marketing/business-analyst.md +34 -0
- package/templates/agents/marketing/content-creator.md +209 -0
- package/templates/agents/marketing/growth-hacker.md +218 -0
- package/templates/agents/marketing/instagram-curator.md +154 -0
- package/templates/agents/marketing/reddit-community-builder.md +197 -0
- package/templates/agents/marketing/tiktok-strategist.md +151 -0
- package/templates/agents/marketing/twitter-engager.md +175 -0
- package/templates/agents/orchestrators/context-manager.md +63 -0
- package/templates/agents/orchestrators/project-analyst.md +66 -0
- package/templates/agents/orchestrators/team-configurator.md +52 -0
- package/templates/agents/orchestrators/tech-lead-orchestrator.md +103 -0
- package/templates/agents/product/feedback-synthesizer.md +174 -0
- package/templates/agents/product/sprint-prioritizer.md +128 -0
- package/templates/agents/product/trend-researcher.md +133 -0
- package/templates/agents/project-management/experiment-tracker.md +165 -0
- package/templates/agents/project-management/project-shipper.md +190 -0
- package/templates/agents/project-management/studio-producer.md +203 -0
- package/templates/agents/specialist/spec-analyst.md +228 -0
- package/templates/agents/specialist/spec-architect.md +375 -0
- package/templates/agents/specialist/spec-developer.md +544 -0
- package/templates/agents/specialist/spec-orchestrator.md +465 -0
- package/templates/agents/specialist/spec-planner.md +497 -0
- package/templates/agents/specialist/spec-reviewer.md +487 -0
- package/templates/agents/specialist/spec-task-reviewer.md +50 -0
- package/templates/agents/specialist/spec-tester.md +652 -0
- package/templates/agents/specialist/spec-validator.md +441 -0
- package/templates/agents/specialized/C++/cpp-pro.md +37 -0
- package/templates/agents/specialized/Golang/golang-pro.md +31 -0
- package/templates/agents/specialized/JavaScript/javascript-pro.md +34 -0
- package/templates/agents/specialized/Python/python-pro.md +31 -0
- package/templates/agents/specialized/databases/sql-pro.md +34 -0
- package/templates/agents/specialized/django/django-api-developer.md +804 -0
- package/templates/agents/specialized/django/django-backend-expert.md +875 -0
- package/templates/agents/specialized/django/django-orm-expert.md +828 -0
- package/templates/agents/specialized/laravel/laravel-backend-expert.md +174 -0
- package/templates/agents/specialized/laravel/laravel-eloquent-expert.md +75 -0
- package/templates/agents/specialized/rails/rails-activerecord-expert.md +690 -0
- package/templates/agents/specialized/rails/rails-api-developer.md +943 -0
- package/templates/agents/specialized/rails/rails-backend-expert.md +876 -0
- package/templates/agents/specialized/react/react-component-architect.md +41 -0
- package/templates/agents/specialized/react/react-nextjs-expert.md +141 -0
- package/templates/agents/specialized/vue/vue-component-architect.md +98 -0
- package/templates/agents/specialized/vue/vue-nuxt-expert.md +720 -0
- package/templates/agents/specialized/vue/vue-state-manager.md +33 -0
- package/templates/agents/studio-operations/analytics-reporter.md +204 -0
- package/templates/agents/studio-operations/finance-tracker.md +293 -0
- package/templates/agents/studio-operations/infrastructure-maintainer.md +219 -0
- package/templates/agents/studio-operations/legal-compliance-checker.md +259 -0
- package/templates/agents/studio-operations/support-responder.md +166 -0
- package/templates/agents/task-execution-agent.ts +160 -0
- package/templates/agents/testing/api-tester.md +214 -0
- package/templates/agents/testing/integration-test-fixer.md +52 -0
- package/templates/agents/testing/performance-benchmarker.md +277 -0
- package/templates/agents/testing/test-automator.md +31 -0
- package/templates/agents/testing/test-results-analyzer.md +273 -0
- package/templates/agents/testing/test-writer-fixer.md +129 -0
- package/templates/agents/testing/tool-evaluator.md +184 -0
- package/templates/agents/testing/workflow-optimizer.md +239 -0
- package/templates/agents/universal/api-architect.md +84 -0
- package/templates/agents/universal/backend-developer.md +95 -0
- package/templates/agents/universal/frontend-developer.md +66 -0
- package/templates/agents/universal/tailwind-css-expert.md +84 -0
- package/templates/cursor.md +20 -14
- package/templates/hooks/claude-code-hooks.json +13 -9
- package/templates/hooks/hook-wrapper.ts +173 -0
- package/templates/hooks/install-hooks.ts +201 -0
- package/templates/hooks/scripts/Notification/desktop-notifier.ts +268 -0
- package/templates/hooks/scripts/Notification/notification.ts +28 -0
- package/templates/hooks/scripts/PostToolUse/code-formatter.ts +182 -0
- package/templates/hooks/scripts/PostToolUse/post-tool-use.ts +27 -0
- package/templates/hooks/scripts/PreToolUse/command-logger.ts +107 -0
- package/templates/hooks/scripts/PreToolUse/file-protection.ts +109 -0
- package/templates/hooks/scripts/PreToolUse/pre-tool-use.ts +42 -0
- package/templates/hooks/scripts/Stop/session-summary.ts +150 -0
- package/templates/hooks/scripts/Stop/stop.ts +17 -0
- package/templates/hooks/scripts/UserPromptSubmit/input-notifier.ts +139 -0
- package/templates/hooks/scripts/UserPromptSubmit/user-prompt-submit.ts +16 -0
- package/templates/hooks/test-hook.ts +171 -0
- package/templates/hooks/tsconfig.json +27 -0
- package/templates/hooks/utils/execution-utils.ts +176 -0
- package/templates/hooks/utils/file-utils.ts +256 -0
- package/templates/hooks/utils/hook-utils.ts +86 -0
- package/templates/hooks/utils/index.ts +42 -0
- package/templates/personality.md +19 -14
- package/templates/settings.json +27 -4
- package/dist/chunks/run-command.mjs +0 -48
- package/templates/agents/base/frontend-designer.md +0 -193
- package/templates/commands/base//344/270/223/345/256/266/347/273/204/345/210/206/346/236/220/346/231/272/350/203/275/344/275/223.md +0 -82
- package/templates/hooks/scripts/Notification/bash/desktop-notifier.sh +0 -63
- package/templates/hooks/scripts/Notification/powershell/desktop-notifier.ps1 +0 -67
- package/templates/hooks/scripts/PostToolUse/bash/code-formatter.sh +0 -73
- package/templates/hooks/scripts/PostToolUse/powershell/code-formatter.ps1 +0 -90
- package/templates/hooks/scripts/PreToolUse/bash/command-logger.sh +0 -38
- package/templates/hooks/scripts/PreToolUse/bash/file-protection.sh +0 -55
- package/templates/hooks/scripts/PreToolUse/powershell/command-logger.ps1 +0 -34
- package/templates/hooks/scripts/PreToolUse/powershell/file-protection.ps1 +0 -46
- package/templates/hooks/scripts/Stop/bash/session-summary.sh +0 -83
- package/templates/hooks/scripts/Stop/powershell/session-summary.ps1 +0 -125
- package/templates/hooks/scripts/UserPromptSubmit/bash/input-notifier.sh +0 -58
- package/templates/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1 +0 -85
- package/templates/skills/slack-gif-creator/LICENSE.txt +0 -202
- package/templates/skills/slack-gif-creator/SKILL.md +0 -646
- package/templates/skills/slack-gif-creator/core/color_palettes.py +0 -302
- package/templates/skills/slack-gif-creator/core/easing.py +0 -230
- package/templates/skills/slack-gif-creator/core/frame_composer.py +0 -469
- package/templates/skills/slack-gif-creator/core/gif_builder.py +0 -246
- package/templates/skills/slack-gif-creator/core/typography.py +0 -357
- package/templates/skills/slack-gif-creator/core/validators.py +0 -264
- package/templates/skills/slack-gif-creator/core/visual_effects.py +0 -494
- package/templates/skills/slack-gif-creator/requirements.txt +0 -4
- package/templates/skills/slack-gif-creator/templates/bounce.py +0 -106
- package/templates/skills/slack-gif-creator/templates/explode.py +0 -331
- package/templates/skills/slack-gif-creator/templates/fade.py +0 -329
- package/templates/skills/slack-gif-creator/templates/flip.py +0 -291
- package/templates/skills/slack-gif-creator/templates/kaleidoscope.py +0 -211
- package/templates/skills/slack-gif-creator/templates/morph.py +0 -329
- package/templates/skills/slack-gif-creator/templates/move.py +0 -293
- package/templates/skills/slack-gif-creator/templates/pulse.py +0 -268
- package/templates/skills/slack-gif-creator/templates/shake.py +0 -127
- package/templates/skills/slack-gif-creator/templates/slide.py +0 -291
- package/templates/skills/slack-gif-creator/templates/spin.py +0 -269
- package/templates/skills/slack-gif-creator/templates/wiggle.py +0 -300
- package/templates/skills/slack-gif-creator/templates/zoom.py +0 -312
- package/templates/skills/swimlane-diagram/README.md +0 -373
- package/templates/skills/swimlane-diagram/SKILL.md +0 -242
- package/templates/skills/swimlane-diagram/examples.md +0 -405
- package/templates/skills/swimlane-diagram/generators.mjs +0 -258
- package/templates/skills/swimlane-diagram/package.json +0 -126
- package/templates/skills/swimlane-diagram/reference.md +0 -368
- package/templates/skills/swimlane-diagram/swimlane-diagram.mjs +0 -215
- package/templates/skills/swimlane-diagram/swimlane-diagram.test.mjs +0 -358
- package/templates/skills/swimlane-diagram/validators.mjs +0 -291
- package/templates/skills/theme-factory/LICENSE.txt +0 -202
- package/templates/skills/theme-factory/SKILL.md +0 -59
- package/templates/skills/theme-factory/theme-showcase.pdf +0 -0
- package/templates/skills/theme-factory/themes/arctic-frost.md +0 -19
- package/templates/skills/theme-factory/themes/botanical-garden.md +0 -19
- package/templates/skills/theme-factory/themes/desert-rose.md +0 -19
- package/templates/skills/theme-factory/themes/forest-canopy.md +0 -19
- package/templates/skills/theme-factory/themes/golden-hour.md +0 -19
- package/templates/skills/theme-factory/themes/midnight-galaxy.md +0 -19
- package/templates/skills/theme-factory/themes/modern-minimalist.md +0 -19
- package/templates/skills/theme-factory/themes/ocean-depths.md +0 -19
- package/templates/skills/theme-factory/themes/sunset-boulevard.md +0 -19
- package/templates/skills/theme-factory/themes/tech-innovation.md +0 -19
- /package/templates/agents/{code//346/240/271/346/234/254/345/216/237/345/233/240/345/210/206/346/236/220/345/270/210.md" → core/root-cause-analyst.md} +0 -0
- /package/templates/agents/{code//346/212/200/346/234/257/346/226/207/346/241/243/345/267/245/347/250/213/345/270/210.md" → core/technical-writer.md} +0 -0
- /package/templates/agents/{code//346/200/247/350/203/275/345/210/206/346/236/220/344/270/223/345/256/266.md" → deployment/performance-analyst.md} +0 -0
- /package/templates/agents/{code//345/256/211/345/205/250/346/274/217/346/264/236/350/257/206/345/210/253/344/270/223/345/256/266.md" → deployment/security-engineer.md} +0 -0
- /package/templates/agents/{code//347/263/273/347/273/237/346/236/266/346/236/204/345/270/210.md" → engineering/middlend/architect.md} +0 -0
- /package/templates/agents/{code/python/345/274/200/345/217/221/344/270/223/345/256/266.md" → specialized/Python/python-expert.md} +0 -0
- /package/templates/agents/{code//350/264/250/351/207/217/350/257/204/344/274/260/345/267/245/347/250/213/345/270/210.md" → testing/quality-engineer.md} +0 -0
- /package/templates/agents/{base → universal}/panel-experts.md +0 -0
|
@@ -1,258 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,126 +0,0 @@
|
|
|
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
|
-
}
|