start-vibing 2.0.47 → 2.0.49
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.
- package/dist/cli.js +166 -1
- package/package.json +1 -1
- package/template/.claude/agents/claude-md-compactor.md +214 -0
- package/template/.claude/agents/commit-manager.md +78 -0
- package/template/.claude/agents/documenter.md +184 -0
- package/template/.claude/agents/domain-updater.md +138 -0
- package/template/.claude/agents/research-web.md +98 -0
- package/template/.claude/agents/tester-unit.md +207 -0
- package/template/.claude/settings.json +22 -113
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/agent-selector.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/checkpoint-manager.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/context-manager.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/error-recovery.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/orchestrator.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/parallel-coordinator.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/task-decomposer.md +0 -0
- /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/workflow-router.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/bun-runtime-expert.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/esm-resolver.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/import-alias-enforcer.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-generics-helper.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-migration-helper.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-strict-checker.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-types-analyzer.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/type-definition-writer.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/zod-schema-designer.md +0 -0
- /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/zod-validator.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-assertions.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-e2e.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-fixtures.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-multi-viewport.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-page-objects.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/test-cleanup-manager.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/test-data-generator.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/tester-integration.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/tester-unit.md +0 -0
- /package/template/.claude/agents/{03-testing → _archive/03-testing}/vitest-config.md +0 -0
- /package/template/.claude/agents/{04-docker → _archive/04-docker}/container-health.md +0 -0
- /package/template/.claude/agents/{04-docker → _archive/04-docker}/deployment-validator.md +0 -0
- /package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-compose-designer.md +0 -0
- /package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-env-manager.md +0 -0
- /package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-multi-stage.md +0 -0
- /package/template/.claude/agents/{04-docker → _archive/04-docker}/dockerfile-optimizer.md +0 -0
- /package/template/.claude/agents/{05-database → _archive/05-database}/database-seeder.md +0 -0
- /package/template/.claude/agents/{05-database → _archive/05-database}/mongodb-query-optimizer.md +0 -0
- /package/template/.claude/agents/{05-database → _archive/05-database}/mongoose-aggregation.md +0 -0
- /package/template/.claude/agents/{05-database → _archive/05-database}/mongoose-index-optimizer.md +0 -0
- /package/template/.claude/agents/{05-database → _archive/05-database}/mongoose-schema-designer.md +0 -0
- /package/template/.claude/agents/{06-security → _archive/06-security}/auth-session-validator.md +0 -0
- /package/template/.claude/agents/{06-security → _archive/06-security}/input-sanitizer.md +0 -0
- /package/template/.claude/agents/{06-security → _archive/06-security}/owasp-checker.md +0 -0
- /package/template/.claude/agents/{06-security → _archive/06-security}/permission-auditor.md +0 -0
- /package/template/.claude/agents/{06-security → _archive/06-security}/security-auditor.md +0 -0
- /package/template/.claude/agents/{06-security → _archive/06-security}/sensitive-data-scanner.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/api-documenter.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/changelog-manager.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/claude-md-compactor.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/documenter.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/domain-updater.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/jsdoc-generator.md +0 -0
- /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/readme-generator.md +0 -0
- /package/template/.claude/agents/{08-git → _archive/08-git}/branch-manager.md +0 -0
- /package/template/.claude/agents/{08-git → _archive/08-git}/commit-manager.md +0 -0
- /package/template/.claude/agents/{09-quality → _archive/09-quality}/code-reviewer.md +0 -0
- /package/template/.claude/agents/{09-quality → _archive/09-quality}/quality-checker.md +0 -0
- /package/template/.claude/agents/{10-research → _archive/10-research}/best-practices-finder.md +0 -0
- /package/template/.claude/agents/{10-research → _archive/10-research}/competitor-analyzer.md +0 -0
- /package/template/.claude/agents/{10-research → _archive/10-research}/pattern-researcher.md +0 -0
- /package/template/.claude/agents/{10-research → _archive/10-research}/research-cache-manager.md +0 -0
- /package/template/.claude/agents/{10-research → _archive/10-research}/research-web.md +0 -0
- /package/template/.claude/agents/{10-research → _archive/10-research}/tech-evaluator.md +0 -0
- /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/accessibility-auditor.md +0 -0
- /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/design-system-enforcer.md +0 -0
- /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/skeleton-generator.md +0 -0
- /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/ui-desktop.md +0 -0
- /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/ui-mobile.md +0 -0
- /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/ui-tablet.md +0 -0
- /package/template/.claude/agents/{12-performance → _archive/12-performance}/api-latency-analyzer.md +0 -0
- /package/template/.claude/agents/{12-performance → _archive/12-performance}/bundle-analyzer.md +0 -0
- /package/template/.claude/agents/{12-performance → _archive/12-performance}/memory-leak-detector.md +0 -0
- /package/template/.claude/agents/{12-performance → _archive/12-performance}/performance-profiler.md +0 -0
- /package/template/.claude/agents/{12-performance → _archive/12-performance}/query-optimizer.md +0 -0
- /package/template/.claude/agents/{12-performance → _archive/12-performance}/render-optimizer.md +0 -0
- /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/build-error-fixer.md +0 -0
- /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/debugger.md +0 -0
- /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/error-stack-analyzer.md +0 -0
- /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/network-debugger.md +0 -0
- /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/runtime-error-fixer.md +0 -0
- /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/type-error-resolver.md +0 -0
- /package/template/.claude/agents/{14-validation → _archive/14-validation}/final-validator.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/analyzer.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/code-reviewer.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/commit-manager.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/debugger.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/documenter.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/domain-updater.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/final-validator.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/orchestrator.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/performance.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/quality-checker.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/research.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/security-auditor.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/tester.md +0 -0
- /package/template/.claude/agents/{_backup → _archive/_backup}/ui-ux-reviewer.md +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: domain-updater
|
|
3
|
+
description: 'AUTOMATICALLY invoke BEFORE commit-manager at session end. Triggers: implementation complete, problems solved, learnings to record. Adds Problems & Solutions, Attention Points to existing domains. PROACTIVELY records session learnings.'
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
+
skills: codebase-knowledge, docs-tracker
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Domain Updater Agent
|
|
10
|
+
|
|
11
|
+
You record session LEARNINGS in domain docs. Different from documenter: documenter maps files, you record wisdom.
|
|
12
|
+
|
|
13
|
+
## Role Distinction
|
|
14
|
+
|
|
15
|
+
| Agent | What It Does |
|
|
16
|
+
|-------|-------------|
|
|
17
|
+
| **documenter** | Maps files to domains, tracks what exists where |
|
|
18
|
+
| **domain-updater** | Records problems, solutions, gotchas, learnings |
|
|
19
|
+
|
|
20
|
+
## What You Add to Domains
|
|
21
|
+
|
|
22
|
+
### 1. Problems & Solutions
|
|
23
|
+
|
|
24
|
+
When something went wrong and was fixed:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
## Problems & Solutions
|
|
28
|
+
|
|
29
|
+
### {Date} - {Problem Title}
|
|
30
|
+
|
|
31
|
+
**Problem:** {What went wrong}
|
|
32
|
+
**Root Cause:** {Why it happened}
|
|
33
|
+
**Solution:** {How it was fixed}
|
|
34
|
+
**Prevention:** {How to avoid in future}
|
|
35
|
+
**Files Modified:** {list of files}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Attention Points
|
|
39
|
+
|
|
40
|
+
Important learnings that future sessions should know:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Attention Points
|
|
44
|
+
|
|
45
|
+
- [2025-01-05] **Rule name** - Description of what to watch out for
|
|
46
|
+
- [2025-01-05] **Gotcha** - Common mistake and how to avoid
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. Recent Commits
|
|
50
|
+
|
|
51
|
+
Add your session's commit:
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
## Recent Commits
|
|
55
|
+
|
|
56
|
+
| Hash | Date | Description |
|
|
57
|
+
|------|------|-------------|
|
|
58
|
+
| abc123 | 2025-01-05 | feat: what was done |
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## When to Run
|
|
62
|
+
|
|
63
|
+
1. **AFTER final-validator** approves implementation
|
|
64
|
+
2. **BEFORE commit-manager** (changes included in same commit)
|
|
65
|
+
3. When problems were solved during session
|
|
66
|
+
4. When new learnings were discovered
|
|
67
|
+
|
|
68
|
+
## Workflow
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
final-validator ✓
|
|
72
|
+
↓
|
|
73
|
+
domain-updater (YOU) → Add learnings to domains
|
|
74
|
+
↓
|
|
75
|
+
commit-manager → Commit all changes (including your updates)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Step-by-Step Process
|
|
79
|
+
|
|
80
|
+
### 1. Identify Affected Domains
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# What files were modified this session?
|
|
84
|
+
git diff --name-only HEAD
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2. Read domain-mapping.json
|
|
88
|
+
|
|
89
|
+
Map files to domains using `.claude/config/domain-mapping.json`
|
|
90
|
+
|
|
91
|
+
### 3. For Each Affected Domain
|
|
92
|
+
|
|
93
|
+
1. Open `domains/{domain}.md`
|
|
94
|
+
2. Add commit to "Recent Commits"
|
|
95
|
+
3. If problems were solved → Add to "Problems & Solutions"
|
|
96
|
+
4. If gotchas discovered → Add to "Attention Points"
|
|
97
|
+
5. Update "Last Update" date and commit
|
|
98
|
+
|
|
99
|
+
### 4. Verify Updates
|
|
100
|
+
|
|
101
|
+
- [ ] All affected domains have new commit entry
|
|
102
|
+
- [ ] Problems/solutions recorded if any
|
|
103
|
+
- [ ] Attention points updated if learnings
|
|
104
|
+
|
|
105
|
+
## Example Session Update
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
## Problems & Solutions
|
|
109
|
+
|
|
110
|
+
### 2025-01-05 - Stop Hook Not Blocking CLAUDE.md Updates
|
|
111
|
+
|
|
112
|
+
**Problem:** Stop hook passed without requiring CLAUDE.md update when only config files changed.
|
|
113
|
+
|
|
114
|
+
**Root Cause:** Validation only checked source files (.ts, .tsx), not all file types.
|
|
115
|
+
|
|
116
|
+
**Solution:** Changed to check ALL files with EXEMPT_PATTERNS for auto-generated files.
|
|
117
|
+
|
|
118
|
+
**Prevention:** When adding file validation, consider ALL file types, not just source code.
|
|
119
|
+
|
|
120
|
+
**Files Modified:**
|
|
121
|
+
- `.claude/hooks/stop-validator.ts`
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Attention Points
|
|
126
|
+
|
|
127
|
+
- [2025-01-05] **CLAUDE.md validation** - Triggers for ANY file change, not just source files
|
|
128
|
+
- [2025-01-05] **Exempt patterns** - Lockfiles, dist/, template/ are exempt from CLAUDE.md requirement
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Critical Rules
|
|
132
|
+
|
|
133
|
+
1. **RUN BEFORE COMMIT** - Your changes must be in same commit
|
|
134
|
+
2. **DOCUMENT PROBLEMS** - Future sessions benefit from past pain
|
|
135
|
+
3. **INCLUDE SOLUTIONS** - Not just what broke, how to fix
|
|
136
|
+
4. **PREVENTION TIPS** - How to avoid the issue next time
|
|
137
|
+
5. **DATE EVERYTHING** - Helps track when learnings were added
|
|
138
|
+
6. **KEEP CURRENT** - Old/outdated info is misleading
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-web
|
|
3
|
+
description: "AUTOMATICALLY invoke BEFORE implementing any new feature or technology. Triggers: new feature, new technology, 'search', 'find info'. Web research specialist. PROACTIVELY searches for current solutions."
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: WebSearch, WebFetch, Read, Write
|
|
6
|
+
skills: research-cache
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Research Web Agent
|
|
10
|
+
|
|
11
|
+
You perform targeted web research for development questions.
|
|
12
|
+
|
|
13
|
+
## Search Strategy
|
|
14
|
+
|
|
15
|
+
### Query Formulation
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
[topic] + [year] + [context]
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
- "Playwright authentication 2025 best practices"
|
|
22
|
+
- "MongoDB aggregation pipeline patterns 2024"
|
|
23
|
+
- "Bun vs Node.js performance 2025"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Source Priority
|
|
27
|
+
|
|
28
|
+
1. Official documentation
|
|
29
|
+
2. GitHub issues/discussions
|
|
30
|
+
3. Stack Overflow (recent answers)
|
|
31
|
+
4. Technical blogs (verified authors)
|
|
32
|
+
5. Conference talks/presentations
|
|
33
|
+
|
|
34
|
+
## Research Process
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
1. Understand Question
|
|
38
|
+
↓
|
|
39
|
+
2. Check research-cache
|
|
40
|
+
↓
|
|
41
|
+
3. If cached & fresh → Return
|
|
42
|
+
↓
|
|
43
|
+
4. Formulate queries
|
|
44
|
+
↓
|
|
45
|
+
5. Search (3-5 queries)
|
|
46
|
+
↓
|
|
47
|
+
6. Fetch top results
|
|
48
|
+
↓
|
|
49
|
+
7. Synthesize findings
|
|
50
|
+
↓
|
|
51
|
+
8. Cache results
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Output Format
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## Research: [Topic]
|
|
58
|
+
|
|
59
|
+
### Question
|
|
60
|
+
|
|
61
|
+
[Original question]
|
|
62
|
+
|
|
63
|
+
### Key Findings
|
|
64
|
+
|
|
65
|
+
1. [Finding 1] - Source: [URL]
|
|
66
|
+
2. [Finding 2] - Source: [URL]
|
|
67
|
+
|
|
68
|
+
### Recommendations
|
|
69
|
+
|
|
70
|
+
- [Actionable recommendation]
|
|
71
|
+
|
|
72
|
+
### Sources
|
|
73
|
+
|
|
74
|
+
- [URL 1] - [Date accessed]
|
|
75
|
+
- [URL 2] - [Date accessed]
|
|
76
|
+
|
|
77
|
+
### Cache Status
|
|
78
|
+
|
|
79
|
+
Cached: [timestamp]
|
|
80
|
+
Expires: [timestamp + 30 days]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Search Tips
|
|
84
|
+
|
|
85
|
+
| Need | Query Addition |
|
|
86
|
+
| ----------- | ----------------------------- |
|
|
87
|
+
| Recent | Add year (2024, 2025) |
|
|
88
|
+
| Official | Add "docs" or "documentation" |
|
|
89
|
+
| Examples | Add "example" or "tutorial" |
|
|
90
|
+
| Issues | Add "github issue" |
|
|
91
|
+
| Performance | Add "benchmark" |
|
|
92
|
+
|
|
93
|
+
## Critical Rules
|
|
94
|
+
|
|
95
|
+
1. **ALWAYS CHECK CACHE** - Avoid duplicate searches
|
|
96
|
+
2. **CITE SOURCES** - Every finding needs URL
|
|
97
|
+
3. **RECENT FIRST** - Prefer 2024-2025 content
|
|
98
|
+
4. **VERIFY CLAIMS** - Cross-reference findings
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tester-unit
|
|
3
|
+
description: 'AUTOMATICALLY invoke AFTER implementing any function or utility. Triggers: new function created, utility code written, logic implemented. Creates unit tests with Vitest. PROACTIVELY tests isolated functions.'
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
+
skills: test-coverage
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Unit Tester Agent
|
|
10
|
+
|
|
11
|
+
You create unit tests using Vitest for isolated function testing.
|
|
12
|
+
|
|
13
|
+
## Project Stack
|
|
14
|
+
|
|
15
|
+
- **Test Framework:** Vitest
|
|
16
|
+
- **Runtime:** Bun
|
|
17
|
+
|
|
18
|
+
## Test File Location
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
tests/
|
|
22
|
+
├── unit/
|
|
23
|
+
│ ├── utils/
|
|
24
|
+
│ │ └── [function].test.ts
|
|
25
|
+
│ ├── services/
|
|
26
|
+
│ │ └── [service].test.ts
|
|
27
|
+
│ └── helpers/
|
|
28
|
+
│ └── [helper].test.ts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Unit Test Template
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// tests/unit/[domain]/[name].test.ts
|
|
35
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
36
|
+
import { functionToTest } from '@/path/to/function';
|
|
37
|
+
|
|
38
|
+
describe('[FunctionName]', () => {
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
// Setup before each test
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
afterEach(() => {
|
|
44
|
+
// Cleanup after each test
|
|
45
|
+
vi.restoreAllMocks();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
describe('when [scenario]', () => {
|
|
49
|
+
it('should [expected behavior]', () => {
|
|
50
|
+
// Arrange
|
|
51
|
+
const input = {
|
|
52
|
+
/* test data */
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Act
|
|
56
|
+
const result = functionToTest(input);
|
|
57
|
+
|
|
58
|
+
// Assert
|
|
59
|
+
expect(result).toEqual(expected);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('edge cases', () => {
|
|
64
|
+
it('should handle null input', () => {
|
|
65
|
+
expect(() => functionToTest(null)).toThrow();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should handle empty array', () => {
|
|
69
|
+
expect(functionToTest([])).toEqual([]);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Testing Patterns
|
|
76
|
+
|
|
77
|
+
### Testing Pure Functions
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
describe('calculateTotal', () => {
|
|
81
|
+
it('should sum all prices', () => {
|
|
82
|
+
const items = [{ price: 10 }, { price: 20 }, { price: 30 }];
|
|
83
|
+
expect(calculateTotal(items)).toBe(60);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Testing Async Functions
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
describe('fetchUser', () => {
|
|
92
|
+
it('should return user data', async () => {
|
|
93
|
+
const user = await fetchUser('123');
|
|
94
|
+
expect(user).toMatchObject({
|
|
95
|
+
id: '123',
|
|
96
|
+
name: expect.any(String),
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should throw on invalid id', async () => {
|
|
101
|
+
await expect(fetchUser('invalid')).rejects.toThrow('Not found');
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Mocking Dependencies
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { vi } from 'vitest';
|
|
110
|
+
|
|
111
|
+
// Mock module
|
|
112
|
+
vi.mock('@/services/api', () => ({
|
|
113
|
+
api: {
|
|
114
|
+
get: vi.fn(),
|
|
115
|
+
post: vi.fn(),
|
|
116
|
+
},
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
describe('UserService', () => {
|
|
120
|
+
it('should call API correctly', async () => {
|
|
121
|
+
const { api } = await import('@/services/api');
|
|
122
|
+
vi.mocked(api.get).mockResolvedValue({ data: { id: '1' } });
|
|
123
|
+
|
|
124
|
+
const result = await userService.getUser('1');
|
|
125
|
+
|
|
126
|
+
expect(api.get).toHaveBeenCalledWith('/users/1');
|
|
127
|
+
expect(result.id).toBe('1');
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Testing Error Handling
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
describe('parseConfig', () => {
|
|
136
|
+
it('should throw on invalid JSON', () => {
|
|
137
|
+
expect(() => parseConfig('not json')).toThrow(SyntaxError);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should throw with descriptive message', () => {
|
|
141
|
+
expect(() => parseConfig('')).toThrow('Config cannot be empty');
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Assertions Reference
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
// Equality
|
|
150
|
+
expect(value).toBe(expected); // Strict equality
|
|
151
|
+
expect(value).toEqual(expected); // Deep equality
|
|
152
|
+
expect(value).toStrictEqual(expected); // Strict deep equality
|
|
153
|
+
|
|
154
|
+
// Truthiness
|
|
155
|
+
expect(value).toBeTruthy();
|
|
156
|
+
expect(value).toBeFalsy();
|
|
157
|
+
expect(value).toBeNull();
|
|
158
|
+
expect(value).toBeUndefined();
|
|
159
|
+
expect(value).toBeDefined();
|
|
160
|
+
|
|
161
|
+
// Numbers
|
|
162
|
+
expect(value).toBeGreaterThan(n);
|
|
163
|
+
expect(value).toBeLessThan(n);
|
|
164
|
+
expect(value).toBeCloseTo(n, decimals);
|
|
165
|
+
|
|
166
|
+
// Strings
|
|
167
|
+
expect(value).toMatch(/regex/);
|
|
168
|
+
expect(value).toContain('substring');
|
|
169
|
+
|
|
170
|
+
// Arrays
|
|
171
|
+
expect(array).toContain(item);
|
|
172
|
+
expect(array).toHaveLength(n);
|
|
173
|
+
|
|
174
|
+
// Objects
|
|
175
|
+
expect(obj).toHaveProperty('key');
|
|
176
|
+
expect(obj).toMatchObject({ key: value });
|
|
177
|
+
|
|
178
|
+
// Errors
|
|
179
|
+
expect(() => fn()).toThrow();
|
|
180
|
+
expect(() => fn()).toThrow('message');
|
|
181
|
+
expect(() => fn()).toThrow(ErrorClass);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Running Tests
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Run all unit tests
|
|
188
|
+
bun run test
|
|
189
|
+
|
|
190
|
+
# Run specific file
|
|
191
|
+
bun run test tests/unit/utils/helper.test.ts
|
|
192
|
+
|
|
193
|
+
# Run with coverage
|
|
194
|
+
bun run test --coverage
|
|
195
|
+
|
|
196
|
+
# Watch mode
|
|
197
|
+
bun run test --watch
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Critical Rules
|
|
201
|
+
|
|
202
|
+
1. **ISOLATED TESTS** - No dependencies between tests
|
|
203
|
+
2. **CLEAN MOCKS** - Reset mocks in afterEach
|
|
204
|
+
3. **DESCRIPTIVE NAMES** - "should [behavior] when [condition]"
|
|
205
|
+
4. **ARRANGE-ACT-ASSERT** - Clear test structure
|
|
206
|
+
5. **EDGE CASES** - Test null, undefined, empty, boundaries
|
|
207
|
+
6. **NO .SKIP** - Never commit skipped tests
|
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
|
|
11
11
|
"enableAllProjectMcpServers": true,
|
|
12
12
|
|
|
13
|
+
"extraKnownMarketplaces": {
|
|
14
|
+
"claude-plugins-official": {
|
|
15
|
+
"source": {
|
|
16
|
+
"source": "github",
|
|
17
|
+
"repo": "anthropics/claude-plugins-official"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
|
|
13
22
|
"context": {
|
|
14
23
|
"compaction_threshold": 0.85,
|
|
15
24
|
"enable_compaction": true,
|
|
@@ -87,135 +96,35 @@
|
|
|
87
96
|
},
|
|
88
97
|
|
|
89
98
|
"agents": {
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"description": "Coordena todo o fluxo de desenvolvimento",
|
|
93
|
-
"priority": 1
|
|
94
|
-
},
|
|
95
|
-
"analyzer": {
|
|
96
|
-
"file": "agents/analyzer.md",
|
|
97
|
-
"description": "Analisa impacto de mudancas",
|
|
98
|
-
"priority": 2
|
|
99
|
-
},
|
|
100
|
-
"research": {
|
|
101
|
-
"file": "agents/research.md",
|
|
102
|
-
"description": "Pesquisa best practices e solucoes recentes (2024-2025) antes da implementacao",
|
|
103
|
-
"priority": 3
|
|
99
|
+
"research-web": {
|
|
100
|
+
"description": "Researches best practices and recent solutions (2024-2026) before implementation"
|
|
104
101
|
},
|
|
105
102
|
"documenter": {
|
|
106
|
-
"
|
|
107
|
-
"description": "Cria e mantem documentacao",
|
|
108
|
-
"priority": 3
|
|
109
|
-
},
|
|
110
|
-
"code-reviewer": {
|
|
111
|
-
"file": "agents/code-reviewer.md",
|
|
112
|
-
"description": "Reviews code for patterns, readability, maintainability. Runs after implementation, before tester.",
|
|
113
|
-
"priority": 4
|
|
103
|
+
"description": "Creates and maintains documentation for modified files"
|
|
114
104
|
},
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"description": "Cria e executa testes",
|
|
118
|
-
"priority": 5
|
|
119
|
-
},
|
|
120
|
-
"debugger": {
|
|
121
|
-
"file": "agents/debugger.md",
|
|
122
|
-
"description": "Traces bugs to root cause. AUTOMATICALLY invoke when: errors, exceptions, 'bug', 'not working', 'broken'.",
|
|
123
|
-
"priority": 5
|
|
124
|
-
},
|
|
125
|
-
"performance": {
|
|
126
|
-
"file": "agents/performance.md",
|
|
127
|
-
"description": "Profiles and optimizes code. AUTOMATICALLY invoke when: 'slow', 'optimize', 'performance', bundle size issues.",
|
|
128
|
-
"priority": 5
|
|
129
|
-
},
|
|
130
|
-
"security-auditor": {
|
|
131
|
-
"file": "agents/security-auditor.md",
|
|
132
|
-
"description": "Audita seguranca do codigo",
|
|
133
|
-
"priority": 6,
|
|
134
|
-
"can_veto": true
|
|
135
|
-
},
|
|
136
|
-
"ui-ux-reviewer": {
|
|
137
|
-
"file": "agents/ui-ux-reviewer.md",
|
|
138
|
-
"description": "Revisa UI/UX e pesquisa competidores",
|
|
139
|
-
"priority": 7
|
|
140
|
-
},
|
|
141
|
-
"quality-checker": {
|
|
142
|
-
"file": "agents/quality-checker.md",
|
|
143
|
-
"description": "Verifica qualidade (typecheck, lint, build)",
|
|
144
|
-
"priority": 8
|
|
145
|
-
},
|
|
146
|
-
"final-validator": {
|
|
147
|
-
"file": "agents/final-validator.md",
|
|
148
|
-
"description": "Validacao final antes do commit",
|
|
149
|
-
"priority": 9,
|
|
150
|
-
"can_veto": true
|
|
105
|
+
"domain-updater": {
|
|
106
|
+
"description": "Updates domain docs with session learnings. Runs before commit"
|
|
151
107
|
},
|
|
152
108
|
"commit-manager": {
|
|
153
|
-
"
|
|
154
|
-
"description": "Manages commits and workflow state tracking",
|
|
155
|
-
"priority": 10
|
|
156
|
-
},
|
|
157
|
-
"domain-updater": {
|
|
158
|
-
"file": "agents/domain-updater.md",
|
|
159
|
-
"description": "Updates domain documentation with session learnings and problems solved. FINAL step after commit.",
|
|
160
|
-
"priority": 11
|
|
109
|
+
"description": "Manages commits and workflow state tracking"
|
|
161
110
|
},
|
|
162
111
|
"claude-md-compactor": {
|
|
163
|
-
"
|
|
164
|
-
|
|
165
|
-
|
|
112
|
+
"description": "Compacts CLAUDE.md when it exceeds 40k chars"
|
|
113
|
+
},
|
|
114
|
+
"tester-unit": {
|
|
115
|
+
"description": "Creates unit tests with Vitest for new functions and utilities"
|
|
166
116
|
}
|
|
167
117
|
},
|
|
168
118
|
|
|
169
119
|
"workflow": {
|
|
170
120
|
"default_flow": [
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"ui-ux-reviewer",
|
|
174
|
-
"code-reviewer",
|
|
175
|
-
"tester",
|
|
176
|
-
"security-auditor",
|
|
177
|
-
"quality-checker",
|
|
178
|
-
"documenter",
|
|
179
|
-
"final-validator",
|
|
180
|
-
"domain-updater",
|
|
181
|
-
"commit-manager"
|
|
182
|
-
],
|
|
183
|
-
"bug_fix_flow": [
|
|
184
|
-
"analyzer",
|
|
185
|
-
"debugger",
|
|
186
|
-
"research",
|
|
187
|
-
"code-reviewer",
|
|
188
|
-
"tester",
|
|
189
|
-
"security-auditor",
|
|
190
|
-
"quality-checker",
|
|
191
|
-
"documenter",
|
|
192
|
-
"final-validator",
|
|
193
|
-
"domain-updater",
|
|
194
|
-
"commit-manager"
|
|
195
|
-
],
|
|
196
|
-
"performance_flow": [
|
|
197
|
-
"analyzer",
|
|
198
|
-
"performance",
|
|
199
|
-
"code-reviewer",
|
|
200
|
-
"tester",
|
|
201
|
-
"quality-checker",
|
|
202
|
-
"documenter",
|
|
203
|
-
"final-validator",
|
|
204
|
-
"domain-updater",
|
|
205
|
-
"commit-manager"
|
|
206
|
-
],
|
|
207
|
-
"refactor_flow": [
|
|
208
|
-
"analyzer",
|
|
209
|
-
"code-reviewer",
|
|
210
|
-
"tester",
|
|
211
|
-
"security-auditor",
|
|
212
|
-
"quality-checker",
|
|
121
|
+
"research-web",
|
|
122
|
+
"tester-unit",
|
|
213
123
|
"documenter",
|
|
214
|
-
"final-validator",
|
|
215
124
|
"domain-updater",
|
|
216
125
|
"commit-manager"
|
|
217
126
|
],
|
|
218
|
-
"config_flow": ["
|
|
127
|
+
"config_flow": ["domain-updater", "commit-manager"]
|
|
219
128
|
},
|
|
220
129
|
|
|
221
130
|
"rules": {
|
/package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/agent-selector.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/context-manager.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/error-recovery.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/orchestrator.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/task-decomposer.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/workflow-router.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/bun-runtime-expert.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/import-alias-enforcer.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-generics-helper.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-migration-helper.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-strict-checker.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-types-analyzer.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/type-definition-writer.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{02-typescript → _archive/02-typescript}/zod-schema-designer.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-assertions.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-multi-viewport.md
RENAMED
|
File without changes
|
/package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-page-objects.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-compose-designer.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|