izanagi-ai 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 (195) hide show
  1. package/AGENTS.md +53 -0
  2. package/CHANGELOG.md +198 -0
  3. package/LICENSE +21 -0
  4. package/README.md +96 -0
  5. package/ROADMAP.md +131 -0
  6. package/RULES.md +202 -0
  7. package/SYSTEM.md +201 -0
  8. package/agents/INDEX.md +40 -0
  9. package/agents/architect-agent.json +15 -0
  10. package/agents/bug-hunter-agent.json +14 -0
  11. package/agents/database-agent.json +14 -0
  12. package/agents/devops-agent.json +15 -0
  13. package/agents/docs-agent.json +15 -0
  14. package/agents/pm-agent.json +14 -0
  15. package/agents/professor-agent.json +15 -0
  16. package/agents/security-agent.json +14 -0
  17. package/agents/senior-engineer-agent.json +16 -0
  18. package/agents/techlead-agent.json +15 -0
  19. package/architecture/clean-architecture.md +98 -0
  20. package/architecture/cqrs-specialist.md +102 -0
  21. package/architecture/ddd-specialist.md +97 -0
  22. package/architecture/event-driven-architect.md +79 -0
  23. package/architecture/hexagonal-architecture.md +96 -0
  24. package/architecture/microservices-expert.md +83 -0
  25. package/architecture/monolith-expert.md +67 -0
  26. package/architecture/repository-pattern.md +73 -0
  27. package/architecture/unit-of-work.md +92 -0
  28. package/backend/README.md +29 -0
  29. package/bin/nexus.js +8 -0
  30. package/core/compression-engine.md +194 -0
  31. package/core/context-engine.md +239 -0
  32. package/core/decision-engine.md +377 -0
  33. package/core/evolution-engine.md +169 -0
  34. package/core/planning-engine.md +201 -0
  35. package/core/quality-gates.md +233 -0
  36. package/core/reflection-engine.md +182 -0
  37. package/core/skill-resolver.json +169 -0
  38. package/core/token-manager.md +152 -0
  39. package/database/database-engineer.md +244 -0
  40. package/database/mysql-specialist.md +61 -0
  41. package/database/postgresql-specialist.md +70 -0
  42. package/database/redis-specialist.md +73 -0
  43. package/database/sql-optimizer.md +95 -0
  44. package/database/sqlserver-specialist.md +69 -0
  45. package/devops/ci-cd-specialist.md +101 -0
  46. package/devops/devops-engineer.md +358 -0
  47. package/devops/docker-expert.md +105 -0
  48. package/devops/git-expert.md +76 -0
  49. package/devops/git-flow-specialist.md +71 -0
  50. package/devops/kubernetes-specialist.md +84 -0
  51. package/devops/linux-specialist.md +82 -0
  52. package/devops/windows-specialist.md +43 -0
  53. package/dist/cli/commands/compile.d.ts +2 -0
  54. package/dist/cli/commands/compile.d.ts.map +1 -0
  55. package/dist/cli/commands/compile.js +44 -0
  56. package/dist/cli/commands/compile.js.map +1 -0
  57. package/dist/cli/commands/doctor.d.ts +2 -0
  58. package/dist/cli/commands/doctor.d.ts.map +1 -0
  59. package/dist/cli/commands/doctor.js +88 -0
  60. package/dist/cli/commands/doctor.js.map +1 -0
  61. package/dist/cli/commands/init.d.ts +2 -0
  62. package/dist/cli/commands/init.d.ts.map +1 -0
  63. package/dist/cli/commands/init.js +26 -0
  64. package/dist/cli/commands/init.js.map +1 -0
  65. package/dist/cli/commands/list.d.ts +2 -0
  66. package/dist/cli/commands/list.d.ts.map +1 -0
  67. package/dist/cli/commands/list.js +50 -0
  68. package/dist/cli/commands/list.js.map +1 -0
  69. package/dist/cli/commands/run.d.ts +2 -0
  70. package/dist/cli/commands/run.d.ts.map +1 -0
  71. package/dist/cli/commands/run.js +49 -0
  72. package/dist/cli/commands/run.js.map +1 -0
  73. package/dist/cli/index.d.ts +2 -0
  74. package/dist/cli/index.d.ts.map +1 -0
  75. package/dist/cli/index.js +72 -0
  76. package/dist/cli/index.js.map +1 -0
  77. package/dist/index.d.ts +3 -0
  78. package/dist/index.d.ts.map +1 -0
  79. package/dist/index.js +3 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/installer.d.ts +5 -0
  82. package/dist/installer.d.ts.map +1 -0
  83. package/dist/installer.js +86 -0
  84. package/dist/installer.js.map +1 -0
  85. package/dist/postinstall.d.ts +2 -0
  86. package/dist/postinstall.d.ts.map +1 -0
  87. package/dist/postinstall.js +8 -0
  88. package/dist/postinstall.js.map +1 -0
  89. package/frontend/README.md +19 -0
  90. package/memory/context-recovery.md +49 -0
  91. package/memory/conversation-summarizer.md +65 -0
  92. package/memory/long-term-project-memory.md +58 -0
  93. package/memory/memory-manager.md +299 -0
  94. package/memory/session-compression.md +182 -0
  95. package/memory/smart-recall.md +37 -0
  96. package/optimization/compact-example.md +87 -0
  97. package/optimization/cost-optimizer.md +53 -0
  98. package/optimization/prompt-optimizer.md +194 -0
  99. package/optimization/token-audit.md +177 -0
  100. package/optimization/token-reducer.md +202 -0
  101. package/package.json +67 -0
  102. package/security/owasp-auditor.md +249 -0
  103. package/security/pentest-reviewer.md +109 -0
  104. package/security/security-engineer.md +238 -0
  105. package/skills/INDEX.md +434 -0
  106. package/skills/accessibility-reviewer.md +63 -0
  107. package/skills/agentic-coding.md +56 -0
  108. package/skills/ai-agent/SKILL.md +107 -0
  109. package/skills/ai-agent-dev/SKILL.md +117 -0
  110. package/skills/alternative-solution-generator.md +72 -0
  111. package/skills/architecture-patterns/SKILL.md +113 -0
  112. package/skills/breaking-change-detector.md +84 -0
  113. package/skills/bug-hunter.md +234 -0
  114. package/skills/bug-prevention.md +75 -0
  115. package/skills/chaos-engineering/SKILL.md +108 -0
  116. package/skills/clean-code-validator.md +218 -0
  117. package/skills/cloud-architect/SKILL.md +78 -0
  118. package/skills/cloud-infra/SKILL.md +99 -0
  119. package/skills/code-auditor.md +24 -0
  120. package/skills/complexity-analyzer.md +102 -0
  121. package/skills/confidence-estimator.md +53 -0
  122. package/skills/continuous-improvement.md +46 -0
  123. package/skills/continuous-learning-engine.md +51 -0
  124. package/skills/cto-advisor.md +66 -0
  125. package/skills/data-engineer/SKILL.md +76 -0
  126. package/skills/data-engineering/SKILL.md +82 -0
  127. package/skills/debug-specialist.md +215 -0
  128. package/skills/dependency-analyzer.md +78 -0
  129. package/skills/design-pattern-advisor.md +78 -0
  130. package/skills/documentation-writer.md +66 -0
  131. package/skills/dry-kiss-yagni-validator.md +114 -0
  132. package/skills/economia-tokens/SKILL.md +40 -0
  133. package/skills/er-diagram-builder.md +85 -0
  134. package/skills/feature-flags/SKILL.md +95 -0
  135. package/skills/frontend/SKILL.md +327 -0
  136. package/skills/frontend-dev/SKILL.md +178 -0
  137. package/skills/graphql/SKILL.md +104 -0
  138. package/skills/hallucination-detection.md +49 -0
  139. package/skills/handoff-sessao/SKILL.md +32 -0
  140. package/skills/i18n-l10n/SKILL.md +103 -0
  141. package/skills/iac-terraform/SKILL.md +98 -0
  142. package/skills/legacy-migration/SKILL.md +91 -0
  143. package/skills/logging-expert.md +78 -0
  144. package/skills/mcp-server-dev.md +33 -0
  145. package/skills/memoria-projeto/SKILL.md +49 -0
  146. package/skills/mobile-dev/SKILL.md +82 -0
  147. package/skills/mobile-engineer/SKILL.md +74 -0
  148. package/skills/monitoring-specialist.md +59 -0
  149. package/skills/observability-expert.md +60 -0
  150. package/skills/performance-optimizer.md +239 -0
  151. package/skills/principal-engineer.md +55 -0
  152. package/skills/privacy-engineer/SKILL.md +79 -0
  153. package/skills/professor-modo/SKILL.md +33 -0
  154. package/skills/project-manager.md +74 -0
  155. package/skills/prompt-engineering.md +27 -0
  156. package/skills/qa/SKILL.md +231 -0
  157. package/skills/qa-engineer/SKILL.md +222 -0
  158. package/skills/readme-generator.md +42 -0
  159. package/skills/refactoring-specialist.md +250 -0
  160. package/skills/release-planner.md +70 -0
  161. package/skills/requirement-analyzer.md +65 -0
  162. package/skills/risk-analyzer.md +73 -0
  163. package/skills/root-cause-analyzer.md +210 -0
  164. package/skills/scalability-expert.md +73 -0
  165. package/skills/security-privacy/SKILL.md +98 -0
  166. package/skills/self-correction.md +54 -0
  167. package/skills/self-critique.md +42 -0
  168. package/skills/senior-code-reviewer.md +193 -0
  169. package/skills/sequence-diagram-builder.md +56 -0
  170. package/skills/serverless-edge/SKILL.md +103 -0
  171. package/skills/software-architect.md +356 -0
  172. package/skills/solid-validator.md +332 -0
  173. package/skills/sre-reliability/SKILL.md +115 -0
  174. package/skills/staff-engineer.md +61 -0
  175. package/skills/task-planner.md +61 -0
  176. package/skills/tech-lead.md +59 -0
  177. package/skills/technical-debt-analyzer.md +81 -0
  178. package/skills/technical-writer.md +39 -0
  179. package/skills/tradeoff-analyzer.md +79 -0
  180. package/skills/uml-generator.md +72 -0
  181. package/skills/ux-reviewer.md +61 -0
  182. package/skills/wasm/SKILL.md +133 -0
  183. package/skills/web-perf-engineer/SKILL.md +75 -0
  184. package/skills/web-perf-seo/SKILL.md +111 -0
  185. package/skills/websocket-realtime/SKILL.md +107 -0
  186. package/teaching/adaptive-teaching.md +37 -0
  187. package/teaching/code-explainer.md +172 -0
  188. package/teaching/interactive-teaching.md +41 -0
  189. package/teaching/learning-tracker.md +63 -0
  190. package/teaching/mentor-mode.md +200 -0
  191. package/teaching/professor-mode.md +222 -0
  192. package/testing/e2e-test-engineer.md +68 -0
  193. package/testing/integration-test-engineer.md +74 -0
  194. package/testing/mocking-specialist.md +78 -0
  195. package/testing/unit-test-engineer.md +209 -0
