agcel 1.0.4 → 2.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 (293) hide show
  1. package/README.md +40 -47
  2. package/dist/cli/commands/create.d.ts +4 -0
  3. package/dist/cli/commands/create.d.ts.map +1 -0
  4. package/dist/cli/commands/create.js +68 -0
  5. package/dist/cli/commands/create.js.map +1 -0
  6. package/dist/cli/commands/init.d.ts +3 -0
  7. package/dist/cli/commands/init.d.ts.map +1 -0
  8. package/dist/cli/commands/init.js +98 -0
  9. package/dist/cli/commands/init.js.map +1 -0
  10. package/dist/cli/commands/install.d.ts +3 -0
  11. package/dist/cli/commands/install.d.ts.map +1 -0
  12. package/dist/cli/commands/install.helpers.d.ts +15 -0
  13. package/dist/cli/commands/install.helpers.d.ts.map +1 -0
  14. package/dist/cli/commands/install.helpers.js +47 -0
  15. package/dist/cli/commands/install.helpers.js.map +1 -0
  16. package/dist/cli/commands/install.helpers.test.d.ts +2 -0
  17. package/dist/cli/commands/install.helpers.test.d.ts.map +1 -0
  18. package/dist/cli/commands/install.helpers.test.js +18 -0
  19. package/dist/cli/commands/install.helpers.test.js.map +1 -0
  20. package/dist/cli/commands/install.js +74 -0
  21. package/dist/cli/commands/install.js.map +1 -0
  22. package/dist/cli/commands/pulse.d.ts +4 -0
  23. package/dist/cli/commands/pulse.d.ts.map +1 -0
  24. package/dist/cli/commands/pulse.js +48 -0
  25. package/dist/cli/commands/pulse.js.map +1 -0
  26. package/dist/cli/commands/pulse.test.d.ts +2 -0
  27. package/dist/cli/commands/pulse.test.d.ts.map +1 -0
  28. package/dist/cli/commands/pulse.test.js +19 -0
  29. package/dist/cli/commands/pulse.test.js.map +1 -0
  30. package/dist/cli/commands/suggest.d.ts +3 -0
  31. package/dist/cli/commands/suggest.d.ts.map +1 -0
  32. package/dist/cli/commands/suggest.js +32 -0
  33. package/dist/cli/commands/suggest.js.map +1 -0
  34. package/dist/cli/index.d.ts +3 -0
  35. package/dist/cli/index.d.ts.map +1 -0
  36. package/dist/cli/index.js +20 -0
  37. package/dist/cli/index.js.map +1 -0
  38. package/dist/cli/research-hints.d.ts +5 -0
  39. package/dist/cli/research-hints.d.ts.map +1 -0
  40. package/dist/cli/research-hints.js +109 -0
  41. package/dist/cli/research-hints.js.map +1 -0
  42. package/dist/cli/research-hints.test.d.ts +2 -0
  43. package/dist/cli/research-hints.test.d.ts.map +1 -0
  44. package/dist/cli/research-hints.test.js +50 -0
  45. package/dist/cli/research-hints.test.js.map +1 -0
  46. package/dist/core/agcel-config.d.ts +27 -0
  47. package/dist/core/agcel-config.d.ts.map +1 -0
  48. package/dist/core/agcel-config.js +4 -0
  49. package/dist/core/agcel-config.js.map +1 -0
  50. package/dist/core/build-rag-engine.d.ts +12 -0
  51. package/dist/core/build-rag-engine.d.ts.map +1 -0
  52. package/dist/core/build-rag-engine.js +24 -0
  53. package/dist/core/build-rag-engine.js.map +1 -0
  54. package/dist/core/build-rag-engine.test.d.ts +2 -0
  55. package/dist/core/build-rag-engine.test.d.ts.map +1 -0
  56. package/dist/core/build-rag-engine.test.js +34 -0
  57. package/dist/core/build-rag-engine.test.js.map +1 -0
  58. package/dist/core/chroma-rag.d.ts +20 -0
  59. package/dist/core/chroma-rag.d.ts.map +1 -0
  60. package/dist/core/chroma-rag.js +108 -0
  61. package/dist/core/chroma-rag.js.map +1 -0
  62. package/dist/core/context-hygiene.d.ts +12 -0
  63. package/dist/core/context-hygiene.d.ts.map +1 -0
  64. package/dist/core/context-hygiene.js +43 -0
  65. package/dist/core/context-hygiene.js.map +1 -0
  66. package/dist/core/context-hygiene.test.d.ts +2 -0
  67. package/dist/core/context-hygiene.test.d.ts.map +1 -0
  68. package/dist/core/context-hygiene.test.js +18 -0
  69. package/dist/core/context-hygiene.test.js.map +1 -0
  70. package/dist/core/context.d.ts +44 -0
  71. package/dist/core/context.d.ts.map +1 -0
  72. package/dist/core/context.js +114 -0
  73. package/dist/core/context.js.map +1 -0
  74. package/dist/core/conversation-routing.d.ts +10 -0
  75. package/dist/core/conversation-routing.d.ts.map +1 -0
  76. package/dist/core/conversation-routing.js +27 -0
  77. package/dist/core/conversation-routing.js.map +1 -0
  78. package/dist/core/conversation-routing.test.d.ts +2 -0
  79. package/dist/core/conversation-routing.test.d.ts.map +1 -0
  80. package/dist/core/conversation-routing.test.js +29 -0
  81. package/dist/core/conversation-routing.test.js.map +1 -0
  82. package/dist/core/guardrails.d.ts +26 -0
  83. package/dist/core/guardrails.d.ts.map +1 -0
  84. package/dist/core/guardrails.js +76 -0
  85. package/dist/core/guardrails.js.map +1 -0
  86. package/dist/core/guardrails.test.d.ts +2 -0
  87. package/dist/core/guardrails.test.d.ts.map +1 -0
  88. package/dist/core/guardrails.test.js +35 -0
  89. package/dist/core/guardrails.test.js.map +1 -0
  90. package/dist/core/intent.d.ts +22 -0
  91. package/dist/core/intent.d.ts.map +1 -0
  92. package/dist/core/intent.js +79 -0
  93. package/dist/core/intent.js.map +1 -0
  94. package/dist/core/intent.test.d.ts +2 -0
  95. package/dist/core/intent.test.d.ts.map +1 -0
  96. package/dist/core/intent.test.js +43 -0
  97. package/dist/core/intent.test.js.map +1 -0
  98. package/dist/core/local-rag.d.ts +17 -0
  99. package/dist/core/local-rag.d.ts.map +1 -0
  100. package/dist/core/local-rag.js +74 -0
  101. package/dist/core/local-rag.js.map +1 -0
  102. package/dist/core/local-rag.test.d.ts +2 -0
  103. package/dist/core/local-rag.test.d.ts.map +1 -0
  104. package/dist/core/local-rag.test.js +47 -0
  105. package/dist/core/local-rag.test.js.map +1 -0
  106. package/dist/core/orchestrator.d.ts +47 -0
  107. package/dist/core/orchestrator.d.ts.map +1 -0
  108. package/dist/core/orchestrator.js +138 -0
  109. package/dist/core/orchestrator.js.map +1 -0
  110. package/dist/core/orchestrator.test.d.ts +2 -0
  111. package/dist/core/orchestrator.test.d.ts.map +1 -0
  112. package/dist/core/orchestrator.test.js +118 -0
  113. package/dist/core/orchestrator.test.js.map +1 -0
  114. package/dist/core/pulse.d.ts +13 -0
  115. package/dist/core/pulse.d.ts.map +1 -0
  116. package/dist/core/pulse.js +29 -0
  117. package/dist/core/pulse.js.map +1 -0
  118. package/dist/core/pulse.test.d.ts +2 -0
  119. package/dist/core/pulse.test.d.ts.map +1 -0
  120. package/dist/core/pulse.test.js +18 -0
  121. package/dist/core/pulse.test.js.map +1 -0
  122. package/dist/core/rag-metadata.d.ts +5 -0
  123. package/dist/core/rag-metadata.d.ts.map +1 -0
  124. package/dist/core/rag-metadata.js +13 -0
  125. package/dist/core/rag-metadata.js.map +1 -0
  126. package/dist/core/rag-metadata.test.d.ts +2 -0
  127. package/dist/core/rag-metadata.test.d.ts.map +1 -0
  128. package/dist/core/rag-metadata.test.js +12 -0
  129. package/dist/core/rag-metadata.test.js.map +1 -0
  130. package/dist/core/rag-types.d.ts +18 -0
  131. package/dist/core/rag-types.d.ts.map +1 -0
  132. package/dist/core/rag-types.js +2 -0
  133. package/dist/core/rag-types.js.map +1 -0
  134. package/dist/core/read-agcel-config.d.ts +3 -0
  135. package/dist/core/read-agcel-config.d.ts.map +1 -0
  136. package/dist/core/read-agcel-config.js +13 -0
  137. package/dist/core/read-agcel-config.js.map +1 -0
  138. package/dist/core/registry.d.ts +9 -0
  139. package/dist/core/registry.d.ts.map +1 -0
  140. package/dist/core/registry.js +75 -0
  141. package/dist/core/registry.js.map +1 -0
  142. package/dist/core/registry.test.d.ts +2 -0
  143. package/dist/core/registry.test.d.ts.map +1 -0
  144. package/dist/core/registry.test.js +128 -0
  145. package/dist/core/registry.test.js.map +1 -0
  146. package/dist/core/schema.d.ts +51 -0
  147. package/dist/core/schema.d.ts.map +1 -0
  148. package/dist/core/schema.js +31 -0
  149. package/dist/core/schema.js.map +1 -0
  150. package/dist/core/summarizer.d.ts +23 -0
  151. package/dist/core/summarizer.d.ts.map +1 -0
  152. package/dist/core/summarizer.js +66 -0
  153. package/dist/core/summarizer.js.map +1 -0
  154. package/dist/core/text-similarity.d.ts +7 -0
  155. package/dist/core/text-similarity.d.ts.map +1 -0
  156. package/dist/core/text-similarity.js +35 -0
  157. package/dist/core/text-similarity.js.map +1 -0
  158. package/dist/core/text-similarity.test.d.ts +2 -0
  159. package/dist/core/text-similarity.test.d.ts.map +1 -0
  160. package/dist/core/text-similarity.test.js +11 -0
  161. package/dist/core/text-similarity.test.js.map +1 -0
  162. package/dist/docs-site.test.d.ts +2 -0
  163. package/dist/docs-site.test.d.ts.map +1 -0
  164. package/dist/docs-site.test.js +19 -0
  165. package/dist/docs-site.test.js.map +1 -0
  166. package/dist/index.d.ts +8 -0
  167. package/dist/index.d.ts.map +1 -0
  168. package/dist/index.js +8 -39
  169. package/dist/index.js.map +1 -0
  170. package/dist/providers/adapter.d.ts +23 -0
  171. package/dist/providers/adapter.d.ts.map +1 -0
  172. package/dist/providers/adapter.js +9 -0
  173. package/dist/providers/adapter.js.map +1 -0
  174. package/dist/providers/chatgpt.d.ts +13 -0
  175. package/dist/providers/chatgpt.d.ts.map +1 -0
  176. package/dist/providers/chatgpt.js +33 -0
  177. package/dist/providers/chatgpt.js.map +1 -0
  178. package/dist/providers/chatgpt.test.d.ts +2 -0
  179. package/dist/providers/chatgpt.test.d.ts.map +1 -0
  180. package/dist/providers/chatgpt.test.js +23 -0
  181. package/dist/providers/chatgpt.test.js.map +1 -0
  182. package/dist/providers/claude.d.ts +13 -0
  183. package/dist/providers/claude.d.ts.map +1 -0
  184. package/dist/providers/claude.js +48 -0
  185. package/dist/providers/claude.js.map +1 -0
  186. package/dist/providers/cursor.d.ts +14 -0
  187. package/dist/providers/cursor.d.ts.map +1 -0
  188. package/dist/providers/cursor.js +47 -0
  189. package/dist/providers/cursor.js.map +1 -0
  190. package/dist/providers/gemini.d.ts +13 -0
  191. package/dist/providers/gemini.d.ts.map +1 -0
  192. package/dist/providers/gemini.js +42 -0
  193. package/dist/providers/gemini.js.map +1 -0
  194. package/dist/providers/index.d.ts +5 -0
  195. package/dist/providers/index.d.ts.map +1 -0
  196. package/dist/providers/index.js +18 -0
  197. package/dist/providers/index.js.map +1 -0
  198. package/dist/server/index.d.ts +2 -0
  199. package/dist/server/index.d.ts.map +1 -0
  200. package/dist/server/index.js +288 -154
  201. package/dist/server/index.js.map +1 -0
  202. package/package.json +62 -52
  203. package/.agent/workflows/api-gen.md +0 -63
  204. package/.agent/workflows/architect.md +0 -44
  205. package/.agent/workflows/brainstorm.md +0 -227
  206. package/.agent/workflows/build.md +0 -38
  207. package/.agent/workflows/changelog.md +0 -55
  208. package/.agent/workflows/checkpoint.md +0 -142
  209. package/.agent/workflows/commit.md +0 -227
  210. package/.agent/workflows/debug.md +0 -61
  211. package/.agent/workflows/deploy.md +0 -80
  212. package/.agent/workflows/doc.md +0 -251
  213. package/.agent/workflows/execute-plan.md +0 -229
  214. package/.agent/workflows/feature.md +0 -259
  215. package/.agent/workflows/fix.md +0 -327
  216. package/.agent/workflows/help.md +0 -67
  217. package/.agent/workflows/index.md +0 -152
  218. package/.agent/workflows/load.md +0 -116
  219. package/.agent/workflows/mode.md +0 -174
  220. package/.agent/workflows/optimize.md +0 -57
  221. package/.agent/workflows/plan.md +0 -341
  222. package/.agent/workflows/pr.md +0 -78
  223. package/.agent/workflows/product-plan.md +0 -36
  224. package/.agent/workflows/production-deploy.md +0 -39
  225. package/.agent/workflows/refactor.md +0 -67
  226. package/.agent/workflows/research.md +0 -120
  227. package/.agent/workflows/review.md +0 -348
  228. package/.agent/workflows/security-scan.md +0 -60
  229. package/.agent/workflows/ship.md +0 -225
  230. package/.agent/workflows/spawn.md +0 -181
  231. package/.agent/workflows/status.md +0 -63
  232. package/.agent/workflows/tdd.md +0 -143
  233. package/.agent/workflows/test.md +0 -344
  234. package/.agent/workflows/verify.md +0 -35
  235. package/LICENSE +0 -21
  236. package/dist/commands/init.js +0 -147
  237. package/dist/commands/list.js +0 -43
  238. package/dist/commands/uninstall.js +0 -70
  239. package/dist/utils/index.js +0 -28
  240. package/skills/api-security-best-practices/SKILL.md +0 -291
  241. package/skills/api-security-best-practices/references/examples.md +0 -617
  242. package/skills/architecture/SKILL.md +0 -59
  243. package/skills/architecture/context-discovery.md +0 -43
  244. package/skills/architecture/examples.md +0 -94
  245. package/skills/architecture/pattern-selection.md +0 -68
  246. package/skills/architecture/patterns-reference.md +0 -50
  247. package/skills/architecture/trade-off-analysis.md +0 -77
  248. package/skills/aws-serverless/SKILL.md +0 -327
  249. package/skills/brainstorming/SKILL.md +0 -234
  250. package/skills/c4-context/SKILL.md +0 -154
  251. package/skills/ci-cd-engineer/SKILL.md +0 -50
  252. package/skills/code-auditing/SKILL.md +0 -55
  253. package/skills/copywriting/SKILL.md +0 -248
  254. package/skills/database-engineer/SKILL.md +0 -47
  255. package/skills/doc-coauthoring/SKILL.md +0 -379
  256. package/skills/docker-expert/SKILL.md +0 -412
  257. package/skills/langgraph/SKILL.md +0 -291
  258. package/skills/postgresql/SKILL.md +0 -73
  259. package/skills/pricing-strategy/SKILL.md +0 -360
  260. package/skills/product-manager/SKILL.md +0 -57
  261. package/skills/prompt-engineer/README.md +0 -659
  262. package/skills/prompt-engineer/SKILL.md +0 -256
  263. package/skills/python-patterns/SKILL.md +0 -445
  264. package/skills/qa-engineer/SKILL.md +0 -42
  265. package/skills/rag-engineer/SKILL.md +0 -94
  266. package/skills/react-patterns/SKILL.md +0 -202
  267. package/skills/secure-refactoring/SKILL.md +0 -54
  268. package/skills/security-documentation/SKILL.md +0 -53
  269. package/skills/senior-architect/SKILL.md +0 -213
  270. package/skills/senior-architect/references/architecture_patterns.md +0 -103
  271. package/skills/senior-architect/references/system_design_workflows.md +0 -103
  272. package/skills/senior-architect/references/tech_decision_guide.md +0 -103
  273. package/skills/senior-architect/scripts/architecture_diagram_generator.py +0 -114
  274. package/skills/senior-architect/scripts/dependency_analyzer.py +0 -114
  275. package/skills/senior-architect/scripts/project_architect.py +0 -114
  276. package/skills/seo-audit/SKILL.md +0 -491
  277. package/skills/sql-injection-testing/SKILL.md +0 -452
  278. package/skills/test-driven-development/SKILL.md +0 -375
  279. package/skills/test-driven-development/testing-anti-patterns.md +0 -299
  280. package/skills/test-fixing/SKILL.md +0 -123
  281. package/skills/testing-patterns/SKILL.md +0 -263
  282. package/skills/typescript-expert/SKILL.md +0 -202
  283. package/skills/typescript-expert/references/advanced-topics.md +0 -252
  284. package/skills/typescript-expert/references/tsconfig-strict.json +0 -92
  285. package/skills/typescript-expert/references/typescript-cheatsheet.md +0 -383
  286. package/skills/typescript-expert/references/utility-types.ts +0 -335
  287. package/skills/typescript-expert/scripts/ts_diagnostic.py +0 -203
  288. package/skills/ui-ux-designer/SKILL.md +0 -46
  289. package/skills/vercel-deployment/SKILL.md +0 -83
  290. package/skills/vulnerability-scanner/SKILL.md +0 -280
  291. package/skills/vulnerability-scanner/checklists.md +0 -121
  292. package/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  293. package/skills/writing-plans/SKILL.md +0 -120
