sumulige-claude 1.2.1 → 1.3.1

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 (55) hide show
  1. package/.claude/.kickoff-hint.txt +1 -1
  2. package/.claude/AGENTS.md +6 -6
  3. package/.claude/USAGE.md +175 -0
  4. package/.claude/commands/audit.md +147 -0
  5. package/.claude/commands/fix.md +83 -0
  6. package/.claude/commands/gha.md +136 -0
  7. package/.claude/commands/handoff.md +93 -0
  8. package/.claude/commands/plan.md +88 -0
  9. package/.claude/commands/refactor.md +102 -0
  10. package/.claude/hooks/pre-push.cjs +3 -2
  11. package/.claude/rules/coding-style.md +119 -0
  12. package/.claude/rules/hooks.md +288 -0
  13. package/.claude/rules/performance.md +78 -0
  14. package/.claude/rules/security.md +56 -0
  15. package/.claude/rules/testing.md +89 -0
  16. package/.claude/settings.local.json +24 -1
  17. package/.claude/skills/design-brain/SKILL.md +190 -0
  18. package/.claude/skills/design-brain/metadata.yaml +26 -0
  19. package/.claude/skills/quality-guard/SKILL.md +138 -0
  20. package/.claude/skills/quality-guard/metadata.yaml +27 -0
  21. package/.claude/skills/quick-fix/SKILL.md +138 -0
  22. package/.claude/skills/quick-fix/metadata.yaml +26 -0
  23. package/.claude/skills/test-master/SKILL.md +186 -0
  24. package/.claude/skills/test-master/metadata.yaml +29 -0
  25. package/AGENTS.md +25 -7
  26. package/CHANGELOG.md +64 -3
  27. package/README.md +57 -0
  28. package/cli.js +4 -0
  29. package/config/official-skills.json +1 -1
  30. package/development/knowledge-base/.index.clean.json +1 -0
  31. package/lib/commands.js +51 -0
  32. package/lib/permission-audit.js +255 -0
  33. package/package.json +1 -1
  34. package/.claude/skills/123-skill/SKILL.md +0 -61
  35. package/.claude/skills/123-skill/examples/basic.md +0 -3
  36. package/.claude/skills/123-skill/metadata.yaml +0 -30
  37. package/.claude/skills/123-skill/templates/default.md +0 -3
  38. package/.claude/skills/api-tester/SKILL.md +0 -90
  39. package/.claude/skills/api-tester/examples/basic.md +0 -3
  40. package/.claude/skills/api-tester/metadata.yaml +0 -30
  41. package/.claude/skills/api-tester/templates/default.md +0 -3
  42. package/.claude/skills/code-reviewer-123/SKILL.md +0 -61
  43. package/.claude/skills/code-reviewer-123/examples/basic.md +0 -3
  44. package/.claude/skills/code-reviewer-123/metadata.yaml +0 -30
  45. package/.claude/skills/code-reviewer-123/templates/default.md +0 -3
  46. package/.claude/skills/my-skill/SKILL.md +0 -61
  47. package/.claude/skills/my-skill/examples/basic.md +0 -3
  48. package/.claude/skills/my-skill/metadata.yaml +0 -30
  49. package/.claude/skills/my-skill/templates/default.md +0 -3
  50. package/.claude/skills/template/SKILL.md +0 -6
  51. package/.claude/skills/template/metadata.yaml +0 -30
  52. package/.claude/skills/test-skill-name/SKILL.md +0 -61
  53. package/.claude/skills/test-skill-name/examples/basic.md +0 -3
  54. package/.claude/skills/test-skill-name/metadata.yaml +0 -30
  55. package/.claude/skills/test-skill-name/templates/default.md +0 -3
