@nguyenphp/antigravity-marketing 1.0.19 → 1.0.20

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 (106) hide show
  1. package/README.md +5 -61
  2. package/package.json +1 -1
  3. package/templates/.agent/agents/backend-specialist.md +0 -263
  4. package/templates/.agent/agents/database-architect.md +0 -226
  5. package/templates/.agent/agents/debugger.md +0 -225
  6. package/templates/.agent/agents/devops-engineer.md +0 -242
  7. package/templates/.agent/agents/frontend-specialist.md +0 -527
  8. package/templates/.agent/agents/game-developer.md +0 -162
  9. package/templates/.agent/agents/mobile-developer.md +0 -377
  10. package/templates/.agent/agents/penetration-tester.md +0 -188
  11. package/templates/.agent/agents/security-auditor.md +0 -170
  12. package/templates/.agent/agents/test-engineer.md +0 -158
  13. package/templates/.agent/skills/api-patterns/SKILL.md +0 -81
  14. package/templates/.agent/skills/api-patterns/api-style.md +0 -42
  15. package/templates/.agent/skills/api-patterns/auth.md +0 -24
  16. package/templates/.agent/skills/api-patterns/documentation.md +0 -26
  17. package/templates/.agent/skills/api-patterns/graphql.md +0 -41
  18. package/templates/.agent/skills/api-patterns/rate-limiting.md +0 -31
  19. package/templates/.agent/skills/api-patterns/response.md +0 -37
  20. package/templates/.agent/skills/api-patterns/rest.md +0 -40
  21. package/templates/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
  22. package/templates/.agent/skills/api-patterns/security-testing.md +0 -122
  23. package/templates/.agent/skills/api-patterns/trpc.md +0 -41
  24. package/templates/.agent/skills/api-patterns/versioning.md +0 -22
  25. package/templates/.agent/skills/app-builder/SKILL.md +0 -75
  26. package/templates/.agent/skills/app-builder/agent-coordination.md +0 -71
  27. package/templates/.agent/skills/app-builder/feature-building.md +0 -53
  28. package/templates/.agent/skills/app-builder/project-detection.md +0 -34
  29. package/templates/.agent/skills/app-builder/scaffolding.md +0 -118
  30. package/templates/.agent/skills/app-builder/tech-stack.md +0 -40
  31. package/templates/.agent/skills/app-builder/templates/SKILL.md +0 -39
  32. package/templates/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
  33. package/templates/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
  34. package/templates/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
  35. package/templates/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
  36. package/templates/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
  37. package/templates/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
  38. package/templates/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
  39. package/templates/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -82
  40. package/templates/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -100
  41. package/templates/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -106
  42. package/templates/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -101
  43. package/templates/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
  44. package/templates/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -93
  45. package/templates/.agent/skills/architecture/SKILL.md +0 -55
  46. package/templates/.agent/skills/architecture/context-discovery.md +0 -43
  47. package/templates/.agent/skills/architecture/examples.md +0 -94
  48. package/templates/.agent/skills/architecture/pattern-selection.md +0 -68
  49. package/templates/.agent/skills/architecture/patterns-reference.md +0 -50
  50. package/templates/.agent/skills/architecture/trade-off-analysis.md +0 -77
  51. package/templates/.agent/skills/bash-linux/SKILL.md +0 -199
  52. package/templates/.agent/skills/behavioral-modes/SKILL.md +0 -242
  53. package/templates/.agent/skills/clean-code/SKILL.md +0 -201
  54. package/templates/.agent/skills/code-review-checklist/SKILL.md +0 -109
  55. package/templates/.agent/skills/database-design/SKILL.md +0 -52
  56. package/templates/.agent/skills/database-design/database-selection.md +0 -43
  57. package/templates/.agent/skills/database-design/indexing.md +0 -39
  58. package/templates/.agent/skills/database-design/migrations.md +0 -48
  59. package/templates/.agent/skills/database-design/optimization.md +0 -36
  60. package/templates/.agent/skills/database-design/orm-selection.md +0 -30
  61. package/templates/.agent/skills/database-design/schema-design.md +0 -56
  62. package/templates/.agent/skills/database-design/scripts/schema_validator.py +0 -172
  63. package/templates/.agent/skills/deployment-procedures/SKILL.md +0 -241
  64. package/templates/.agent/skills/docker-expert/SKILL.md +0 -409
  65. package/templates/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  66. package/templates/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  67. package/templates/.agent/skills/game-development/SKILL.md +0 -167
  68. package/templates/.agent/skills/game-development/game-art/SKILL.md +0 -185
  69. package/templates/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  70. package/templates/.agent/skills/game-development/game-design/SKILL.md +0 -129
  71. package/templates/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  72. package/templates/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  73. package/templates/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  74. package/templates/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  75. package/templates/.agent/skills/game-development/web-games/SKILL.md +0 -150
  76. package/templates/.agent/skills/lint-and-validate/SKILL.md +0 -45
  77. package/templates/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -172
  78. package/templates/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
  79. package/templates/.agent/skills/mcp-builder/SKILL.md +0 -176
  80. package/templates/.agent/skills/nestjs-expert/SKILL.md +0 -552
  81. package/templates/.agent/skills/nextjs-best-practices/SKILL.md +0 -203
  82. package/templates/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
  83. package/templates/.agent/skills/parallel-agents/SKILL.md +0 -175
  84. package/templates/.agent/skills/performance-profiling/SKILL.md +0 -143
  85. package/templates/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
  86. package/templates/.agent/skills/powershell-windows/SKILL.md +0 -167
  87. package/templates/.agent/skills/prisma-expert/SKILL.md +0 -355
  88. package/templates/.agent/skills/python-patterns/SKILL.md +0 -441
  89. package/templates/.agent/skills/react-patterns/SKILL.md +0 -198
  90. package/templates/.agent/skills/red-team-tactics/SKILL.md +0 -199
  91. package/templates/.agent/skills/server-management/SKILL.md +0 -161
  92. package/templates/.agent/skills/systematic-debugging/SKILL.md +0 -109
  93. package/templates/.agent/skills/tdd-workflow/SKILL.md +0 -149
  94. package/templates/.agent/skills/testing-patterns/SKILL.md +0 -178
  95. package/templates/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
  96. package/templates/.agent/skills/typescript-expert/SKILL.md +0 -429
  97. package/templates/.agent/skills/vue-expert/SKILL.md +0 -374
  98. package/templates/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
  99. package/templates/.agent/skills/vulnerability-scanner/checklists.md +0 -121
  100. package/templates/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  101. package/templates/.agent/skills/webapp-testing/SKILL.md +0 -187
  102. package/templates/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
  103. package/templates/.agent/workflows/debug.md +0 -103
  104. package/templates/.agent/workflows/deploy.md +0 -176
  105. package/templates/.agent/workflows/enhance.md +0 -63
  106. package/templates/.agent/workflows/test.md +0 -144
