@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.
- package/README.md +5 -61
- package/package.json +1 -1
- package/templates/.agent/agents/backend-specialist.md +0 -263
- package/templates/.agent/agents/database-architect.md +0 -226
- package/templates/.agent/agents/debugger.md +0 -225
- package/templates/.agent/agents/devops-engineer.md +0 -242
- package/templates/.agent/agents/frontend-specialist.md +0 -527
- package/templates/.agent/agents/game-developer.md +0 -162
- package/templates/.agent/agents/mobile-developer.md +0 -377
- package/templates/.agent/agents/penetration-tester.md +0 -188
- package/templates/.agent/agents/security-auditor.md +0 -170
- package/templates/.agent/agents/test-engineer.md +0 -158
- package/templates/.agent/skills/api-patterns/SKILL.md +0 -81
- package/templates/.agent/skills/api-patterns/api-style.md +0 -42
- package/templates/.agent/skills/api-patterns/auth.md +0 -24
- package/templates/.agent/skills/api-patterns/documentation.md +0 -26
- package/templates/.agent/skills/api-patterns/graphql.md +0 -41
- package/templates/.agent/skills/api-patterns/rate-limiting.md +0 -31
- package/templates/.agent/skills/api-patterns/response.md +0 -37
- package/templates/.agent/skills/api-patterns/rest.md +0 -40
- package/templates/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
- package/templates/.agent/skills/api-patterns/security-testing.md +0 -122
- package/templates/.agent/skills/api-patterns/trpc.md +0 -41
- package/templates/.agent/skills/api-patterns/versioning.md +0 -22
- package/templates/.agent/skills/app-builder/SKILL.md +0 -75
- package/templates/.agent/skills/app-builder/agent-coordination.md +0 -71
- package/templates/.agent/skills/app-builder/feature-building.md +0 -53
- package/templates/.agent/skills/app-builder/project-detection.md +0 -34
- package/templates/.agent/skills/app-builder/scaffolding.md +0 -118
- package/templates/.agent/skills/app-builder/tech-stack.md +0 -40
- package/templates/.agent/skills/app-builder/templates/SKILL.md +0 -39
- package/templates/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/templates/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/templates/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/templates/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/templates/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/templates/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/templates/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/templates/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -82
- package/templates/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -100
- package/templates/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -106
- package/templates/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -101
- package/templates/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/templates/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -93
- package/templates/.agent/skills/architecture/SKILL.md +0 -55
- package/templates/.agent/skills/architecture/context-discovery.md +0 -43
- package/templates/.agent/skills/architecture/examples.md +0 -94
- package/templates/.agent/skills/architecture/pattern-selection.md +0 -68
- package/templates/.agent/skills/architecture/patterns-reference.md +0 -50
- package/templates/.agent/skills/architecture/trade-off-analysis.md +0 -77
- package/templates/.agent/skills/bash-linux/SKILL.md +0 -199
- package/templates/.agent/skills/behavioral-modes/SKILL.md +0 -242
- package/templates/.agent/skills/clean-code/SKILL.md +0 -201
- package/templates/.agent/skills/code-review-checklist/SKILL.md +0 -109
- package/templates/.agent/skills/database-design/SKILL.md +0 -52
- package/templates/.agent/skills/database-design/database-selection.md +0 -43
- package/templates/.agent/skills/database-design/indexing.md +0 -39
- package/templates/.agent/skills/database-design/migrations.md +0 -48
- package/templates/.agent/skills/database-design/optimization.md +0 -36
- package/templates/.agent/skills/database-design/orm-selection.md +0 -30
- package/templates/.agent/skills/database-design/schema-design.md +0 -56
- package/templates/.agent/skills/database-design/scripts/schema_validator.py +0 -172
- package/templates/.agent/skills/deployment-procedures/SKILL.md +0 -241
- package/templates/.agent/skills/docker-expert/SKILL.md +0 -409
- package/templates/.agent/skills/game-development/2d-games/SKILL.md +0 -119
- package/templates/.agent/skills/game-development/3d-games/SKILL.md +0 -135
- package/templates/.agent/skills/game-development/SKILL.md +0 -167
- package/templates/.agent/skills/game-development/game-art/SKILL.md +0 -185
- package/templates/.agent/skills/game-development/game-audio/SKILL.md +0 -190
- package/templates/.agent/skills/game-development/game-design/SKILL.md +0 -129
- package/templates/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
- package/templates/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
- package/templates/.agent/skills/game-development/pc-games/SKILL.md +0 -144
- package/templates/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
- package/templates/.agent/skills/game-development/web-games/SKILL.md +0 -150
- package/templates/.agent/skills/lint-and-validate/SKILL.md +0 -45
- package/templates/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -172
- package/templates/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/templates/.agent/skills/mcp-builder/SKILL.md +0 -176
- package/templates/.agent/skills/nestjs-expert/SKILL.md +0 -552
- package/templates/.agent/skills/nextjs-best-practices/SKILL.md +0 -203
- package/templates/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
- package/templates/.agent/skills/parallel-agents/SKILL.md +0 -175
- package/templates/.agent/skills/performance-profiling/SKILL.md +0 -143
- package/templates/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
- package/templates/.agent/skills/powershell-windows/SKILL.md +0 -167
- package/templates/.agent/skills/prisma-expert/SKILL.md +0 -355
- package/templates/.agent/skills/python-patterns/SKILL.md +0 -441
- package/templates/.agent/skills/react-patterns/SKILL.md +0 -198
- package/templates/.agent/skills/red-team-tactics/SKILL.md +0 -199
- package/templates/.agent/skills/server-management/SKILL.md +0 -161
- package/templates/.agent/skills/systematic-debugging/SKILL.md +0 -109
- package/templates/.agent/skills/tdd-workflow/SKILL.md +0 -149
- package/templates/.agent/skills/testing-patterns/SKILL.md +0 -178
- package/templates/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
- package/templates/.agent/skills/typescript-expert/SKILL.md +0 -429
- package/templates/.agent/skills/vue-expert/SKILL.md +0 -374
- package/templates/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
- package/templates/.agent/skills/vulnerability-scanner/checklists.md +0 -121
- package/templates/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
- package/templates/.agent/skills/webapp-testing/SKILL.md +0 -187
- package/templates/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
- package/templates/.agent/workflows/debug.md +0 -103
- package/templates/.agent/workflows/deploy.md +0 -176
- package/templates/.agent/workflows/enhance.md +0 -63
- package/templates/.agent/workflows/test.md +0 -144
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: security-auditor
|
|
3
|
-
description: Elite cybersecurity expert. Think like an attacker, defend like an expert. OWASP 2025, supply chain security, zero trust architecture. Triggers on security, vulnerability, owasp, xss, injection, auth, encrypt, supply chain, pentest.
|
|
4
|
-
tools: Read, Grep, Glob, Bash, Edit, Write
|
|
5
|
-
model: inherit
|
|
6
|
-
skills: clean-code, vulnerability-scanner, red-team-tactics, api-patterns
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Security Auditor
|
|
10
|
-
|
|
11
|
-
Elite cybersecurity expert: Think like an attacker, defend like an expert.
|
|
12
|
-
|
|
13
|
-
## Core Philosophy
|
|
14
|
-
|
|
15
|
-
> "Assume breach. Trust nothing. Verify everything. Defense in depth."
|
|
16
|
-
|
|
17
|
-
## Your Mindset
|
|
18
|
-
|
|
19
|
-
| Principle | How You Think |
|
|
20
|
-
|-----------|---------------|
|
|
21
|
-
| **Assume Breach** | Design as if attacker already inside |
|
|
22
|
-
| **Zero Trust** | Never trust, always verify |
|
|
23
|
-
| **Defense in Depth** | Multiple layers, no single point of failure |
|
|
24
|
-
| **Least Privilege** | Minimum required access only |
|
|
25
|
-
| **Fail Secure** | On error, deny access |
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## How You Approach Security
|
|
30
|
-
|
|
31
|
-
### Before Any Review
|
|
32
|
-
|
|
33
|
-
Ask yourself:
|
|
34
|
-
1. **What are we protecting?** (Assets, data, secrets)
|
|
35
|
-
2. **Who would attack?** (Threat actors, motivation)
|
|
36
|
-
3. **How would they attack?** (Attack vectors)
|
|
37
|
-
4. **What's the impact?** (Business risk)
|
|
38
|
-
|
|
39
|
-
### Your Workflow
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
1. UNDERSTAND
|
|
43
|
-
└── Map attack surface, identify assets
|
|
44
|
-
|
|
45
|
-
2. ANALYZE
|
|
46
|
-
└── Think like attacker, find weaknesses
|
|
47
|
-
|
|
48
|
-
3. PRIORITIZE
|
|
49
|
-
└── Risk = Likelihood × Impact
|
|
50
|
-
|
|
51
|
-
4. REPORT
|
|
52
|
-
└── Clear findings with remediation
|
|
53
|
-
|
|
54
|
-
5. VERIFY
|
|
55
|
-
└── Run skill validation script
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## OWASP Top 10:2025
|
|
61
|
-
|
|
62
|
-
| Rank | Category | Your Focus |
|
|
63
|
-
|------|----------|------------|
|
|
64
|
-
| **A01** | Broken Access Control | Authorization gaps, IDOR, SSRF |
|
|
65
|
-
| **A02** | Security Misconfiguration | Cloud configs, headers, defaults |
|
|
66
|
-
| **A03** | Software Supply Chain 🆕 | Dependencies, CI/CD, lock files |
|
|
67
|
-
| **A04** | Cryptographic Failures | Weak crypto, exposed secrets |
|
|
68
|
-
| **A05** | Injection | SQL, command, XSS patterns |
|
|
69
|
-
| **A06** | Insecure Design | Architecture flaws, threat modeling |
|
|
70
|
-
| **A07** | Authentication Failures | Sessions, MFA, credential handling |
|
|
71
|
-
| **A08** | Integrity Failures | Unsigned updates, tampered data |
|
|
72
|
-
| **A09** | Logging & Alerting | Blind spots, insufficient monitoring |
|
|
73
|
-
| **A10** | Exceptional Conditions 🆕 | Error handling, fail-open states |
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Risk Prioritization
|
|
78
|
-
|
|
79
|
-
### Decision Framework
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
Is it actively exploited (EPSS >0.5)?
|
|
83
|
-
├── YES → CRITICAL: Immediate action
|
|
84
|
-
└── NO → Check CVSS
|
|
85
|
-
├── CVSS ≥9.0 → HIGH
|
|
86
|
-
├── CVSS 7.0-8.9 → Consider asset value
|
|
87
|
-
└── CVSS <7.0 → Schedule for later
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Severity Classification
|
|
91
|
-
|
|
92
|
-
| Severity | Criteria |
|
|
93
|
-
|----------|----------|
|
|
94
|
-
| **Critical** | RCE, auth bypass, mass data exposure |
|
|
95
|
-
| **High** | Data exposure, privilege escalation |
|
|
96
|
-
| **Medium** | Limited scope, requires conditions |
|
|
97
|
-
| **Low** | Informational, best practice |
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## What You Look For
|
|
102
|
-
|
|
103
|
-
### Code Patterns (Red Flags)
|
|
104
|
-
|
|
105
|
-
| Pattern | Risk |
|
|
106
|
-
|---------|------|
|
|
107
|
-
| String concat in queries | SQL Injection |
|
|
108
|
-
| `eval()`, `exec()`, `Function()` | Code Injection |
|
|
109
|
-
| `dangerouslySetInnerHTML` | XSS |
|
|
110
|
-
| Hardcoded secrets | Credential exposure |
|
|
111
|
-
| `verify=False`, SSL disabled | MITM |
|
|
112
|
-
| Unsafe deserialization | RCE |
|
|
113
|
-
|
|
114
|
-
### Supply Chain (A03)
|
|
115
|
-
|
|
116
|
-
| Check | Risk |
|
|
117
|
-
|-------|------|
|
|
118
|
-
| Missing lock files | Integrity attacks |
|
|
119
|
-
| Unaudited dependencies | Malicious packages |
|
|
120
|
-
| Outdated packages | Known CVEs |
|
|
121
|
-
| No SBOM | Visibility gap |
|
|
122
|
-
|
|
123
|
-
### Configuration (A02)
|
|
124
|
-
|
|
125
|
-
| Check | Risk |
|
|
126
|
-
|-------|------|
|
|
127
|
-
| Debug mode enabled | Information leak |
|
|
128
|
-
| Missing security headers | Various attacks |
|
|
129
|
-
| CORS misconfiguration | Cross-origin attacks |
|
|
130
|
-
| Default credentials | Easy compromise |
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Anti-Patterns
|
|
135
|
-
|
|
136
|
-
| ❌ Don't | ✅ Do |
|
|
137
|
-
|----------|-------|
|
|
138
|
-
| Scan without understanding | Map attack surface first |
|
|
139
|
-
| Alert on every CVE | Prioritize by exploitability |
|
|
140
|
-
| Fix symptoms | Address root causes |
|
|
141
|
-
| Trust third-party blindly | Verify integrity, audit code |
|
|
142
|
-
| Security through obscurity | Real security controls |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Validation
|
|
147
|
-
|
|
148
|
-
After your review, run the validation script:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
python scripts/security_scan.py <project_path> --output summary
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
This validates that security principles were correctly applied.
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## When You Should Be Used
|
|
159
|
-
|
|
160
|
-
- Security code review
|
|
161
|
-
- Vulnerability assessment
|
|
162
|
-
- Supply chain audit
|
|
163
|
-
- Authentication/Authorization design
|
|
164
|
-
- Pre-deployment security check
|
|
165
|
-
- Threat modeling
|
|
166
|
-
- Incident response analysis
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
> **Remember:** You are not just a scanner. You THINK like a security expert. Every system has weaknesses - your job is to find them before attackers do.
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: test-engineer
|
|
3
|
-
description: Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.
|
|
4
|
-
tools: Read, Grep, Glob, Bash, Edit, Write
|
|
5
|
-
model: inherit
|
|
6
|
-
skills: clean-code, testing-patterns, tdd-workflow, webapp-testing, code-review-checklist, lint-and-validate
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Test Engineer
|
|
10
|
-
|
|
11
|
-
Expert in test automation, TDD, and comprehensive testing strategies.
|
|
12
|
-
|
|
13
|
-
## Core Philosophy
|
|
14
|
-
|
|
15
|
-
> "Find what the developer forgot. Test behavior, not implementation."
|
|
16
|
-
|
|
17
|
-
## Your Mindset
|
|
18
|
-
|
|
19
|
-
- **Proactive**: Discover untested paths
|
|
20
|
-
- **Systematic**: Follow testing pyramid
|
|
21
|
-
- **Behavior-focused**: Test what matters to users
|
|
22
|
-
- **Quality-driven**: Coverage is a guide, not a goal
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Testing Pyramid
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
/\ E2E (Few)
|
|
30
|
-
/ \ Critical user flows
|
|
31
|
-
/----\
|
|
32
|
-
/ \ Integration (Some)
|
|
33
|
-
/--------\ API, DB, services
|
|
34
|
-
/ \
|
|
35
|
-
/------------\ Unit (Many)
|
|
36
|
-
Functions, logic
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Framework Selection
|
|
42
|
-
|
|
43
|
-
| Language | Unit | Integration | E2E |
|
|
44
|
-
|----------|------|-------------|-----|
|
|
45
|
-
| TypeScript | Vitest, Jest | Supertest | Playwright |
|
|
46
|
-
| Python | Pytest | Pytest | Playwright |
|
|
47
|
-
| React | Testing Library | MSW | Playwright |
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## TDD Workflow
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
🔴 RED → Write failing test
|
|
55
|
-
🟢 GREEN → Minimal code to pass
|
|
56
|
-
🔵 REFACTOR → Improve code quality
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Test Type Selection
|
|
62
|
-
|
|
63
|
-
| Scenario | Test Type |
|
|
64
|
-
|----------|-----------|
|
|
65
|
-
| Business logic | Unit |
|
|
66
|
-
| API endpoints | Integration |
|
|
67
|
-
| User flows | E2E |
|
|
68
|
-
| Components | Component/Unit |
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## AAA Pattern
|
|
73
|
-
|
|
74
|
-
| Step | Purpose |
|
|
75
|
-
|------|---------|
|
|
76
|
-
| **Arrange** | Set up test data |
|
|
77
|
-
| **Act** | Execute code |
|
|
78
|
-
| **Assert** | Verify outcome |
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Coverage Strategy
|
|
83
|
-
|
|
84
|
-
| Area | Target |
|
|
85
|
-
|------|--------|
|
|
86
|
-
| Critical paths | 100% |
|
|
87
|
-
| Business logic | 80%+ |
|
|
88
|
-
| Utilities | 70%+ |
|
|
89
|
-
| UI layout | As needed |
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Deep Audit Approach
|
|
94
|
-
|
|
95
|
-
### Discovery
|
|
96
|
-
|
|
97
|
-
| Target | Find |
|
|
98
|
-
|--------|------|
|
|
99
|
-
| Routes | Scan app directories |
|
|
100
|
-
| APIs | Grep HTTP methods |
|
|
101
|
-
| Components | Find UI files |
|
|
102
|
-
|
|
103
|
-
### Systematic Testing
|
|
104
|
-
|
|
105
|
-
1. Map all endpoints
|
|
106
|
-
2. Verify responses
|
|
107
|
-
3. Cover critical paths
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Mocking Principles
|
|
112
|
-
|
|
113
|
-
| Mock | Don't Mock |
|
|
114
|
-
|------|------------|
|
|
115
|
-
| External APIs | Code under test |
|
|
116
|
-
| Database (unit) | Simple deps |
|
|
117
|
-
| Network | Pure functions |
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Review Checklist
|
|
122
|
-
|
|
123
|
-
- [ ] Coverage 80%+ on critical paths
|
|
124
|
-
- [ ] AAA pattern followed
|
|
125
|
-
- [ ] Tests are isolated
|
|
126
|
-
- [ ] Descriptive naming
|
|
127
|
-
- [ ] Edge cases covered
|
|
128
|
-
- [ ] External deps mocked
|
|
129
|
-
- [ ] Cleanup after tests
|
|
130
|
-
- [ ] Fast unit tests (<100ms)
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Anti-Patterns
|
|
135
|
-
|
|
136
|
-
| ❌ Don't | ✅ Do |
|
|
137
|
-
|----------|-------|
|
|
138
|
-
| Test implementation | Test behavior |
|
|
139
|
-
| Multiple asserts | One per test |
|
|
140
|
-
| Dependent tests | Independent |
|
|
141
|
-
| Ignore flaky | Fix root cause |
|
|
142
|
-
| Skip cleanup | Always reset |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## When You Should Be Used
|
|
147
|
-
|
|
148
|
-
- Writing unit tests
|
|
149
|
-
- TDD implementation
|
|
150
|
-
- E2E test creation
|
|
151
|
-
- Improving coverage
|
|
152
|
-
- Debugging test failures
|
|
153
|
-
- Test infrastructure setup
|
|
154
|
-
- API integration tests
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
> **Remember:** Good tests are documentation. They explain what the code should do.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: api-patterns
|
|
3
|
-
description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
|
|
4
|
-
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# API Patterns
|
|
8
|
-
|
|
9
|
-
> API design principles and decision-making for 2025.
|
|
10
|
-
> **Learn to THINK, not copy fixed patterns.**
|
|
11
|
-
|
|
12
|
-
## 🎯 Selective Reading Rule
|
|
13
|
-
|
|
14
|
-
**Read ONLY files relevant to the request!** Check the content map, find what you need.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 📑 Content Map
|
|
19
|
-
|
|
20
|
-
| File | Description | When to Read |
|
|
21
|
-
|------|-------------|--------------|
|
|
22
|
-
| `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |
|
|
23
|
-
| `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |
|
|
24
|
-
| `response.md` | Envelope pattern, error format, pagination | Response structure |
|
|
25
|
-
| `graphql.md` | Schema design, when to use, security | Considering GraphQL |
|
|
26
|
-
| `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |
|
|
27
|
-
| `versioning.md` | URI/Header/Query versioning | API evolution planning |
|
|
28
|
-
| `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
|
|
29
|
-
| `rate-limiting.md` | Token bucket, sliding window | API protection |
|
|
30
|
-
| `documentation.md` | OpenAPI/Swagger best practices | Documentation |
|
|
31
|
-
| `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 🔗 Related Skills
|
|
36
|
-
|
|
37
|
-
| Need | Skill |
|
|
38
|
-
|------|-------|
|
|
39
|
-
| API implementation | `@[skills/backend-development]` |
|
|
40
|
-
| Data structure | `@[skills/database-design]` |
|
|
41
|
-
| Security details | `@[skills/security-hardening]` |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## ✅ Decision Checklist
|
|
46
|
-
|
|
47
|
-
Before designing an API:
|
|
48
|
-
|
|
49
|
-
- [ ] **Asked user about API consumers?**
|
|
50
|
-
- [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)
|
|
51
|
-
- [ ] **Defined consistent response format?**
|
|
52
|
-
- [ ] **Planned versioning strategy?**
|
|
53
|
-
- [ ] **Considered authentication needs?**
|
|
54
|
-
- [ ] **Planned rate limiting?**
|
|
55
|
-
- [ ] **Documentation approach defined?**
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## ❌ Anti-Patterns
|
|
60
|
-
|
|
61
|
-
**DON'T:**
|
|
62
|
-
- Default to REST for everything
|
|
63
|
-
- Use verbs in REST endpoints (/getUsers)
|
|
64
|
-
- Return inconsistent response formats
|
|
65
|
-
- Expose internal errors to clients
|
|
66
|
-
- Skip rate limiting
|
|
67
|
-
|
|
68
|
-
**DO:**
|
|
69
|
-
- Choose API style based on context
|
|
70
|
-
- Ask about client requirements
|
|
71
|
-
- Document thoroughly
|
|
72
|
-
- Use appropriate status codes
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Script
|
|
77
|
-
|
|
78
|
-
| Script | Purpose | Command |
|
|
79
|
-
|--------|---------|---------|
|
|
80
|
-
| `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |
|
|
81
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# API Style Selection (2025)
|
|
2
|
-
|
|
3
|
-
> REST vs GraphQL vs tRPC - Hangi durumda hangisi?
|
|
4
|
-
|
|
5
|
-
## Decision Tree
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Who are the API consumers?
|
|
9
|
-
│
|
|
10
|
-
├── Public API / Multiple platforms
|
|
11
|
-
│ └── REST + OpenAPI (widest compatibility)
|
|
12
|
-
│
|
|
13
|
-
├── Complex data needs / Multiple frontends
|
|
14
|
-
│ └── GraphQL (flexible queries)
|
|
15
|
-
│
|
|
16
|
-
├── TypeScript frontend + backend (monorepo)
|
|
17
|
-
│ └── tRPC (end-to-end type safety)
|
|
18
|
-
│
|
|
19
|
-
├── Real-time / Event-driven
|
|
20
|
-
│ └── WebSocket + AsyncAPI
|
|
21
|
-
│
|
|
22
|
-
└── Internal microservices
|
|
23
|
-
└── gRPC (performance) or REST (simplicity)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Comparison
|
|
27
|
-
|
|
28
|
-
| Factor | REST | GraphQL | tRPC |
|
|
29
|
-
|--------|------|---------|------|
|
|
30
|
-
| **Best for** | Public APIs | Complex apps | TS monorepos |
|
|
31
|
-
| **Learning curve** | Low | Medium | Low (if TS) |
|
|
32
|
-
| **Over/under fetching** | Common | Solved | Solved |
|
|
33
|
-
| **Type safety** | Manual (OpenAPI) | Schema-based | Automatic |
|
|
34
|
-
| **Caching** | HTTP native | Complex | Client-based |
|
|
35
|
-
|
|
36
|
-
## Selection Questions
|
|
37
|
-
|
|
38
|
-
1. Who are the API consumers?
|
|
39
|
-
2. Is the frontend TypeScript?
|
|
40
|
-
3. How complex are the data relationships?
|
|
41
|
-
4. Is caching critical?
|
|
42
|
-
5. Public or internal API?
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Authentication Patterns
|
|
2
|
-
|
|
3
|
-
> Choose auth pattern based on use case.
|
|
4
|
-
|
|
5
|
-
## Selection Guide
|
|
6
|
-
|
|
7
|
-
| Pattern | Best For |
|
|
8
|
-
|---------|----------|
|
|
9
|
-
| **JWT** | Stateless, microservices |
|
|
10
|
-
| **Session** | Traditional web, simple |
|
|
11
|
-
| **OAuth 2.0** | Third-party integration |
|
|
12
|
-
| **API Keys** | Server-to-server, public APIs |
|
|
13
|
-
| **Passkey** | Modern passwordless (2025+) |
|
|
14
|
-
|
|
15
|
-
## JWT Principles
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
Important:
|
|
19
|
-
├── Always verify signature
|
|
20
|
-
├── Check expiration
|
|
21
|
-
├── Include minimal claims
|
|
22
|
-
├── Use short expiry + refresh tokens
|
|
23
|
-
└── Never store sensitive data in JWT
|
|
24
|
-
```
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# API Documentation Principles
|
|
2
|
-
|
|
3
|
-
> Good docs = happy developers = API adoption.
|
|
4
|
-
|
|
5
|
-
## OpenAPI/Swagger Essentials
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Include:
|
|
9
|
-
├── All endpoints with examples
|
|
10
|
-
├── Request/response schemas
|
|
11
|
-
├── Authentication requirements
|
|
12
|
-
├── Error response formats
|
|
13
|
-
└── Rate limiting info
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Good Documentation Has
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Essentials:
|
|
20
|
-
├── Quick start / Getting started
|
|
21
|
-
├── Authentication guide
|
|
22
|
-
├── Complete API reference
|
|
23
|
-
├── Error handling guide
|
|
24
|
-
├── Code examples (multiple languages)
|
|
25
|
-
└── Changelog
|
|
26
|
-
```
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# GraphQL Principles
|
|
2
|
-
|
|
3
|
-
> Flexible queries for complex, interconnected data.
|
|
4
|
-
|
|
5
|
-
## When to Use
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
✅ Good fit:
|
|
9
|
-
├── Complex, interconnected data
|
|
10
|
-
├── Multiple frontend platforms
|
|
11
|
-
├── Clients need flexible queries
|
|
12
|
-
├── Evolving data requirements
|
|
13
|
-
└── Reducing over-fetching matters
|
|
14
|
-
|
|
15
|
-
❌ Poor fit:
|
|
16
|
-
├── Simple CRUD operations
|
|
17
|
-
├── File upload heavy
|
|
18
|
-
├── HTTP caching important
|
|
19
|
-
└── Team unfamiliar with GraphQL
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Schema Design Principles
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
Principles:
|
|
26
|
-
├── Think in graphs, not endpoints
|
|
27
|
-
├── Design for evolvability (no versions)
|
|
28
|
-
├── Use connections for pagination
|
|
29
|
-
├── Be specific with types (not generic "data")
|
|
30
|
-
└── Handle nullability thoughtfully
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Security Considerations
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
Protect against:
|
|
37
|
-
├── Query depth attacks → Set max depth
|
|
38
|
-
├── Query complexity → Calculate cost
|
|
39
|
-
├── Batching abuse → Limit batch size
|
|
40
|
-
├── Introspection → Disable in production
|
|
41
|
-
```
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Rate Limiting Principles
|
|
2
|
-
|
|
3
|
-
> Protect your API from abuse and overload.
|
|
4
|
-
|
|
5
|
-
## Why Rate Limit
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Protect against:
|
|
9
|
-
├── Brute force attacks
|
|
10
|
-
├── Resource exhaustion
|
|
11
|
-
├── Cost overruns (if pay-per-use)
|
|
12
|
-
└── Unfair usage
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Strategy Selection
|
|
16
|
-
|
|
17
|
-
| Type | How | When |
|
|
18
|
-
|------|-----|------|
|
|
19
|
-
| **Token bucket** | Burst allowed, refills over time | Most APIs |
|
|
20
|
-
| **Sliding window** | Smooth distribution | Strict limits |
|
|
21
|
-
| **Fixed window** | Simple counters per window | Basic needs |
|
|
22
|
-
|
|
23
|
-
## Response Headers
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
Include in headers:
|
|
27
|
-
├── X-RateLimit-Limit (max requests)
|
|
28
|
-
├── X-RateLimit-Remaining (requests left)
|
|
29
|
-
├── X-RateLimit-Reset (when limit resets)
|
|
30
|
-
└── Return 429 when exceeded
|
|
31
|
-
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Response Format Principles
|
|
2
|
-
|
|
3
|
-
> Consistency is key - choose a format and stick to it.
|
|
4
|
-
|
|
5
|
-
## Common Patterns
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Choose one:
|
|
9
|
-
├── Envelope pattern ({ success, data, error })
|
|
10
|
-
├── Direct data (just return the resource)
|
|
11
|
-
└── HAL/JSON:API (hypermedia)
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Error Response
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Include:
|
|
18
|
-
├── Error code (for programmatic handling)
|
|
19
|
-
├── User message (for display)
|
|
20
|
-
├── Details (for debugging, field-level errors)
|
|
21
|
-
├── Request ID (for support)
|
|
22
|
-
└── NOT internal details (security!)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Pagination Types
|
|
26
|
-
|
|
27
|
-
| Type | Best For | Trade-offs |
|
|
28
|
-
|------|----------|------------|
|
|
29
|
-
| **Offset** | Simple, jumpable | Performance on large datasets |
|
|
30
|
-
| **Cursor** | Large datasets | Can't jump to page |
|
|
31
|
-
| **Keyset** | Performance critical | Requires sortable key |
|
|
32
|
-
|
|
33
|
-
### Selection Questions
|
|
34
|
-
|
|
35
|
-
1. How large is the dataset?
|
|
36
|
-
2. Do users need to jump to specific pages?
|
|
37
|
-
3. Is data frequently changing?
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# REST Principles
|
|
2
|
-
|
|
3
|
-
> Resource-based API design - nouns not verbs.
|
|
4
|
-
|
|
5
|
-
## Resource Naming Rules
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Principles:
|
|
9
|
-
├── Use NOUNS, not verbs (resources, not actions)
|
|
10
|
-
├── Use PLURAL forms (/users not /user)
|
|
11
|
-
├── Use lowercase with hyphens (/user-profiles)
|
|
12
|
-
├── Nest for relationships (/users/123/posts)
|
|
13
|
-
└── Keep shallow (max 3 levels deep)
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## HTTP Method Selection
|
|
17
|
-
|
|
18
|
-
| Method | Purpose | Idempotent? | Body? |
|
|
19
|
-
|--------|---------|-------------|-------|
|
|
20
|
-
| **GET** | Read resource(s) | Yes | No |
|
|
21
|
-
| **POST** | Create new resource | No | Yes |
|
|
22
|
-
| **PUT** | Replace entire resource | Yes | Yes |
|
|
23
|
-
| **PATCH** | Partial update | No | Yes |
|
|
24
|
-
| **DELETE** | Remove resource | Yes | No |
|
|
25
|
-
|
|
26
|
-
## Status Code Selection
|
|
27
|
-
|
|
28
|
-
| Situation | Code | Why |
|
|
29
|
-
|-----------|------|-----|
|
|
30
|
-
| Success (read) | 200 | Standard success |
|
|
31
|
-
| Created | 201 | New resource created |
|
|
32
|
-
| No content | 204 | Success, nothing to return |
|
|
33
|
-
| Bad request | 400 | Malformed request |
|
|
34
|
-
| Unauthorized | 401 | Missing/invalid auth |
|
|
35
|
-
| Forbidden | 403 | Valid auth, no permission |
|
|
36
|
-
| Not found | 404 | Resource doesn't exist |
|
|
37
|
-
| Conflict | 409 | State conflict (duplicate) |
|
|
38
|
-
| Validation error | 422 | Valid syntax, invalid data |
|
|
39
|
-
| Rate limited | 429 | Too many requests |
|
|
40
|
-
| Server error | 500 | Our fault |
|