@@ -0,0 +1,26 @@
1
+ name: quick-fix
2
+ version: 2.0.0
3
+ description: |
4
+ 快速修复者。专注于构建错误、lint 错误、类型错误的快速修复。
5
+ 使用 haiku 模型确保响应快速、成本低。
6
+ 遵循最小变更原则,不做复杂重构。
7
+
8
+ triggers:
9
+ - build error
10
+ - compile error
11
+ - type error
12
+ - lint error
13
+ - tsc error
14
+ - 构建错误
15
+ - 编译错误
16
+ - 类型错误
17
+
18
+ tools:
19
+ - Read
20
+ - Edit
21
+ - Bash
22
+ - Grep
23
+
24
+ model: haiku
25
+
26
+ source: optimized from build-error-resolver
@@ -0,0 +1,186 @@
1
+ # Test Master
2
+
3
+ > 测试大师 - 合并: tdd-workflow + e2e-runner
4
+
5
+ ## 核心职责
6
+
7
+ 统一处理所有测试相关工作:
8
+
9
+ 1. **单元测试** - TDD 流程、Jest/Vitest
10
+ 2. **E2E 测试** - Playwright、用户流程
11
+ 3. **覆盖率** - 分析和提升覆盖率
12
+
13
+ ## 工作模式
14
+
15
+ ### 模式 1:TDD 开发
16
+
17
+ ```
18
+ 触发:实现新功能或修复 bug
19
+ 流程:RED → GREEN → REFACTOR
20
+ 目标:测试先行,覆盖率 > 80%
21
+ ```
22
+
23
+ ### 模式 2:E2E 测试
24
+
25
+ ```
26
+ 触发:--e2e 或用户流程测试
27
+ 框架:Playwright + Page Object Model
28
+ 输出:测试文件 + 截图/视频
29
+ ```
30
+
31
+ ### 模式 3:覆盖率分析
32
+
33
+ ```
34
+ 触发:--coverage
35
+ 输出:覆盖率报告 + 未覆盖代码建议
36
+ ```
37
+
38
+ ## TDD 工作流
39
+
40
+ ### RED(写失败的测试)
41
+
42
+ ```typescript
43
+ // 1. 先写测试,明确期望行为
44
+ describe('calculateTotal', () => {
45
+ it('should sum all items with tax', () => {
46
+ const items = [{ price: 100 }, { price: 200 }]
47
+ expect(calculateTotal(items, 0.1)).toBe(330)
48
+ })
49
+ })
50
+ ```
51
+
52
+ ### GREEN(最小实现)
53
+
54
+ ```typescript
55
+ // 2. 写最少代码让测试通过
56
+ function calculateTotal(items, taxRate) {
57
+ const subtotal = items.reduce((sum, item) => sum + item.price, 0)
58
+ return subtotal * (1 + taxRate)
59
+ }
60
+ ```
61
+
62
+ ### REFACTOR(优化)
63
+
64
+ ```typescript
65
+ // 3. 重构,保持测试通过
66
+ function calculateTotal(items: Item[], taxRate: number): number {
67
+ const subtotal = items.reduce((sum, { price }) => sum + price, 0)
68
+ return Math.round(subtotal * (1 + taxRate) * 100) / 100
69
+ }
70
+ ```
71
+
72
+ ## E2E 测试结构
73
+
74
+ ```
75
+ tests/
76
+ ├── e2e/
77
+ │ ├── pages/ # Page Objects
78
+ │ │ ├── LoginPage.ts
79
+ │ │ ├── DashboardPage.ts
80
+ │ │ └── BasePage.ts
81
+ │ ├── fixtures/ # 测试数据
82
+ │ │ └── users.json
83
+ │ ├── specs/ # 测试用例
84
+ │ │ ├── auth.spec.ts
85
+ │ │ └── dashboard.spec.ts
86
+ │ └── playwright.config.ts
87
+ ```
88
+
89
+ ### Page Object 示例
90
+
91
+ ```typescript
92
+ // pages/LoginPage.ts
93
+ import { Page } from '@playwright/test'
94
+
95
+ export class LoginPage {
96
+ constructor(private page: Page) {}
97
+
98
+ async goto() {
99
+ await this.page.goto('/login')
100
+ }
101
+
102
+ async login(email: string, password: string) {
103
+ await this.page.fill('[data-testid="email"]', email)
104
+ await this.page.fill('[data-testid="password"]', password)
105
+ await this.page.click('[data-testid="submit"]')
106
+ }
107
+
108
+ async expectError(message: string) {
109
+ await expect(this.page.locator('.error')).toContainText(message)
110
+ }
111
+ }
112
+ ```
113
+
114
+ ## 覆盖率目标
115
+
116
+ | 类型 | 目标 | 最低 |
117
+ |------|------|------|
118
+ | 语句覆盖 | 90% | 80% |
119
+ | 分支覆盖 | 85% | 70% |
120
+ | 函数覆盖 | 90% | 80% |
121
+ | 行覆盖 | 90% | 80% |
122
+
123
+ ## 测试命令
124
+
125
+ ```bash
126
+ # 运行单元测试
127
+ npm test
128
+
129
+ # 运行并生成覆盖率
130
+ npm test -- --coverage
131
+
132
+ # 运行 E2E 测试
133
+ npx playwright test
134
+
135
+ # 运行特定测试
136
+ npm test -- --grep "calculateTotal"
137
+
138
+ # 监视模式
139
+ npm test -- --watch
140
+ ```
141
+
142
+ ## 输出格式
143
+
144
+ ```markdown
145
+ # Test Report
146
+
147
+ ## Summary
148
+ - Total: X tests
149
+ - Passed: X ✅
150
+ - Failed: X ❌
151
+ - Skipped: X ⏭️
152
+
153
+ ## Coverage
154
+ | Metric | Current | Target | Status |
155
+ |--------|---------|--------|--------|
156
+ | Statements | 85% | 80% | ✅ |
157
+ | Branches | 72% | 70% | ✅ |
158
+ | Functions | 88% | 80% | ✅ |
159
+ | Lines | 85% | 80% | ✅ |
160
+
161
+ ## Failed Tests
162
+ [详细失败信息]
163
+
164
+ ## Uncovered Code
165
+ [建议添加测试的代码]
166
+ ```
167
+
168
+ ## 使用方式
169
+
170
+ ```bash
171
+ # TDD 开发
172
+ /test
173
+
174
+ # E2E 测试
175
+ /test --e2e
176
+
177
+ # 覆盖率分析
178
+ /test --coverage
179
+
180
+ # 完整测试
181
+ /test --all
182
+ ```
183
+
184
+ ---
185
+
186
+ **原则**:没有测试的代码是不完整的。测试先行,覆盖率为王。
@@ -0,0 +1,29 @@
1
+ name: test-master
2
+ version: 2.0.0
3
+ description: |
4
+ 测试大师。合并了 TDD 工作流和 E2E 测试功能。
5
+ 支持单元测试、E2E 测试、覆盖率分析三种模式。
6
+ 遵循 RED-GREEN-REFACTOR 循环,目标覆盖率 80%+。
7
+
8
+ triggers:
9
+ - write test
10
+ - tdd
11
+ - test-driven
12
+ - e2e test
13
+ - playwright
14
+ - coverage
15
+ - unit test
16
+ - 写测试
17
+ - 测试覆盖
18
+
19
+ tools:
20
+ - Read
21
+ - Write
22
+ - Edit
23
+ - Bash
24
+ - Grep
25
+ - Glob
26
+
27
+ model: sonnet
28
+
29
+ source: merged from tdd-workflow + e2e-runner
package/AGENTS.md CHANGED
@@ -436,12 +436,6 @@ Usage notes:
436
436
 
