@defai.digital/automatosx 5.0.13 → 5.1.2
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/CHANGELOG.md +110 -0
- package/README.md +310 -92
- package/dist/index.js +7784 -6097
- package/dist/index.js.map +1 -1
- package/dist/version.json +3 -3
- package/examples/AGENTS_INFO.md +495 -0
- package/examples/README.md +434 -0
- package/examples/abilities/accessibility.md +115 -0
- package/examples/abilities/api-design.md +159 -0
- package/examples/abilities/best-practices.md +102 -0
- package/examples/abilities/caching-strategy.md +165 -0
- package/examples/abilities/ci-cd.md +61 -0
- package/examples/abilities/code-generation.md +95 -0
- package/examples/abilities/code-review.md +42 -0
- package/examples/abilities/component-architecture.md +112 -0
- package/examples/abilities/content-creation.md +97 -0
- package/examples/abilities/data-modeling.md +171 -0
- package/examples/abilities/data-validation.md +50 -0
- package/examples/abilities/db-modeling.md +158 -0
- package/examples/abilities/debugging.md +43 -0
- package/examples/abilities/dependency-audit.md +60 -0
- package/examples/abilities/design-system-implementation.md +126 -0
- package/examples/abilities/documentation.md +54 -0
- package/examples/abilities/error-analysis.md +107 -0
- package/examples/abilities/etl-pipelines.md +44 -0
- package/examples/abilities/feasibility-study.md +20 -0
- package/examples/abilities/general-assistance.md +26 -0
- package/examples/abilities/idea-evaluation.md +21 -0
- package/examples/abilities/infra-as-code.md +57 -0
- package/examples/abilities/job-orchestration.md +44 -0
- package/examples/abilities/literature-review.md +19 -0
- package/examples/abilities/logical-analysis.md +21 -0
- package/examples/abilities/longform-report.md +25 -0
- package/examples/abilities/observability.md +61 -0
- package/examples/abilities/our-architecture-decisions.md +180 -0
- package/examples/abilities/our-code-review-checklist.md +149 -0
- package/examples/abilities/our-coding-standards.md +270 -0
- package/examples/abilities/our-project-structure.md +175 -0
- package/examples/abilities/performance-analysis.md +56 -0
- package/examples/abilities/performance.md +80 -0
- package/examples/abilities/problem-solving.md +50 -0
- package/examples/abilities/refactoring.md +49 -0
- package/examples/abilities/release-strategy.md +58 -0
- package/examples/abilities/risk-assessment.md +19 -0
- package/examples/abilities/secrets-policy.md +61 -0
- package/examples/abilities/secure-coding-review.md +51 -0
- package/examples/abilities/security-audit.md +65 -0
- package/examples/abilities/sql-optimization.md +84 -0
- package/examples/abilities/state-management.md +96 -0
- package/examples/abilities/task-planning.md +65 -0
- package/examples/abilities/technical-writing.md +77 -0
- package/examples/abilities/testing.md +47 -0
- package/examples/abilities/threat-modeling.md +49 -0
- package/examples/abilities/troubleshooting.md +80 -0
- package/examples/agents/.tmp +0 -0
- package/examples/agents/backend.yaml +69 -0
- package/examples/agents/ceo.yaml +60 -0
- package/examples/agents/cto.yaml +59 -0
- package/examples/agents/data.yaml +77 -0
- package/examples/agents/design.yaml +73 -0
- package/examples/agents/devops.yaml +82 -0
- package/examples/agents/frontend.yaml +74 -0
- package/examples/agents/product.yaml +69 -0
- package/examples/agents/quality.yaml +70 -0
- package/examples/agents/researcher.yaml +71 -0
- package/examples/agents/security.yaml +84 -0
- package/examples/agents/writer.yaml +77 -0
- package/examples/claude/commands/ax:agent.md +37 -0
- package/examples/claude/commands/ax:clear.md +22 -0
- package/examples/claude/commands/ax:init.md +25 -0
- package/examples/claude/commands/ax:list.md +19 -0
- package/examples/claude/commands/ax:memory.md +25 -0
- package/examples/claude/commands/ax:status.md +24 -0
- package/examples/claude/commands/ax:update.md +28 -0
- package/examples/claude/mcp/automatosx.json +244 -0
- package/examples/teams/business.yaml +56 -0
- package/examples/teams/core.yaml +59 -0
- package/examples/teams/design.yaml +58 -0
- package/examples/teams/engineering.yaml +69 -0
- package/examples/teams/research.yaml +56 -0
- package/examples/templates/analyst.yaml +60 -0
- package/examples/templates/assistant.yaml +48 -0
- package/examples/templates/basic-agent.yaml +28 -0
- package/examples/templates/code-reviewer.yaml +52 -0
- package/examples/templates/debugger.yaml +63 -0
- package/examples/templates/designer.yaml +69 -0
- package/examples/templates/developer.yaml +60 -0
- package/examples/templates/fullstack-developer.yaml +395 -0
- package/examples/templates/qa-specialist.yaml +71 -0
- package/examples/use-cases/01-web-app-development.md +374 -0
- package/package.json +2 -1
- package/version.json +3 -3
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Best Practices Ability
|
|
2
|
+
|
|
3
|
+
Apply industry-standard best practices across development.
|
|
4
|
+
|
|
5
|
+
## Code Quality
|
|
6
|
+
|
|
7
|
+
1. **Readability**
|
|
8
|
+
- Clear, descriptive names
|
|
9
|
+
- Consistent formatting
|
|
10
|
+
- Meaningful comments
|
|
11
|
+
- Self-documenting code
|
|
12
|
+
|
|
13
|
+
2. **Simplicity**
|
|
14
|
+
- KISS (Keep It Simple, Stupid)
|
|
15
|
+
- Avoid over-engineering
|
|
16
|
+
- Solve today's problem
|
|
17
|
+
- Refactor when needed
|
|
18
|
+
|
|
19
|
+
3. **Maintainability**
|
|
20
|
+
- DRY (Don't Repeat Yourself)
|
|
21
|
+
- SOLID principles
|
|
22
|
+
- Low coupling, high cohesion
|
|
23
|
+
- Modular design
|
|
24
|
+
|
|
25
|
+
4. **Reliability**
|
|
26
|
+
- Error handling
|
|
27
|
+
- Input validation
|
|
28
|
+
- Defensive programming
|
|
29
|
+
- Comprehensive testing
|
|
30
|
+
|
|
31
|
+
## Development Practices
|
|
32
|
+
|
|
33
|
+
### Version Control (Git)
|
|
34
|
+
|
|
35
|
+
- Commit often, push daily
|
|
36
|
+
- Write meaningful commit messages
|
|
37
|
+
- Use feature branches
|
|
38
|
+
- Review before merging
|
|
39
|
+
- Keep main/master deployable
|
|
40
|
+
|
|
41
|
+
### Code Review
|
|
42
|
+
|
|
43
|
+
- Review all changes
|
|
44
|
+
- Be constructive and respectful
|
|
45
|
+
- Check for bugs, style, design
|
|
46
|
+
- Suggest alternatives
|
|
47
|
+
- Approve only when ready
|
|
48
|
+
|
|
49
|
+
### Testing
|
|
50
|
+
|
|
51
|
+
- Write tests first (TDD)
|
|
52
|
+
- Test behavior, not implementation
|
|
53
|
+
- Aim for 80%+ coverage
|
|
54
|
+
- Fast test execution
|
|
55
|
+
- Fix failing tests immediately
|
|
56
|
+
|
|
57
|
+
### Security
|
|
58
|
+
|
|
59
|
+
- Never commit secrets
|
|
60
|
+
- Validate all inputs
|
|
61
|
+
- Use parameterized queries
|
|
62
|
+
- Keep dependencies updated
|
|
63
|
+
- Follow OWASP guidelines
|
|
64
|
+
|
|
65
|
+
## Architecture Principles
|
|
66
|
+
|
|
67
|
+
1. **Separation of Concerns**
|
|
68
|
+
- Each module has one responsibility
|
|
69
|
+
- Clear boundaries
|
|
70
|
+
- Minimal dependencies
|
|
71
|
+
|
|
72
|
+
2. **Dependency Injection**
|
|
73
|
+
- Don't create dependencies internally
|
|
74
|
+
- Inject through constructor/parameters
|
|
75
|
+
- Easier testing and flexibility
|
|
76
|
+
|
|
77
|
+
3. **Interface-Based Design**
|
|
78
|
+
- Program to interfaces, not implementations
|
|
79
|
+
- Enables polymorphism
|
|
80
|
+
- Facilitates testing (mocking)
|
|
81
|
+
|
|
82
|
+
4. **Configuration Over Hardcoding**
|
|
83
|
+
- Use config files/environment variables
|
|
84
|
+
- Don't hardcode URLs, paths, credentials
|
|
85
|
+
- Environment-specific configs
|
|
86
|
+
|
|
87
|
+
## Performance
|
|
88
|
+
|
|
89
|
+
- Profile before optimizing
|
|
90
|
+
- Optimize bottlenecks only
|
|
91
|
+
- Use caching strategically
|
|
92
|
+
- Minimize database queries
|
|
93
|
+
- Lazy load when possible
|
|
94
|
+
- Consider asynchronous operations
|
|
95
|
+
|
|
96
|
+
## Documentation
|
|
97
|
+
|
|
98
|
+
- README for every project
|
|
99
|
+
- API documentation (JSDoc, OpenAPI)
|
|
100
|
+
- Code comments for "why"
|
|
101
|
+
- Architecture diagrams
|
|
102
|
+
- Changelog/release notes
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Caching Strategy
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Design and implement multi-layer caching strategies to optimize application performance, reduce database load, and improve user experience.
|
|
5
|
+
|
|
6
|
+
## Caching Layers
|
|
7
|
+
|
|
8
|
+
### 1. Client-Side Caching
|
|
9
|
+
- Browser cache (Cache-Control, ETag)
|
|
10
|
+
- Service Worker caching
|
|
11
|
+
- Local Storage / IndexedDB
|
|
12
|
+
- CDN edge caching
|
|
13
|
+
|
|
14
|
+
### 2. Application-Level Caching
|
|
15
|
+
- In-memory cache (Redis, Memcached)
|
|
16
|
+
- Application process cache
|
|
17
|
+
- Query result caching
|
|
18
|
+
- Computed value caching
|
|
19
|
+
|
|
20
|
+
### 3. Database Caching
|
|
21
|
+
- Query result cache
|
|
22
|
+
- Prepared statement cache
|
|
23
|
+
- Connection pool
|
|
24
|
+
- Buffer pool (InnoDB)
|
|
25
|
+
|
|
26
|
+
## Cache Patterns
|
|
27
|
+
|
|
28
|
+
### Cache-Aside (Lazy Loading)
|
|
29
|
+
1. Check cache
|
|
30
|
+
2. If miss → Query database
|
|
31
|
+
3. Store in cache
|
|
32
|
+
4. Return data
|
|
33
|
+
|
|
34
|
+
**Use when**: Read-heavy, acceptable stale data
|
|
35
|
+
|
|
36
|
+
### Write-Through
|
|
37
|
+
1. Write to cache
|
|
38
|
+
2. Write to database (synchronous)
|
|
39
|
+
3. Return success
|
|
40
|
+
|
|
41
|
+
**Use when**: Data consistency critical
|
|
42
|
+
|
|
43
|
+
### Write-Behind (Write-Back)
|
|
44
|
+
1. Write to cache
|
|
45
|
+
2. Queue database write (async)
|
|
46
|
+
3. Return success
|
|
47
|
+
|
|
48
|
+
**Use when**: High write throughput needed
|
|
49
|
+
|
|
50
|
+
### Read-Through
|
|
51
|
+
Cache handles database reads automatically
|
|
52
|
+
|
|
53
|
+
**Use when**: Simplify application logic
|
|
54
|
+
|
|
55
|
+
### Refresh-Ahead
|
|
56
|
+
Proactively refresh before expiration
|
|
57
|
+
|
|
58
|
+
**Use when**: Predictable access patterns
|
|
59
|
+
|
|
60
|
+
## Cache Invalidation
|
|
61
|
+
|
|
62
|
+
### Time-Based (TTL)
|
|
63
|
+
**Pros**: Simple, predictable
|
|
64
|
+
**Cons**: May serve stale data
|
|
65
|
+
|
|
66
|
+
### Event-Based
|
|
67
|
+
**Pros**: Always fresh
|
|
68
|
+
**Cons**: Complex invalidation logic
|
|
69
|
+
|
|
70
|
+
### Tag-Based
|
|
71
|
+
**Pros**: Flexible, bulk invalidation
|
|
72
|
+
**Cons**: Overhead in management
|
|
73
|
+
|
|
74
|
+
## Cache Key Design
|
|
75
|
+
|
|
76
|
+
### Naming Conventions
|
|
77
|
+
`<namespace>:<entity>:<id>:<attribute>`
|
|
78
|
+
|
|
79
|
+
Examples:
|
|
80
|
+
- `user:123:profile`
|
|
81
|
+
- `product:456:inventory`
|
|
82
|
+
- `session:abc123:cart`
|
|
83
|
+
|
|
84
|
+
### Hierarchical Keys
|
|
85
|
+
`app:v1:user:123:settings`
|
|
86
|
+
|
|
87
|
+
### Composite Keys
|
|
88
|
+
- `search:query:<hash>:page:1`
|
|
89
|
+
- `filter:category:electronics:brand:apple`
|
|
90
|
+
|
|
91
|
+
## Performance Optimization
|
|
92
|
+
|
|
93
|
+
### Connection Pooling
|
|
94
|
+
- Min/max pool size tuning
|
|
95
|
+
- Connection timeout configuration
|
|
96
|
+
- Health checks for stale connections
|
|
97
|
+
|
|
98
|
+
### Compression
|
|
99
|
+
- Compress large values (>1KB)
|
|
100
|
+
- Trade CPU for memory savings
|
|
101
|
+
- Use MessagePack or Snappy
|
|
102
|
+
|
|
103
|
+
### Batch Operations
|
|
104
|
+
- Pipeline multiple commands
|
|
105
|
+
- Reduce network round trips
|
|
106
|
+
|
|
107
|
+
### Read Replicas
|
|
108
|
+
- Separate read/write connections
|
|
109
|
+
- Route heavy reads to replicas
|
|
110
|
+
- Monitor replication lag
|
|
111
|
+
|
|
112
|
+
## Monitoring & Metrics
|
|
113
|
+
|
|
114
|
+
### Key Metrics
|
|
115
|
+
- Hit rate (hits / (hits + misses))
|
|
116
|
+
- Miss rate
|
|
117
|
+
- Eviction rate
|
|
118
|
+
- Memory usage
|
|
119
|
+
- Latency (p50, p95, p99)
|
|
120
|
+
|
|
121
|
+
### Alerts
|
|
122
|
+
- Hit rate < 80%
|
|
123
|
+
- Memory usage > 85%
|
|
124
|
+
- Eviction rate spike
|
|
125
|
+
- Replication lag > 1s
|
|
126
|
+
|
|
127
|
+
## Eviction Policies
|
|
128
|
+
- **noeviction**: Return error when full
|
|
129
|
+
- **allkeys-lru**: Evict least recently used
|
|
130
|
+
- **volatile-lru**: Evict LRU with TTL set
|
|
131
|
+
- **allkeys-random**: Random eviction
|
|
132
|
+
- **volatile-ttl**: Evict soonest expiring
|
|
133
|
+
|
|
134
|
+
## Common Pitfalls
|
|
135
|
+
|
|
136
|
+
### Cache Stampede
|
|
137
|
+
**Problem**: Many requests hit DB on cache miss
|
|
138
|
+
**Solution**: Probabilistic early expiration, lock-based refresh, always return stale data while refreshing
|
|
139
|
+
|
|
140
|
+
### Cache Penetration
|
|
141
|
+
**Problem**: Queries for non-existent data bypass cache
|
|
142
|
+
**Solution**: Cache null results with short TTL
|
|
143
|
+
|
|
144
|
+
### Hot Key Problem
|
|
145
|
+
**Problem**: Single key gets massive traffic
|
|
146
|
+
**Solution**: Key sharding, local cache, load balancing
|
|
147
|
+
|
|
148
|
+
### Cache Avalanche
|
|
149
|
+
**Problem**: Many keys expire simultaneously
|
|
150
|
+
**Solution**: Add jitter to TTL (TTL ± random)
|
|
151
|
+
|
|
152
|
+
## Design Checklist
|
|
153
|
+
|
|
154
|
+
- [ ] Cache layers identified (client, app, DB)
|
|
155
|
+
- [ ] Cache pattern selected (cache-aside, write-through, etc.)
|
|
156
|
+
- [ ] Invalidation strategy defined
|
|
157
|
+
- [ ] Key naming convention established
|
|
158
|
+
- [ ] TTL values justified
|
|
159
|
+
- [ ] Eviction policy configured
|
|
160
|
+
- [ ] Connection pooling set up
|
|
161
|
+
- [ ] Monitoring/alerting configured
|
|
162
|
+
- [ ] Security measures implemented
|
|
163
|
+
- [ ] Cache stampede prevention
|
|
164
|
+
- [ ] Performance testing completed
|
|
165
|
+
- [ ] Documentation updated
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# CI/CD Pipelines
|
|
2
|
+
|
|
3
|
+
Automate build, test, and deployment processes. Implement continuous integration and continuous delivery for reliable, fast releases.
|
|
4
|
+
|
|
5
|
+
## Do's ✅
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
# ✅ Good: Comprehensive pipeline (GitHub Actions)
|
|
9
|
+
name: CI/CD
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches: [main]
|
|
13
|
+
pull_request:
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v3
|
|
20
|
+
- uses: actions/setup-node@v3
|
|
21
|
+
with:
|
|
22
|
+
node-version: '18'
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
- run: npm ci
|
|
25
|
+
- run: npm run lint
|
|
26
|
+
- run: npm test
|
|
27
|
+
- run: npm run build
|
|
28
|
+
|
|
29
|
+
deploy:
|
|
30
|
+
needs: test
|
|
31
|
+
if: github.ref == 'refs/heads/main'
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- name: Deploy
|
|
35
|
+
run: ./deploy.sh production
|
|
36
|
+
env:
|
|
37
|
+
AWS_KEY: ${{ secrets.AWS_KEY }}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Don'ts ❌
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
# ❌ Bad: Deploy without testing
|
|
44
|
+
on: push
|
|
45
|
+
jobs:
|
|
46
|
+
deploy:
|
|
47
|
+
steps:
|
|
48
|
+
- run: ./deploy.sh # YOLO!
|
|
49
|
+
|
|
50
|
+
# ❌ Bad: Secrets in code
|
|
51
|
+
env:
|
|
52
|
+
API_KEY: "sk_live_abc123" # Never!
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Best Practices
|
|
56
|
+
- Run tests on every commit
|
|
57
|
+
- Use secrets management
|
|
58
|
+
- Implement rollback strategies
|
|
59
|
+
- Use artifact caching
|
|
60
|
+
- Implement deployment gates for production
|
|
61
|
+
- Monitor deployment health
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Code Generation
|
|
2
|
+
|
|
3
|
+
Generate high-quality, production-ready code following best practices and patterns.
|
|
4
|
+
|
|
5
|
+
## Core Principles
|
|
6
|
+
|
|
7
|
+
### 1. Type Safety & Validation
|
|
8
|
+
- Use strong typing (TypeScript interfaces, Python type hints)
|
|
9
|
+
- Validate inputs before processing
|
|
10
|
+
- Define clear return types
|
|
11
|
+
- Use enums for fixed value sets
|
|
12
|
+
|
|
13
|
+
### 2. Error Handling
|
|
14
|
+
- Use try-catch for I/O operations
|
|
15
|
+
- Provide specific error messages with context
|
|
16
|
+
- Log errors appropriately
|
|
17
|
+
- Never swallow errors silently
|
|
18
|
+
- Return typed error objects or throw typed exceptions
|
|
19
|
+
|
|
20
|
+
### 3. Function Design
|
|
21
|
+
- Single responsibility per function
|
|
22
|
+
- Clear, descriptive names
|
|
23
|
+
- Document complex logic with comments
|
|
24
|
+
- Keep functions small (<50 lines)
|
|
25
|
+
- Minimize side effects
|
|
26
|
+
|
|
27
|
+
### 4. API Design
|
|
28
|
+
- RESTful conventions (GET/POST/PUT/DELETE)
|
|
29
|
+
- Consistent response formats
|
|
30
|
+
- Proper HTTP status codes
|
|
31
|
+
- Request/response validation
|
|
32
|
+
- API versioning when needed
|
|
33
|
+
|
|
34
|
+
### 5. Testing
|
|
35
|
+
- Write unit tests for business logic
|
|
36
|
+
- Test error cases and edge conditions
|
|
37
|
+
- Use descriptive test names
|
|
38
|
+
- Aim for >80% coverage on critical paths
|
|
39
|
+
- Mock external dependencies
|
|
40
|
+
|
|
41
|
+
### 6. Code Quality
|
|
42
|
+
- Follow project coding standards
|
|
43
|
+
- Use linting and formatting tools
|
|
44
|
+
- Write self-documenting code
|
|
45
|
+
- Keep complexity low (cyclomatic complexity <10)
|
|
46
|
+
- Remove dead code and TODOs
|
|
47
|
+
|
|
48
|
+
### 7. Security
|
|
49
|
+
- Validate and sanitize all inputs
|
|
50
|
+
- Use parameterized queries (prevent SQL injection)
|
|
51
|
+
- Never log sensitive data
|
|
52
|
+
- Follow principle of least privilege
|
|
53
|
+
- Keep dependencies updated
|
|
54
|
+
|
|
55
|
+
### 8. Performance
|
|
56
|
+
- Avoid N+1 queries
|
|
57
|
+
- Use appropriate data structures
|
|
58
|
+
- Cache when beneficial
|
|
59
|
+
- Lazy load when possible
|
|
60
|
+
- Profile before optimizing
|
|
61
|
+
|
|
62
|
+
## Language-Specific Patterns
|
|
63
|
+
|
|
64
|
+
### TypeScript/JavaScript
|
|
65
|
+
- Async/await for promises
|
|
66
|
+
- Optional chaining (?.) and nullish coalescing (??)
|
|
67
|
+
- Destructuring for cleaner code
|
|
68
|
+
- Use const by default, let when needed
|
|
69
|
+
- Avoid var
|
|
70
|
+
|
|
71
|
+
### Python
|
|
72
|
+
- Type hints for function signatures
|
|
73
|
+
- List/dict comprehensions for data transformation
|
|
74
|
+
- Context managers (with statement) for resources
|
|
75
|
+
- Follow PEP 8 style guide
|
|
76
|
+
- Use dataclasses for data models
|
|
77
|
+
|
|
78
|
+
### SQL
|
|
79
|
+
- Use indexes on frequently queried columns
|
|
80
|
+
- Avoid SELECT *
|
|
81
|
+
- Use JOINs efficiently
|
|
82
|
+
- Parameterize queries
|
|
83
|
+
- Use transactions for multi-step operations
|
|
84
|
+
|
|
85
|
+
## Quick Checklist
|
|
86
|
+
|
|
87
|
+
Before submitting code:
|
|
88
|
+
- [ ] Types and interfaces defined
|
|
89
|
+
- [ ] Error handling implemented
|
|
90
|
+
- [ ] Input validation added
|
|
91
|
+
- [ ] Tests written and passing
|
|
92
|
+
- [ ] Code formatted and linted
|
|
93
|
+
- [ ] No console.log/print in production code
|
|
94
|
+
- [ ] Security considerations addressed
|
|
95
|
+
- [ ] Performance optimized where needed
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Code Review Ability
|
|
2
|
+
|
|
3
|
+
Perform thorough code reviews focusing on quality, security, and maintainability.
|
|
4
|
+
|
|
5
|
+
## Review Areas
|
|
6
|
+
|
|
7
|
+
1. **Correctness**
|
|
8
|
+
- Logic errors and bugs
|
|
9
|
+
- Edge case handling
|
|
10
|
+
- Error handling and validation
|
|
11
|
+
|
|
12
|
+
2. **Security**
|
|
13
|
+
- Input validation
|
|
14
|
+
- SQL injection, XSS vulnerabilities
|
|
15
|
+
- Secrets and credentials exposure
|
|
16
|
+
- Authentication and authorization
|
|
17
|
+
|
|
18
|
+
3. **Performance**
|
|
19
|
+
- Algorithm complexity (Big O)
|
|
20
|
+
- Resource usage (memory, CPU)
|
|
21
|
+
- Database query optimization
|
|
22
|
+
- Caching opportunities
|
|
23
|
+
|
|
24
|
+
4. **Maintainability**
|
|
25
|
+
- Code clarity and readability
|
|
26
|
+
- Documentation quality
|
|
27
|
+
- Test coverage
|
|
28
|
+
- Modularity and coupling
|
|
29
|
+
|
|
30
|
+
5. **Style**
|
|
31
|
+
- Coding standards compliance
|
|
32
|
+
- Naming conventions
|
|
33
|
+
- Code organization
|
|
34
|
+
- Consistent formatting
|
|
35
|
+
|
|
36
|
+
## Review Process
|
|
37
|
+
|
|
38
|
+
1. Understand the context and requirements
|
|
39
|
+
2. Review code systematically (file by file)
|
|
40
|
+
3. Identify issues and improvements
|
|
41
|
+
4. Prioritize findings (critical/major/minor)
|
|
42
|
+
5. Provide actionable, constructive feedback
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Component Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Design and implement reusable, maintainable component structures following modern frontend architecture patterns. Focus on composition, separation of concerns, and clear component hierarchies.
|
|
5
|
+
|
|
6
|
+
## Core Principles
|
|
7
|
+
|
|
8
|
+
### 1. Single Responsibility
|
|
9
|
+
Each component should have one clear purpose. Avoid components that try to do too much.
|
|
10
|
+
|
|
11
|
+
### 2. Composition Over Inheritance
|
|
12
|
+
Build complex UIs by composing smaller, focused components rather than creating deep inheritance chains.
|
|
13
|
+
|
|
14
|
+
### 3. Container/Presentational Pattern
|
|
15
|
+
- **Container components**: Handle logic, state, and side effects
|
|
16
|
+
- **Presentational components**: Focus purely on rendering UI based on props
|
|
17
|
+
|
|
18
|
+
### 4. Props Design
|
|
19
|
+
- Keep props interfaces simple and explicit
|
|
20
|
+
- Use TypeScript for type safety
|
|
21
|
+
- Avoid prop drilling—use context or state management for deep data
|
|
22
|
+
|
|
23
|
+
## Component Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
/components
|
|
27
|
+
/Button
|
|
28
|
+
Button.tsx # Component implementation
|
|
29
|
+
Button.test.tsx # Tests
|
|
30
|
+
Button.stories.tsx # Storybook stories
|
|
31
|
+
index.ts # Public exports
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Atomic Design
|
|
35
|
+
|
|
36
|
+
Organize components by complexity:
|
|
37
|
+
- **Atoms**: Button, Input, Label
|
|
38
|
+
- **Molecules**: FormField (Input + Label), SearchBar
|
|
39
|
+
- **Organisms**: LoginForm, Header, Card
|
|
40
|
+
- **Templates**: Page layouts
|
|
41
|
+
- **Pages**: Complete pages
|
|
42
|
+
|
|
43
|
+
## Best Practices
|
|
44
|
+
|
|
45
|
+
### Component Design
|
|
46
|
+
- Single responsibility principle
|
|
47
|
+
- TypeScript interfaces for props
|
|
48
|
+
- Proper error boundaries
|
|
49
|
+
- Clear naming conventions
|
|
50
|
+
|
|
51
|
+
### Performance
|
|
52
|
+
- Memoization where appropriate (React.memo, useMemo)
|
|
53
|
+
- Callback memoization (useCallback)
|
|
54
|
+
- Code splitting for heavy components
|
|
55
|
+
- Lazy loading with Suspense
|
|
56
|
+
|
|
57
|
+
### Testing
|
|
58
|
+
- Unit tests for component logic
|
|
59
|
+
- Integration tests for user interactions
|
|
60
|
+
- Accessibility testing
|
|
61
|
+
- Visual regression tests
|
|
62
|
+
|
|
63
|
+
## Anti-Patterns to Avoid
|
|
64
|
+
|
|
65
|
+
### 1. God Components
|
|
66
|
+
Components that handle too many responsibilities
|
|
67
|
+
|
|
68
|
+
### 2. Prop Drilling
|
|
69
|
+
Passing props through many levels—use Context API or state management
|
|
70
|
+
|
|
71
|
+
### 3. Tight Coupling
|
|
72
|
+
Components depending on specific parent or child implementations
|
|
73
|
+
|
|
74
|
+
### 4. Mixed Concerns
|
|
75
|
+
Mixing business logic, API calls, and rendering in one component
|
|
76
|
+
|
|
77
|
+
## Component Checklist
|
|
78
|
+
|
|
79
|
+
- [ ] Single responsibility
|
|
80
|
+
- [ ] TypeScript interfaces for props
|
|
81
|
+
- [ ] Proper error boundaries
|
|
82
|
+
- [ ] Memoization where appropriate
|
|
83
|
+
- [ ] Accessibility attributes (ARIA)
|
|
84
|
+
- [ ] Unit tests for logic
|
|
85
|
+
- [ ] Integration tests for interactions
|
|
86
|
+
- [ ] Storybook documentation
|
|
87
|
+
- [ ] Performance optimized
|
|
88
|
+
- [ ] Code split if heavy
|
|
89
|
+
|
|
90
|
+
## Performance Considerations
|
|
91
|
+
|
|
92
|
+
### Memoization
|
|
93
|
+
- Memoize expensive computations (useMemo)
|
|
94
|
+
- Memoize callback functions (useCallback)
|
|
95
|
+
- Memoize components that render often (React.memo)
|
|
96
|
+
|
|
97
|
+
### Code Splitting
|
|
98
|
+
- Lazy load heavy components
|
|
99
|
+
- Use Suspense for loading states
|
|
100
|
+
- Route-based code splitting
|
|
101
|
+
|
|
102
|
+
### Optimization Techniques
|
|
103
|
+
- Virtual scrolling for long lists
|
|
104
|
+
- Debounce/throttle for frequent events
|
|
105
|
+
- Avoid unnecessary re-renders
|
|
106
|
+
- Use production builds
|
|
107
|
+
|
|
108
|
+
## Resources
|
|
109
|
+
|
|
110
|
+
- [React Component Patterns](https://reactpatterns.com/)
|
|
111
|
+
- [Atomic Design Methodology](https://atomicdesign.bradfrost.com/)
|
|
112
|
+
- [Testing Library Best Practices](https://testing-library.com/docs/react-testing-library/intro)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Content Creation Ability
|
|
2
|
+
|
|
3
|
+
Create engaging, informative content for various audiences.
|
|
4
|
+
|
|
5
|
+
## Content Types
|
|
6
|
+
|
|
7
|
+
1. **Blog Posts**
|
|
8
|
+
- Catchy title
|
|
9
|
+
- Hook in first paragraph
|
|
10
|
+
- Clear structure (intro, body, conclusion)
|
|
11
|
+
- Scannable (headings, bullets, short paragraphs)
|
|
12
|
+
- Call to action
|
|
13
|
+
|
|
14
|
+
2. **Tutorials**
|
|
15
|
+
- Clear learning objectives
|
|
16
|
+
- Prerequisites listed
|
|
17
|
+
- Step-by-step instructions
|
|
18
|
+
- Code examples
|
|
19
|
+
- Screenshots/diagrams
|
|
20
|
+
- What you learned / next steps
|
|
21
|
+
|
|
22
|
+
3. **Documentation**
|
|
23
|
+
- Purpose and overview
|
|
24
|
+
- Installation/setup
|
|
25
|
+
- Usage examples
|
|
26
|
+
- API reference
|
|
27
|
+
- Troubleshooting
|
|
28
|
+
- FAQ
|
|
29
|
+
|
|
30
|
+
4. **Presentations**
|
|
31
|
+
- One idea per slide
|
|
32
|
+
- Visual > text
|
|
33
|
+
- Tell a story
|
|
34
|
+
- Practice delivery
|
|
35
|
+
- End with key takeaways
|
|
36
|
+
|
|
37
|
+
## Writing Process
|
|
38
|
+
|
|
39
|
+
1. **Research**
|
|
40
|
+
- Understand the topic
|
|
41
|
+
- Know your audience
|
|
42
|
+
- Check existing content
|
|
43
|
+
- Gather examples
|
|
44
|
+
|
|
45
|
+
2. **Outline**
|
|
46
|
+
- Main points
|
|
47
|
+
- Logical flow
|
|
48
|
+
- Supporting details
|
|
49
|
+
- Conclusion
|
|
50
|
+
|
|
51
|
+
3. **Draft**
|
|
52
|
+
- Get ideas down
|
|
53
|
+
- Don't self-edit yet
|
|
54
|
+
- Write more than needed
|
|
55
|
+
- Focus on clarity
|
|
56
|
+
|
|
57
|
+
4. **Edit**
|
|
58
|
+
- Cut unnecessary content
|
|
59
|
+
- Improve clarity
|
|
60
|
+
- Fix grammar/spelling
|
|
61
|
+
- Check flow and structure
|
|
62
|
+
|
|
63
|
+
5. **Review**
|
|
64
|
+
- Read aloud
|
|
65
|
+
- Get feedback
|
|
66
|
+
- Check accuracy
|
|
67
|
+
- Final polish
|
|
68
|
+
|
|
69
|
+
## Writing Tips
|
|
70
|
+
|
|
71
|
+
**Clarity:**
|
|
72
|
+
|
|
73
|
+
- Use simple words
|
|
74
|
+
- Short sentences
|
|
75
|
+
- Active voice
|
|
76
|
+
- Concrete examples
|
|
77
|
+
|
|
78
|
+
**Engagement:**
|
|
79
|
+
|
|
80
|
+
- Hook readers early
|
|
81
|
+
- Use stories and examples
|
|
82
|
+
- Ask questions
|
|
83
|
+
- Vary sentence length
|
|
84
|
+
|
|
85
|
+
**Structure:**
|
|
86
|
+
|
|
87
|
+
- Clear headings
|
|
88
|
+
- Logical progression
|
|
89
|
+
- Bullet points for lists
|
|
90
|
+
- White space for readability
|
|
91
|
+
|
|
92
|
+
**Credibility:**
|
|
93
|
+
|
|
94
|
+
- Cite sources
|
|
95
|
+
- Use data and statistics
|
|
96
|
+
- Show expertise
|
|
97
|
+
- Acknowledge limitations
|