flower-trellis 0.3.1-beta.4 → 0.3.1-beta.5
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/enhancements/0.6/.agents/skills/trellis-create-command/SKILL.md +2 -2
- package/enhancements/0.6/.agents/skills/trellis-visualize/SKILL.md +257 -0
- package/enhancements/0.6/.agents/skills/trellis-visualize/templates/template.html +319 -0
- package/enhancements/0.6/.claude/skills/trellis-create-command/SKILL.md +2 -2
- package/enhancements/0.6/.claude/skills/trellis-visualize/SKILL.md +257 -0
- package/enhancements/0.6/.claude/skills/trellis-visualize/templates/template.html +319 -0
- package/enhancements/MANIFEST.json +6 -6
- package/package.json +1 -1
- package/src/commands/update.js +32 -15
- package/src/lib/config-preserver.js +180 -0
- package/enhancements/0.6/.agents/skills/trellis-draw-uml/SKILL.md +0 -148
- package/enhancements/0.6/.claude/skills/trellis-draw-uml/SKILL.md +0 -148
|
@@ -74,7 +74,7 @@ description: "Create a new trellis entry as command or skill; writes agents copy
|
|
|
74
74
|
| 形态 | 何时选 | 触发方式 |
|
|
75
75
|
|------|--------|---------|
|
|
76
76
|
| **command** | 显式动作、高风险、需确认点(如 finish-work、continue) | `/trellis:<name>` |
|
|
77
|
-
| **skill** | 自然语可触发、查询 / 分析 / 检查、低破坏性(如 check-all、extract-prd、
|
|
77
|
+
| **skill** | 自然语可触发、查询 / 分析 / 检查、低破坏性(如 check-all、extract-prd、visualize) | Claude 自动路由 + `/trellis-<name>` |
|
|
78
78
|
|
|
79
79
|
决定不了时**推荐 skill**:自然语路由更灵活,显式斜杠仍可用。反过来,后悔做成 skill 想改 command 比较费事。
|
|
80
80
|
|
|
@@ -253,7 +253,7 @@ cp -r <target>/.agents/skills/trellis-<X> <skill-garden>/.trellis/0.6/.agents/sk
|
|
|
253
253
|
| Create / generate(从零创建) | `create-` | `create-command` |
|
|
254
254
|
| Analyze | `analyze-` | `analyze-task` |
|
|
255
255
|
| Sync / update | `sync-` / `update-` | `sync-prd` / `update-spec` |
|
|
256
|
-
| 动作类 | 动词开头 | `push` / `
|
|
256
|
+
| 动作类 | 动词开头 | `push` / `visualize` |
|
|
257
257
|
|
|
258
258
|
> **0.6 命名取舍**:「严格提取」类用 `extract-` 前缀(强调原文不动、禁止发挥);「从零创建」类才用 `create-` 前缀(如 create-command)。区分这两者能让 AI 在触发时不混淆生成 vs 提取的语义。
|
|
259
259
|
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-visualize
|
|
3
|
+
description: "把架构、流程、业务逻辑、状态流转和旧 UML / 活动图诉求可视化为离线 HTML/SVG 图解。触发:画架构图、系统图、流程图、业务流程图、梳理流程、解释逻辑、状态流转、画活动图、draw UML、diagram、visualize。用于编码或决策前生成可复核视觉模型;生成图时必须优先使用随 skill 分发的 templates/template.html 作为结构和视觉参考;不用于 PRD 提取、任务规格校验或全链路测试。"
|
|
4
|
+
---
|
|
5
|
+
# Trellis 可视化图解
|
|
6
|
+
|
|
7
|
+
把架构、流程、业务规则和复杂逻辑转成可复核的离线 HTML/SVG 图解。这个 skill 继承 `architecture-diagram` 的设计范式,不是松散重写:生成图前必须先建立图模型,并在需要生成 HTML/SVG 时读取本 skill 自带的 `templates/template.html`。
|
|
8
|
+
|
|
9
|
+
## 资源
|
|
10
|
+
|
|
11
|
+
- `templates/template.html`:从原 `architecture-diagram` 保留下来的 HTML/SVG 结构模板,包含暗色网格、SVG defs、箭头 marker、组件样式、边界、图例和说明卡片示例。
|
|
12
|
+
|
|
13
|
+
使用规则:
|
|
14
|
+
|
|
15
|
+
- 生成任何 HTML/SVG 图解前,先读取 `templates/template.html`。文件路径相对本 `SKILL.md` 所在目录。
|
|
16
|
+
- 技术架构、云架构、基础设施图必须以该模板作为结构基准,替换标题、节点、连线和说明卡片,不要从零另写一套视觉系统。
|
|
17
|
+
- 流程图、逻辑图、状态图也要复用该模板的页面结构、暗色网格、SVG defs、卡片区和排版约束;只扩展节点语义,不换掉整体设计范式。
|
|
18
|
+
- 如果当前平台不能直接读取 bundled resource,明确说明模板不可用,并用本文件中的硬约束近似复刻;不要假装已经使用模板。
|
|
19
|
+
|
|
20
|
+
## 适用范围
|
|
21
|
+
|
|
22
|
+
优先使用本 skill:
|
|
23
|
+
|
|
24
|
+
- 架构图:系统、服务、组件、部署、依赖关系、数据流、云资源、网络边界。
|
|
25
|
+
- 流程图:角色、触发、主路径、分支、异常、终态、泳道。
|
|
26
|
+
- 逻辑图:规则链路、判断条件、因果关系、策略选择。
|
|
27
|
+
- 状态图:状态流转、事件触发、失败、取消、超时、回滚。
|
|
28
|
+
- 旧意图兼容:用户说“画活动图”、“业务流程图”、“梳理流程”、“draw UML”时,也使用本 skill。
|
|
29
|
+
|
|
30
|
+
不要用于:
|
|
31
|
+
|
|
32
|
+
- 正式需求提取:使用 `trellis-extract-prd`。
|
|
33
|
+
- 三件套校验:使用 `trellis-verify-task`。
|
|
34
|
+
- 开发后质量检查:使用 `trellis-check-all`。
|
|
35
|
+
- 跨层自动化验证:使用 `trellis-run-full-chain`。
|
|
36
|
+
|
|
37
|
+
## 不可弱化的原始约束
|
|
38
|
+
|
|
39
|
+
以下约束来自原 `architecture-diagram`,必须按硬约束执行,不要翻译成可选建议:
|
|
40
|
+
|
|
41
|
+
- 产物是 standalone HTML file with inline SVG graphics。
|
|
42
|
+
- 不需要外部工具、API key 或渲染库;浏览器离线打开即可查看。
|
|
43
|
+
- CSS 和 SVG 必须内联;不得依赖外部渲染服务。
|
|
44
|
+
- 不使用 JavaScript;允许纯 CSS 动效。
|
|
45
|
+
- 模板里的 Google Fonts 可保留,也可以替换成系统字体栈;如果保留,要知道离线时会降级。
|
|
46
|
+
- 连线要在 SVG 中早于节点绘制,让箭头位于节点盒子后方。
|
|
47
|
+
- 半透明节点要使用 double-rect masking technique:先画不透明背景矩形,再画半透明样式矩形,避免箭头透出来。
|
|
48
|
+
- 图例位置必须计算,不得遮挡边界、节点或连线;有边界框时,图例放到最低边界下方至少 20px,或放在明确不遮挡的位置。
|
|
49
|
+
- Message bus / 异步事件 / 队列必须放在服务之间的间隙,不得压在节点上。
|
|
50
|
+
|
|
51
|
+
## 工作流
|
|
52
|
+
|
|
53
|
+
### 1. 判断图类型
|
|
54
|
+
|
|
55
|
+
从用户描述中判断主图类型:
|
|
56
|
+
|
|
57
|
+
| 用户意图 | 图类型 |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| 系统、服务、组件、部署、调用链、云资源 | 架构图 |
|
|
60
|
+
| 业务办理、审批、操作步骤、泳道 | 流程图 |
|
|
61
|
+
| 规则、判断、因果、策略 | 逻辑图 |
|
|
62
|
+
| 状态、事件、流转、回滚 | 状态图 |
|
|
63
|
+
|
|
64
|
+
如果请求同时包含多种图,先选择最能回答当前问题的一张主图;其他图作为待确认或后续迭代。
|
|
65
|
+
|
|
66
|
+
### 2. 整理图模型
|
|
67
|
+
|
|
68
|
+
输出图之前,先整理图模型:
|
|
69
|
+
|
|
70
|
+
- 图名:本图要解释的问题。
|
|
71
|
+
- 主体:角色、系统、组件、服务、外部依赖。
|
|
72
|
+
- 关系:调用、依赖、流转、触发、判断、异常、回滚。
|
|
73
|
+
- 边界:系统边界、组织边界、阶段边界、权限边界、云区域、安全组。
|
|
74
|
+
- 终态:成功、失败、取消、超时、回滚等结束状态。
|
|
75
|
+
- 事实 / 假设 / 待确认:明确区分用户已给出的事实和仍需确认的信息。
|
|
76
|
+
|
|
77
|
+
不要虚构角色、系统、字段、规则、状态、分支或异常路径。能从仓库、文档、任务文件中查到的事实不要问用户。
|
|
78
|
+
|
|
79
|
+
### 3. 澄清规则
|
|
80
|
+
|
|
81
|
+
当缺失信息会影响图结构时,先问再画。一次最多问 3 个关键问题,并给出推荐答案或取舍。
|
|
82
|
+
|
|
83
|
+
优先澄清:
|
|
84
|
+
|
|
85
|
+
- 主体是谁:用户、运营、审批人、系统、第三方。
|
|
86
|
+
- 入口是什么:触发事件、页面入口、API 调用、定时任务。
|
|
87
|
+
- 分支条件是什么:判断字段、阈值、权限、状态。
|
|
88
|
+
- 异常怎么处理:失败、拒绝、超时、重复提交、回滚。
|
|
89
|
+
- 终态是什么:成功状态、失败状态、是否通知、是否留痕。
|
|
90
|
+
|
|
91
|
+
如果信息不足但可以画“待确认版”,必须在图模型和说明卡片里标出待确认项。
|
|
92
|
+
|
|
93
|
+
## 输出契约
|
|
94
|
+
|
|
95
|
+
默认输出:
|
|
96
|
+
|
|
97
|
+
- 主图:`doc/visualize/<slug>.html`
|
|
98
|
+
- 截图:`doc/visualize/<slug>.png`,仅在用户需要对话内预览或明确要求截图时生成。
|
|
99
|
+
|
|
100
|
+
规则:
|
|
101
|
+
|
|
102
|
+
- **输出语言必须跟随用户语言**:中文对话生成中文标题、中文节点、中文图例、中文卡片和中文说明;英文对话才生成英文可见文案。
|
|
103
|
+
- 技术 token 可以保留原文,例如命令、文件名、包名、函数名、tag、环境变量、API 名:`npm run sync`、`release.yml`、`vX.Y.Z-beta.N`、`MANIFEST.sourceCommit`。
|
|
104
|
+
- 模板里的示例文案不是输出文案来源;不得残留 `Legend`、`Users`、`Backend`、`Channel check`、`Card Title` 等与当前语境无关的英文示例标签。
|
|
105
|
+
- 图模型中明确记录:`输出语言:<中文 / English / 用户指定语言>;技术 token 保留原文`。
|
|
106
|
+
- `slug` 使用英文小写和连字符,例如 `order-approval-flow`。
|
|
107
|
+
- 无法安全命名时,向用户确认 `slug`。
|
|
108
|
+
- 同名文件可以覆盖;HTML 是当前真源。
|
|
109
|
+
- 旧 `doc/uml/` 不再作为默认目录。
|
|
110
|
+
|
|
111
|
+
最终答复包含:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
## 可视化图解:<图名>
|
|
115
|
+
|
|
116
|
+
### 图类型
|
|
117
|
+
- <架构图 / 流程图 / 逻辑图 / 状态图>
|
|
118
|
+
|
|
119
|
+
### 产物
|
|
120
|
+
- HTML:`doc/visualize/<slug>.html`
|
|
121
|
+
- PNG:`doc/visualize/<slug>.png`(如已生成)
|
|
122
|
+
|
|
123
|
+
### 图模型
|
|
124
|
+
- 输出语言:<中文 / English / 用户指定语言;技术 token 保留原文>
|
|
125
|
+
- 主体:<角色 / 系统 / 组件>
|
|
126
|
+
- 关系:<调用 / 流转 / 判定 / 异常>
|
|
127
|
+
- 边界:<系统边界 / 阶段 / 权限>
|
|
128
|
+
|
|
129
|
+
### 关键说明
|
|
130
|
+
- <关键节点或路径>
|
|
131
|
+
- <关键判定>
|
|
132
|
+
- <异常 / 回滚>
|
|
133
|
+
|
|
134
|
+
### 待确认
|
|
135
|
+
- [ ] <仍未确认但不阻塞当前图的问题>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## HTML/SVG 生成规则
|
|
139
|
+
|
|
140
|
+
生成 HTML 时,以 `templates/template.html` 的四段式结构为基准:
|
|
141
|
+
|
|
142
|
+
1. Header:标题、状态点、简短副标题。
|
|
143
|
+
2. Main SVG:带暗色网格背景的主图区域。
|
|
144
|
+
3. Summary Cards:图下方说明卡片,至少覆盖关键节点、关键判定、异常 / 风险、待确认项中的三类。
|
|
145
|
+
4. Footer:产物元信息。
|
|
146
|
+
|
|
147
|
+
SVG 必须包含:
|
|
148
|
+
|
|
149
|
+
- `defs` 中的 arrow marker。
|
|
150
|
+
- `pattern id="grid"` 的 40px 网格背景。
|
|
151
|
+
- 先画背景和连线,再画边界和节点。
|
|
152
|
+
- 节点文本短句化;细节放在副标题或说明卡片。
|
|
153
|
+
- 复杂节点使用不透明底层矩形 + 半透明样式层。
|
|
154
|
+
|
|
155
|
+
### 模板替换规则
|
|
156
|
+
|
|
157
|
+
复制或参考 `templates/template.html` 后,必须逐项替换所有可见文案:
|
|
158
|
+
|
|
159
|
+
- HTML `<title>`、`h1`、subtitle、footer。
|
|
160
|
+
- SVG 中所有 `<text>`:节点标题、节点副标题、连线标签、边界标题、图例。
|
|
161
|
+
- Summary Cards:卡片标题、列表项、状态点语义。
|
|
162
|
+
- 示例节点、示例云资源、示例技术栈和示例图例都必须替换成当前图模型中的真实主体和关系。
|
|
163
|
+
|
|
164
|
+
允许保留的英文只限技术 token。普通说明性 UI 文案必须翻译或改写成用户语言,例如:
|
|
165
|
+
|
|
166
|
+
- `Legend` → `图例`
|
|
167
|
+
- `Maintainer` → `维护者`
|
|
168
|
+
- `Channel check` → `通道判定`
|
|
169
|
+
- `Release notes` → `Release 说明` 或 `发布说明`
|
|
170
|
+
- `same args` → `参数一致`
|
|
171
|
+
- `trigger CI` → `触发 CI`
|
|
172
|
+
|
|
173
|
+
不要为了保留模板风格而保留英文示例文案。
|
|
174
|
+
|
|
175
|
+
## 语义映射
|
|
176
|
+
|
|
177
|
+
模板原生颜色用于技术架构:
|
|
178
|
+
|
|
179
|
+
| 类型 | 填充 | 描边 | 用途 |
|
|
180
|
+
| --- | --- | --- | --- |
|
|
181
|
+
| Frontend | `rgba(8, 51, 68, 0.4)` | `#22d3ee` | 前端、入口、人工动作 |
|
|
182
|
+
| Backend | `rgba(6, 78, 59, 0.4)` | `#34d399` | 后端服务、系统动作、任务执行 |
|
|
183
|
+
| Database | `rgba(76, 29, 149, 0.4)` | `#a78bfa` | 数据库、缓存、文件、状态记录 |
|
|
184
|
+
| AWS/Cloud | `rgba(120, 53, 15, 0.3)` | `#fbbf24` | 云资源、平台边界、业务阶段 |
|
|
185
|
+
| Security | `rgba(136, 19, 55, 0.4)` | `#fb7185` | 安全、异常、拒绝、超时、回滚 |
|
|
186
|
+
| Message Bus | `rgba(251, 146, 60, 0.3)` | `#fb923c` | 队列、事件、异步、判定规则 |
|
|
187
|
+
| External | `rgba(30, 41, 59, 0.5)` | `#94a3b8` | 外部参与者、第三方系统 |
|
|
188
|
+
|
|
189
|
+
扩展到流程 / 逻辑 / 状态图时按同一色板映射,不新增一套不兼容色板:
|
|
190
|
+
|
|
191
|
+
- 外部参与者 / 第三方系统:External。
|
|
192
|
+
- 人工动作 / 用户操作 / 审批:Frontend。
|
|
193
|
+
- 系统动作 / 服务处理 / 定时任务:Backend。
|
|
194
|
+
- 数据 / 状态记录 / 审计日志:Database。
|
|
195
|
+
- 阶段 / 组织 / 平台边界:AWS/Cloud boundary。
|
|
196
|
+
- 判定 / 策略 / 异步事件:Message Bus。
|
|
197
|
+
- 异常 / 拒绝 / 超时 / 回滚:Security。
|
|
198
|
+
- 成功终态:Backend 或 Database 色系,并在文本中标明终态。
|
|
199
|
+
|
|
200
|
+
## 连线规则
|
|
201
|
+
|
|
202
|
+
- 普通调用、主流程:实线箭头。
|
|
203
|
+
- 鉴权、安全、拒绝、失败、回滚:玫红色虚线。
|
|
204
|
+
- 异步、事件、队列:橙色或琥珀色,并标注“异步”、“事件触发”或队列名。
|
|
205
|
+
- 条件分支必须在线上或节点旁标注条件,不允许只靠箭头颜色表达。
|
|
206
|
+
- 回到前置状态的路径必须明确标注原因,例如“补充材料”、“重试”、“人工复核”。
|
|
207
|
+
|
|
208
|
+
## PNG 渲染
|
|
209
|
+
|
|
210
|
+
生成 HTML 后,只有在用户需要预览时才生成 PNG。优先用本地浏览器 / Playwright 截图:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
node - <<'JS'
|
|
214
|
+
const { chromium } = require('playwright');
|
|
215
|
+
const path = require('path');
|
|
216
|
+
|
|
217
|
+
(async () => {
|
|
218
|
+
const input = path.resolve('doc/visualize/<slug>.html');
|
|
219
|
+
const output = path.resolve('doc/visualize/<slug>.png');
|
|
220
|
+
const browser = await chromium.launch();
|
|
221
|
+
const page = await browser.newPage({ viewport: { width: 1280, height: 900 }, deviceScaleFactor: 2 });
|
|
222
|
+
await page.goto('file://' + input);
|
|
223
|
+
await page.screenshot({ path: output, fullPage: true });
|
|
224
|
+
await browser.close();
|
|
225
|
+
console.log(`saved: ${output}`);
|
|
226
|
+
})();
|
|
227
|
+
JS
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
如果 Playwright 或浏览器不可用,保留 HTML 主产物并说明 PNG 未生成的原因;不要假装截图成功。
|
|
231
|
+
|
|
232
|
+
## 生成后自检
|
|
233
|
+
|
|
234
|
+
交付前必须检查 HTML:
|
|
235
|
+
|
|
236
|
+
- 确认 `templates/template.html` 的结构已被业务内容替换,不存在 `Card Title`、`Users`、`Frontend`、`Backend`、`Database` 等无关示例残留;如果这些词本身就是业务真实名称,必须在说明中可解释。
|
|
237
|
+
- 对中文用户,用 `rg -n "[A-Za-z]{3,}" doc/visualize/<slug>.html` 扫描可见英文。保留命令、文件名、包名、tag、API 名、CSS/HTML 属性等技术 token;把普通 UI 标签、状态说明、图例、节点标题和连线说明改成中文。
|
|
238
|
+
- 确认图中每个节点和说明卡片都来自图模型,不从模板示例继承。
|
|
239
|
+
- 自检不通过时,先修 HTML,再向用户报告产物。
|
|
240
|
+
|
|
241
|
+
## 迭代规则
|
|
242
|
+
|
|
243
|
+
- 用户反馈后,只改被指出的部分,保持其他节点和关系稳定。
|
|
244
|
+
- 大幅改图类型、版式或主流程前,先确认修改范围。
|
|
245
|
+
- 修改后必须同步更新 HTML;如果已经生成 PNG,也要重新截图。
|
|
246
|
+
|
|
247
|
+
## 禁止事项
|
|
248
|
+
|
|
249
|
+
- 不要不读 `templates/template.html` 就直接生成最终 HTML/SVG。
|
|
250
|
+
- 不要把原 `architecture-diagram` 的硬约束弱化为“可选建议”。
|
|
251
|
+
- 不要让模板英文示例文案泄漏到最终图中;除技术 token 外,可见文案必须跟随用户语言。
|
|
252
|
+
- 不要跳过澄清直接画复杂分支图。
|
|
253
|
+
- 不要虚构角色、系统、字段、状态、规则、异常路径。
|
|
254
|
+
- 不要只输出文字说明而不生成图。
|
|
255
|
+
- 不要只给 Mermaid 代码作为最终产物。
|
|
256
|
+
- 不要把旧 UML 诉求继续写入 `doc/uml/`。
|
|
257
|
+
- 不要在 PNG 生成失败时假装成功。
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>[PROJECT NAME] Architecture Diagram</title>
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
8
|
+
<style>
|
|
9
|
+
* {
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
font-family: 'JetBrains Mono', monospace;
|
|
17
|
+
background: #020617;
|
|
18
|
+
min-height: 100vh;
|
|
19
|
+
padding: 2rem;
|
|
20
|
+
color: white;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.container {
|
|
24
|
+
max-width: 1200px;
|
|
25
|
+
margin: 0 auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.header {
|
|
29
|
+
margin-bottom: 2rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.header-row {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 1rem;
|
|
36
|
+
margin-bottom: 0.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pulse-dot {
|
|
40
|
+
width: 12px;
|
|
41
|
+
height: 12px;
|
|
42
|
+
background: #22d3ee;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
animation: pulse 2s infinite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes pulse {
|
|
48
|
+
0%, 100% { opacity: 1; }
|
|
49
|
+
50% { opacity: 0.5; }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
h1 {
|
|
53
|
+
font-size: 1.5rem;
|
|
54
|
+
font-weight: 700;
|
|
55
|
+
letter-spacing: -0.025em;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.subtitle {
|
|
59
|
+
color: #94a3b8;
|
|
60
|
+
font-size: 0.875rem;
|
|
61
|
+
margin-left: 1.75rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.diagram-container {
|
|
65
|
+
background: rgba(15, 23, 42, 0.5);
|
|
66
|
+
border-radius: 1rem;
|
|
67
|
+
border: 1px solid #1e293b;
|
|
68
|
+
padding: 1.5rem;
|
|
69
|
+
overflow-x: auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
svg {
|
|
73
|
+
width: 100%;
|
|
74
|
+
min-width: 900px;
|
|
75
|
+
display: block;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cards {
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
81
|
+
gap: 1rem;
|
|
82
|
+
margin-top: 2rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.card {
|
|
86
|
+
background: rgba(15, 23, 42, 0.5);
|
|
87
|
+
border-radius: 0.75rem;
|
|
88
|
+
border: 1px solid #1e293b;
|
|
89
|
+
padding: 1.25rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.card-header {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: 0.5rem;
|
|
96
|
+
margin-bottom: 0.75rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.card-dot {
|
|
100
|
+
width: 8px;
|
|
101
|
+
height: 8px;
|
|
102
|
+
border-radius: 50%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.card-dot.cyan { background: #22d3ee; }
|
|
106
|
+
.card-dot.emerald { background: #34d399; }
|
|
107
|
+
.card-dot.violet { background: #a78bfa; }
|
|
108
|
+
.card-dot.amber { background: #fbbf24; }
|
|
109
|
+
.card-dot.rose { background: #fb7185; }
|
|
110
|
+
|
|
111
|
+
.card h3 {
|
|
112
|
+
font-size: 0.875rem;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.card ul {
|
|
117
|
+
list-style: none;
|
|
118
|
+
color: #94a3b8;
|
|
119
|
+
font-size: 0.75rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.card li {
|
|
123
|
+
margin-bottom: 0.375rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.footer {
|
|
127
|
+
text-align: center;
|
|
128
|
+
margin-top: 1.5rem;
|
|
129
|
+
color: #475569;
|
|
130
|
+
font-size: 0.75rem;
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
133
|
+
</head>
|
|
134
|
+
<body>
|
|
135
|
+
<div class="container">
|
|
136
|
+
<!-- Header -->
|
|
137
|
+
<div class="header">
|
|
138
|
+
<div class="header-row">
|
|
139
|
+
<div class="pulse-dot"></div>
|
|
140
|
+
<h1>[PROJECT NAME] Architecture</h1>
|
|
141
|
+
</div>
|
|
142
|
+
<p class="subtitle">[Subtitle description]</p>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<!-- Main Diagram -->
|
|
146
|
+
<div class="diagram-container">
|
|
147
|
+
<svg viewBox="0 0 1000 680">
|
|
148
|
+
<!-- Definitions -->
|
|
149
|
+
<defs>
|
|
150
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
151
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="#64748b" />
|
|
152
|
+
</marker>
|
|
153
|
+
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
|
|
154
|
+
<path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>
|
|
155
|
+
</pattern>
|
|
156
|
+
</defs>
|
|
157
|
+
|
|
158
|
+
<!-- Background Grid -->
|
|
159
|
+
<rect width="100%" height="100%" fill="url(#grid)" />
|
|
160
|
+
|
|
161
|
+
<!-- =================================================================
|
|
162
|
+
COMPONENT EXAMPLES - Copy and customize these patterns
|
|
163
|
+
================================================================= -->
|
|
164
|
+
|
|
165
|
+
<!-- External/Generic Component -->
|
|
166
|
+
<rect x="30" y="280" width="100" height="50" rx="6" fill="rgba(30, 41, 59, 0.5)" stroke="#94a3b8" stroke-width="1.5"/>
|
|
167
|
+
<text x="80" y="300" fill="white" font-size="11" font-weight="600" text-anchor="middle">Users</text>
|
|
168
|
+
<text x="80" y="316" fill="#94a3b8" font-size="9" text-anchor="middle">Browser/Mobile</text>
|
|
169
|
+
|
|
170
|
+
<!-- Security Component -->
|
|
171
|
+
<rect x="30" y="80" width="100" height="60" rx="6" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1.5"/>
|
|
172
|
+
<text x="80" y="105" fill="white" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
|
|
173
|
+
<text x="80" y="121" fill="#94a3b8" font-size="9" text-anchor="middle">OAuth 2.0</text>
|
|
174
|
+
|
|
175
|
+
<!-- Region/Cloud Boundary -->
|
|
176
|
+
<rect x="160" y="40" width="820" height="620" rx="12" fill="rgba(251, 191, 36, 0.05)" stroke="#fbbf24" stroke-width="1" stroke-dasharray="8,4"/>
|
|
177
|
+
<text x="172" y="58" fill="#fbbf24" font-size="10" font-weight="600">AWS Region: us-west-2</text>
|
|
178
|
+
|
|
179
|
+
<!-- AWS/Cloud Service -->
|
|
180
|
+
<rect x="200" y="280" width="110" height="50" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>
|
|
181
|
+
<text x="255" y="300" fill="white" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
|
|
182
|
+
<text x="255" y="316" fill="#94a3b8" font-size="9" text-anchor="middle">CDN</text>
|
|
183
|
+
|
|
184
|
+
<!-- Multi-line AWS Component (S3 Buckets example) -->
|
|
185
|
+
<rect x="200" y="380" width="110" height="100" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>
|
|
186
|
+
<text x="255" y="400" fill="white" font-size="11" font-weight="600" text-anchor="middle">S3 Buckets</text>
|
|
187
|
+
<text x="255" y="420" fill="#94a3b8" font-size="8" text-anchor="middle">• bucket-one</text>
|
|
188
|
+
<text x="255" y="434" fill="#94a3b8" font-size="8" text-anchor="middle">• bucket-two</text>
|
|
189
|
+
<text x="255" y="448" fill="#94a3b8" font-size="8" text-anchor="middle">• bucket-three</text>
|
|
190
|
+
<text x="255" y="466" fill="#fbbf24" font-size="7" text-anchor="middle">OAI Protected</text>
|
|
191
|
+
|
|
192
|
+
<!-- Security Group (dashed boundary) -->
|
|
193
|
+
<rect x="350" y="265" width="120" height="80" rx="8" fill="transparent" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>
|
|
194
|
+
<text x="358" y="279" fill="#fb7185" font-size="8">sg-name :port</text>
|
|
195
|
+
|
|
196
|
+
<!-- Component inside security group -->
|
|
197
|
+
<rect x="360" y="280" width="100" height="50" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>
|
|
198
|
+
<text x="410" y="300" fill="white" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
|
|
199
|
+
<text x="410" y="316" fill="#94a3b8" font-size="9" text-anchor="middle">HTTPS :443</text>
|
|
200
|
+
|
|
201
|
+
<!-- Backend Component -->
|
|
202
|
+
<rect x="510" y="280" width="110" height="50" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>
|
|
203
|
+
<text x="565" y="300" fill="white" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
|
|
204
|
+
<text x="565" y="316" fill="#94a3b8" font-size="9" text-anchor="middle">FastAPI :8000</text>
|
|
205
|
+
|
|
206
|
+
<!-- Database Component -->
|
|
207
|
+
<rect x="700" y="280" width="120" height="50" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>
|
|
208
|
+
<text x="760" y="300" fill="white" font-size="11" font-weight="600" text-anchor="middle">Database</text>
|
|
209
|
+
<text x="760" y="316" fill="#94a3b8" font-size="9" text-anchor="middle">PostgreSQL</text>
|
|
210
|
+
|
|
211
|
+
<!-- Frontend Component -->
|
|
212
|
+
<rect x="200" y="520" width="200" height="110" rx="8" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1.5"/>
|
|
213
|
+
<text x="300" y="545" fill="white" font-size="12" font-weight="600" text-anchor="middle">Frontend</text>
|
|
214
|
+
<text x="300" y="565" fill="#94a3b8" font-size="9" text-anchor="middle">React + TypeScript</text>
|
|
215
|
+
<text x="300" y="580" fill="#94a3b8" font-size="9" text-anchor="middle">Additional detail</text>
|
|
216
|
+
<text x="300" y="595" fill="#94a3b8" font-size="9" text-anchor="middle">More info</text>
|
|
217
|
+
<text x="300" y="615" fill="#22d3ee" font-size="8" text-anchor="middle">domain.example.com</text>
|
|
218
|
+
|
|
219
|
+
<!-- =================================================================
|
|
220
|
+
ARROW EXAMPLES
|
|
221
|
+
================================================================= -->
|
|
222
|
+
|
|
223
|
+
<!-- Standard arrow with label -->
|
|
224
|
+
<line x1="130" y1="305" x2="198" y2="305" stroke="#22d3ee" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
|
225
|
+
<text x="164" y="299" fill="#94a3b8" font-size="9" text-anchor="middle">HTTPS</text>
|
|
226
|
+
|
|
227
|
+
<!-- Simple arrow (no label) -->
|
|
228
|
+
<line x1="310" y1="305" x2="358" y2="305" stroke="#22d3ee" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
|
229
|
+
|
|
230
|
+
<!-- Vertical arrow -->
|
|
231
|
+
<line x1="255" y1="330" x2="255" y2="378" stroke="#fbbf24" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
|
232
|
+
<text x="270" y="358" fill="#94a3b8" font-size="9">OAI</text>
|
|
233
|
+
|
|
234
|
+
<!-- Dashed arrow (for auth/security flows) -->
|
|
235
|
+
<line x1="460" y1="305" x2="508" y2="305" stroke="#34d399" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
|
236
|
+
<line x1="620" y1="305" x2="698" y2="305" stroke="#a78bfa" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
|
237
|
+
<text x="655" y="299" fill="#94a3b8" font-size="9">TLS</text>
|
|
238
|
+
|
|
239
|
+
<!-- Curved path for auth flow -->
|
|
240
|
+
<path d="M 80 140 L 80 200 Q 80 220 100 220 L 200 220 Q 220 220 220 240 L 220 278" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="5,5"/>
|
|
241
|
+
<text x="150" y="210" fill="#fb7185" font-size="8">JWT + PKCE</text>
|
|
242
|
+
|
|
243
|
+
<!-- =================================================================
|
|
244
|
+
LEGEND
|
|
245
|
+
================================================================= -->
|
|
246
|
+
<text x="720" y="70" fill="white" font-size="10" font-weight="600">Legend</text>
|
|
247
|
+
|
|
248
|
+
<rect x="720" y="82" width="16" height="10" rx="2" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1"/>
|
|
249
|
+
<text x="742" y="90" fill="#94a3b8" font-size="8">Frontend</text>
|
|
250
|
+
|
|
251
|
+
<rect x="720" y="98" width="16" height="10" rx="2" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1"/>
|
|
252
|
+
<text x="742" y="106" fill="#94a3b8" font-size="8">Backend</text>
|
|
253
|
+
|
|
254
|
+
<rect x="720" y="114" width="16" height="10" rx="2" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1"/>
|
|
255
|
+
<text x="742" y="122" fill="#94a3b8" font-size="8">Cloud Service</text>
|
|
256
|
+
|
|
257
|
+
<rect x="720" y="130" width="16" height="10" rx="2" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1"/>
|
|
258
|
+
<text x="742" y="138" fill="#94a3b8" font-size="8">Database</text>
|
|
259
|
+
|
|
260
|
+
<rect x="720" y="146" width="16" height="10" rx="2" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1"/>
|
|
261
|
+
<text x="742" y="154" fill="#94a3b8" font-size="8">Security</text>
|
|
262
|
+
|
|
263
|
+
<line x1="720" y1="168" x2="736" y2="168" stroke="#fb7185" stroke-width="1" stroke-dasharray="3,3"/>
|
|
264
|
+
<text x="742" y="171" fill="#94a3b8" font-size="8">Auth Flow</text>
|
|
265
|
+
|
|
266
|
+
<rect x="720" y="178" width="16" height="10" rx="2" fill="transparent" stroke="#fb7185" stroke-width="1" stroke-dasharray="3,3"/>
|
|
267
|
+
<text x="742" y="186" fill="#94a3b8" font-size="8">Security Group</text>
|
|
268
|
+
</svg>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<!-- Info Cards -->
|
|
272
|
+
<div class="cards">
|
|
273
|
+
<div class="card">
|
|
274
|
+
<div class="card-header">
|
|
275
|
+
<div class="card-dot rose"></div>
|
|
276
|
+
<h3>Card Title 1</h3>
|
|
277
|
+
</div>
|
|
278
|
+
<ul>
|
|
279
|
+
<li>• Item one</li>
|
|
280
|
+
<li>• Item two</li>
|
|
281
|
+
<li>• Item three</li>
|
|
282
|
+
<li>• Item four</li>
|
|
283
|
+
</ul>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<div class="card">
|
|
287
|
+
<div class="card-header">
|
|
288
|
+
<div class="card-dot amber"></div>
|
|
289
|
+
<h3>Card Title 2</h3>
|
|
290
|
+
</div>
|
|
291
|
+
<ul>
|
|
292
|
+
<li>• Item one</li>
|
|
293
|
+
<li>• Item two</li>
|
|
294
|
+
<li>• Item three</li>
|
|
295
|
+
<li>• Item four</li>
|
|
296
|
+
</ul>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<div class="card">
|
|
300
|
+
<div class="card-header">
|
|
301
|
+
<div class="card-dot violet"></div>
|
|
302
|
+
<h3>Card Title 3</h3>
|
|
303
|
+
</div>
|
|
304
|
+
<ul>
|
|
305
|
+
<li>• Item one</li>
|
|
306
|
+
<li>• Item two</li>
|
|
307
|
+
<li>• Item three</li>
|
|
308
|
+
<li>• Item four</li>
|
|
309
|
+
</ul>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<!-- Footer -->
|
|
314
|
+
<p class="footer">
|
|
315
|
+
[Project Name] • [Additional metadata]
|
|
316
|
+
</p>
|
|
317
|
+
</div>
|
|
318
|
+
</body>
|
|
319
|
+
</html>
|
|
@@ -74,7 +74,7 @@ description: "Create a new trellis entry as command or skill; writes agents copy
|
|
|
74
74
|
| 形态 | 何时选 | 触发方式 |
|
|
75
75
|
|------|--------|---------|
|
|
76
76
|
| **command** | 显式动作、高风险、需确认点(如 finish-work、continue) | `/trellis:<name>` |
|
|
77
|
-
| **skill** | 自然语可触发、查询 / 分析 / 检查、低破坏性(如 check-all、extract-prd、
|
|
77
|
+
| **skill** | 自然语可触发、查询 / 分析 / 检查、低破坏性(如 check-all、extract-prd、visualize) | Claude 自动路由 + `/trellis-<name>` |
|
|
78
78
|
|
|
79
79
|
决定不了时**推荐 skill**:自然语路由更灵活,显式斜杠仍可用。反过来,后悔做成 skill 想改 command 比较费事。
|
|
80
80
|
|
|
@@ -253,7 +253,7 @@ cp -r <target>/.agents/skills/trellis-<X> <skill-garden>/.trellis/0.6/.agents/sk
|
|
|
253
253
|
| Create / generate(从零创建) | `create-` | `create-command` |
|
|
254
254
|
| Analyze | `analyze-` | `analyze-task` |
|
|
255
255
|
| Sync / update | `sync-` / `update-` | `sync-prd` / `update-spec` |
|
|
256
|
-
| 动作类 | 动词开头 | `push` / `
|
|
256
|
+
| 动作类 | 动词开头 | `push` / `visualize` |
|
|
257
257
|
|
|
258
258
|
> **0.6 命名取舍**:「严格提取」类用 `extract-` 前缀(强调原文不动、禁止发挥);「从零创建」类才用 `create-` 前缀(如 create-command)。区分这两者能让 AI 在触发时不混淆生成 vs 提取的语义。
|
|
259
259
|
|