437
437
  <available_skills>
438
438
 
439
- <skill>
440
- <name>123-skill</name>
441
- <description></description>
442
- <location>project</location>
443
- </skill>
444
-
445
439
  <skill>
446
440
  <name>algorithmic-art</name>
447
441
  <description>Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.</description>
@@ -450,7 +444,7 @@ Usage notes:
450
444
 
451
445
  <skill>
452
446
  <name>api-tester</name>
453
- <description>API testing and HTTP request validation tool for REST/GraphQL endpoints</description>
447
+ <description></description>
454
448
  <location>project</location>
455
449
  </skill>
456
450
 
@@ -472,6 +466,12 @@ Usage notes:
472
466
  <location>project</location>
473
467
  </skill>
474
468
 
469
+ <skill>
470
+ <name>design-brain</name>
471
+ <description></description>
472
+ <location>project</location>
473
+ </skill>
474
+
475
475
  <skill>
476
476
  <name>doc-coauthoring</name>
477
477
  <description>Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.</description>
@@ -526,6 +526,18 @@ Usage notes:
526
526
  <location>project</location>
527
527
  </skill>
528
528
 
529
+ <skill>
530
+ <name>quality-guard</name>
531
+ <description></description>
532
+ <location>project</location>
533
+ </skill>
534
+
535
+ <skill>
536
+ <name>quick-fix</name>
537
+ <description></description>
538
+ <location>project</location>
539
+ </skill>
540
+
529
541
  <skill>
530
542
  <name>skill-creator</name>
531
543
  <description>Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.</description>
@@ -544,6 +556,12 @@ Usage notes:
544
556
  <location>project</location>
545
557
  </skill>
546
558
 
559
+ <skill>
560
+ <name>test-master</name>
561
+ <description></description>
562
+ <location>project</location>
563
+ </skill>
564
+
547
565
  <skill>
548
566
  <name>test-skill-name</name>
549
567
  <description></description>
package/CHANGELOG.md CHANGED
@@ -1,8 +1,69 @@
1
- # Changelog
1
+ ## [1.3.1](https://github.com/sumulige/sumulige-claude/compare/v1.3.0...v1.3.1) (2026-01-22)
2
2
 
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
3
+ ### New Features
4
4
 
