ccgx-workflow 1.0.0

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 (212) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +469 -0
  3. package/README.zh-CN.md +466 -0
  4. package/bin/ccg.mjs +2 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.d.ts +1 -0
  7. package/dist/cli.mjs +173 -0
  8. package/dist/index.d.mts +1774 -0
  9. package/dist/index.d.ts +1774 -0
  10. package/dist/index.mjs +2029 -0
  11. package/dist/shared/ccgx-workflow.WgUzkiC3.mjs +5248 -0
  12. package/package.json +129 -0
  13. package/templates/commands/agents/assumptions-analyzer.md +129 -0
  14. package/templates/commands/agents/code-fixer.md +292 -0
  15. package/templates/commands/agents/codebase-mapper.md +152 -0
  16. package/templates/commands/agents/debug-session-manager.md +247 -0
  17. package/templates/commands/agents/debugger.md +111 -0
  18. package/templates/commands/agents/eval-auditor.md +171 -0
  19. package/templates/commands/agents/framework-selector.md +152 -0
  20. package/templates/commands/agents/get-current-datetime.md +29 -0
  21. package/templates/commands/agents/init-architect.md +114 -0
  22. package/templates/commands/agents/integration-checker.md +163 -0
  23. package/templates/commands/agents/interface-auditor.md +170 -0
  24. package/templates/commands/agents/nyquist-auditor.md +131 -0
  25. package/templates/commands/agents/pattern-mapper.md +111 -0
  26. package/templates/commands/agents/phase-runner.md +321 -0
  27. package/templates/commands/agents/plan-checker.md +255 -0
  28. package/templates/commands/agents/planner.md +320 -0
  29. package/templates/commands/agents/team-architect.md +186 -0
  30. package/templates/commands/agents/team-qa.md +121 -0
  31. package/templates/commands/agents/team-reviewer.md +157 -0
  32. package/templates/commands/agents/ui-ux-designer.md +573 -0
  33. package/templates/commands/agents/verifier.md +274 -0
  34. package/templates/commands/analyze.md +210 -0
  35. package/templates/commands/autonomous.md +792 -0
  36. package/templates/commands/cancel.md +132 -0
  37. package/templates/commands/clean-branches.md +117 -0
  38. package/templates/commands/codex-exec.md +404 -0
  39. package/templates/commands/commit.md +151 -0
  40. package/templates/commands/context.md +332 -0
  41. package/templates/commands/debate.md +165 -0
  42. package/templates/commands/debug.md +226 -0
  43. package/templates/commands/enhance.md +64 -0
  44. package/templates/commands/execute.md +380 -0
  45. package/templates/commands/init.md +123 -0
  46. package/templates/commands/optimize.md +217 -0
  47. package/templates/commands/plan.md +373 -0
  48. package/templates/commands/result.md +106 -0
  49. package/templates/commands/review.md +338 -0
  50. package/templates/commands/rollback.md +116 -0
  51. package/templates/commands/spec-impl.md +139 -0
  52. package/templates/commands/spec-init.md +101 -0
  53. package/templates/commands/spec-plan.md +210 -0
  54. package/templates/commands/spec-research.md +152 -0
  55. package/templates/commands/spec-review.md +120 -0
  56. package/templates/commands/status.md +206 -0
  57. package/templates/commands/team-exec.md +265 -0
  58. package/templates/commands/test.md +236 -0
  59. package/templates/commands/verify-work.md +338 -0
  60. package/templates/commands/verify.md +66 -0
  61. package/templates/commands/workflow.md +190 -0
  62. package/templates/commands/worktree.md +128 -0
  63. package/templates/hooks/ccg-context-monitor.js +159 -0
  64. package/templates/hooks/ccg-session-state.cjs +510 -0
  65. package/templates/hooks/ccg-statusline.js +142 -0
  66. package/templates/output-styles/abyss-command.md +56 -0
  67. package/templates/output-styles/abyss-concise.md +89 -0
  68. package/templates/output-styles/abyss-cultivator.md +302 -0
  69. package/templates/output-styles/abyss-ritual.md +70 -0
  70. package/templates/output-styles/engineer-professional.md +89 -0
  71. package/templates/output-styles/laowang-engineer.md +127 -0
  72. package/templates/output-styles/nekomata-engineer.md +120 -0
  73. package/templates/output-styles/ojousama-engineer.md +121 -0
  74. package/templates/prompts/claude/analyzer.md +59 -0
  75. package/templates/prompts/claude/architect.md +54 -0
  76. package/templates/prompts/claude/debugger.md +71 -0
  77. package/templates/prompts/claude/optimizer.md +73 -0
  78. package/templates/prompts/claude/reviewer.md +63 -0
  79. package/templates/prompts/claude/tester.md +69 -0
  80. package/templates/prompts/codex/analyzer.md +58 -0
  81. package/templates/prompts/codex/architect.md +54 -0
  82. package/templates/prompts/codex/debugger.md +74 -0
  83. package/templates/prompts/codex/optimizer.md +81 -0
  84. package/templates/prompts/codex/reviewer.md +73 -0
  85. package/templates/prompts/codex/tester.md +62 -0
  86. package/templates/prompts/gemini/analyzer.md +61 -0
  87. package/templates/prompts/gemini/architect.md +55 -0
  88. package/templates/prompts/gemini/debugger.md +78 -0
  89. package/templates/prompts/gemini/frontend.md +64 -0
  90. package/templates/prompts/gemini/optimizer.md +84 -0
  91. package/templates/prompts/gemini/reviewer.md +80 -0
  92. package/templates/prompts/gemini/tester.md +68 -0
  93. package/templates/rules/ccg-skill-routing.md +83 -0
  94. package/templates/rules/ccg-skills.md +71 -0
  95. package/templates/scripts/ccg-phase-runner-launcher.mjs +467 -0
  96. package/templates/scripts/invoke-model.mjs +949 -0
  97. package/templates/scripts/repatch-gemini-plugin.mjs +194 -0
  98. package/templates/skills/SKILL.md +92 -0
  99. package/templates/skills/domains/ai/SKILL.md +35 -0
  100. package/templates/skills/domains/ai/agent-dev.md +242 -0
  101. package/templates/skills/domains/ai/llm-security.md +288 -0
  102. package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
  103. package/templates/skills/domains/ai/rag-system.md +542 -0
  104. package/templates/skills/domains/architecture/SKILL.md +43 -0
  105. package/templates/skills/domains/architecture/api-design.md +225 -0
  106. package/templates/skills/domains/architecture/caching.md +299 -0
  107. package/templates/skills/domains/architecture/cloud-native.md +285 -0
  108. package/templates/skills/domains/architecture/message-queue.md +329 -0
  109. package/templates/skills/domains/architecture/security-arch.md +297 -0
  110. package/templates/skills/domains/data-engineering/SKILL.md +208 -0
  111. package/templates/skills/domains/development/SKILL.md +47 -0
  112. package/templates/skills/domains/development/cpp.md +246 -0
  113. package/templates/skills/domains/development/go.md +323 -0
  114. package/templates/skills/domains/development/java.md +277 -0
  115. package/templates/skills/domains/development/python.md +288 -0
  116. package/templates/skills/domains/development/rust.md +313 -0
  117. package/templates/skills/domains/development/shell.md +313 -0
  118. package/templates/skills/domains/development/typescript.md +277 -0
  119. package/templates/skills/domains/devops/SKILL.md +40 -0
  120. package/templates/skills/domains/devops/cost-optimization.md +272 -0
  121. package/templates/skills/domains/devops/database.md +217 -0
  122. package/templates/skills/domains/devops/devsecops.md +198 -0
  123. package/templates/skills/domains/devops/git-workflow.md +181 -0
  124. package/templates/skills/domains/devops/observability.md +280 -0
  125. package/templates/skills/domains/devops/performance.md +336 -0
  126. package/templates/skills/domains/devops/testing.md +283 -0
  127. package/templates/skills/domains/frontend-design/SKILL.md +244 -0
  128. package/templates/skills/domains/frontend-design/agents/openai.yaml +4 -0
  129. package/templates/skills/domains/frontend-design/claymorphism/SKILL.md +121 -0
  130. package/templates/skills/domains/frontend-design/claymorphism/references/tokens.css +52 -0
  131. package/templates/skills/domains/frontend-design/component-patterns.md +202 -0
  132. package/templates/skills/domains/frontend-design/engineering.md +287 -0
  133. package/templates/skills/domains/frontend-design/glassmorphism/SKILL.md +142 -0
  134. package/templates/skills/domains/frontend-design/glassmorphism/references/tokens.css +32 -0
  135. package/templates/skills/domains/frontend-design/liquid-glass/SKILL.md +139 -0
  136. package/templates/skills/domains/frontend-design/liquid-glass/references/tokens.css +81 -0
  137. package/templates/skills/domains/frontend-design/neubrutalism/SKILL.md +145 -0
  138. package/templates/skills/domains/frontend-design/neubrutalism/references/tokens.css +44 -0
  139. package/templates/skills/domains/frontend-design/reference/color-and-contrast.md +132 -0
  140. package/templates/skills/domains/frontend-design/reference/interaction-design.md +195 -0
  141. package/templates/skills/domains/frontend-design/reference/motion-design.md +99 -0
  142. package/templates/skills/domains/frontend-design/reference/responsive-design.md +114 -0
  143. package/templates/skills/domains/frontend-design/reference/spatial-design.md +100 -0
  144. package/templates/skills/domains/frontend-design/reference/typography.md +133 -0
  145. package/templates/skills/domains/frontend-design/reference/ux-writing.md +107 -0
  146. package/templates/skills/domains/frontend-design/state-management.md +680 -0
  147. package/templates/skills/domains/frontend-design/ui-aesthetics.md +110 -0
  148. package/templates/skills/domains/frontend-design/ux-principles.md +156 -0
  149. package/templates/skills/domains/infrastructure/SKILL.md +201 -0
  150. package/templates/skills/domains/mobile/SKILL.md +225 -0
  151. package/templates/skills/domains/orchestration/SKILL.md +30 -0
  152. package/templates/skills/domains/orchestration/multi-agent.md +263 -0
  153. package/templates/skills/domains/security/SKILL.md +73 -0
  154. package/templates/skills/domains/security/blue-team.md +436 -0
  155. package/templates/skills/domains/security/code-audit.md +265 -0
  156. package/templates/skills/domains/security/pentest.md +226 -0
  157. package/templates/skills/domains/security/red-team.md +374 -0
  158. package/templates/skills/domains/security/threat-intel.md +372 -0
  159. package/templates/skills/domains/security/vuln-research.md +369 -0
  160. package/templates/skills/impeccable/adapt/SKILL.md +201 -0
  161. package/templates/skills/impeccable/animate/SKILL.md +176 -0
  162. package/templates/skills/impeccable/arrange/SKILL.md +126 -0
  163. package/templates/skills/impeccable/audit/SKILL.md +149 -0
  164. package/templates/skills/impeccable/bolder/SKILL.md +118 -0
  165. package/templates/skills/impeccable/clarify/SKILL.md +185 -0
  166. package/templates/skills/impeccable/colorize/SKILL.md +144 -0
  167. package/templates/skills/impeccable/critique/SKILL.md +203 -0
  168. package/templates/skills/impeccable/critique/reference/cognitive-load.md +106 -0
  169. package/templates/skills/impeccable/critique/reference/heuristics-scoring.md +234 -0
  170. package/templates/skills/impeccable/critique/reference/personas.md +178 -0
  171. package/templates/skills/impeccable/delight/SKILL.md +305 -0
  172. package/templates/skills/impeccable/distill/SKILL.md +123 -0
  173. package/templates/skills/impeccable/extract/SKILL.md +94 -0
  174. package/templates/skills/impeccable/harden/SKILL.md +357 -0
  175. package/templates/skills/impeccable/normalize/SKILL.md +72 -0
  176. package/templates/skills/impeccable/onboard/SKILL.md +248 -0
  177. package/templates/skills/impeccable/optimize/SKILL.md +268 -0
  178. package/templates/skills/impeccable/overdrive/SKILL.md +143 -0
  179. package/templates/skills/impeccable/polish/SKILL.md +205 -0
  180. package/templates/skills/impeccable/quieter/SKILL.md +104 -0
  181. package/templates/skills/impeccable/teach-impeccable/SKILL.md +72 -0
  182. package/templates/skills/impeccable/typeset/SKILL.md +117 -0
  183. package/templates/skills/orchestration/multi-agent/SKILL.md +533 -0
  184. package/templates/skills/run_skill.js +129 -0
  185. package/templates/skills/scrapling/SKILL.md +98 -0
  186. package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
  187. package/templates/skills/scrapling/references/cookie-vault.md +56 -0
  188. package/templates/skills/scrapling/references/maintenance.md +79 -0
  189. package/templates/skills/scrapling/references/site-patterns.md +86 -0
  190. package/templates/skills/scrapling/references/troubleshooting.md +95 -0
  191. package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
  192. package/templates/skills/scrapling/templates/parse_only.py +15 -0
  193. package/templates/skills/scrapling/templates/session_login.py +19 -0
  194. package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
  195. package/templates/skills/tools/extract-learnings/SKILL.md +77 -0
  196. package/templates/skills/tools/forensics/SKILL.md +89 -0
  197. package/templates/skills/tools/gen-docs/SKILL.md +116 -0
  198. package/templates/skills/tools/gen-docs/scripts/doc_generator.js +435 -0
  199. package/templates/skills/tools/health/SKILL.md +121 -0
  200. package/templates/skills/tools/lib/shared.js +98 -0
  201. package/templates/skills/tools/map-codebase/SKILL.md +118 -0
  202. package/templates/skills/tools/override-refusal/SKILL.md +53 -0
  203. package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
  204. package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -0
  205. package/templates/skills/tools/verify-change/SKILL.md +143 -0
  206. package/templates/skills/tools/verify-change/scripts/change_analyzer.js +289 -0
  207. package/templates/skills/tools/verify-module/SKILL.md +130 -0
  208. package/templates/skills/tools/verify-module/scripts/module_scanner.js +171 -0
  209. package/templates/skills/tools/verify-quality/SKILL.md +163 -0
  210. package/templates/skills/tools/verify-quality/scripts/quality_checker.js +337 -0
  211. package/templates/skills/tools/verify-security/SKILL.md +146 -0
  212. package/templates/skills/tools/verify-security/scripts/security_scanner.js +283 -0