@@ -1,344 +0,0 @@
1
- ---
2
- description: Test Generation
3
- ---
4
-
5
- # /test - Test Generation Command
6
-
7
- ## Purpose
8
-
9
- Generate comprehensive tests for specified code including unit tests, integration tests, and edge cases.
10
-
11
- ## Usage
12
-
13
- ```
14
- /test [file path | function name | 'coverage' | 'all']
15
- ```
16
-
17
- ## Arguments
18
-
19
- - `$ARGUMENTS`:
20
- - File path: Generate tests for specific file
21
- - Function name: Generate tests for specific function
22
- - `coverage`: Analyze and improve test coverage
23
- - `all`: Run all tests and report results
24
-
25
- ---
26
-
27
- Generate comprehensive tests for: **$ARGUMENTS**
28
-
29
- ## Workflow
30
-
31
- ### For File/Function Testing
32
-
33
- 1. **Analyze Target Code**
34
- - Read the code to understand functionality
35
- - Identify inputs, outputs, and side effects
36
- - Note dependencies to mock
37
- - Find existing tests for patterns
38
-
39
- 2. **Design Test Cases**
40
- - **Happy Path**: Normal operation with valid inputs
41
- - **Edge Cases**: Boundary values, empty inputs, limits
42
- - **Error Cases**: Invalid inputs, exceptions
43
- - **Integration Points**: External dependencies
44
-
45
- 3. **Generate Tests**
46
- - Follow project testing conventions
47
- - Use appropriate mocking strategies
48
- - Write clear, descriptive test names
49
- - Include setup and teardown
50
-
51
- 4. **Run and Verify**
52
- ```bash
53
- # Python
54
- pytest [test_file] -v
55
-
56
- # TypeScript
57
- pnpm test [test_file]
58
- ```
59
-
60
- ### For Coverage Analysis
61
-
62
- 1. **Run Coverage Report**
63
- ```bash
64
- # Python
65
- pytest --cov=src --cov-report=term-missing
66
-
67
- # TypeScript
68
- pnpm test --coverage
69
- ```
70
-
71
- 2. **Identify Gaps**
72
- - Find untested functions
73
- - Identify untested branches
74
- - Note missing edge cases
75
-
76
- 3. **Generate Missing Tests**
77
- - Prioritize by risk
78
- - Focus on critical paths
79
- - Add edge case coverage
80
-
81
- ## Test Templates
82
-
83
- ### Python (pytest)
84
-
85
- ```python
86
- import pytest
87
- from unittest.mock import Mock, patch
88
- from src.module import function_under_test
89
-
90
- class TestFunctionUnderTest:
91
- """Tests for function_under_test."""
92
-
93
- def test_with_valid_input_returns_expected(self):
94
- """Test that valid input produces expected output."""
95
- result = function_under_test("valid_input")
96
- assert result == "expected_output"
97
-
98
- def test_with_empty_input_returns_default(self):
99
- """Test that empty input returns default value."""
100
- result = function_under_test("")
101
- assert result == "default"
102
-
103
- def test_with_invalid_input_raises_error(self):
104
- """Test that invalid input raises ValueError."""
105
- with pytest.raises(ValueError, match="Invalid input"):
106
- function_under_test(None)
107
-
108
- @pytest.mark.parametrize("input_val,expected", [
109
- ("a", "result_a"),
110
- ("b", "result_b"),
111
- ("c", "result_c"),
112
- ])
113
- def test_parametrized_inputs(self, input_val, expected):
114
- """Test multiple input variations."""
115
- assert function_under_test(input_val) == expected
116
-
117
- @patch('src.module.external_service')
118
- def test_with_mocked_dependency(self, mock_service):
119
- """Test with mocked external dependency."""
120
- mock_service.call.return_value = "mocked_result"
121
- result = function_under_test("input")
122
- assert result == "expected_with_mock"
123
- mock_service.call.assert_called_once_with("input")
124
- ```
125
-
126
- ### TypeScript (vitest)
127
-
128
- ```typescript
129
- import { describe, it, expect, vi, beforeEach } from 'vitest';
130
- import { functionUnderTest } from './module';
131
-
132
- describe('functionUnderTest', () => {
133
- beforeEach(() => {
134
- vi.clearAllMocks();
135
- });
136
-
137
- it('should return expected output for valid input', () => {
138
- const result = functionUnderTest('valid_input');
139
- expect(result).toBe('expected_output');
140
- });
141
-
142
- it('should return default for empty input', () => {
143
- const result = functionUnderTest('');
144
- expect(result).toBe('default');
145
- });
146
-
147
- it('should throw error for invalid input', () => {
148
- expect(() => functionUnderTest(null)).toThrow('Invalid input');
149
- });
150
-
151
- it.each([
152
- ['a', 'result_a'],
153
- ['b', 'result_b'],
154
- ['c', 'result_c'],
155
- ])('should handle input %s correctly', (input, expected) => {
156
- expect(functionUnderTest(input)).toBe(expected);
157
- });
158
-
159
- it('should work with mocked dependency', async () => {
160
- vi.mock('./external-service', () => ({
161
- call: vi.fn().mockResolvedValue('mocked_result'),
162
- }));
163
-
164
- const result = await functionUnderTest('input');
165
- expect(result).toBe('expected_with_mock');
166
- });
167
- });
168
- ```
169
-
170
- ### React Component (Testing Library)
171
-
172
- ```typescript
173
- import { describe, it, expect, vi } from 'vitest';
174
- import { render, screen, fireEvent, waitFor } from '@testing-library/react';
175
- import { UserForm } from './UserForm';
176
-
177
- describe('UserForm', () => {
178
- it('should render form fields', () => {
179
- render(<UserForm onSubmit={vi.fn()} />);
180
-
181
- expect(screen.getByLabelText(/name/i)).toBeInTheDocument();
182
- expect(screen.getByLabelText(/email/i)).toBeInTheDocument();
183
- expect(screen.getByRole('button', { name: /submit/i })).toBeInTheDocument();
184
- });
185
-
186
- it('should call onSubmit with form data', async () => {
187
- const onSubmit = vi.fn();
188
- render(<UserForm onSubmit={onSubmit} />);
189
-
190
- fireEvent.change(screen.getByLabelText(/name/i), {
191
- target: { value: 'John' },
192
- });
193
- fireEvent.change(screen.getByLabelText(/email/i), {
194
- target: { value: 'john@example.com' },
195
- });
196
- fireEvent.click(screen.getByRole('button', { name: /submit/i }));
197
-
198
- await waitFor(() => {
199
- expect(onSubmit).toHaveBeenCalledWith({
200
- name: 'John',
201
- email: 'john@example.com',
202
- });
203
- });
204
- });
205
-
206
- it('should show validation error for invalid email', async () => {
207
- render(<UserForm onSubmit={vi.fn()} />);
208
-
209
- fireEvent.change(screen.getByLabelText(/email/i), {
210
- target: { value: 'invalid' },
211
- });
212
- fireEvent.blur(screen.getByLabelText(/email/i));
213
-
214
- expect(await screen.findByText(/invalid email/i)).toBeInTheDocument();
215
- });
216
- });
217
- ```
218
-
219
- ## Output
220
-
221
- ### Test Generation Report
222
-
223
- ```markdown
224
- ## Tests Generated
225
-
226
- ### Target
227
- `src/services/auth.ts` - AuthService class
228
-
229
- ### Tests Created
230
- - `tests/services/auth.test.ts`
231
-
232
- ### Test Cases
233
- 1. `login_with_valid_credentials_returns_token` - Happy path
234
- 2. `login_with_invalid_password_throws_error` - Error case
235
- 3. `login_with_nonexistent_user_throws_error` - Error case
236
- 4. `refresh_token_with_valid_token_returns_new_token` - Happy path
237
- 5. `refresh_token_with_expired_token_throws_error` - Edge case
238
- 6. `logout_invalidates_session` - Happy path
239
-
240
- ### Coverage Impact
241
- - Before: 65%
242
- - After: 88%
243
- - New lines covered: 42
244
-
245
- ### Run Tests
246
- ```bash
247
- pytest tests/services/auth.test.ts -v
248
- ```
249
-
250
- ### Notes
251
- - Mocked database calls using pytest-mock
252
- - Added edge case for token expiration
253
- - Consider adding integration tests for full auth flow
254
- ```
255
-
256
- ## Flags
257
-
258
- | Flag | Description | Example |
259
- |------|-------------|---------|
260
- | `--coverage` | Generate coverage-focused tests | `--coverage` |
261
- | `--type=[type]` | Test type to generate | `--type=integration` |
262
- | `--format=[fmt]` | Output format (concise/detailed) | `--format=concise` |
263
- | `--framework=[fw]` | Specify test framework | `--framework=vitest` |
264
- | `--tdd` | Generate TDD-style with failing tests first | `--tdd` |
265
- | `--edge-cases` | Focus on edge case coverage | `--edge-cases` |
266
-
267
- ### Flag Usage Examples
268
-
269
- ```bash
270
- /test --coverage src/services/
271
- /test --type=integration src/api/users.ts
272
- /test --tdd src/utils/validator.ts
273
- /test --edge-cases --framework=pytest src/models/user.py
274
- ```
275
-
276
- ### Test Types
277
-
278
- | Type | Description |
279
- |------|-------------|
280
- | `unit` | Isolated function tests (default) |
281
- | `integration` | Multi-component tests |
282
- | `e2e` | End-to-end workflow tests |
283
- | `snapshot` | Snapshot tests for UI |
284
- | `property` | Property-based testing |
285
-
286
- ### Framework Options
287
-
288
- | Framework | Language |
289
- |-----------|----------|
290
- | `pytest` | Python |
291
- | `vitest` | TypeScript/JavaScript |
292
- | `jest` | JavaScript |
293
- | `playwright` | E2E (any) |
294
-
295
- ## MCP Integration
296
-
297
- This command leverages MCP servers for enhanced testing:
298
-
299
- ### Browser tools - E2E Testing (Primary for UI)
300
- ```
301
- For E2E and browser tests:
302
- - Use Browser tools for cross-browser testing
303
- - Automate user flow verification
304
- - Capture screenshots for visual testing
305
- - Test on different device emulations
306
- ```
307
-
308
- ### Filesystem - Test File Management
309
- ```
310
- For test file operations:
311
- - Use list_dir to find test directories
312
- - Use grep_search to find existing tests
313
- - Use view_file to check test patterns
314
- - Use write_to_file to create new test files
315
- ```
316
-
317
- ### Web Search - Testing Best Practices
318
- ```
319
- For framework-specific testing:
320
- - Fetch current testing library docs
321
- - Get latest assertions and matchers
322
- - Find recommended testing patterns
323
- ```
324
-
325
- ### Memory - Test Patterns
326
- ```
327
- Recall testing context:
328
- - Remember project testing conventions
329
- - Recall mock patterns used previously
330
- - Store common test fixtures
331
- ```
332
-
333
- <!-- CUSTOMIZATION POINT -->
334
- ## Variations
335
-
336
- Modify behavior via CLAUDE.md:
337
- - Preferred test framework
338
- - Minimum coverage targets
339
- - Test naming conventions
340
- - Required test categories
341
-
342
-
343
- ## Gap Analysis Rule
344
- Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
@@ -1,35 +0,0 @@
1
- ---
2
- description: Verification, Testing, and Auditing
3
- ---
4
-
5
- # /verify Workflow
6
-
7
- This workflow audits the codebase for bugs, quality issues, and security vulnerabilities.
8
-
9
- ## Steps
10
-
11
- 1. **Static Analysis & Audit**
12
- - Use key: `code-auditing`
13
- - Goal: General code quality review and linting.
14
- - Output: List of code style issues or potential bugs.
15
-
16
- 2. **Security Scan**
17
- - Use key: `vulnerability-scanner`
18
- - Goal: Scan dependencies and code patterns for known vulnerabilities.
19
- - Instruction: Check `package.json` / `requirements.txt` against known CVE databases (simulated).
20
-
21
- 3. **SQL Injection Check**
22
- - Use key: `sql-injection-testing`
23
- - Goal: Specifically check database queries for injection risks.
24
-
25
- 4. **Test Verification**
26
- - Use key: `qa-engineer` / `test-fixing`
27
- - Goal: Run all tests and attempt to fix any failures.
28
- - Instruction: Ensure all tests pass before completing the workflow.
29
-
30
- ## Iron Rules
31
- 1. If there is anything unclear, ask the user instead of inventing new stuff. Unless the user explicitly tells the AI to invent or suggest ideas.
32
-
33
-
34
- ## Gap Analysis Rule
35
- Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Bennie Ng
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,147 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.initCommand = initCommand;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const chalk_1 = __importDefault(require("chalk"));
10
- const inquirer_1 = __importDefault(require("inquirer"));
11
- const index_js_1 = require("../utils/index.js");
12
- async function initCommand() {
13
- const globalDir = (0, index_js_1.getGlobalAgCelDir)();
14
- const globalWorkflowsDir = path_1.default.join(globalDir, 'workflows');
15
- console.log(chalk_1.default.blue('Initializing AgCel in current project...'));
16
- // 1. Check if global install exists
17
- if (!fs_1.default.existsSync(globalDir)) {
18
- console.error(chalk_1.default.red('Error: AgCel is not installed globally.'));
19
- console.error(chalk_1.default.yellow('Please run "npm install -g agcel" first.'));
20
- return;
21
- }
22
- if (!fs_1.default.existsSync(globalWorkflowsDir)) {
23
- console.error(chalk_1.default.red(`Error: Workflows directory not found in global install at ${globalWorkflowsDir}`));
24
- console.error(chalk_1.default.yellow('Please try reinstalling: npm install -g agcel'));
25
- return;
26
- }
27
- // 2. Setup local .agc and .agent directories
28
- const projectAgcDir = path_1.default.join(process.cwd(), '.agc');
29
- const projectSkillsDir = path_1.default.join(projectAgcDir, 'skills');
30
- const projectAgentDir = path_1.default.join(process.cwd(), '.agent');
31
- const projectWorkflowsDir = path_1.default.join(projectAgentDir, 'workflows');
32
- // Create .agc directory (Critical for isInitialized check)
33
- if (!fs_1.default.existsSync(projectAgcDir)) {
34
- console.log(chalk_1.default.blue('Creating .agc directory...'));
35
- fs_1.default.mkdirSync(projectAgcDir, { recursive: true });
36
- }
37
- // Copy skills from global install to .agc/skills
38
- const globalSkillsDir = path_1.default.join(globalDir, 'skills');
39
- if (fs_1.default.existsSync(globalSkillsDir)) {
40
- if (!fs_1.default.existsSync(projectSkillsDir)) {
41
- console.log(chalk_1.default.blue('Creating .agc/skills directory...'));
42
- fs_1.default.mkdirSync(projectSkillsDir, { recursive: true });
43
- }
44
- console.log(chalk_1.default.blue('Copying skills...'));
45
- try {
46
- fs_1.default.cpSync(globalSkillsDir, projectSkillsDir, { recursive: true });
47
- }
48
- catch (e) {
49
- console.error(chalk_1.default.red('Failed to copy skills.'), e);
50
- }
51
- }
52
- else {
53
- console.warn(chalk_1.default.yellow(`Warning: Global skills not found at ${globalSkillsDir}`));
54
- }
55
- try {
56
- if (!fs_1.default.existsSync(projectAgentDir)) {
57
- console.log(chalk_1.default.blue('Creating .agent directory...'));
58
- fs_1.default.mkdirSync(projectAgentDir, { recursive: true });
59
- }
60
- if (!fs_1.default.existsSync(projectWorkflowsDir)) {
61
- console.log(chalk_1.default.blue('Creating .agent/workflows directory...'));
62
- fs_1.default.mkdirSync(projectWorkflowsDir, { recursive: true });
63
- }
64
- // 3. Copy workflows
65
- console.log(chalk_1.default.blue('Copying workflows...'));
66
- const workflows = fs_1.default.readdirSync(globalWorkflowsDir);
67
- let overwriteAll = false;
68
- for (const workflow of workflows) {
69
- const srcPath = path_1.default.join(globalWorkflowsDir, workflow);
70
- const destPath = path_1.default.join(projectWorkflowsDir, workflow);
71
- if (fs_1.default.lstatSync(srcPath).isFile()) {
72
- const content = fs_1.default.readFileSync(srcPath, 'utf-8');
73
- if (fs_1.default.existsSync(destPath)) {
74
- const destContent = fs_1.default.readFileSync(destPath, 'utf-8');
75
- if (content !== destContent) {
76
- let action = 'skip';
77
- if (overwriteAll) {
78
- action = 'overwrite';
79
- }
80
- else {
81
- const answer = await inquirer_1.default.prompt([{
82
- type: 'expand',
83
- name: 'action',
84
- message: `Workflow ${workflow} already exists and is different.`,
85
- choices: [
86
- { key: 'y', name: 'Overwrite', value: 'overwrite' },
87
- { key: 'n', name: 'Skip', value: 'skip' },
88
- { key: 'a', name: 'Overwrite All', value: 'all' }
89
- ],
90
- default: 1
91
- }]);
92
- if (answer.action === 'all') {
93
- overwriteAll = true;
94
- action = 'overwrite';
95
- }
96
- else {
97
- action = answer.action;
98
- }
99
- }
100
- if (action === 'overwrite') {
101
- fs_1.default.writeFileSync(destPath, content);
102
- console.log(chalk_1.default.green(`Updated ${workflow}`));
103
- }
104
- else {
105
- console.log(chalk_1.default.yellow(`Skipped ${workflow}`));
106
- }
107
- }
108
- }
109
- else {
110
- fs_1.default.writeFileSync(destPath, content);
111
- console.log(chalk_1.default.green(`Created ${workflow}`));
112
- }
113
- }
114
- }
115
- console.log(chalk_1.default.green('AgCel project initialization complete!'));
116
- console.log(chalk_1.default.cyan('Workflows installed to .agent/workflows'));
117
- console.log(chalk_1.default.cyan('Skills installed to .agc/skills'));
118
- // 4. Update .gitignore
119
- updateGitIgnore(process.cwd());
120
- }
121
- catch (error) {
122
- throw error; // Re-throw to be caught by outer catch
123
- }
124
- }
125
- function updateGitIgnore(cwd) {
126
- const gitIgnorePath = path_1.default.join(cwd, '.gitignore');
127
- const entriesToAdd = ['.agc', '.agents', '.agent'];
128
- let content = '';
129
- if (fs_1.default.existsSync(gitIgnorePath)) {
130
- content = fs_1.default.readFileSync(gitIgnorePath, 'utf-8');
131
- }
132
- else {
133
- console.log(chalk_1.default.blue('Creating .gitignore...'));
134
- }
135
- const lines = content.split('\n').map(line => line.trim());
136
- const newEntries = [];
137
- for (const entry of entriesToAdd) {
138
- if (!lines.includes(entry)) {
139
- newEntries.push(entry);
140
- }
141
- }
142
- if (newEntries.length > 0) {
143
- const appendContent = (content && !content.endsWith('\n') ? '\n' : '') + newEntries.join('\n') + '\n';
144
- fs_1.default.appendFileSync(gitIgnorePath, appendContent);
145
- console.log(chalk_1.default.green(`Added ${newEntries.join(', ')} to .gitignore`));
146
- }
147
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.listCommand = listCommand;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const chalk_1 = __importDefault(require("chalk"));
10
- const index_js_1 = require("../utils/index.js");
11
- function listCommand(type) {
12
- const agCelDir = (0, index_js_1.getAgCelDir)();
13
- const globalDir = (0, index_js_1.getGlobalAgCelDir)();
14
- let targetDir = path_1.default.join(agCelDir, type);
15
- if (type === 'workflows') {
16
- targetDir = path_1.default.join(process.cwd(), '.agent', 'workflows');
17
- }
18
- if (!(0, index_js_1.isInitialized)() || !fs_1.default.existsSync(targetDir)) {
19
- console.log(chalk_1.default.yellow(`Project not initialized or ${type} not found locally. Listing global ${type}...`));
20
- targetDir = path_1.default.join(globalDir, type === 'workflows' ? 'workflows' : 'skills');
21
- }
22
- try {
23
- const items = fs_1.default.readdirSync(targetDir).filter(item => {
24
- if (type === 'skills') {
25
- return fs_1.default.statSync(path_1.default.join(targetDir, item)).isDirectory();
26
- }
27
- // Workflows are .md files
28
- return item.endsWith('.md') && fs_1.default.statSync(path_1.default.join(targetDir, item)).isFile();
29
- });
30
- if (items.length === 0) {
31
- console.log(chalk_1.default.yellow(`No ${type} found.`));
32
- }
33
- else {
34
- console.log(chalk_1.default.blue(`Available ${type}:`));
35
- items.forEach(item => {
36
- console.log(`- ${item}`);
37
- });
38
- }
39
- }
40
- catch (error) {
41
- console.error(chalk_1.default.red(`Failed to list ${type}:`), error);
42
- }
43
- }
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.uninstallCommand = uninstallCommand;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const os_1 = __importDefault(require("os"));
10
- const chalk_1 = __importDefault(require("chalk"));
11
- const inquirer_1 = __importDefault(require("inquirer"));
12
- const child_process_1 = require("child_process");
13
- const index_js_1 = require("../utils/index.js");
14
- async function uninstallCommand() {
15
- const globalDir = (0, index_js_1.getGlobalAgCelDir)();
16
- const mcpConfigPath = path_1.default.join(os_1.default.homedir(), '.gemini', 'antigravity', 'mcp_config.json');
17
- console.log(chalk_1.default.blue('Cleaning up AgCel configuration and data...'));
18
- // 1. Remove from MCP Config
19
- if (fs_1.default.existsSync(mcpConfigPath)) {
20
- try {
21
- const content = fs_1.default.readFileSync(mcpConfigPath, 'utf-8');
22
- const mcpConfig = JSON.parse(content);
23
- if (mcpConfig.mcpServers && mcpConfig.mcpServers['agcel']) {
24
- delete mcpConfig.mcpServers['agcel'];
25
- fs_1.default.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
26
- console.log(chalk_1.default.green(`Removed AgCel from ${mcpConfigPath}`));
27
- }
28
- }
29
- catch (error) {
30
- console.error(chalk_1.default.red('Failed to update MCP config:'), error);
31
- }
32
- }
33
- // 2. Remove Global Data Directory (~/.agcel)
34
- if (fs_1.default.existsSync(globalDir)) {
35
- const answer = await inquirer_1.default.prompt([{
36
- type: 'confirm',
37
- name: 'removeData',
38
- message: `Do you want to remove the global data directory at ${globalDir}? (this deletes global logs and skills)`,
39
- default: true
40
- }]);
41
- if (answer.removeData) {
42
- try {
43
- fs_1.default.rmSync(globalDir, { recursive: true, force: true });
44
- console.log(chalk_1.default.green(`Removed global directory at ${globalDir}`));
45
- }
46
- catch (error) {
47
- console.error(chalk_1.default.red(`Failed to remove global directory. You may need to delete it manually: sudo rm -rf ${globalDir}`));
48
- }
49
- }
50
- }
51
- // 3. Prompt for npm uninstall
52
- const npmAnswer = await inquirer_1.default.prompt([{
53
- type: 'confirm',
54
- name: 'npmUninstall',
55
- message: 'Do you want to run "npm uninstall -g agcel" now?',
56
- default: true
57
- }]);
58
- if (npmAnswer.npmUninstall) {
59
- try {
60
- console.log(chalk_1.default.blue('Running "npm uninstall -g agcel"...'));
61
- (0, child_process_1.execSync)('npm uninstall -g agcel', { stdio: 'inherit' });
62
- console.log(chalk_1.default.green('AgCel package uninstalled successfully.'));
63
- }
64
- catch (error) {
65
- console.error(chalk_1.default.red('Failed to uninstall npm package via CLI.'));
66
- console.error(chalk_1.default.yellow('Please run manually: npm uninstall -g agcel'));
67
- }
68
- }
69
- console.log(chalk_1.default.green('\nAgCel cleanup complete.'));
70
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AG_CEL_CONFIG_FILE = exports.AG_CEL_DIR = void 0;
7
- exports.getPackageRoot = getPackageRoot;
8
- exports.getAgCelDir = getAgCelDir;
9
- exports.getGlobalAgCelDir = getGlobalAgCelDir;
10
- exports.isInitialized = isInitialized;
11
- const fs_1 = __importDefault(require("fs"));
12
- const path_1 = __importDefault(require("path"));
13
- const os_1 = __importDefault(require("os"));
14
- // In CJS, __dirname is available globally
15
- function getPackageRoot() {
16
- return path_1.default.resolve(__dirname, '..', '..');
17
- }
18
- exports.AG_CEL_DIR = '.agc';
19
- exports.AG_CEL_CONFIG_FILE = 'config.json';
20
- function getAgCelDir() {
21
- return path_1.default.join(process.cwd(), exports.AG_CEL_DIR);
22
- }
23
- function getGlobalAgCelDir() {
24
- return path_1.default.join(os_1.default.homedir(), '.agcel');
25
- }
26
- function isInitialized() {
27
- return fs_1.default.existsSync(getAgCelDir());
28
- }