5
- ### [1.2.1](https://github.com/sumulige/sumulige-claude/compare/v1.1.2...v1.2.1) (2026-01-18)
5
+ - **System Prompt Optimization**: Token savings via MCP lazy-loading
6
+ - `ENABLE_TOOL_SEARCH=true` - MCP tools loaded on demand
7
+ - `DISABLE_AUTOUPDATER=1` - Reduce startup overhead
8
+ - ~50% token reduction for system prompts
9
+ - **New Commands**:
10
+ - `/handoff` - Generate context handoff documents for session continuity
11
+ - `/gha` - Analyze GitHub Actions CI failures
12
+ - `/audit` - Security audit for approved commands (cc-safe style)
13
+ - **Permission Audit**: Detect dangerous patterns in approved commands
14
+ - Critical: `rm -rf /`, disk overwrite, fork bombs
15
+ - High: `sudo`, `chmod 777`, privileged containers
16
+ - Medium: global installs, force push
17
+
18
+ ### 📝 Documentation
19
+
20
+ - Add `/handoff` command guide
21
+ - Add `/gha` CI analysis guide
22
+ - Add `/audit` security audit guide
23
+
24
+ ---
25
+
26
+ ## [1.3.0](https://github.com/sumulige/sumulige-claude/compare/v1.2.1...v1.3.0) (2026-01-22)
27
+
28
+ ### ✨ New Features
29
+
30
+ - **4 Core Skills System**: Cost-optimized skill architecture
31
+ - `quality-guard` (sonnet) - Code review + security + cleanup
32
+ - `test-master` (sonnet) - TDD + E2E + coverage
33
+ - `design-brain` (opus) - Planning + architecture
34
+ - `quick-fix` (haiku) - Fast error resolution
35
+ - **Model Strategy**: Automatic model selection based on task complexity
36
+ - **Workflow Engine**: 4-phase project workflow (research → approve → plan → develop)
37
+ - **Usage Manual**: Comprehensive `.claude/USAGE.md` documentation
38
+
39
+ ### 🐛 Bug Fixes
40
+
41
+ - make git hooks executable (e748915a)
42
+ - fix pre-push hook for deleted files detection (46cccc6)
43
+
44
+ ### 📝 Documentation
45
+
46
+ - add `.claude/USAGE.md` with complete skills guide
47
+ - add Layer 5.5 Core Skills section to README
48
+ - update CHANGELOG with test coverage improvements
49
+
50
+ ### ♻️ Refactor
51
+
52
+ - **BREAKING**: merge 9 skills into 4 core skills (60-70% cost reduction)
53
+ - delete 6 placeholder skills
54
+ - streamline commands from 17 to 12
55
+
56
+ ### 🧪 Tests
57
+
58
+ - improve test coverage to 63.53%
59
+ - all 575 tests passing
60
+
61
+ ### 🧹 Chores
62
+
63
+ - add workflows, templates, and development infrastructure
64
+ - add hook templates for customization
65
+
66
+ ## [1.2.1](https://github.com/sumulige/sumulige-claude/compare/v1.1.2...v1.2.1) (2026-01-18)
6
67
 
7
68
 
8
69
  ### Fixed
package/README.md CHANGED
@@ -261,6 +261,63 @@ smc kickoff
261
261
 
262
262
  ---
263
263
 
