omgkit 2.1.1 → 2.3.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 (56) hide show
  1. package/package.json +1 -1
  2. package/plugin/skills/databases/mongodb/SKILL.md +81 -28
  3. package/plugin/skills/databases/prisma/SKILL.md +87 -32
  4. package/plugin/skills/databases/redis/SKILL.md +80 -27
  5. package/plugin/skills/devops/aws/SKILL.md +80 -26
  6. package/plugin/skills/devops/github-actions/SKILL.md +84 -32
  7. package/plugin/skills/devops/kubernetes/SKILL.md +94 -32
  8. package/plugin/skills/devops/performance-profiling/SKILL.md +59 -863
  9. package/plugin/skills/frameworks/django/SKILL.md +158 -24
  10. package/plugin/skills/frameworks/express/SKILL.md +153 -33
  11. package/plugin/skills/frameworks/fastapi/SKILL.md +153 -34
  12. package/plugin/skills/frameworks/laravel/SKILL.md +146 -33
  13. package/plugin/skills/frameworks/nestjs/SKILL.md +137 -25
  14. package/plugin/skills/frameworks/rails/SKILL.md +594 -28
  15. package/plugin/skills/frameworks/react/SKILL.md +94 -962
  16. package/plugin/skills/frameworks/spring/SKILL.md +528 -35
  17. package/plugin/skills/frameworks/vue/SKILL.md +147 -25
  18. package/plugin/skills/frontend/accessibility/SKILL.md +145 -36
  19. package/plugin/skills/frontend/frontend-design/SKILL.md +114 -29
  20. package/plugin/skills/frontend/responsive/SKILL.md +131 -28
  21. package/plugin/skills/frontend/shadcn-ui/SKILL.md +133 -43
  22. package/plugin/skills/frontend/tailwindcss/SKILL.md +105 -37
  23. package/plugin/skills/frontend/threejs/SKILL.md +110 -35
  24. package/plugin/skills/languages/javascript/SKILL.md +195 -34
  25. package/plugin/skills/methodology/brainstorming/SKILL.md +98 -30
  26. package/plugin/skills/methodology/defense-in-depth/SKILL.md +83 -37
  27. package/plugin/skills/methodology/dispatching-parallel-agents/SKILL.md +92 -31
  28. package/plugin/skills/methodology/executing-plans/SKILL.md +117 -28
  29. package/plugin/skills/methodology/finishing-development-branch/SKILL.md +111 -32
  30. package/plugin/skills/methodology/problem-solving/SKILL.md +65 -311
  31. package/plugin/skills/methodology/receiving-code-review/SKILL.md +76 -27
  32. package/plugin/skills/methodology/requesting-code-review/SKILL.md +93 -22
  33. package/plugin/skills/methodology/root-cause-tracing/SKILL.md +75 -40
  34. package/plugin/skills/methodology/sequential-thinking/SKILL.md +75 -224
  35. package/plugin/skills/methodology/systematic-debugging/SKILL.md +81 -35
  36. package/plugin/skills/methodology/test-driven-development/SKILL.md +120 -26
  37. package/plugin/skills/methodology/testing-anti-patterns/SKILL.md +88 -35
  38. package/plugin/skills/methodology/token-optimization/SKILL.md +73 -34
  39. package/plugin/skills/methodology/verification-before-completion/SKILL.md +128 -28
  40. package/plugin/skills/methodology/writing-plans/SKILL.md +105 -20
  41. package/plugin/skills/omega/omega-architecture/SKILL.md +178 -40
  42. package/plugin/skills/omega/omega-coding/SKILL.md +247 -41
  43. package/plugin/skills/omega/omega-sprint/SKILL.md +208 -46
  44. package/plugin/skills/omega/omega-testing/SKILL.md +253 -42
  45. package/plugin/skills/omega/omega-thinking/SKILL.md +263 -51
  46. package/plugin/skills/security/better-auth/SKILL.md +83 -34
  47. package/plugin/skills/security/oauth/SKILL.md +118 -35
  48. package/plugin/skills/security/owasp/SKILL.md +112 -35
  49. package/plugin/skills/testing/playwright/SKILL.md +141 -38
  50. package/plugin/skills/testing/pytest/SKILL.md +137 -38
  51. package/plugin/skills/testing/vitest/SKILL.md +124 -39
  52. package/plugin/skills/tools/document-processing/SKILL.md +111 -838
  53. package/plugin/skills/tools/image-processing/SKILL.md +126 -659
  54. package/plugin/skills/tools/mcp-development/SKILL.md +85 -758
  55. package/plugin/skills/tools/media-processing/SKILL.md +118 -735
  56. package/plugin/stdrules/SKILL_STANDARDS.md +490 -0
