@oalacea/daemon 0.5.0 → 0.5.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 (38) hide show
  1. package/CHANGELOG.md +46 -38
  2. package/LICENSE +23 -23
  3. package/README.md +147 -141
  4. package/agents/deps-analyzer.js +366 -366
  5. package/agents/detector.js +570 -570
  6. package/agents/fix-engine.js +305 -305
  7. package/agents/lighthouse-scanner.js +405 -405
  8. package/agents/perf-analyzer.js +294 -294
  9. package/agents/perf-front-analyzer.js +229 -229
  10. package/agents/test-generator.js +387 -387
  11. package/agents/test-runner.js +318 -318
  12. package/bin/Dockerfile +75 -74
  13. package/bin/cli.js +449 -449
  14. package/lib/config.js +250 -250
  15. package/lib/docker.js +207 -207
  16. package/lib/reporter.js +297 -297
  17. package/package.json +34 -34
  18. package/prompts/DEPS_EFFICIENCY.md +558 -558
  19. package/prompts/E2E.md +491 -491
  20. package/prompts/EXECUTE.md +1060 -1060
  21. package/prompts/INTEGRATION_API.md +484 -484
  22. package/prompts/INTEGRATION_DB.md +425 -425
  23. package/prompts/PERF_API.md +433 -433
  24. package/prompts/PERF_DB.md +430 -430
  25. package/prompts/PERF_FRONT.md +357 -357
  26. package/prompts/REMEDIATION.md +482 -482
  27. package/prompts/UNIT.md +260 -260
  28. package/scripts/dev.js +106 -106
  29. package/templates/README.md +38 -38
  30. package/templates/k6/load-test.js +54 -54
  31. package/templates/playwright/e2e.spec.ts +61 -61
  32. package/templates/vitest/angular-component.test.ts +38 -38
  33. package/templates/vitest/api.test.ts +51 -51
  34. package/templates/vitest/component.test.ts +27 -27
  35. package/templates/vitest/hook.test.ts +36 -36
  36. package/templates/vitest/solid-component.test.ts +34 -34
  37. package/templates/vitest/svelte-component.test.ts +33 -33
  38. package/templates/vitest/vue-component.test.ts +39 -39