@@ -1,199 +0,0 @@
1
- ---
2
- name: red-team-tactics
3
- description: Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # Red Team Tactics
8
-
9
- > Adversary simulation principles based on MITRE ATT&CK framework.
10
-
11
- ---
12
-
13
- ## 1. MITRE ATT&CK Phases
14
-
15
- ### Attack Lifecycle
16
-
17
- ```
18
- RECONNAISSANCE → INITIAL ACCESS → EXECUTION → PERSISTENCE
19
- ↓ ↓ ↓ ↓
20
- PRIVILEGE ESC → DEFENSE EVASION → CRED ACCESS → DISCOVERY
21
- ↓ ↓ ↓ ↓
22
- LATERAL MOVEMENT → COLLECTION → C2 → EXFILTRATION → IMPACT
23
- ```
24
-
25
- ### Phase Objectives
26
-
27
- | Phase | Objective |
28
- |-------|-----------|
29
- | **Recon** | Map attack surface |
30
- | **Initial Access** | Get first foothold |
31
- | **Execution** | Run code on target |
32
- | **Persistence** | Survive reboots |
33
- | **Privilege Escalation** | Get admin/root |
34
- | **Defense Evasion** | Avoid detection |
35
- | **Credential Access** | Harvest credentials |
36
- | **Discovery** | Map internal network |
37
- | **Lateral Movement** | Spread to other systems |
38
- | **Collection** | Gather target data |
39
- | **C2** | Maintain command channel |
40
- | **Exfiltration** | Extract data |
41
-
42
- ---
43
-
44
- ## 2. Reconnaissance Principles
45
-
46
- ### Passive vs Active
47
-
48
- | Type | Trade-off |
49
- |------|-----------|
50
- | **Passive** | No target contact, limited info |
51
- | **Active** | Direct contact, more detection risk |
52
-
53
- ### Information Targets
54
-
55
- | Category | Value |
56
- |----------|-------|
57
- | Technology stack | Attack vector selection |
58
- | Employee info | Social engineering |
59
- | Network ranges | Scanning scope |
60
- | Third parties | Supply chain attack |
61
-
62
- ---
63
-
64
- ## 3. Initial Access Vectors
65
-
66
- ### Selection Criteria
67
-
68
- | Vector | When to Use |
69
- |--------|-------------|
70
- | **Phishing** | Human target, email access |
71
- | **Public exploits** | Vulnerable services exposed |
72
- | **Valid credentials** | Leaked or cracked |
73
- | **Supply chain** | Third-party access |
74
-
75
- ---
76
-
77
- ## 4. Privilege Escalation Principles
78
-
79
- ### Windows Targets
80
-
81
- | Check | Opportunity |
82
- |-------|-------------|
83
- | Unquoted service paths | Write to path |
84
- | Weak service permissions | Modify service |
85
- | Token privileges | Abuse SeDebug, etc. |
86
- | Stored credentials | Harvest |
87
-
88
- ### Linux Targets
89
-
90
- | Check | Opportunity |
91
- |-------|-------------|
92
- | SUID binaries | Execute as owner |
93
- | Sudo misconfiguration | Command execution |
94
- | Kernel vulnerabilities | Kernel exploits |
95
- | Cron jobs | Writable scripts |
96
-
97
- ---
98
-
99
- ## 5. Defense Evasion Principles
100
-
101
- ### Key Techniques
102
-
103
- | Technique | Purpose |
104
- |-----------|---------|
105
- | LOLBins | Use legitimate tools |
106
- | Obfuscation | Hide malicious code |
107
- | Timestomping | Hide file modifications |
108
- | Log clearing | Remove evidence |
109
-
110
- ### Operational Security
111
-
112
- - Work during business hours
113
- - Mimic legitimate traffic patterns
114
- - Use encrypted channels
115
- - Blend with normal behavior
116
-
117
- ---
118
-
119
- ## 6. Lateral Movement Principles
120
-
121
- ### Credential Types
122
-
123
- | Type | Use |
124
- |------|-----|
125
- | Password | Standard auth |
126
- | Hash | Pass-the-hash |
127
- | Ticket | Pass-the-ticket |
128
- | Certificate | Certificate auth |
129
-
130
- ### Movement Paths
131
-
132
- - Admin shares
133
- - Remote services (RDP, SSH, WinRM)
134
- - Exploitation of internal services
135
-
136
- ---
137
-
138
- ## 7. Active Directory Attacks
139
-
140
- ### Attack Categories
141
-
142
- | Attack | Target |
143
- |--------|--------|
144
- | Kerberoasting | Service account passwords |
145
- | AS-REP Roasting | Accounts without pre-auth |
146
- | DCSync | Domain credentials |
147
- | Golden Ticket | Persistent domain access |
148
-
149
- ---
150
-
151
- ## 8. Reporting Principles
152
-
153
- ### Attack Narrative
154
-
155
- Document the full attack chain:
156
- 1. How initial access was gained
157
- 2. What techniques were used
158
- 3. What objectives were achieved
159
- 4. Where detection failed
160
-
161
- ### Detection Gaps
162
-
163
- For each successful technique:
164
- - What should have detected it?
165
- - Why didn't detection work?
166
- - How to improve detection
167
-
168
- ---
169
-
170
- ## 9. Ethical Boundaries
171
-
172
- ### Always
173
-
174
- - Stay within scope
175
- - Minimize impact
176
- - Report immediately if real threat found
177
- - Document all actions
178
-
179
- ### Never
180
-
181
- - Destroy production data
182
- - Cause denial of service (unless scoped)
183
- - Access beyond proof of concept
184
- - Retain sensitive data
185
-
186
- ---
187
-
188
- ## 10. Anti-Patterns
189
-
190
- | ❌ Don't | ✅ Do |
191
- |----------|-------|
192
- | Rush to exploitation | Follow methodology |
193
- | Cause damage | Minimize impact |
194
- | Skip reporting | Document everything |
195
- | Ignore scope | Stay within boundaries |
196
-
197
- ---
198
-
199
- > **Remember:** Red team simulates attackers to improve defenses, not to cause harm.
@@ -1,161 +0,0 @@
1
- ---
2
- name: server-management
3
- description: Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.
4
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5
- ---
6
-
7
- # Server Management
8
-
9
- > Server management principles for production operations.
10
- > **Learn to THINK, not memorize commands.**
11
-
12
- ---
13
-
14
- ## 1. Process Management Principles
15
-
16
- ### Tool Selection
17
-
18
- | Scenario | Tool |
19
- |----------|------|
20
- | **Node.js app** | PM2 (clustering, reload) |
21
- | **Any app** | systemd (Linux native) |
22
- | **Containers** | Docker/Podman |
23
- | **Orchestration** | Kubernetes, Docker Swarm |
24
-
25
- ### Process Management Goals
26
-
27
- | Goal | What It Means |
28
- |------|---------------|
29
- | **Restart on crash** | Auto-recovery |
30
- | **Zero-downtime reload** | No service interruption |
31
- | **Clustering** | Use all CPU cores |
32
- | **Persistence** | Survive server reboot |
33
-
34
- ---
35
-
36
- ## 2. Monitoring Principles
37
-
38
- ### What to Monitor
39
-
40
- | Category | Key Metrics |
41
- |----------|-------------|
42
- | **Availability** | Uptime, health checks |
43
- | **Performance** | Response time, throughput |
44
- | **Errors** | Error rate, types |
45
- | **Resources** | CPU, memory, disk |
46
-
47
- ### Alert Severity Strategy
48
-
49
- | Level | Response |
50
- |-------|----------|
51
- | **Critical** | Immediate action |
52
- | **Warning** | Investigate soon |
53
- | **Info** | Review daily |
54
-
55
- ### Monitoring Tool Selection
56
-
57
- | Need | Options |
58
- |------|---------|
59
- | Simple/Free | PM2 metrics, htop |
60
- | Full observability | Grafana, Datadog |
61
- | Error tracking | Sentry |
62
- | Uptime | UptimeRobot, Pingdom |
63
-
64
- ---
65
-
66
- ## 3. Log Management Principles
67
-
68
- ### Log Strategy
69
-
70
- | Log Type | Purpose |
71
- |----------|---------|
72
- | **Application logs** | Debug, audit |
73
- | **Access logs** | Traffic analysis |
74
- | **Error logs** | Issue detection |
75
-
76
- ### Log Principles
77
-
78
- 1. **Rotate logs** to prevent disk fill
79
- 2. **Structured logging** (JSON) for parsing
80
- 3. **Appropriate levels** (error/warn/info/debug)
81
- 4. **No sensitive data** in logs
82
-
83
- ---
84
-
85
- ## 4. Scaling Decisions
86
-
87
- ### When to Scale
88
-
89
- | Symptom | Solution |
90
- |---------|----------|
91
- | High CPU | Add instances (horizontal) |
92
- | High memory | Increase RAM or fix leak |
93
- | Slow response | Profile first, then scale |
94
- | Traffic spikes | Auto-scaling |
95
-
96
- ### Scaling Strategy
97
-
98
- | Type | When to Use |
99
- |------|-------------|
100
- | **Vertical** | Quick fix, single instance |
101
- | **Horizontal** | Sustainable, distributed |
102
- | **Auto** | Variable traffic |
103
-
104
- ---
105
-
106
- ## 5. Health Check Principles
107
-
108
- ### What Constitutes Healthy
109
-
110
- | Check | Meaning |
111
- |-------|---------|
112
- | **HTTP 200** | Service responding |
113
- | **Database connected** | Data accessible |
114
- | **Dependencies OK** | External services reachable |
115
- | **Resources OK** | CPU/memory not exhausted |
116
-
117
- ### Health Check Implementation
118
-
119
- - Simple: Just return 200
120
- - Deep: Check all dependencies
121
- - Choose based on load balancer needs
122
-
123
- ---
124
-
125
- ## 6. Security Principles
126
-
127
- | Area | Principle |
128
- |------|-----------|
129
- | **Access** | SSH keys only, no passwords |
130
- | **Firewall** | Only needed ports open |
131
- | **Updates** | Regular security patches |
132
- | **Secrets** | Environment vars, not files |
133
- | **Audit** | Log access and changes |
134
-
135
- ---
136
-
137
- ## 7. Troubleshooting Priority
138
-
139
- When something's wrong:
140
-
141
- 1. **Check if running** (process status)
142
- 2. **Check logs** (error messages)
143
- 3. **Check resources** (disk, memory, CPU)
144
- 4. **Check network** (ports, DNS)
145
- 5. **Check dependencies** (database, APIs)
146
-
147
- ---
148
-
149
- ## 8. Anti-Patterns
150
-
151
- | ❌ Don't | ✅ Do |
152
- |----------|-------|
153
- | Run as root | Use non-root user |
154
- | Ignore logs | Set up log rotation |
155
- | Skip monitoring | Monitor from day one |
156
- | Manual restarts | Auto-restart config |
157
- | No backups | Regular backup schedule |
158
-
159
- ---
160
-
161
- > **Remember:** A well-managed server is boring. That's the goal.
@@ -1,109 +0,0 @@
1
- ---
2
- name: systematic-debugging
3
- description: 4-phase systematic debugging methodology with root cause analysis and evidence-based verification. Use when debugging complex issues.
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # Systematic Debugging
8
-
9
- > Source: obra/superpowers
10
-
11
- ## Overview
12
- This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.
13
-
14
- ## 4-Phase Debugging Process
15
-
16
- ### Phase 1: Reproduce
17
- Before fixing, reliably reproduce the issue.
18
-
19
- ```markdown
20
- ## Reproduction Steps
21
- 1. [Exact step to reproduce]
22
- 2. [Next step]
23
- 3. [Expected vs actual result]
24
-
25
- ## Reproduction Rate
26
- - [ ] Always (100%)
27
- - [ ] Often (50-90%)
28
- - [ ] Sometimes (10-50%)
29
- - [ ] Rare (<10%)
30
- ```
31
-
32
- ### Phase 2: Isolate
33
- Narrow down the source.
34
-
35
- ```markdown
36
- ## Isolation Questions
37
- - When did this start happening?
38
- - What changed recently?
39
- - Does it happen in all environments?
40
- - Can we reproduce with minimal code?
41
- - What's the smallest change that triggers it?
42
- ```
43
-
44
- ### Phase 3: Understand
45
- Find the root cause, not just symptoms.
46
-
47
- ```markdown
48
- ## Root Cause Analysis
49
- ### The 5 Whys
50
- 1. Why: [First observation]
51
- 2. Why: [Deeper reason]
52
- 3. Why: [Still deeper]
53
- 4. Why: [Getting closer]
54
- 5. Why: [Root cause]
55
- ```
56
-
57
- ### Phase 4: Fix & Verify
58
- Fix and verify it's truly fixed.
59
-
60
- ```markdown
61
- ## Fix Verification
62
- - [ ] Bug no longer reproduces
63
- - [ ] Related functionality still works
64
- - [ ] No new issues introduced
65
- - [ ] Test added to prevent regression
66
- ```
67
-
68
- ## Debugging Checklist
69
-
70
- ```markdown
71
- ## Before Starting
72
- - [ ] Can reproduce consistently
73
- - [ ] Have minimal reproduction case
74
- - [ ] Understand expected behavior
75
-
76
- ## During Investigation
77
- - [ ] Check recent changes (git log)
78
- - [ ] Check logs for errors
79
- - [ ] Add logging if needed
80
- - [ ] Use debugger/breakpoints
81
-
82
- ## After Fix
83
- - [ ] Root cause documented
84
- - [ ] Fix verified
85
- - [ ] Regression test added
86
- - [ ] Similar code checked
87
- ```
88
-
89
- ## Common Debugging Commands
90
-
91
- ```bash
92
- # Recent changes
93
- git log --oneline -20
94
- git diff HEAD~5
95
-
96
- # Search for pattern
97
- grep -r "errorPattern" --include="*.ts"
98
-
99
- # Check logs
100
- pm2 logs app-name --err --lines 100
101
- ```
102
-
103
- ## Anti-Patterns
104
-
105
- ❌ **Random changes** - "Maybe if I change this..."
106
- ❌ **Ignoring evidence** - "That can't be the cause"
107
- ❌ **Assuming** - "It must be X" without proof
108
- ❌ **Not reproducing first** - Fixing blindly
109
- ❌ **Stopping at symptoms** - Not finding root cause
@@ -1,149 +0,0 @@
1
- ---
2
- name: tdd-workflow
3
- description: Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle.
4
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5
- ---
6
-
7
- # TDD Workflow
8
-
9
- > Write tests first, code second.
10
-
11
- ---
12
-
13
- ## 1. The TDD Cycle
14
-
15
- ```
16
- 🔴 RED → Write failing test
17
-
18
- 🟢 GREEN → Write minimal code to pass
19
-
20
- 🔵 REFACTOR → Improve code quality
21
-
22
- Repeat...
23
- ```
24
-
25
- ---
26
-
27
- ## 2. The Three Laws of TDD
28
-
29
- 1. Write production code only to make a failing test pass
30
- 2. Write only enough test to demonstrate failure
31
- 3. Write only enough code to make the test pass
32
-
33
- ---
34
-
35
- ## 3. RED Phase Principles
36
-
37
- ### What to Write
38
-
39
- | Focus | Example |
40
- |-------|---------|
41
- | Behavior | "should add two numbers" |
42
- | Edge cases | "should handle empty input" |
43
- | Error states | "should throw for invalid data" |
44
-
45
- ### RED Phase Rules
46
-
47
- - Test must fail first
48
- - Test name describes expected behavior
49
- - One assertion per test (ideally)
50
-
51
- ---
52
-
53
- ## 4. GREEN Phase Principles
54
-
55
- ### Minimum Code
56
-
57
- | Principle | Meaning |
58
- |-----------|---------|
59
- | **YAGNI** | You Aren't Gonna Need It |
60
- | **Simplest thing** | Write the minimum to pass |
61
- | **No optimization** | Just make it work |
62
-
63
- ### GREEN Phase Rules
64
-
65
- - Don't write unneeded code
66
- - Don't optimize yet
67
- - Pass the test, nothing more
68
-
69
- ---
70
-
71
- ## 5. REFACTOR Phase Principles
72
-
73
- ### What to Improve
74
-
75
- | Area | Action |
76
- |------|--------|
77
- | Duplication | Extract common code |
78
- | Naming | Make intent clear |
79
- | Structure | Improve organization |
80
- | Complexity | Simplify logic |
81
-
82
- ### REFACTOR Rules
83
-
84
- - All tests must stay green
85
- - Small incremental changes
86
- - Commit after each refactor
87
-
88
- ---
89
-
90
- ## 6. AAA Pattern
91
-
92
- Every test follows:
93
-
94
- | Step | Purpose |
95
- |------|---------|
96
- | **Arrange** | Set up test data |
97
- | **Act** | Execute code under test |
98
- | **Assert** | Verify expected outcome |
99
-
100
- ---
101
-
102
- ## 7. When to Use TDD
103
-
104
- | Scenario | TDD Value |
105
- |----------|-----------|
106
- | New feature | High |
107
- | Bug fix | High (write test first) |
108
- | Complex logic | High |
109
- | Exploratory | Low (spike, then TDD) |
110
- | UI layout | Low |
111
-
112
- ---
113
-
114
- ## 8. Test Prioritization
115
-
116
- | Priority | Test Type |
117
- |----------|-----------|
118
- | 1 | Happy path |
119
- | 2 | Error cases |
120
- | 3 | Edge cases |
121
- | 4 | Performance |
122
-
123
- ---
124
-
125
- ## 9. Anti-Patterns
126
-
127
- | ❌ Don't | ✅ Do |
128
- |----------|-------|
129
- | Skip the RED phase | Watch test fail first |
130
- | Write tests after | Write tests before |
131
- | Over-engineer initial | Keep it simple |
132
- | Multiple asserts | One behavior per test |
133
- | Test implementation | Test behavior |
134
-
135
- ---
136
-
137
- ## 10. AI-Augmented TDD
138
-
139
- ### Multi-Agent Pattern
140
-
141
- | Agent | Role |
142
- |-------|------|
143
- | Agent A | Write failing tests (RED) |
144
- | Agent B | Implement to pass (GREEN) |
145
- | Agent C | Optimize (REFACTOR) |
146
-
147
- ---
148
-
149
- > **Remember:** The test is the specification. If you can't write a test, you don't understand the requirement.