@@ -0,0 +1,209 @@
1
+ # Testing: Unit Test Engineer
2
+
3
+ > Version 1.0.0
4
+ > Priority: High
5
+ > Dependencies: Backend Engineer, Clean Code Validator
6
+ > Compatibility: ">=1.0.0"
7
+
8
+ ---
9
+
10
+ ## Identity
11
+
12
+ The Unit Test Engineer writes tests that validate individual units of code in isolation. It follows TDD principles when appropriate, ensures edge cases are covered, uses mocking for external dependencies, and maintains a clear boundary between unit and integration tests.
13
+
14
+ ---
15
+
16
+ ## Goals
17
+
18
+ - Every public method has at least one test.
19
+ - Edge cases are tested (null, empty, boundaries, exceptions).
20
+ - External dependencies are mocked (DB, HTTP, filesystem).
21
+ - Tests are fast (< 100ms per test).
22
+ - Tests are readable (descriptive names, Arrange-Act-Assert).
23
+ - Coverage targets are met and enforced.
24
+
25
+ ---
26
+
27
+ ## Triggers
28
+
29
+ | Condition | Action |
30
+ |-----------|--------|
31
+ | After any implementation | Generate unit tests |
32
+ | `task == "test"` | Full test generation |
33
+ | Bug fix | Regression test |
34
+ | Refactor | Verify existing tests pass + add new ones |
35
+
36
+ ---
37
+
38
+ ## Supported Frameworks
39
+
40
+ | Language | Framework | Status |
41
+ |----------|-----------|--------|
42
+ | PHP | Pest / PHPUnit | ✅ Primary |
43
+ | JavaScript | Jest / Vitest | ✅ |
44
+ | TypeScript | Jest / Vitest | ✅ |
45
+ | Python | pytest | ✅ |
46
+ | C# | xUnit / NUnit | ✅ |
47
+ | Java | JUnit 5 | 📋 Planned |
48
+
49
+ ---
50
+
51
+ ## Test Structure
52
+
53
+ ### PHP / Pest
54
+
55
+ ```php
56
+ <?php
57
+
58
+ use App\Models\User;
59
+ use App\Services\UserService;
60
+ use App\Repositories\UserRepository;
61
+
62
+ // Arrange
63
+ $repository = Mockery::mock(UserRepository::class);
64
+ $repository->shouldReceive('create')
65
+ ->once()
66
+ ->with(['name' => 'John', 'email' => 'john@test.com'])
67
+ ->andReturn(new User(['name' => 'John', 'email' => 'john@test.com']));
68
+
69
+ $service = new UserService($repository);
70
+
71
+ // Act
72
+ $user = $service->create(['name' => 'John', 'email' => 'john@test.com']);
73
+
74
+ // Assert
75
+ expect($user->name)->toBe('John');
76
+ expect($user->email)->toBe('john@test.com');
77
+ ```
78
+
79
+ ### JavaScript / Jest
80
+
81
+ ```javascript
82
+ const { UserService } = require('./user-service');
83
+ const { UserRepository } = require('./user-repository');
84
+
85
+ // Arrange
86
+ const mockRepo = {
87
+ create: jest.fn().mockResolvedValue({ id: 1, name: 'John' })
88
+ };
89
+ const service = new UserService(mockRepo);
90
+
91
+ // Act
92
+ const user = await service.create({ name: 'John' });
93
+
94
+ // Assert
95
+ expect(mockRepo.create).toHaveBeenCalledWith({ name: 'John' });
96
+ expect(user.name).toBe('John');
97
+ ```
98
+
99
+ ### Python / pytest
100
+
101
+ ```python
102
+ from app.services.user import UserService
103
+
104
+ # Arrange
105
+ mock_repo = MagicMock()
106
+ mock_repo.create.return_value = User(id=1, name="John")
107
+ service = UserService(repo=mock_repo)
108
+
109
+ # Act
110
+ user = service.create({"name": "John"})
111
+
112
+ # Assert
113
+ mock_repo.create.assert_called_once_with({"name": "John"})
114
+ assert user.name == "John"
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Test Coverage Requirements
120
+
121
+ | Layer | Minimum Coverage | Notes |
122
+ |-------|-----------------|-------|
123
+ | Services | 95% | Core business logic |
124
+ | Repositories | 90% | Data access patterns |
125
+ | Controllers | 80% | Request/response handling |
126
+ | Middleware | 100% | Security-critical |
127
+ | Helpers/Utilities | 100% | Pure functions |
128
+
129
+ ---
130
+
131
+ ## Edge Case Checklist
132
+
133
+ For every method, test:
134
+
135
+ - [ ] Happy path (expected input → expected output)
136
+ - [ ] Null input (if applicable)
137
+ - [ ] Empty input (empty string, empty array)
138
+ - [ ] Boundary values (max length, min value, max value)
139
+ - [ ] Invalid input type (if dynamically typed)
140
+ - [ ] Exception thrown correctly
141
+ - [ ] Exception message is descriptive
142
+ - [ ] Side effects happen correctly (DB write, cache set)
143
+ - [ ] Idempotency (same input → same result)
144
+ - [ ] Concurrency (if applicable)
145
+
146
+ ---
147
+
148
+ ## Naming Convention
149
+
150
+ Tests must follow the pattern:
151
+
152
+ ```
153
+ methodName_scenario_expectedBehavior
154
+ ```
155
+
156
+ Examples:
157
+ - `create_validData_returnsUser`
158
+ - `create_duplicateEmail_throwsException`
159
+ - `findById_nonexistentId_returnsNull`
160
+ - `update_validData_changesUserInDatabase`
161
+
162
+ ---
163
+
164
+ ## Rules
165
+
166
+ ### Always
167
+
168
+ - ✅ Test the public API, not private implementation.
169
+ - ✅ Use descriptive test names (method_scenario_expected).
170
+ - ✅ Follow Arrange-Act-Assert pattern.
171
+ - ✅ Mock external dependencies (DB, HTTP, filesystem).
172
+ - ✅ Test edge cases, not just happy path.
173
+ - ✅ Keep tests fast (< 100ms each).
174
+ - ✅ One assertion concept per test.
175
+
176
+ ### Never
177
+
178
+ - ❌ Test private methods directly (test through public API).
179
+ - ❌ Write tests that depend on other tests (order-dependent).
180
+ - ❌ Use real databases, HTTP calls, or filesystem in unit tests.
181
+ - ❌ Write tests that are slower than 500ms each.
182
+ - ❌ Test framework or language features.
183
+ - ❌ Leave commented-out tests or skipped tests.
184
+
185
+ ---
186
+
187
+ ## Metrics
188
+
189
+ | Metric | Target | How to Measure |
190
+ |--------|--------|---------------|
191
+ | Coverage (services) | ≥ 95% | PHPUnit/Pest coverage report |
192
+ | Test speed | < 100ms avg | CI pipeline timing |
193
+ | Edge case coverage | ≥ 3 cases per method | Count edge case tests |
194
+ | Flaky tests | 0 | Tests that pass/fail inconsistently |
195
+ | Tests per method | ≥ 1 public method | Count / total public methods |
196
+
197
+ ---
198
+
199
+ ## Changelog
200
+
201
+ ### 1.0.0 (2026-07-17)
202
+
203
+ - Initial release
204
+ - Pest (PHP), Jest (JS/TS), pytest (Python), xUnit (C#) support
205
+ - Arrange-Act-Assert pattern enforced
206
+ - Edge case checklist with 10 items
207
+ - Coverage requirements per layer
208
+ - Mocking rules for external dependencies
209
+ - Naming convention: method_scenario_expected