@@ -0,0 +1,283 @@
1
+ ---
2
+ name: testing
3
+ description: 软件测试。单元测试、集成测试、TDD、测试框架。当用户提到测试、单元测试、pytest、Jest、mock、TDD时使用。
4
+ ---
5
+
6
+ # 🔧 炼器秘典 · 软件测试
7
+
8
+
9
+ ## 测试金字塔
10
+
11
+ ```
12
+ /\
13
+ / \ E2E 测试 (少)
14
+ /----\
15
+ / \ 集成测试 (中)
16
+ /--------\
17
+ / \ 单元测试 (多)
18
+ --------------
19
+ ```
20
+
21
+ ## Python (pytest)
22
+
23
+ ```python
24
+ import pytest
25
+ from myapp import calculate, UserService
26
+
27
+ # 基础测试
28
+ def test_add():
29
+ assert calculate.add(1, 2) == 3
30
+
31
+ # 参数化
32
+ @pytest.mark.parametrize("a,b,expected", [
33
+ (1, 2, 3),
34
+ (0, 0, 0),
35
+ (-1, 1, 0),
36
+ ])
37
+ def test_add_params(a, b, expected):
38
+ assert calculate.add(a, b) == expected
39
+
40
+ # Fixture
41
+ @pytest.fixture
42
+ def user_service():
43
+ service = UserService()
44
+ yield service
45
+ service.cleanup()
46
+
47
+ def test_create_user(user_service):
48
+ user = user_service.create("test")
49
+ assert user.name == "test"
50
+
51
+ # Mock
52
+ from unittest.mock import Mock, patch
53
+
54
+ @patch('myapp.requests.get')
55
+ def test_fetch(mock_get):
56
+ mock_get.return_value.json.return_value = {"id": 1}
57
+ result = fetch_user(1)
58
+ assert result["id"] == 1
59
+
60
+ # 异步测试
61
+ @pytest.mark.asyncio
62
+ async def test_async_fetch():
63
+ result = await async_fetch()
64
+ assert result is not None
65
+ ```
66
+
67
+ ### 运行命令
68
+ ```bash
69
+ pytest # 运行所有
70
+ pytest test_file.py # 指定文件
71
+ pytest -k "test_add" # 匹配名称
72
+ pytest -v # 详细输出
73
+ pytest --cov=myapp # 覆盖率
74
+ pytest -x # 失败即停
75
+ ```
76
+
77
+ ## JavaScript (Jest/Vitest)
78
+
79
+ ```javascript
80
+ import { describe, it, expect, vi } from 'vitest';
81
+
82
+ // 基础测试
83
+ describe('add', () => {
84
+ it('should add two numbers', () => {
85
+ expect(add(1, 2)).toBe(3);
86
+ });
87
+
88
+ it.each([
89
+ [1, 2, 3],
90
+ [0, 0, 0],
91
+ [-1, 1, 0],
92
+ ])('add(%i, %i) = %i', (a, b, expected) => {
93
+ expect(add(a, b)).toBe(expected);
94
+ });
95
+ });
96
+
97
+ // Mock
98
+ vi.mock('./api', () => ({
99
+ getUser: vi.fn().mockResolvedValue({ id: 1, name: 'test' })
100
+ }));
101
+
102
+ it('should fetch user', async () => {
103
+ const user = await fetchUser(1);
104
+ expect(user.name).toBe('test');
105
+ });
106
+
107
+ // Spy
108
+ const spy = vi.spyOn(console, 'log');
109
+ doSomething();
110
+ expect(spy).toHaveBeenCalledWith('message');
111
+ ```
112
+
113
+ ## Go (testing)
114
+
115
+ ```go
116
+ package main
117
+
118
+ import (
119
+ "testing"
120
+ "github.com/stretchr/testify/assert"
121
+ )
122
+
123
+ func TestAdd(t *testing.T) {
124
+ result := Add(1, 2)
125
+ assert.Equal(t, 3, result)
126
+ }
127
+
128
+ // 表驱动测试
129
+ func TestAddTable(t *testing.T) {
130
+ tests := []struct {
131
+ name string
132
+ a, b int
133
+ expected int
134
+ }{
135
+ {"positive", 1, 2, 3},
136
+ {"zero", 0, 0, 0},
137
+ {"negative", -1, 1, 0},
138
+ }
139
+
140
+ for _, tt := range tests {
141
+ t.Run(tt.name, func(t *testing.T) {
142
+ assert.Equal(t, tt.expected, Add(tt.a, tt.b))
143
+ })
144
+ }
145
+ }
146
+
147
+ // Benchmark
148
+ func BenchmarkAdd(b *testing.B) {
149
+ for i := 0; i < b.N; i++ {
150
+ Add(1, 2)
151
+ }
152
+ }
153
+ ```
154
+
155
+ ## 测试原则
156
+
157
+ ```yaml
158
+ FIRST:
159
+ - Fast: 快速执行
160
+ - Independent: 相互独立
161
+ - Repeatable: 可重复
162
+ - Self-validating: 自验证
163
+ - Timely: 及时编写
164
+
165
+ AAA:
166
+ - Arrange: 准备数据
167
+ - Act: 执行操作
168
+ - Assert: 验证结果
169
+
170
+ 原则:
171
+ - 每个测试只验证一件事
172
+ - 测试边界条件
173
+ - 测试异常情况
174
+ - 避免测试实现细节
175
+ ```
176
+
177
+ ## TDD 流程
178
+
179
+ ```
180
+ 红 → 绿 → 重构
181
+
182
+ 1. 红: 写一个失败的测试
183
+ 2. 绿: 写最少代码让测试通过
184
+ 3. 重构: 优化代码,保持测试通过
185
+ ```
186
+
187
+ ---
188
+
189
+ ## 测试策略(源自 testing-strategy)
190
+
191
+ ### 测试金字塔比例
192
+
193
+ | 层级 | 占比 | 执行时间 | 成本 |
194
+ |------|------|----------|------|
195
+ | 单元测试 | 70% | <1s | 低 |
196
+ | 集成测试 | 20% | 1-10s | 中 |
197
+ | E2E测试 | 10% | 10s-5m | 高 |
198
+
199
+ ### 测试左移 Checklist
200
+
201
+ ```yaml
202
+ 需求阶段: 可测试性评审、验收标准定义、测试用例设计
203
+ 开发阶段: TDD、单元测试同步编写、代码审查包含测试
204
+ 提交阶段: Pre-commit Hook、本地测试必过、静态分析
205
+ CI阶段: 自动化测试、覆盖率门禁、性能基准测试
206
+ ```
207
+
208
+ ### 契约测试要点
209
+
210
+ - 消费者驱动契约 (CDC):Consumer 定义期望 → Provider 验证契约
211
+ - 工具:Pact(多语言)、Spring Cloud Contract(Java)
212
+ - 核心:Provider API <-> Contract <-> Consumer,双方独立验证
213
+
214
+ ### 覆盖率策略
215
+
216
+ ```yaml
217
+ 类型: 行覆盖率、分支覆盖率、函数覆盖率、语句覆盖率
218
+ 门禁: 全局 ≥80%,核心模块 ≥90%
219
+ 排除: tests/、migrations/、__init__.py、config 文件
220
+ ```
221
+
222
+ ### 变异测试
223
+
224
+ - 修改源码(变异体)验证测试是否能捕获
225
+ - 工具:Stryker (JS)、Pitest (Java)
226
+ - 阈值:high 80% / low 60% / break 50%
227
+
228
+ ### 测试最佳实践
229
+
230
+ - AAA 模式:Arrange → Act → Assert
231
+ - 命名:`should [预期行为] when [条件]`
232
+ - 单一职责:每个测试只验证一件事
233
+ - 数据隔离:Fixture/Factory 模式,每测试独立实例
234
+ - 并行执行:Jest `maxWorkers: '50%'`、pytest `-n auto`
235
+
236
+ ---
237
+
238
+ ## E2E 测试(源自 e2e-testing)
239
+
240
+ ### Playwright vs Cypress
241
+
242
+ | 特性 | Playwright | Cypress |
243
+ |------|-----------|---------|
244
+ | 多浏览器 | Chromium/Firefox/WebKit | Chromium/Firefox/Edge |
245
+ | 多标签页/iframe | 原生支持 | 有限 |
246
+ | 并行执行 | 原生支持 | 需付费 |
247
+ | 调试体验 | 一般 | 优秀 |
248
+
249
+ ### 选择器优先级
250
+
251
+ ```
252
+ 1. data-testid (推荐)
253
+ 2. role + accessible name
254
+ 3. 稳定的 class/id
255
+ 4. 文本内容 (谨慎)
256
+ 5. CSS/XPath (避免)
257
+ ```
258
+
259
+ ### E2E Checklist
260
+
261
+ ```yaml
262
+ 架构:
263
+ - 页面对象模式 (POM) 封装页面操作
264
+ - 测试独立性:通过 API 准备数据,不依赖其他测试
265
+ - 智能等待:waitForSelector/waitForResponse,禁止 waitForTimeout
266
+
267
+ 网络:
268
+ - Mock API:page.route() / cy.intercept() 隔离后端
269
+ - 等待响应:waitForResponse 确认数据加载
270
+
271
+ 可视化回归:
272
+ - Playwright: toHaveScreenshot() + mask 动态内容
273
+ - Percy/Chromatic: 云端截图对比
274
+
275
+ 认证:
276
+ - Playwright: storageState 复用登录态
277
+ - Cypress: cy.session() 缓存会话
278
+
279
+ CI集成:
280
+ - retries: CI 环境 2 次重试
281
+ - artifacts: 失败时保存截图/视频/trace
282
+ ```
283
+
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: frontend-design
3
+ description: "前端设计秘典(Impeccable 融合版:排版/OKLCH 配色/空间/动效/交互/响应式/UX 文案 + 4 种 style 变体)。"
4
+ license: "Apache 2.0 (Impeccable) + MIT (custom extensions)"
5
+ user-invocable: false
6
+ disable-model-invocation: false
7
+ context: fork
8
+ paths: "*.tsx,*.jsx,*.vue,*.svelte,*.css,*.scss"
9
+ ---
10
+
11
+ # Frontend Design (Impeccable Fusion Edition)
12
+
13
+ This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. It fuses [Impeccable](https://github.com/pbakaus/impeccable) design philosophy with extended knowledge on state management, engineering, and design style systems.
14
+
15
+ ---
16
+
17
+ ## Context Gathering Protocol
18
+
19
+ Design skills produce generic output without project context. You MUST have confirmed design context before doing any design work.
20
+
21
+ **Required context** — every design skill needs at minimum:
22
+ - **Target audience**: Who uses this product and in what context?
23
+ - **Use cases**: What jobs are they trying to get done?
24
+ - **Brand personality/tone**: How should the interface feel?
25
+
26
+ **Gathering order:**
27
+ 1. **Check current instructions (instant)**: If your loaded instructions already contain a **Design Context** section, proceed immediately.
28
+ 2. **Check .impeccable.md (fast)**: If not in instructions, read `.impeccable.md` from the project root. If it exists and contains the required context, proceed.
29
+ 3. **Run /teach-impeccable (REQUIRED)**: If neither source has context, you MUST run `/teach-impeccable` NOW before doing anything else. Do NOT skip this step. Do NOT attempt to infer context from the codebase instead.
30
+
31
+ ---
32
+
33
+ ## Design Direction
34
+
35
+ Commit to a BOLD aesthetic direction:
36
+ - **Purpose**: What problem does this interface solve? Who uses it?
37
+ - **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc.
38
+ - **Constraints**: Technical requirements (framework, performance, accessibility).
39
+ - **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
40
+
41
+ **CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
42
+
43
+ ---
44
+
45
+ ## Frontend Aesthetics Guidelines
46
+
47
+ ### Typography
48
+ > *Consult [typography reference](reference/typography.md) for scales, pairing, and loading strategies.*
49
+
50
+ Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font.
51
+
52
+ **DO**: Use a modular type scale with fluid sizing (clamp) for display text; fixed rem scales for app UIs
53
+ **DO**: Vary font weights and sizes to create clear visual hierarchy
54
+ **DON'T**: Use overused fonts — Inter, Roboto, Arial, Open Sans, system defaults
55
+ **DON'T**: Use monospace typography as lazy shorthand for "technical/developer" vibes
56
+ **DON'T**: Put large icons with rounded corners above every heading — they rarely add value
57
+
58
+ ### Color & Theme
59
+ > *Consult [color reference](reference/color-and-contrast.md) for OKLCH, palettes, and dark mode.*
60
+
61
+ Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
62
+
63
+ **DO**: Use OKLCH (not HSL) for perceptually uniform, maintainable palettes
64
+ **DO**: Tint your neutrals toward your brand hue — even a subtle hint creates subconscious cohesion
65
+ **DON'T**: Use gray text on colored backgrounds — use a shade of the background color instead
66
+ **DON'T**: Use pure black (#000) or pure white (#fff) — always tint
67
+ **DON'T**: Use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds
68
+ **DON'T**: Use gradient text for "impact" — it's decorative rather than meaningful
69
+ **DON'T**: Default to dark mode with glowing accents
70
+
71
+ ### Layout & Space
72
+ > *Consult [spatial reference](reference/spatial-design.md) for grids, rhythm, and container queries.*
73
+
74
+ **DO**: Create visual rhythm through varied spacing — tight groupings, generous separations
75
+ **DO**: Use fluid spacing with clamp() that breathes on larger screens
76
+ **DO**: Use asymmetry and unexpected compositions; break the grid intentionally
77
+ **DON'T**: Wrap everything in cards — not everything needs a container
78
+ **DON'T**: Nest cards inside cards — flatten the hierarchy
79
+ **DON'T**: Use identical card grids — same-sized cards with icon + heading + text, repeated endlessly
80
+ **DON'T**: Center everything — left-aligned text with asymmetric layouts feels more designed
81
+ **DON'T**: Use the same spacing everywhere — without rhythm, layouts feel monotonous
82
+
83
+ ### Visual Details
84
+ **DO**: Use intentional, purposeful decorative elements that reinforce brand
85
+ **DON'T**: Use glassmorphism everywhere — blur effects used decoratively rather than purposefully
86
+ **DON'T**: Use rounded elements with thick colored border on one side — a lazy accent
87
+ **DON'T**: Use sparklines as decoration — tiny charts that convey nothing meaningful
88
+ **DON'T**: Use rounded rectangles with generic drop shadows — safe, forgettable
89
+ **DON'T**: Use modals unless there's truly no better alternative
90
+
91
+ ### Motion
92
+ > *Consult [motion reference](reference/motion-design.md) for timing, easing, and reduced motion.*
93
+
94
+ **DO**: Use motion to convey state changes — entrances, exits, feedback
95
+ **DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration
96
+ **DO**: For height animations, use grid-template-rows transitions
97
+ **DON'T**: Animate layout properties (width, height, padding, margin) — use transform and opacity only
98
+ **DON'T**: Use bounce or elastic easing — they feel dated and tacky
99
+
100
+ ### Interaction
101
+ > *Consult [interaction reference](reference/interaction-design.md) for forms, focus, and loading patterns.*
102
+
103
+ **DO**: Use progressive disclosure — start simple, reveal sophistication through interaction
104
+ **DO**: Design empty states that teach the interface, not just say "nothing here"
105
+ **DO**: Make every interactive surface feel intentional and responsive
106
+ **DON'T**: Repeat the same information — redundant headers, intros that restate the heading
107
+ **DON'T**: Make every button primary — hierarchy matters
108
+
109
+ ### Responsive
110
+ > *Consult [responsive reference](reference/responsive-design.md) for mobile-first, fluid design, and container queries.*
111
+
112
+ **DO**: Use container queries (@container) for component-level responsiveness
113
+ **DO**: Adapt the interface for different contexts — don't just shrink it
114
+ **DON'T**: Hide critical functionality on mobile — adapt, don't amputate
115
+
116
+ ### UX Writing
117
+ > *Consult [ux-writing reference](reference/ux-writing.md) for labels, errors, and empty states.*
118
+
119
+ **DO**: Make every word earn its place
120
+ **DON'T**: Repeat information users can already see
121
+
122
+ ---
123
+
124
+ ## The AI Slop Test
125
+
126
+ **Critical quality check**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
127
+
128
+ A distinctive interface should make someone ask "how was this made?" not "which AI made this?"
129
+
130
+ Review the DON'T guidelines above — they are the fingerprints of AI-generated work from 2024-2025.
131
+
132
+ ---
133
+
134
+ ## Reference Library (Impeccable)
135
+
136
+ Deep-dive reference documents for each design dimension:
137
+
138
+ | Reference | Covers |
139
+ |-----------|--------|
140
+ | [typography](reference/typography.md) | Type systems, font pairing, modular scales, OpenType, web font loading |
141
+ | [color-and-contrast](reference/color-and-contrast.md) | OKLCH, tinted neutrals, dark mode, accessibility, 60-30-10 |
142
+ | [spatial-design](reference/spatial-design.md) | 4pt spacing, grids, visual hierarchy, container queries, optical adjustments |
143
+ | [motion-design](reference/motion-design.md) | 100/300/500 rule, easing curves, stagger, reduced motion, perceived performance |
144
+ | [interaction-design](reference/interaction-design.md) | 8 states, focus rings, Popover API, CSS Anchor, modals, keyboard nav |
145
+ | [responsive-design](reference/responsive-design.md) | Content-driven breakpoints, pointer/hover queries, safe areas, srcset |
146
+ | [ux-writing](reference/ux-writing.md) | Button labels, error formulas, empty states, voice vs tone, i18n |
147
+
148
+ ## Extended Knowledge (Original)
149
+
150
+ | Topic | Document | Covers |
151
+ |-------|----------|--------|
152
+ | UI Aesthetics | [ui-aesthetics.md](ui-aesthetics.md) | HSL color tokens, 8px grid CSS snippets, shadow scales, dark mode CSS |
153
+ | Component Patterns | [component-patterns.md](component-patterns.md) | CSS Grid/Flexbox layouts, responsive nav, glass card, Framer Motion |
154
+ | UX Principles | [ux-principles.md](ux-principles.md) | Nielsen 10 heuristics, WCAG, ARIA, keyboard, loading patterns |
155
+ | State Management | [state-management.md](state-management.md) | Redux/Zustand/Jotai/Recoil/Context — decision tree + code templates |
156
+ | Frontend Engineering | [engineering.md](engineering.md) | Web Vitals, code splitting, virtual scroll, Vitest/Playwright, Vite/Webpack |
157
+
158
+ ## Design Style Systems
159
+
160
+ Specific style variant specs with CSS tokens and component patterns:
161
+
162
+ | Style | Document | Aesthetic |
163
+ |-------|----------|-----------|
164
+ | Claymorphism | [claymorphism/SKILL.md](claymorphism/SKILL.md) | Soft clay, large radii, dual inner shadows, offset outer shadows |
165
+ | Glassmorphism | [glassmorphism/SKILL.md](glassmorphism/SKILL.md) | Frosted glass, backdrop-filter, translucency, blur layers |
166
+ | Neubrutalism | [neubrutalism/SKILL.md](neubrutalism/SKILL.md) | Thick borders, offset solid shadows, high saturation, minimal radius |
167
+ | Liquid Glass | [liquid-glass/SKILL.md](liquid-glass/SKILL.md) | Apple-style translucent depth, spring animations, ambient response |
168
+
169
+ ---
170
+
171
+ ## Command System (20 Impeccable Commands)
172
+
173
+ All commands are in `~/.claude/skills/ccg/impeccable/`. Each invokes this skill's guidelines first.
174
+
175
+ ### Quality & Audit
176
+ | Command | What it does |
177
+ |---------|------------|
178
+ | `/audit` | Technical quality checks (a11y, performance, responsive, theming, anti-patterns) — scored 0-20 |
179
+ | `/critique` | UX design review with Nielsen heuristics scoring (0-40), persona testing, cognitive load |
180
+ | `/teach-impeccable` | One-time setup: gather design context, save to .impeccable.md |
181
+
182
+ ### Fix & Align
183
+ | Command | What it does |
184
+ |---------|------------|
185
+ | `/normalize` | Align with design system standards |
186
+ | `/polish` | Final pass before shipping — 20-item checklist |
187
+ | `/distill` | Strip to essence, remove unnecessary complexity |
188
+ | `/clarify` | Improve unclear UX copy, error messages, labels |
189
+ | `/optimize` | Performance improvements (CWV, bundle, rendering) |
190
+ | `/harden` | Error handling, i18n, text overflow, edge cases |
191
+
192
+ ### Style & Expression
193
+ | Command | What it does |
194
+ |---------|------------|
195
+ | `/animate` | Add purposeful motion and micro-interactions |
196
+ | `/colorize` | Introduce strategic color to monochromatic designs |
197
+ | `/bolder` | Amplify boring designs with distinctive impact |
198
+ | `/quieter` | Tone down overly bold designs to refined sophistication |
199
+ | `/delight` | Add moments of joy, personality, and surprise |
200
+
201
+ ### Structure & Components
202
+ | Command | What it does |
203
+ |---------|------------|
204
+ | `/extract` | Pull into reusable components and design tokens |
205
+ | `/adapt` | Adapt for different devices and contexts |
206
+ | `/onboard` | Design onboarding flows and empty states |
207
+ | `/typeset` | Fix font choices, hierarchy, sizing, readability |
208
+ | `/arrange` | Fix layout, spacing, visual rhythm |
209
+ | `/overdrive` | Technically extraordinary effects (shaders, springs, scroll-driven) |
210
+
211
+ ### Combining Commands
212
+ ```
213
+ /audit /normalize /polish blog # Full workflow: audit -> fix -> polish
214
+ /critique /harden checkout # UX review + add error handling
215
+ /audit # Find issues first
216
+ /normalize # Then fix inconsistencies
217
+ /polish # Final cleanup
218
+ ```
219
+
220
+ ---
221
+
222
+ ## Implementation Principles
223
+
224
+ Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details.
225
+
226
+ Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices across generations.
227
+
228
+ ---
229
+
230
+ ## Use Cases
231
+
232
+ - Design system establishment
233
+ - Component library development
234
+ - UI/UX audit and review (`/audit`, `/critique`)
235
+ - Accessibility improvement
236
+ - Responsive layout design (`/adapt`)
237
+ - Interaction and animation design (`/animate`, `/delight`)
238
+ - Style variant selection (Claymorphism / Glassmorphism / Neubrutalism / Liquid Glass)
239
+ - Performance optimization (`/optimize`)
240
+ - Pre-launch polish (`/polish`)
241
+ - Copy improvement (`/clarify`)
242
+ - Production hardening (`/harden`)
243
+ - Typography refinement (`/typeset`)
244
+ - Layout improvement (`/arrange`)
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Frontend Design"
3
+ short_description: "前端设计美学秘典"
4
+ default_prompt: "Read the skill at ~/.claude/skills/ccg/domains/frontend-design/SKILL.md and use it as the authoritative playbook."
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: claymorphism
3
+ description: Claymorphism 黏土态设计(柔软膨胀、大圆角、双向内阴影、偏移外阴影)。
4
+ license: MIT
5
+ user-invocable: false
6
+ disable-model-invocation: false
7
+ context: fork
8
+ paths: "*.tsx,*.jsx,*.vue,*.svelte,*.css,*.scss"
9
+ ---
10
+
11
+ # Claymorphism Design Spec
12
+
13
+ ## 3 Core Elements
14
+
15
+ 1. **Large Radius** — Generous `border-radius` (20–50px) for a puffy, inflated look
16
+ 2. **Dual Inner Shadows** — Light inset from top-left + dark inset from bottom-right to simulate 3D clay surface
17
+ 3. **Offset Outer Shadow** — Directional `box-shadow` offset (not centered) to ground the element
18
+
19
+ ## CSS Tokens
20
+
21
+ Reference: [references/tokens.css](references/tokens.css)
22
+
23
+ ```css
24
+ @import 'references/tokens.css';
25
+
26
+ .clay-card {
27
+ background: var(--clay-bg-card);
28
+ border-radius: var(--clay-radius-lg);
29
+ box-shadow: var(--clay-shadow);
30
+ color: var(--clay-text);
31
+ }
32
+ ```
33
+
34
+ ## Component Examples
35
+
36
+ ### Card
37
+ ```css
38
+ .clay-card {
39
+ background: var(--clay-bg-card);
40
+ border-radius: var(--clay-radius-lg);
41
+ box-shadow: var(--clay-shadow);
42
+ padding: 1.5rem;
43
+ color: var(--clay-text);
44
+ }
45
+ ```
46
+
47
+ ### Button
48
+ ```css
49
+ .clay-btn {
50
+ background: var(--clay-bg-button);
51
+ border: none;
52
+ border-radius: var(--clay-radius-pill);
53
+ box-shadow: var(--clay-shadow);
54
+ padding: 0.75rem 1.5rem;
55
+ color: var(--clay-text);
56
+ cursor: pointer;
57
+ transition: box-shadow 0.2s;
58
+ }
59
+ .clay-btn:hover {
60
+ box-shadow: var(--clay-shadow-elevated);
61
+ }
62
+ .clay-btn:active {
63
+ box-shadow: var(--clay-shadow-pressed);
64
+ }
65
+ ```
66
+
67
+ ### Input
68
+ ```css
69
+ .clay-input {
70
+ background: var(--clay-bg);
71
+ border: none;
72
+ border-radius: var(--clay-radius);
73
+ box-shadow: var(--clay-shadow-pressed);
74
+ padding: 0.75rem 1rem;
75
+ color: var(--clay-text);
76
+ }
77
+ .clay-input:focus {
78
+ outline: 2px solid var(--clay-accent);
79
+ outline-offset: 2px;
80
+ }
81
+ ```
82
+
83
+ ### Toggle
84
+ ```css
85
+ .clay-toggle {
86
+ width: 56px;
87
+ height: 30px;
88
+ background: var(--clay-bg-card);
89
+ border-radius: var(--clay-radius-pill);
90
+ box-shadow: var(--clay-shadow-pressed);
91
+ }
92
+ .clay-toggle-knob {
93
+ width: 24px;
94
+ height: 24px;
95
+ background: var(--clay-bg);
96
+ border-radius: 50%;
97
+ box-shadow: var(--clay-shadow);
98
+ transition: transform 0.2s;
99
+ }
100
+ ```
101
+
102
+ ## Dark Mode Notes
103
+
104
+ - Dark mode reduces inner highlight intensity (`rgba(255,255,255,0.05)` vs `0.6`) to avoid glowing artifacts
105
+ - Outer shadow opacity increases to maintain depth on dark backgrounds
106
+ - Background colors shift to warm dark tones — avoid pure black to preserve the clay feel
107
+ - All dark tokens are defined in `[data-theme="dark"]` in `tokens.css`
108
+
109
+ ## Accessibility Notes
110
+
111
+ - Ensure **contrast ratio ≥ 4.5:1** for text — clay backgrounds are muted, verify against `--clay-text`
112
+ - Provide visible `:focus` outlines since clay shadows alone don't indicate focus
113
+ - Use `prefers-contrast: more` to flatten shadows and increase text contrast
114
+
115
+ ```css
116
+ @media (prefers-contrast: more) {
117
+ .clay-card {
118
+ box-shadow: 0 0 0 2px var(--clay-text);
119
+ }
120
+ }
121
+ ```
@@ -0,0 +1,52 @@
1
+ :root {
2
+ /* Backgrounds — soft, muted pastels */
3
+ --clay-bg: #f0e6db;
4
+ --clay-bg-card: #e8ddd4;
5
+ --clay-bg-button: #d4c4b0;
6
+ --clay-accent: #c4a882;
7
+
8
+ /* Radius — large, rounded, puffy */
9
+ --clay-radius: 20px;
10
+ --clay-radius-lg: 32px;
11
+ --clay-radius-pill: 50px;
12
+
13
+ /* Shadows — dual inner + offset outer */
14
+ --clay-shadow:
15
+ 8px 8px 16px rgba(0, 0, 0, 0.12),
16
+ inset -4px -4px 8px rgba(0, 0, 0, 0.08),
17
+ inset 4px 4px 8px rgba(255, 255, 255, 0.6);
18
+ --clay-shadow-elevated:
19
+ 12px 12px 24px rgba(0, 0, 0, 0.15),
20
+ inset -6px -6px 12px rgba(0, 0, 0, 0.1),
21
+ inset 6px 6px 12px rgba(255, 255, 255, 0.7);
22
+ --clay-shadow-pressed:
23
+ 2px 2px 6px rgba(0, 0, 0, 0.1),
24
+ inset -6px -6px 12px rgba(0, 0, 0, 0.12),
25
+ inset 6px 6px 12px rgba(255, 255, 255, 0.5);
26
+
27
+ /* Text */
28
+ --clay-text: #4a3f35;
29
+ --clay-text-muted: #8a7e72;
30
+ }
31
+
32
+ /* Dark mode */
33
+ [data-theme="dark"] {
34
+ --clay-bg: #2a2520;
35
+ --clay-bg-card: #352f28;
36
+ --clay-bg-button: #443c33;
37
+ --clay-accent: #6b5d4f;
38
+ --clay-shadow:
39
+ 8px 8px 16px rgba(0, 0, 0, 0.35),
40
+ inset -4px -4px 8px rgba(0, 0, 0, 0.25),
41
+ inset 4px 4px 8px rgba(255, 255, 255, 0.05);
42
+ --clay-shadow-elevated:
43
+ 12px 12px 24px rgba(0, 0, 0, 0.4),
44
+ inset -6px -6px 12px rgba(0, 0, 0, 0.3),
45
+ inset 6px 6px 12px rgba(255, 255, 255, 0.06);
46
+ --clay-shadow-pressed:
47
+ 2px 2px 6px rgba(0, 0, 0, 0.3),
48
+ inset -6px -6px 12px rgba(0, 0, 0, 0.35),
49
+ inset 6px 6px 12px rgba(255, 255, 255, 0.04);
50
+ --clay-text: #d4c8bc;
51
+ --clay-text-muted: #8a7e72;
52
+ }