package/CHANGELOG.md CHANGED
@@ -1,38 +1,46 @@
1
- # Daemon - Changelog
2
-
3
- ## [1.0.0-alpha] - 2025-02-07
4
-
5
- ### Added
6
- - Initial release
7
- - Auto-detection for frameworks (Next.js, Remix, SvelteKit, Vite, etc.)
8
- - Database detection (Prisma, Drizzle, Neon, Supabase, local Postgres)
9
- - Unit test generation (components, hooks, utils)
10
- - Integration test templates (API routes, DB with transaction rollback)
11
- - E2E test templates (Playwright)
12
- - Performance test templates (k6)
13
- - Dependency efficiency analysis (TanStack Router, React Query, Prisma, Zustand, React Compiler)
14
- - Docker container with all testing tools
15
- - Cross-platform support (Linux, macOS, Windows)
16
-
17
- ### Features
18
- - **Unit Tests**: Component, hook, and utility testing with Vitest
19
- - **Integration Tests**: API route and database testing with Prisma
20
- - **E2E Tests**: User flow testing with Playwright
21
- - **Performance Tests**: API load testing with k6
22
- - **Analysis**: Dependency pattern analysis and recommendations
23
- - **Remediation**: Automatic test failure categorization and fix suggestions
24
-
25
- ### Tools Included
26
- - Vitest
27
- - @testing-library/react
28
- - Playwright
29
- - k6
30
- - supertest
31
- - MSW
32
- - @prisma/cli
33
-
34
- ### Documentation
35
- - Comprehensive prompt system for AI agent
36
- - Test templates for all test types
37
- - Fix engine for common test failures
38
- - Performance analysis and reporting
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - Additional framework support
12
+ - Enhanced test patterns
13
+ - Performance benchmarking comparisons
14
+ - CI/CD integration templates
15
+
16
+ ## [1.0.0] - 2026-02-09
17
+
18
+ ### Added
19
+ - Initial stable release of Daemon - AI-powered automated test generation
20
+ - CLI tool: `npx @oalacea/daemon@latest`
21
+ - Automated framework detection (Next.js, Remix, SvelteKit, Vite, etc.)
22
+ - Database detection (Prisma, Drizzle, Neon, Supabase, local Postgres)
23
+ - Unit test generation (components, hooks, utils, validators, stores)
24
+ - Integration test generation (API routes, database operations with transaction rollback)
25
+ - E2E test generation with Playwright (user flows, forms, navigation)
26
+ - Backend performance testing with k6 (API load testing, DB benchmarks)
27
+ - Frontend performance testing with Lighthouse (Core Web Vitals, LCP, FID, CLS)
28
+ - Dependency analysis (TanStack Router, React Query, Prisma, Zustand, React Compiler)
29
+ - Docker toolkit with pre-configured tools (~500 MB)
30
+ - Vitest, Testing Library (React, Vue, Svelte, Solid), Happy DOM
31
+ - Playwright (Chromium) for E2E testing
32
+ - k6 for load testing
33
+ - Lighthouse for performance metrics
34
+ - Comprehensive reporting with coverage and performance data
35
+ - Cross-platform support (Linux, macOS, Windows)
36
+ - Automatic test failure categorization and fix suggestions
37
+ - MIT License
38
+ - Complete documentation
39
+
40
+ ## [1.0.0-alpha] - 2025-02-07
41
+
42
+ ### Added
43
+ - Initial alpha release
44
+ - Core framework and database detection
45
+ - Basic test generation templates
46
+ - Docker container setup
package/LICENSE CHANGED
@@ -1,23 +1,23 @@
1
- # Daemon - License
2
-
3
- MIT License
4
-
5
- Copyright (c) 2025 Yanis
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- SOFTWARE.
1
+ # Daemon - License
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2025 Yanis
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md CHANGED
@@ -1,141 +1,147 @@
1
- # Daemon
2
-
3
- AI-powered automated test generation and remediation for web applications.
4
-
5
- ## Quick Start
6
-
7
- ```bash
8
- # From your project directory
9
- npx --yes @oalacea/daemon@latest
10
- ```
11
-
12
- First run installs the testing toolkit (~500 MB Docker image, takes 2-3 minutes).
13
-
14
- ## What You Need
15
-
16
- - **Docker** - [Install](https://docs.docker.com/get-docker/)
17
- - **AI coding agent** - Claude Code, Cursor, Windsurf, Aider, Codex...
18
-
19
- ## Features
20
-
21
- | Category | Features |
22
- |----------|----------|
23
- | **Unit Tests** | Components, hooks, utils, validators, stores |
24
- | **Integration Tests** | API routes, database operations (with transaction rollback) |
25
- | **E2E Tests** | User flows, form interactions, navigation (Playwright) |
26
- | **Backend Performance** | API load testing (k6), DB query benchmarks |
27
- | **Frontend Performance** | Core Web Vitals, LCP, FID, CLS (Lighthouse) |
28
- | **Dependency Analysis** | TanStack Router, React Query, Prisma, Zustand, React Compiler |
29
-
30
- ## How It Works
31
-
32
- 1. **Analyze** - Auto-detects your framework, database, and existing tests
33
- 2. **Generate** - Creates tests based on your code patterns
34
- 3. **Execute** - Runs tests inside Docker container
35
- 4. **Fix** - Analyzes failures and applies corrections
36
- 5. **Report** - Provides comprehensive coverage and performance report
37
-
38
- ## Included Tools
39
-
40
- The Docker toolkit includes:
41
-
42
- | Category | Tools |
43
- |----------|-------|
44
- | Testing | Vitest, @testing-library/react, @testing-library/vue, @testing-library/svelte, @solidjs/testing-library, happy-dom |
45
- | E2E | Playwright (Chromium) |
46
- | Backend Performance | k6 (load testing) |
47
- | Frontend Performance | Lighthouse (Core Web Vitals) |
48
- | Utilities | supertest, MSW, @prisma/cli |
49
-
50
- ## Framework Support
51
-
52
- | Framework | Detection | Status |
53
- |-----------|-----------|--------|
54
- | Next.js | | Full support |
55
- | Remix | ✅ | Full support |
56
- | SvelteKit | ✅ | Full support |
57
- | Nuxt | ✅ | Full support |
58
- | Astro | | Full support |
59
- | Gatsby | ✅ | Full support |
60
- | Vite | ✅ | Full support |
61
- | Solid | ✅ | Full support |
62
- | Vue | ✅ | Full support |
63
- | Svelte | ✅ | Full support |
64
- | Angular | ✅ | Full support |
65
- | React Native | ✅ | Basic support |
66
- | Express | ✅ | Full support |
67
- | NestJS | ✅ | Full support |
68
-
69
- ## Output Example
70
-
71
- ```
72
- Unit Tests: 45 created, 42 passing, 3 fixed
73
- Integration: 12 created, 12 passing
74
- ✓ E2E: 8 created, 7 passing, 1 requires manual review
75
- Backend Performance: API p95 = 145ms (PASS)
76
- ✓ Frontend Performance: Lighthouse 85/100 (PASS)
77
- - LCP: 2.1s ✓ (target: <2.5s)
78
- - FID: 56ms (target: <100ms)
79
- - CLS: 0.05 (target: <0.1)
80
- Dependencies: 3 improvements suggested
81
-
82
- ## Summary
83
- Total Tests: 245
84
- Passing: 238
85
- Failing: 2 (requires manual review)
86
- Coverage: 84%
87
- ```
88
-
89
- ## Safety
90
-
91
- - Always use transaction rollback for database tests
92
- - Never modify production data
93
- - Git integration for safe rollbacks
94
- - Non-destructive testing modes available
95
-
96
- ## Troubleshooting
97
-
98
- ### Rebuild toolkit image
99
-
100
- ```bash
101
- docker rm -f daemon-tools
102
- docker rmi daemon-tools
103
- npx --yes @oalacea/daemon@latest
104
- ```
105
-
106
- ### Run specific test
107
-
108
- ```bash
109
- docker exec daemon-tools npm test -- Button.test.ts
110
- ```
111
-
112
- ### Debug test
113
-
114
- ```bash
115
- docker exec daemon-tools npm test -- Button.test.ts --reporter=verbose
116
- ```
117
-
118
- ### Run Lighthouse audit
119
-
120
- ```bash
121
- # Quick performance check
122
- docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --output=json --output=html
123
-
124
- # Mobile audit
125
- docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --form-factor=mobile
126
-
127
- # All categories
128
- docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --only-categories=performance,accessibility,best-practices,seo
129
- ```
130
-
131
- ## Related
132
-
133
- - **Guardian** - Security testing package: `npx @oalacea/guardian`
134
-
135
- ## License
136
-
137
- MIT - Use at your own risk.
138
-
139
- ## Credits
140
-
141
- Inspired by the need for comprehensive automated testing in modern web development.
1
+ # Daemon
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![GitHub release](https://img.shields.io/github/v/release/Pamacea/daemon)](https://github.com/Pamacea/daemon/releases/latest)
5
+ [![CI](https://github.com/Pamacea/daemon/actions/workflows/ci.yml/badge.svg)](https://github.com/Pamacea/daemon/actions)
6
+
7
+
8
+
9
+ AI-powered automated test generation and remediation for web applications.
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # From your project directory
15
+ npx --yes @oalacea/daemon@latest
16
+ ```
17
+
18
+ First run installs the testing toolkit (~500 MB Docker image, takes 2-3 minutes).
19
+
20
+ ## What You Need
21
+
22
+ - **Docker** - [Install](https://docs.docker.com/get-docker/)
23
+ - **AI coding agent** - Claude Code, Cursor, Windsurf, Aider, Codex...
24
+
25
+ ## Features
26
+
27
+ | Category | Features |
28
+ |----------|----------|
29
+ | **Unit Tests** | Components, hooks, utils, validators, stores |
30
+ | **Integration Tests** | API routes, database operations (with transaction rollback) |
31
+ | **E2E Tests** | User flows, form interactions, navigation (Playwright) |
32
+ | **Backend Performance** | API load testing (k6), DB query benchmarks |
33
+ | **Frontend Performance** | Core Web Vitals, LCP, FID, CLS (Lighthouse) |
34
+ | **Dependency Analysis** | TanStack Router, React Query, Prisma, Zustand, React Compiler |
35
+
36
+ ## How It Works
37
+
38
+ 1. **Analyze** - Auto-detects your framework, database, and existing tests
39
+ 2. **Generate** - Creates tests based on your code patterns
40
+ 3. **Execute** - Runs tests inside Docker container
41
+ 4. **Fix** - Analyzes failures and applies corrections
42
+ 5. **Report** - Provides comprehensive coverage and performance report
43
+
44
+ ## Included Tools
45
+
46
+ The Docker toolkit includes:
47
+
48
+ | Category | Tools |
49
+ |----------|-------|
50
+ | Testing | Vitest, @testing-library/react, @testing-library/vue, @testing-library/svelte, @solidjs/testing-library, happy-dom |
51
+ | E2E | Playwright (Chromium) |
52
+ | Backend Performance | k6 (load testing) |
53
+ | Frontend Performance | Lighthouse (Core Web Vitals) |
54
+ | Utilities | supertest, MSW, @prisma/cli |
55
+
56
+ ## Framework Support
57
+
58
+ | Framework | Detection | Status |
59
+ |-----------|-----------|--------|
60
+ | Next.js | ✅ | Full support |
61
+ | Remix | ✅ | Full support |
62
+ | SvelteKit | ✅ | Full support |
63
+ | Nuxt | ✅ | Full support |
64
+ | Astro | ✅ | Full support |
65
+ | Gatsby | ✅ | Full support |
66
+ | Vite | ✅ | Full support |
67
+ | Solid | ✅ | Full support |
68
+ | Vue | ✅ | Full support |
69
+ | Svelte | ✅ | Full support |
70
+ | Angular | ✅ | Full support |
71
+ | React Native | ✅ | Basic support |
72
+ | Express | | Full support |
73
+ | NestJS | | Full support |
74
+
75
+ ## Output Example
76
+
77
+ ```
78
+ Unit Tests: 45 created, 42 passing, 3 fixed
79
+ Integration: 12 created, 12 passing
80
+ E2E: 8 created, 7 passing, 1 requires manual review
81
+ ✓ Backend Performance: API p95 = 145ms (PASS)
82
+ Frontend Performance: Lighthouse 85/100 (PASS)
83
+ - LCP: 2.1s ✓ (target: <2.5s)
84
+ - FID: 56ms ✓ (target: <100ms)
85
+ - CLS: 0.05 (target: <0.1)
86
+ ✓ Dependencies: 3 improvements suggested
87
+
88
+ ## Summary
89
+ Total Tests: 245
90
+ Passing: 238
91
+ Failing: 2 (requires manual review)
92
+ Coverage: 84%
93
+ ```
94
+
95
+ ## Safety
96
+
97
+ - Always use transaction rollback for database tests
98
+ - Never modify production data
99
+ - Git integration for safe rollbacks
100
+ - Non-destructive testing modes available
101
+
102
+ ## Troubleshooting
103
+
104
+ ### Rebuild toolkit image
105
+
106
+ ```bash
107
+ docker rm -f daemon-tools
108
+ docker rmi daemon-tools
109
+ npx --yes @oalacea/daemon@latest
110
+ ```
111
+
112
+ ### Run specific test
113
+
114
+ ```bash
115
+ docker exec daemon-tools npm test -- Button.test.ts
116
+ ```
117
+
118
+ ### Debug test
119
+
120
+ ```bash
121
+ docker exec daemon-tools npm test -- Button.test.ts --reporter=verbose
122
+ ```
123
+
124
+ ### Run Lighthouse audit
125
+
126
+ ```bash
127
+ # Quick performance check
128
+ docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --output=json --output=html
129
+
130
+ # Mobile audit
131
+ docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --form-factor=mobile
132
+
133
+ # All categories
134
+ docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --only-categories=performance,accessibility,best-practices,seo
135
+ ```
136
+
137
+ ## Related
138
+
139
+ - **Guardian** - Security testing package: `npx @oalacea/guardian`
140
+
141
+ ## License
142
+
143
+ MIT - Use at your own risk.
144
+
145
+ ## Credits
146
+
147
+ Inspired by the need for comprehensive automated testing in modern web development.