@@ -1,64 +1,149 @@
1
1
  ---
2
- name: vitest
3
- description: Vitest testing. Use for JavaScript/TypeScript unit tests.
2
+ name: Testing with Vitest
3
+ description: Claude writes fast, reliable tests using Vitest for TypeScript/JavaScript projects. Use when writing unit tests, component tests, setting up mocks, snapshot testing, or configuring test coverage.
4
4
  ---
5
5
 
6
- # Vitest Skill
6
+ # Testing with Vitest
7
7
 
8
- ## Basic Tests
9
- ```typescript
10
- import { describe, it, expect } from 'vitest';
8
+ ## Quick Start
11
9
 
12
- describe('add', () => {
13
- it('adds two numbers', () => {
14
- expect(add(1, 2)).toBe(3);
15
- });
10
+ ```typescript
11
+ // vitest.config.ts
12
+ import { defineConfig } from "vitest/config";
16
13
 
17
- it('handles negative numbers', () => {
18
- expect(add(-1, 1)).toBe(0);
19
- });
14
+ export default defineConfig({
15
+ test: {
16
+ globals: true,
17
+ environment: "jsdom",
18
+ setupFiles: ["./tests/setup.ts"],
19
+ coverage: {
20
+ provider: "v8",
21
+ reporter: ["text", "html"],
22
+ thresholds: { global: { branches: 80, functions: 80, lines: 80 } },
23
+ },
24
+ },
20
25
  });
26
+
27
+ // tests/setup.ts
28
+ import { afterEach, vi } from "vitest";
29
+ import { cleanup } from "@testing-library/vue";
30
+ import "@testing-library/jest-dom/vitest";
31
+
32
+ afterEach(() => { vi.clearAllMocks(); cleanup(); });
21
33
  ```
22
34
 
23
- ## Async Tests
35
+ ## Features
36
+
37
+ | Feature | Description | Reference |
38
+ |---------|-------------|-----------|
39
+ | Unit Testing | Fast isolated tests with describe/it/expect | [Vitest API](https://vitest.dev/api/) |
40
+ | Mocking | Module, function, and timer mocking with vi | [Mocking Guide](https://vitest.dev/guide/mocking.html) |
41
+ | Snapshot Testing | Component and data structure snapshots | [Snapshot Testing](https://vitest.dev/guide/snapshot.html) |
42
+ | Component Testing | Vue/React component testing with Testing Library | [Vue Test Utils](https://test-utils.vuejs.org/) |
43
+ | Coverage Reports | V8/Istanbul coverage with thresholds | [Coverage](https://vitest.dev/guide/coverage.html) |
44
+ | Parallel Execution | Multi-threaded test runner | [Test Runner](https://vitest.dev/guide/features.html) |
45
+
46
+ ## Common Patterns
47
+
48
+ ### Unit Testing with Parametrization
49
+
24
50
  ```typescript