264
+ ## Layer 5.5: Core Skills / 核心技能系统
265
+
266
+ ### 4 Core Skills / 4 个核心技能
267
+
268
+ > v2.0.0 优化:将 9 个技能合并为 4 个核心技能,成本降低 60-70%
269
+
270
+ | Skill | 命令 | 模型 | 作用 |
271
+ |-------|------|------|------|
272
+ | `quality-guard` | `/review` | sonnet | 代码审查 + 安全检查 + 清理建议 |
273
+ | `test-master` | `/test` | sonnet | TDD + E2E + 覆盖率分析 |
274
+ | `design-brain` | `/plan` | opus | 规划 + 架构设计 |
275
+ | `quick-fix` | `/fix` | haiku | 快速修复构建/类型/lint 错误 |
276
+
277
+ ### Quick Reference / 命令速查
278
+
279
+ ```bash
280
+ # 代码审查
281
+ /review # 标准审查
282
+ /review --security # 安全深扫 (OWASP Top 10)
283
+ /review --clean # 死代码清理
284
+
285
+ # 测试
286
+ /test # 运行测试
287
+ /test --tdd # TDD 模式
288
+ /test --e2e # E2E 测试
289
+ /test --coverage # 覆盖率
290
+
291
+ # 规划
292
+ /plan # 快速规划
293
+ /plan --deep # 深度设计
294
+
295
+ # 快速修复
296
+ /fix # 自动检测修复
297
+ /fix --build # 构建错误
298
+ /fix --type # 类型错误
299
+
300
+ # 重构
301
+ /refactor # 分析建议
302
+ /refactor --execute # 执行清理
303
+ ```
304
+
305
+ ### Model Cost Strategy / 模型成本策略
306
+
307
+ ```
308
+ ┌─────────┬─────────────────────┬──────────┬────────┐
309
+ │ 模型 │ 使用场景 │ 相对成本 │ 速度 │
310
+ ├─────────┼─────────────────────┼──────────┼────────┤
311
+ │ haiku │ /fix 快速修复 │ 1x │ 最快 │
312
+ │ sonnet │ /review, /test │ 5x │ 中等 │
313
+ │ opus │ /plan --deep │ 15x │ 较慢 │
314
+ └─────────┴─────────────────────┴──────────┴────────┘
315
+ ```
316
+
317
+ 详细使用指南: [.claude/USAGE.md](.claude/USAGE.md)
318
+
319
+ ---
320
+
264
321
  ## Layer 6: Advanced / 第六层:高级配置
265
322
 
266
323
  ### Multi-Agent Configuration / 多 Agent 配置
package/cli.js CHANGED
@@ -175,6 +175,10 @@ const COMMANDS = {
175
175
  notebooklm: {
176
176
  help: 'NotebookLM browser automation',
177
177
  args: '<auth|ask|status|clear> [args...]'
178
+ },
179
+ audit: {
180
+ help: 'Audit approved commands for security risks',
181
+ args: '[--global] [--ci] [--report]'
178
182
  }
179
183
  };
180
184
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "last_updated": "2026-01-18",
3
+ "last_updated": "2026-01-22",
4
4
  "source": "anthropics/skills",
5
5
  "categories": {
6
6
  "documents": {
package/lib/commands.js CHANGED
@@ -3332,6 +3332,57 @@ All notable changes to this project will be documented in this file.
3332
3332
  } = require("../.claude/workflow/notebooklm/browser");
3333
3333
  await handleNotebookLMCommand(args);
3334
3334
  },
3335
+
3336
+ // ==========================================================================
3337
+ // Security Audit Commands
3338
+ // ==========================================================================
3339
+
3340
+ audit: async (...args) => {
3341
+ const { audit, generateReport, passes } = require("./permission-audit");
3342
+
3343
+ const isGlobal = args.includes("--global");
3344
+ const isCi = args.includes("--ci");
3345
+ const isReport = args.includes("--report");
3346
+
3347
+ console.log("🔍 Running permission audit...\n");
3348
+
3349
+ const results = audit({ global: isGlobal });
3350
+
3351
+ if (isReport) {
3352
+ console.log(generateReport(results));
3353
+ } else {
3354
+ const { issues } = results;
3355
+ const total = issues.critical.length + issues.high.length + issues.medium.length;
3356
+
3357
+ if (total === 0) {
3358
+ console.log("✅ No security issues found!\n");
3359
+ console.log(`Scanned ${results.scanned} settings file(s)`);
3360
+ } else {
3361
+ console.log(`Found ${total} potential issue(s):\n`);
3362
+
3363
+ if (issues.critical.length > 0) {
3364
+ console.log(`🔴 Critical: ${issues.critical.length}`);
3365
+ issues.critical.forEach(i => console.log(` - ${i.desc}: ${i.permission}`));
3366
+ }
3367
+
3368
+ if (issues.high.length > 0) {
3369
+ console.log(`🟠 High: ${issues.high.length}`);
3370
+ issues.high.forEach(i => console.log(` - ${i.desc}: ${i.permission}`));
3371
+ }
3372
+
3373
+ if (issues.medium.length > 0) {
3374
+ console.log(`🟡 Medium: ${issues.medium.length}`);
3375
+ issues.medium.forEach(i => console.log(` - ${i.desc}: ${i.permission}`));
3376
+ }
3377
+
3378
+ console.log("\nRun 'smc audit --report' for detailed analysis.");
3379
+ }
3380
+ }
3381
+
3382
+ if (isCi && !passes(results)) {
3383
+ process.exit(1);
3384
+ }
3385
+ },
3335
3386
  };
3336
3387
 
3337
3388
  // ============================================================================