ccg-workflow 1.8.2 → 1.8.4

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 (111) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/dist/index.d.mts +1 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/shared/{ccg-workflow.B1RHp04H.mjs → ccg-workflow.BngAQymM.mjs} +204 -6
  6. package/package.json +1 -1
  7. package/templates/commands/agents/team-architect.md +97 -0
  8. package/templates/commands/agents/team-qa.md +121 -0
  9. package/templates/commands/agents/team-reviewer.md +112 -0
  10. package/templates/output-styles/abyss-command.md +56 -0
  11. package/templates/output-styles/abyss-concise.md +89 -0
  12. package/templates/output-styles/abyss-ritual.md +70 -0
  13. package/templates/rules/ccg-skill-routing.md +83 -0
  14. package/templates/skills/domains/ai/SKILL.md +34 -0
  15. package/templates/skills/domains/ai/agent-dev.md +242 -0
  16. package/templates/skills/domains/ai/llm-security.md +288 -0
  17. package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
  18. package/templates/skills/domains/ai/rag-system.md +542 -0
  19. package/templates/skills/domains/architecture/SKILL.md +42 -0
  20. package/templates/skills/domains/architecture/api-design.md +225 -0
  21. package/templates/skills/domains/architecture/caching.md +299 -0
  22. package/templates/skills/domains/architecture/cloud-native.md +285 -0
  23. package/templates/skills/domains/architecture/message-queue.md +329 -0
  24. package/templates/skills/domains/architecture/security-arch.md +297 -0
  25. package/templates/skills/domains/data-engineering/SKILL.md +207 -0
  26. package/templates/skills/domains/development/SKILL.md +46 -0
  27. package/templates/skills/domains/development/cpp.md +246 -0
  28. package/templates/skills/domains/development/go.md +323 -0
  29. package/templates/skills/domains/development/java.md +277 -0
  30. package/templates/skills/domains/development/python.md +288 -0
  31. package/templates/skills/domains/development/rust.md +313 -0
  32. package/templates/skills/domains/development/shell.md +313 -0
  33. package/templates/skills/domains/development/typescript.md +277 -0
  34. package/templates/skills/domains/devops/SKILL.md +39 -0
  35. package/templates/skills/domains/devops/cost-optimization.md +272 -0
  36. package/templates/skills/domains/devops/database.md +217 -0
  37. package/templates/skills/domains/devops/devsecops.md +198 -0
  38. package/templates/skills/domains/devops/git-workflow.md +181 -0
  39. package/templates/skills/domains/devops/observability.md +280 -0
  40. package/templates/skills/domains/devops/performance.md +336 -0
  41. package/templates/skills/domains/devops/testing.md +283 -0
  42. package/templates/skills/domains/frontend-design/SKILL.md +242 -0
  43. package/templates/skills/domains/frontend-design/agents/openai.yaml +4 -0
  44. package/templates/skills/domains/frontend-design/claymorphism/SKILL.md +119 -0
  45. package/templates/skills/domains/frontend-design/claymorphism/references/tokens.css +52 -0
  46. package/templates/skills/domains/frontend-design/component-patterns.md +202 -0
  47. package/templates/skills/domains/frontend-design/engineering.md +287 -0
  48. package/templates/skills/domains/frontend-design/glassmorphism/SKILL.md +140 -0
  49. package/templates/skills/domains/frontend-design/glassmorphism/references/tokens.css +32 -0
  50. package/templates/skills/domains/frontend-design/liquid-glass/SKILL.md +137 -0
  51. package/templates/skills/domains/frontend-design/liquid-glass/references/tokens.css +81 -0
  52. package/templates/skills/domains/frontend-design/neubrutalism/SKILL.md +143 -0
  53. package/templates/skills/domains/frontend-design/neubrutalism/references/tokens.css +44 -0
  54. package/templates/skills/domains/frontend-design/reference/color-and-contrast.md +132 -0
  55. package/templates/skills/domains/frontend-design/reference/interaction-design.md +195 -0
  56. package/templates/skills/domains/frontend-design/reference/motion-design.md +99 -0
  57. package/templates/skills/domains/frontend-design/reference/responsive-design.md +114 -0
  58. package/templates/skills/domains/frontend-design/reference/spatial-design.md +100 -0
  59. package/templates/skills/domains/frontend-design/reference/typography.md +133 -0
  60. package/templates/skills/domains/frontend-design/reference/ux-writing.md +107 -0
  61. package/templates/skills/domains/frontend-design/state-management.md +680 -0
  62. package/templates/skills/domains/frontend-design/ui-aesthetics.md +110 -0
  63. package/templates/skills/domains/frontend-design/ux-principles.md +156 -0
  64. package/templates/skills/domains/infrastructure/SKILL.md +200 -0
  65. package/templates/skills/domains/mobile/SKILL.md +224 -0
  66. package/templates/skills/domains/orchestration/SKILL.md +29 -0
  67. package/templates/skills/domains/orchestration/multi-agent.md +263 -0
  68. package/templates/skills/domains/security/SKILL.md +72 -0
  69. package/templates/skills/domains/security/blue-team.md +436 -0
  70. package/templates/skills/domains/security/code-audit.md +265 -0
  71. package/templates/skills/domains/security/pentest.md +226 -0
  72. package/templates/skills/domains/security/red-team.md +374 -0
  73. package/templates/skills/domains/security/threat-intel.md +372 -0
  74. package/templates/skills/domains/security/vuln-research.md +369 -0
  75. package/templates/skills/impeccable/adapt/SKILL.md +199 -0
  76. package/templates/skills/impeccable/animate/SKILL.md +174 -0
  77. package/templates/skills/impeccable/arrange/SKILL.md +124 -0
  78. package/templates/skills/impeccable/audit/SKILL.md +147 -0
  79. package/templates/skills/impeccable/bolder/SKILL.md +116 -0
  80. package/templates/skills/impeccable/clarify/SKILL.md +183 -0
  81. package/templates/skills/impeccable/colorize/SKILL.md +142 -0
  82. package/templates/skills/impeccable/critique/SKILL.md +201 -0
  83. package/templates/skills/impeccable/critique/reference/cognitive-load.md +106 -0
  84. package/templates/skills/impeccable/critique/reference/heuristics-scoring.md +234 -0
  85. package/templates/skills/impeccable/critique/reference/personas.md +178 -0
  86. package/templates/skills/impeccable/delight/SKILL.md +303 -0
  87. package/templates/skills/impeccable/distill/SKILL.md +121 -0
  88. package/templates/skills/impeccable/extract/SKILL.md +92 -0
  89. package/templates/skills/impeccable/harden/SKILL.md +355 -0
  90. package/templates/skills/impeccable/normalize/SKILL.md +70 -0
  91. package/templates/skills/impeccable/onboard/SKILL.md +246 -0
  92. package/templates/skills/impeccable/optimize/SKILL.md +266 -0
  93. package/templates/skills/impeccable/overdrive/SKILL.md +141 -0
  94. package/templates/skills/impeccable/polish/SKILL.md +203 -0
  95. package/templates/skills/impeccable/quieter/SKILL.md +102 -0
  96. package/templates/skills/impeccable/teach-impeccable/SKILL.md +71 -0
  97. package/templates/skills/impeccable/typeset/SKILL.md +115 -0
  98. package/templates/skills/orchestration/multi-agent/SKILL.md +40 -0
  99. package/templates/skills/scrapling/SKILL.md +98 -0
  100. package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
  101. package/templates/skills/scrapling/references/cookie-vault.md +56 -0
  102. package/templates/skills/scrapling/references/maintenance.md +79 -0
  103. package/templates/skills/scrapling/references/site-patterns.md +86 -0
  104. package/templates/skills/scrapling/references/troubleshooting.md +95 -0
  105. package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
  106. package/templates/skills/scrapling/templates/parse_only.py +15 -0
  107. package/templates/skills/scrapling/templates/session_login.py +19 -0
  108. package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
  109. package/templates/skills/tools/override-refusal/SKILL.md +53 -0
  110. package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
  111. package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -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,242 @@