25
- it('fetches user', async () => {
26
- const user = await fetchUser('123');
27
- expect(user.email).toBe('test@example.com');
51
+ import { describe, it, expect, test } from "vitest";
52
+
53
+ describe("String Utils", () => {
54
+ test.each([
55
+ ["hello", 3, "hel..."],
56
+ ["hi", 10, "hi"],
57
+ ["test", 4, "test"],
58
+ ])('truncate("%s", %d) returns "%s"', (str, len, expected) => {
59
+ expect(truncate(str, len)).toBe(expected);
60
+ });
28
61
  });
29
62
  ```
30
63
 
31
- ## Mocking
64
+ ### Mocking Modules and Services
65
+
32
66
  ```typescript
33
- import { vi } from 'vitest';
67
+ import { describe, it, expect, vi, beforeEach, Mock } from "vitest";
68
+ import { UserService } from "@/services/user";
69
+ import { apiClient } from "@/lib/api";
34
70
 
35
- vi.mock('./api', () => ({
36
- fetchData: vi.fn().mockResolvedValue({ data: 'test' }),
71
+ vi.mock("@/lib/api", () => ({
72
+ apiClient: { get: vi.fn(), post: vi.fn() },
37
73
  }));
38
74
 
39
- it('calls API', async () => {
40
- const result = await getData();
41
- expect(fetchData).toHaveBeenCalled();
75
+ describe("UserService", () => {
76
+ beforeEach(() => vi.clearAllMocks());
77
+
78
+ it("fetches user from API", async () => {
79
+ const mockUser = { id: "1", name: "John" };
80
+ (apiClient.get as Mock).mockResolvedValue({ data: mockUser });
81
+
82
+ const user = await new UserService().getUser("1");
83
+
84
+ expect(apiClient.get).toHaveBeenCalledWith("/users/1");
85
+ expect(user).toEqual(mockUser);
86
+ });
42
87
  });
43
88
  ```
44
89
 
45
- ## Setup
90
+ ### Vue Component Testing
91
+
46
92
  ```typescript
47
- // vitest.config.ts
48
- export default defineConfig({
49
- test: {
50
- globals: true,
51
- environment: 'jsdom',
52
- coverage: {
53
- provider: 'v8',
54
- },
55
- },
93
+ import { describe, it, expect, vi } from "vitest";
94
+ import { mount } from "@vue/test-utils";
95
+ import Button from "@/components/Button.vue";
96
+
97
+ describe("Button", () => {
98
+ it("emits click event", async () => {
99
+ const wrapper = mount(Button, { slots: { default: "Click" } });
100
+ await wrapper.trigger("click");
101
+ expect(wrapper.emitted("click")).toHaveLength(1);
102
+ });
103
+
104
+ it("is disabled when loading", () => {
105
+ const wrapper = mount(Button, { props: { loading: true } });
106
+ expect(wrapper.attributes("disabled")).toBeDefined();
107
+ });
56
108
  });
57
109
  ```
58
110
 
59
- ## Run
60
- ```bash
61
- vitest
62
- vitest --coverage
63
- vitest --ui
111
+ ### Testing Async Operations with Timers
112
+
113
+ ```typescript
114
+ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
115
+
116
+ describe("Debounce", () => {
117
+ beforeEach(() => vi.useFakeTimers());
118
+ afterEach(() => vi.useRealTimers());
119
+
120
+ it("delays function execution", () => {
121
+ const fn = vi.fn();
122
+ const debouncedFn = debounce(fn, 100);
123
+
124
+ debouncedFn();
125
+ expect(fn).not.toHaveBeenCalled();
126
+
127
+ vi.advanceTimersByTime(100);
128
+ expect(fn).toHaveBeenCalledTimes(1);
129
+ });
130
+ });
64
131
  ```
132
+
133
+ ## Best Practices
134
+
135
+ | Do | Avoid |
136
+ |----|-------|
137
+ | Use descriptive test names explaining behavior | Testing implementation details |
138
+ | Test behavior, not internal state | Sharing state between tests |
139
+ | Use test.each for multiple similar cases | Using arbitrary timeouts |
140
+ | Mock external dependencies | Over-mocking internal modules |
141
+ | Keep tests focused and isolated | Duplicating test coverage |
142
+ | Write tests alongside code | Ignoring flaky tests |
143
+
144
+ ## References
145
+
146
+ - [Vitest Documentation](https://vitest.dev/)
147
+ - [Vue Test Utils](https://test-utils.vuejs.org/)
148
+ - [Testing Library](https://testing-library.com/)
149
+ - [Vitest Coverage](https://vitest.dev/guide/coverage.html)