@ruyfranca/myskills 1.0.28 → 1.0.30
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/.agent/rules/AGENTS.md +273 -0
- package/.agent/skills/cqrs-implementation/SKILL.md +107 -0
- package/.agent/skills/ddd-strategic-design/SKILL.md +70 -0
- package/.agent/skills/ddd-tactical-patterns/SKILL.md +70 -0
- package/.agent/skills/elixir-pro/SKILL.md +89 -0
- package/.agent/skills/event-sourcing-architect/SKILL.md +66 -0
- package/.agent/skills/golang-pro/SKILL.md +121 -0
- package/.agent/skills/kotlin-coroutines-expert/SKILL.md +99 -0
- package/.agent/skills/modern-javascript-patterns/SKILL.md +131 -0
- package/.agent/skills/monorepo-architect/SKILL.md +91 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +94 -247
- package/.agent/skills/react-patterns/SKILL.md +200 -0
- package/.agent/skills/react-state-management/SKILL.md +147 -0
- package/.agent/skills/ruby-pro/SKILL.md +105 -0
- package/.agent/skills/zod-validation-expert/SKILL.md +132 -0
- package/AGENTS.md +273 -0
- package/index.js +42 -9
- package/package.json +1 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: golang-pro
|
|
3
|
+
description: Master Go 1.21+ with modern patterns, advanced concurrency, performance optimization, and production-ready microservices.
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Go Pro
|
|
10
|
+
|
|
11
|
+
You are a Go expert specializing in modern Go 1.21+ development with advanced concurrency patterns, performance optimization, and production-ready system design.
|
|
12
|
+
|
|
13
|
+
## Use this skill when
|
|
14
|
+
|
|
15
|
+
- Building Go services, CLIs, or microservices
|
|
16
|
+
- Designing concurrency patterns and performance optimizations
|
|
17
|
+
- Reviewing Go architecture and production readiness
|
|
18
|
+
|
|
19
|
+
## Do not use this skill when
|
|
20
|
+
|
|
21
|
+
- You need another language or runtime
|
|
22
|
+
- You only need basic Go syntax explanations
|
|
23
|
+
- You cannot change Go tooling or build configuration
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
1. Confirm Go version, tooling, and runtime constraints.
|
|
28
|
+
2. Choose concurrency and architecture patterns.
|
|
29
|
+
3. Implement with testing and profiling.
|
|
30
|
+
4. Optimize for latency, memory, and reliability.
|
|
31
|
+
|
|
32
|
+
## Key Capabilities
|
|
33
|
+
|
|
34
|
+
### Concurrency & Parallelism
|
|
35
|
+
|
|
36
|
+
```go
|
|
37
|
+
// Worker pool pattern
|
|
38
|
+
func workerPool(ctx context.Context, jobs <-chan Job, numWorkers int) <-chan Result {
|
|
39
|
+
results := make(chan Result, numWorkers)
|
|
40
|
+
var wg sync.WaitGroup
|
|
41
|
+
|
|
42
|
+
for i := 0; i < numWorkers; i++ {
|
|
43
|
+
wg.Add(1)
|
|
44
|
+
go func() {
|
|
45
|
+
defer wg.Done()
|
|
46
|
+
for job := range jobs {
|
|
47
|
+
select {
|
|
48
|
+
case results <- processJob(ctx, job):
|
|
49
|
+
case <-ctx.Done():
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
go func() {
|
|
57
|
+
wg.Wait()
|
|
58
|
+
close(results)
|
|
59
|
+
}()
|
|
60
|
+
|
|
61
|
+
return results
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Error Handling
|
|
66
|
+
|
|
67
|
+
```go
|
|
68
|
+
// Wrap errors with context
|
|
69
|
+
if err := store.Save(user); err != nil {
|
|
70
|
+
return fmt.Errorf("saving user %s: %w", user.ID, err)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Sentinel errors
|
|
74
|
+
var ErrNotFound = errors.New("not found")
|
|
75
|
+
|
|
76
|
+
// Check wrapped errors
|
|
77
|
+
if errors.Is(err, ErrNotFound) {
|
|
78
|
+
// handle not found
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Testing
|
|
83
|
+
|
|
84
|
+
```go
|
|
85
|
+
func TestCalculate(t *testing.T) {
|
|
86
|
+
cases := []struct {
|
|
87
|
+
name string
|
|
88
|
+
input int
|
|
89
|
+
want int
|
|
90
|
+
}{
|
|
91
|
+
{"positive", 5, 25},
|
|
92
|
+
{"zero", 0, 0},
|
|
93
|
+
{"negative", -3, 9},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
for _, tc := range cases {
|
|
97
|
+
t.Run(tc.name, func(t *testing.T) {
|
|
98
|
+
got := Calculate(tc.input)
|
|
99
|
+
if got != tc.want {
|
|
100
|
+
t.Errorf("Calculate(%d) = %d, want %d", tc.input, got, tc.want)
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Modern Go Features (1.21+)
|
|
108
|
+
|
|
109
|
+
- Structured logging with `slog` (built-in)
|
|
110
|
+
- Improved type inference for generics
|
|
111
|
+
- `slices` and `maps` packages for common operations
|
|
112
|
+
- `min`, `max`, `clear` built-in functions
|
|
113
|
+
- `errors.Join` for combining errors
|
|
114
|
+
|
|
115
|
+
## Best Practices
|
|
116
|
+
|
|
117
|
+
- Prefer composition over inheritance (embed interfaces)
|
|
118
|
+
- Accept interfaces, return structs
|
|
119
|
+
- Use context for cancellation and deadlines
|
|
120
|
+
- Profile before optimizing (pprof)
|
|
121
|
+
- Use `golangci-lint` with strict config in CI
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kotlin-coroutines-expert
|
|
3
|
+
description: "Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing."
|
|
4
|
+
risk: safe
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Kotlin Coroutines Expert
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
A guide to mastering asynchronous programming with Kotlin Coroutines. Covers advanced topics like structured concurrency, `Flow` transformations, exception handling, and testing strategies.
|
|
14
|
+
|
|
15
|
+
## When to Use This Skill
|
|
16
|
+
|
|
17
|
+
- Use when implementing asynchronous operations in Kotlin.
|
|
18
|
+
- Use when designing reactive data streams with `Flow`.
|
|
19
|
+
- Use when debugging coroutine cancellations or exceptions.
|
|
20
|
+
- Use when writing unit tests for suspending functions or Flows.
|
|
21
|
+
|
|
22
|
+
## Step-by-Step Guide
|
|
23
|
+
|
|
24
|
+
### 1. Structured Concurrency
|
|
25
|
+
|
|
26
|
+
Always launch coroutines within a defined `CoroutineScope`. Use `coroutineScope` or `supervisorScope` to group concurrent tasks.
|
|
27
|
+
|
|
28
|
+
```kotlin
|
|
29
|
+
suspend fun loadDashboardData(): DashboardData = coroutineScope {
|
|
30
|
+
val userDeferred = async { userRepo.getUser() }
|
|
31
|
+
val settingsDeferred = async { settingsRepo.getSettings() }
|
|
32
|
+
|
|
33
|
+
DashboardData(
|
|
34
|
+
user = userDeferred.await(),
|
|
35
|
+
settings = settingsDeferred.await()
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Exception Handling
|
|
41
|
+
|
|
42
|
+
Use `CoroutineExceptionHandler` for top-level scopes, but rely on `try-catch` within suspending functions for granular control.
|
|
43
|
+
|
|
44
|
+
```kotlin
|
|
45
|
+
val handler = CoroutineExceptionHandler { _, exception ->
|
|
46
|
+
println("Caught $exception")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
viewModelScope.launch(handler) {
|
|
50
|
+
try {
|
|
51
|
+
riskyOperation()
|
|
52
|
+
} catch (e: IOException) {
|
|
53
|
+
// Handle network error specifically
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Reactive Streams with Flow
|
|
59
|
+
|
|
60
|
+
Use `StateFlow` for state that needs to be retained, and `SharedFlow` for events.
|
|
61
|
+
|
|
62
|
+
```kotlin
|
|
63
|
+
// Cold Flow (Lazy)
|
|
64
|
+
val searchResults: Flow<List<Item>> = searchQuery
|
|
65
|
+
.debounce(300)
|
|
66
|
+
.flatMapLatest { query -> searchRepo.search(query) }
|
|
67
|
+
.flowOn(Dispatchers.IO)
|
|
68
|
+
|
|
69
|
+
// Hot Flow (State)
|
|
70
|
+
val uiState: StateFlow<UiState> = _uiState.asStateFlow()
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 4. Parallel Execution with Error Handling
|
|
74
|
+
|
|
75
|
+
```kotlin
|
|
76
|
+
suspend fun fetchDataWithErrorHandling() = supervisorScope {
|
|
77
|
+
val task1 = async {
|
|
78
|
+
try { api.fetchA() } catch (e: Exception) { null }
|
|
79
|
+
}
|
|
80
|
+
val task2 = async { api.fetchB() }
|
|
81
|
+
|
|
82
|
+
// If task2 fails, task1 is NOT cancelled because of supervisorScope
|
|
83
|
+
val result1 = task1.await()
|
|
84
|
+
val result2 = task2.await() // May throw
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Best Practices
|
|
89
|
+
|
|
90
|
+
- ✅ **Do:** Use `Dispatchers.IO` for blocking I/O operations.
|
|
91
|
+
- ✅ **Do:** Cancel scopes when they are no longer needed (e.g., `ViewModel.onCleared`).
|
|
92
|
+
- ✅ **Do:** Use `TestScope` and `runTest` for unit testing coroutines.
|
|
93
|
+
- ❌ **Don't:** Use `GlobalScope`. It breaks structured concurrency and can lead to leaks.
|
|
94
|
+
- ❌ **Don't:** Catch `CancellationException` unless you rethrow it.
|
|
95
|
+
|
|
96
|
+
## Troubleshooting
|
|
97
|
+
|
|
98
|
+
**Problem:** Coroutine test hangs or fails unpredictably.
|
|
99
|
+
**Solution:** Ensure you are using `runTest` and injecting `TestDispatcher` into your classes so you can control virtual time.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: modern-javascript-patterns
|
|
3
|
+
description: "Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient code."
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Modern JavaScript Patterns
|
|
10
|
+
|
|
11
|
+
Comprehensive guide for mastering modern JavaScript (ES6+) features, functional programming patterns, and best practices for writing clean, maintainable, and performant code.
|
|
12
|
+
|
|
13
|
+
## Use this skill when
|
|
14
|
+
|
|
15
|
+
- Refactoring legacy JavaScript to modern syntax
|
|
16
|
+
- Implementing functional programming patterns
|
|
17
|
+
- Optimizing JavaScript performance
|
|
18
|
+
- Writing maintainable and readable code
|
|
19
|
+
- Working with asynchronous operations
|
|
20
|
+
- Building modern web applications
|
|
21
|
+
- Migrating from callbacks to Promises/async-await
|
|
22
|
+
- Implementing data transformation pipelines
|
|
23
|
+
|
|
24
|
+
## Do not use this skill when
|
|
25
|
+
|
|
26
|
+
- The task is unrelated to modern javascript patterns
|
|
27
|
+
- You need a different domain or tool outside this scope
|
|
28
|
+
|
|
29
|
+
## Instructions
|
|
30
|
+
|
|
31
|
+
- Clarify goals, constraints, and required inputs.
|
|
32
|
+
- Apply relevant best practices and validate outcomes.
|
|
33
|
+
- Provide actionable steps and verification.
|
|
34
|
+
|
|
35
|
+
## Core Patterns
|
|
36
|
+
|
|
37
|
+
### 1. Async/Await
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
// ✅ Modern async patterns
|
|
41
|
+
const fetchData = async (url) => {
|
|
42
|
+
const response = await fetch(url);
|
|
43
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
44
|
+
return response.json();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Parallel execution
|
|
48
|
+
const [users, posts] = await Promise.all([fetchUsers(), fetchPosts()]);
|
|
49
|
+
|
|
50
|
+
// Error handling
|
|
51
|
+
const result = await fetchData(url).catch(err => ({ error: err.message }));
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. Destructuring & Spread
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
// Object destructuring with defaults
|
|
58
|
+
const { name = 'Anonymous', role = 'user', ...rest } = user;
|
|
59
|
+
|
|
60
|
+
// Array destructuring
|
|
61
|
+
const [first, second, ...remaining] = items;
|
|
62
|
+
|
|
63
|
+
// Function parameters
|
|
64
|
+
const greet = ({ name, greeting = 'Hello' }) => `${greeting}, ${name}!`;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Functional Patterns
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
// Immutable transformations
|
|
71
|
+
const updated = items.map(item => item.id === id ? { ...item, done: true } : item);
|
|
72
|
+
const active = items.filter(item => !item.done);
|
|
73
|
+
const total = items.reduce((sum, item) => sum + item.price, 0);
|
|
74
|
+
|
|
75
|
+
// Composition
|
|
76
|
+
const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x);
|
|
77
|
+
const process = pipe(validate, normalize, format);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 4. Modules (ESM)
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// Named exports
|
|
84
|
+
export const add = (a, b) => a + b;
|
|
85
|
+
export const multiply = (a, b) => a * b;
|
|
86
|
+
|
|
87
|
+
// Dynamic import (lazy loading)
|
|
88
|
+
const module = await import('./heavy-module.js');
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 5. Generators & Iterators
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
function* range(start, end, step = 1) {
|
|
95
|
+
for (let i = start; i < end; i += step) yield i;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Paginated data fetching
|
|
99
|
+
async function* paginate(fetchPage) {
|
|
100
|
+
let page = 1;
|
|
101
|
+
while (true) {
|
|
102
|
+
const data = await fetchPage(page++);
|
|
103
|
+
if (!data.length) break;
|
|
104
|
+
yield* data;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 6. Proxy & Reflect
|
|
110
|
+
|
|
111
|
+
```javascript
|
|
112
|
+
const handler = {
|
|
113
|
+
get(target, key) {
|
|
114
|
+
return key in target ? target[key] : `Property ${key} not found`;
|
|
115
|
+
},
|
|
116
|
+
set(target, key, value) {
|
|
117
|
+
if (typeof value !== 'string') throw new TypeError('Value must be string');
|
|
118
|
+
return Reflect.set(target, key, value);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Anti-Patterns
|
|
124
|
+
|
|
125
|
+
| ❌ Avoid | ✅ Use Instead |
|
|
126
|
+
|---------|--------------|
|
|
127
|
+
| `var` | `const` / `let` |
|
|
128
|
+
| Callback hell | async/await |
|
|
129
|
+
| `arguments` object | Rest parameters |
|
|
130
|
+
| Mutating arrays | map/filter/spread |
|
|
131
|
+
| `eval()` | Template literals |
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monorepo-architect
|
|
3
|
+
description: "Expert in monorepo architecture, build systems, and dependency management at scale. Masters Nx, Turborepo, Bazel, and Lerna for efficient multi-project development."
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Monorepo Architect
|
|
10
|
+
|
|
11
|
+
Expert in monorepo architecture, build systems, and dependency management at scale. Masters Nx, Turborepo, Bazel, and Lerna for efficient multi-project development. Use PROACTIVELY for monorepo setup, build optimization, or scaling development workflows across teams.
|
|
12
|
+
|
|
13
|
+
## Use this skill when
|
|
14
|
+
|
|
15
|
+
- Setting up a new monorepo from scratch
|
|
16
|
+
- Migrating from polyrepo to monorepo
|
|
17
|
+
- Optimizing slow CI/CD pipelines
|
|
18
|
+
- Sharing code between multiple applications
|
|
19
|
+
- Managing dependencies across projects
|
|
20
|
+
- Implementing consistent tooling across teams
|
|
21
|
+
|
|
22
|
+
## Do not use this skill when
|
|
23
|
+
|
|
24
|
+
- The task is unrelated to monorepo architect
|
|
25
|
+
- You need a different domain or tool outside this scope
|
|
26
|
+
|
|
27
|
+
## Capabilities
|
|
28
|
+
|
|
29
|
+
- Monorepo tool selection (Nx, Turborepo, Bazel, Lerna)
|
|
30
|
+
- Workspace configuration and project structure
|
|
31
|
+
- Build caching (local and remote)
|
|
32
|
+
- Dependency graph management
|
|
33
|
+
- Affected/changed detection for CI optimization
|
|
34
|
+
- Code sharing and library extraction
|
|
35
|
+
- Task orchestration and parallelization
|
|
36
|
+
|
|
37
|
+
## Tool Selection Guide
|
|
38
|
+
|
|
39
|
+
| Tool | Best For | Key Feature |
|
|
40
|
+
|------|----------|-------------|
|
|
41
|
+
| **Turborepo** | JS/TS projects, simple setup | Remote caching, fast incremental builds |
|
|
42
|
+
| **Nx** | Large teams, enterprise | Dependency graph, affected commands |
|
|
43
|
+
| **Bazel** | Polyglot, Google-scale | Hermetic builds, extreme scalability |
|
|
44
|
+
| **Lerna** | npm package publishing | Versioning/publishing automation |
|
|
45
|
+
|
|
46
|
+
## Workflow
|
|
47
|
+
|
|
48
|
+
1. Assess codebase size and team structure
|
|
49
|
+
2. Select appropriate monorepo tooling
|
|
50
|
+
3. Design workspace and project structure
|
|
51
|
+
4. Configure build caching strategy
|
|
52
|
+
5. Set up affected/changed detection
|
|
53
|
+
6. Implement task pipelines
|
|
54
|
+
7. Configure remote caching for CI
|
|
55
|
+
8. Document conventions and workflows
|
|
56
|
+
|
|
57
|
+
## Turborepo Example
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
// turbo.json
|
|
61
|
+
{
|
|
62
|
+
"$schema": "https://turbo.build/schema.json",
|
|
63
|
+
"tasks": {
|
|
64
|
+
"build": {
|
|
65
|
+
"dependsOn": ["^build"],
|
|
66
|
+
"outputs": [".next/**", "dist/**"]
|
|
67
|
+
},
|
|
68
|
+
"test": {
|
|
69
|
+
"dependsOn": ["build"],
|
|
70
|
+
"cache": false
|
|
71
|
+
},
|
|
72
|
+
"lint": {
|
|
73
|
+
"cache": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"remoteCache": {
|
|
77
|
+
"enabled": true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Best Practices
|
|
83
|
+
|
|
84
|
+
- Start with clear project boundaries
|
|
85
|
+
- Use consistent naming conventions
|
|
86
|
+
- Implement remote caching early
|
|
87
|
+
- Keep shared libraries focused
|
|
88
|
+
- Use tags for dependency constraints
|
|
89
|
+
- Automate dependency updates
|
|
90
|
+
- Document the dependency graph
|
|
91
|
+
- Set up code ownership rules
|