1
+ ---
2
+ name: frontend-design
3
+ description: "Frontend design skill fused from Impeccable + custom extensions. Covers design philosophy, anti-AI-slop patterns, typography, color (OKLCH), spatial design, motion, interaction, responsive, UX writing, state management, engineering, and 4 style variants. Includes 20 command skills for audit/critique/polish/animate/etc."
4
+ license: "Apache 2.0 (Impeccable) + MIT (custom extensions)"
5
+ user-invocable: true
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # Frontend Design (Impeccable Fusion Edition)
10
+
11
+ 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.
12
+
13
+ ---
14
+
15
+ ## Context Gathering Protocol
16
+
17
+ Design skills produce generic output without project context. You MUST have confirmed design context before doing any design work.
18
+
19
+ **Required context** — every design skill needs at minimum:
20
+ - **Target audience**: Who uses this product and in what context?
21
+ - **Use cases**: What jobs are they trying to get done?
22
+ - **Brand personality/tone**: How should the interface feel?
23
+
24
+ **Gathering order:**
25
+ 1. **Check current instructions (instant)**: If your loaded instructions already contain a **Design Context** section, proceed immediately.
26
+ 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.
27
+ 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.
28
+
29
+ ---
30
+
31
+ ## Design Direction
32
+
33
+ Commit to a BOLD aesthetic direction:
34
+ - **Purpose**: What problem does this interface solve? Who uses it?
35
+ - **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.
36
+ - **Constraints**: Technical requirements (framework, performance, accessibility).
37
+ - **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
38
+
39
+ **CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
40
+
41
+ ---
42
+
43
+ ## Frontend Aesthetics Guidelines
44
+
45
+ ### Typography
46
+ > *Consult [typography reference](reference/typography.md) for scales, pairing, and loading strategies.*
47
+
48
+ Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font.
49
+
50
+ **DO**: Use a modular type scale with fluid sizing (clamp) for display text; fixed rem scales for app UIs
51
+ **DO**: Vary font weights and sizes to create clear visual hierarchy
52
+ **DON'T**: Use overused fonts — Inter, Roboto, Arial, Open Sans, system defaults
53
+ **DON'T**: Use monospace typography as lazy shorthand for "technical/developer" vibes
54
+ **DON'T**: Put large icons with rounded corners above every heading — they rarely add value
55
+
56
+ ### Color & Theme
57
+ > *Consult [color reference](reference/color-and-contrast.md) for OKLCH, palettes, and dark mode.*
58
+
59
+ Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
60
+
61
+ **DO**: Use OKLCH (not HSL) for perceptually uniform, maintainable palettes
62
+ **DO**: Tint your neutrals toward your brand hue — even a subtle hint creates subconscious cohesion
63
+ **DON'T**: Use gray text on colored backgrounds — use a shade of the background color instead
64
+ **DON'T**: Use pure black (#000) or pure white (#fff) — always tint
65
+ **DON'T**: Use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds
66
+ **DON'T**: Use gradient text for "impact" — it's decorative rather than meaningful
67
+ **DON'T**: Default to dark mode with glowing accents
68
+
69
+ ### Layout & Space
70
+ > *Consult [spatial reference](reference/spatial-design.md) for grids, rhythm, and container queries.*
71
+
72
+ **DO**: Create visual rhythm through varied spacing — tight groupings, generous separations
73
+ **DO**: Use fluid spacing with clamp() that breathes on larger screens
74
+ **DO**: Use asymmetry and unexpected compositions; break the grid intentionally
75
+ **DON'T**: Wrap everything in cards — not everything needs a container
76
+ **DON'T**: Nest cards inside cards — flatten the hierarchy
77
+ **DON'T**: Use identical card grids — same-sized cards with icon + heading + text, repeated endlessly
78
+ **DON'T**: Center everything — left-aligned text with asymmetric layouts feels more designed
79
+ **DON'T**: Use the same spacing everywhere — without rhythm, layouts feel monotonous
80
+
81
+ ### Visual Details
82
+ **DO**: Use intentional, purposeful decorative elements that reinforce brand
83
+ **DON'T**: Use glassmorphism everywhere — blur effects used decoratively rather than purposefully
84
+ **DON'T**: Use rounded elements with thick colored border on one side — a lazy accent
85
+ **DON'T**: Use sparklines as decoration — tiny charts that convey nothing meaningful
86
+ **DON'T**: Use rounded rectangles with generic drop shadows — safe, forgettable
87
+ **DON'T**: Use modals unless there's truly no better alternative
88
+
89
+ ### Motion
90
+ > *Consult [motion reference](reference/motion-design.md) for timing, easing, and reduced motion.*
91
+
92
+ **DO**: Use motion to convey state changes — entrances, exits, feedback
93
+ **DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration
94
+ **DO**: For height animations, use grid-template-rows transitions
95
+ **DON'T**: Animate layout properties (width, height, padding, margin) — use transform and opacity only
96
+ **DON'T**: Use bounce or elastic easing — they feel dated and tacky
97
+
98
+ ### Interaction
99
+ > *Consult [interaction reference](reference/interaction-design.md) for forms, focus, and loading patterns.*
100
+
101
+ **DO**: Use progressive disclosure — start simple, reveal sophistication through interaction
102
+ **DO**: Design empty states that teach the interface, not just say "nothing here"
103
+ **DO**: Make every interactive surface feel intentional and responsive
104
+ **DON'T**: Repeat the same information — redundant headers, intros that restate the heading
105
+ **DON'T**: Make every button primary — hierarchy matters
106
+
107
+ ### Responsive
108
+ > *Consult [responsive reference](reference/responsive-design.md) for mobile-first, fluid design, and container queries.*
109
+
110
+ **DO**: Use container queries (@container) for component-level responsiveness
111
+ **DO**: Adapt the interface for different contexts — don't just shrink it
112
+ **DON'T**: Hide critical functionality on mobile — adapt, don't amputate
113
+
114
+ ### UX Writing
115
+ > *Consult [ux-writing reference](reference/ux-writing.md) for labels, errors, and empty states.*
116
+
117
+ **DO**: Make every word earn its place
118
+ **DON'T**: Repeat information users can already see
119
+
120
+ ---
121
+
122
+ ## The AI Slop Test
123
+
124
+ **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.
125
+
126
+ A distinctive interface should make someone ask "how was this made?" not "which AI made this?"
127
+
128
+ Review the DON'T guidelines above — they are the fingerprints of AI-generated work from 2024-2025.
129
+
130
+ ---
131
+
132
+ ## Reference Library (Impeccable)
133
+
134
+ Deep-dive reference documents for each design dimension:
135
+
136
+ | Reference | Covers |
137
+ |-----------|--------|
138
+ | [typography](reference/typography.md) | Type systems, font pairing, modular scales, OpenType, web font loading |
139
+ | [color-and-contrast](reference/color-and-contrast.md) | OKLCH, tinted neutrals, dark mode, accessibility, 60-30-10 |
140
+ | [spatial-design](reference/spatial-design.md) | 4pt spacing, grids, visual hierarchy, container queries, optical adjustments |
141
+ | [motion-design](reference/motion-design.md) | 100/300/500 rule, easing curves, stagger, reduced motion, perceived performance |
142
+ | [interaction-design](reference/interaction-design.md) | 8 states, focus rings, Popover API, CSS Anchor, modals, keyboard nav |
143
+ | [responsive-design](reference/responsive-design.md) | Content-driven breakpoints, pointer/hover queries, safe areas, srcset |
144
+ | [ux-writing](reference/ux-writing.md) | Button labels, error formulas, empty states, voice vs tone, i18n |
145
+
146
+ ## Extended Knowledge (Original)
147
+
148
+ | Topic | Document | Covers |
149
+ |-------|----------|--------|
150
+ | UI Aesthetics | [ui-aesthetics.md](ui-aesthetics.md) | HSL color tokens, 8px grid CSS snippets, shadow scales, dark mode CSS |
151
+ | Component Patterns | [component-patterns.md](component-patterns.md) | CSS Grid/Flexbox layouts, responsive nav, glass card, Framer Motion |
152
+ | UX Principles | [ux-principles.md](ux-principles.md) | Nielsen 10 heuristics, WCAG, ARIA, keyboard, loading patterns |
153
+ | State Management | [state-management.md](state-management.md) | Redux/Zustand/Jotai/Recoil/Context — decision tree + code templates |
154
+ | Frontend Engineering | [engineering.md](engineering.md) | Web Vitals, code splitting, virtual scroll, Vitest/Playwright, Vite/Webpack |
155
+
156
+ ## Design Style Systems
157
+
158
+ Specific style variant specs with CSS tokens and component patterns:
159
+
160
+ | Style | Document | Aesthetic |
161
+ |-------|----------|-----------|
162
+ | Claymorphism | [claymorphism/SKILL.md](claymorphism/SKILL.md) | Soft clay, large radii, dual inner shadows, offset outer shadows |
163
+ | Glassmorphism | [glassmorphism/SKILL.md](glassmorphism/SKILL.md) | Frosted glass, backdrop-filter, translucency, blur layers |
164
+ | Neubrutalism | [neubrutalism/SKILL.md](neubrutalism/SKILL.md) | Thick borders, offset solid shadows, high saturation, minimal radius |
165
+ | Liquid Glass | [liquid-glass/SKILL.md](liquid-glass/SKILL.md) | Apple-style translucent depth, spring animations, ambient response |
166
+
167
+ ---
168
+
169
+ ## Command System (20 Impeccable Commands)
170
+
171
+ All commands are in `~/.claude/skills/ccg/impeccable/`. Each invokes this skill's guidelines first.
172
+
173
+ ### Quality & Audit
174
+ | Command | What it does |
175
+ |---------|------------|
176
+ | `/audit` | Technical quality checks (a11y, performance, responsive, theming, anti-patterns) — scored 0-20 |
177
+ | `/critique` | UX design review with Nielsen heuristics scoring (0-40), persona testing, cognitive load |
178
+ | `/teach-impeccable` | One-time setup: gather design context, save to .impeccable.md |
179
+
180
+ ### Fix & Align
181
+ | Command | What it does |
182
+ |---------|------------|
183
+ | `/normalize` | Align with design system standards |
184
+ | `/polish` | Final pass before shipping — 20-item checklist |
185
+ | `/distill` | Strip to essence, remove unnecessary complexity |
186
+ | `/clarify` | Improve unclear UX copy, error messages, labels |
187
+ | `/optimize` | Performance improvements (CWV, bundle, rendering) |
188
+ | `/harden` | Error handling, i18n, text overflow, edge cases |
189
+
190
+ ### Style & Expression
191
+ | Command | What it does |
192
+ |---------|------------|
193
+ | `/animate` | Add purposeful motion and micro-interactions |
194
+ | `/colorize` | Introduce strategic color to monochromatic designs |
195
+ | `/bolder` | Amplify boring designs with distinctive impact |
196
+ | `/quieter` | Tone down overly bold designs to refined sophistication |
197
+ | `/delight` | Add moments of joy, personality, and surprise |
198
+
199
+ ### Structure & Components
200
+ | Command | What it does |
201
+ |---------|------------|
202
+ | `/extract` | Pull into reusable components and design tokens |
203
+ | `/adapt` | Adapt for different devices and contexts |
204
+ | `/onboard` | Design onboarding flows and empty states |
205
+ | `/typeset` | Fix font choices, hierarchy, sizing, readability |
206
+ | `/arrange` | Fix layout, spacing, visual rhythm |
207
+ | `/overdrive` | Technically extraordinary effects (shaders, springs, scroll-driven) |
208
+
209
+ ### Combining Commands
210
+ ```
211
+ /audit /normalize /polish blog # Full workflow: audit -> fix -> polish
212
+ /critique /harden checkout # UX review + add error handling
213
+ /audit # Find issues first
214
+ /normalize # Then fix inconsistencies
215
+ /polish # Final cleanup
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Implementation Principles
221
+
222
+ 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.
223
+
224
+ 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.
225
+
226
+ ---
227
+
228
+ ## Use Cases
229
+
230
+ - Design system establishment
231
+ - Component library development
232
+ - UI/UX audit and review (`/audit`, `/critique`)
233
+ - Accessibility improvement
234
+ - Responsive layout design (`/adapt`)
235
+ - Interaction and animation design (`/animate`, `/delight`)
236
+ - Style variant selection (Claymorphism / Glassmorphism / Neubrutalism / Liquid Glass)
237
+ - Performance optimization (`/optimize`)
238
+ - Pre-launch polish (`/polish`)
239
+ - Copy improvement (`/clarify`)
240
+ - Production hardening (`/harden`)
241
+ - Typography refinement (`/typeset`)
242
+ - 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,119 @@
1
+ ---
2
+ name: claymorphism
3
+ description: Claymorphism design system skill. Use when building soft, puffy, clay-like UI components with large radii, dual inner shadows, and offset outer shadows.
4
+ license: MIT
5
+ user-invocable: false
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # Claymorphism Design Spec
10
+
11
+ ## 3 Core Elements
12
+
13
+ 1. **Large Radius** — Generous `border-radius` (20–50px) for a puffy, inflated look
14
+ 2. **Dual Inner Shadows** — Light inset from top-left + dark inset from bottom-right to simulate 3D clay surface
15
+ 3. **Offset Outer Shadow** — Directional `box-shadow` offset (not centered) to ground the element
16
+
17
+ ## CSS Tokens
18
+
19
+ Reference: [references/tokens.css](references/tokens.css)
20
+
21
+ ```css
22
+ @import 'references/tokens.css';
23
+
24
+ .clay-card {
25
+ background: var(--clay-bg-card);
26
+ border-radius: var(--clay-radius-lg);
27
+ box-shadow: var(--clay-shadow);
28
+ color: var(--clay-text);
29
+ }
30
+ ```
31
+
32
+ ## Component Examples
33
+
34
+ ### Card
35
+ ```css
36
+ .clay-card {
37
+ background: var(--clay-bg-card);
38
+ border-radius: var(--clay-radius-lg);
39
+ box-shadow: var(--clay-shadow);
40
+ padding: 1.5rem;
41
+ color: var(--clay-text);
42
+ }
43
+ ```
44
+
45
+ ### Button
46
+ ```css
47
+ .clay-btn {
48
+ background: var(--clay-bg-button);
49
+ border: none;
50
+ border-radius: var(--clay-radius-pill);
51
+ box-shadow: var(--clay-shadow);
52
+ padding: 0.75rem 1.5rem;
53
+ color: var(--clay-text);
54
+ cursor: pointer;
55
+ transition: box-shadow 0.2s;
56
+ }
57
+ .clay-btn:hover {
58
+ box-shadow: var(--clay-shadow-elevated);
59
+ }
60
+ .clay-btn:active {
61
+ box-shadow: var(--clay-shadow-pressed);
62
+ }
63
+ ```
64
+
65
+ ### Input
66
+ ```css
67
+ .clay-input {
68
+ background: var(--clay-bg);
69
+ border: none;
70
+ border-radius: var(--clay-radius);
71
+ box-shadow: var(--clay-shadow-pressed);
72
+ padding: 0.75rem 1rem;
73
+ color: var(--clay-text);
74
+ }
75
+ .clay-input:focus {
76
+ outline: 2px solid var(--clay-accent);
77
+ outline-offset: 2px;
78
+ }
79
+ ```
80
+
81
+ ### Toggle
82
+ ```css
83
+ .clay-toggle {
84
+ width: 56px;
85
+ height: 30px;
86
+ background: var(--clay-bg-card);
87
+ border-radius: var(--clay-radius-pill);
88
+ box-shadow: var(--clay-shadow-pressed);
89
+ }
90
+ .clay-toggle-knob {
91
+ width: 24px;
92
+ height: 24px;
93
+ background: var(--clay-bg);
94
+ border-radius: 50%;
95
+ box-shadow: var(--clay-shadow);
96
+ transition: transform 0.2s;
97
+ }
98
+ ```
99
+
100
+ ## Dark Mode Notes
101
+
102
+ - Dark mode reduces inner highlight intensity (`rgba(255,255,255,0.05)` vs `0.6`) to avoid glowing artifacts
103
+ - Outer shadow opacity increases to maintain depth on dark backgrounds
104
+ - Background colors shift to warm dark tones — avoid pure black to preserve the clay feel
105
+ - All dark tokens are defined in `[data-theme="dark"]` in `tokens.css`
106
+
107
+ ## Accessibility Notes
108
+
109
+ - Ensure **contrast ratio ≥ 4.5:1** for text — clay backgrounds are muted, verify against `--clay-text`
110
+ - Provide visible `:focus` outlines since clay shadows alone don't indicate focus
111
+ - Use `prefers-contrast: more` to flatten shadows and increase text contrast
112
+
113
+ ```css
114
+ @media (prefers-contrast: more) {
115
+ .clay-card {
116
+ box-shadow: 0 0 0 2px var(--clay-text);
117
+ }
118
+ }
119
+ ```
@@ -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
+ }