@neyugn/agent-kits 0.2.5 → 0.2.6
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/common/COMMON.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Common Skills Layer
|
|
2
|
+
|
|
3
|
+
> Universal skills shared across ALL kits in @neyugn/agent-kits
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 Purpose
|
|
8
|
+
|
|
9
|
+
Common Skills là một layer đặc biệt chứa các skill được chia sẻ giữa **tất cả các kits**. Những skill này:
|
|
10
|
+
|
|
11
|
+
1. **Được cài đặt cùng với mọi kit** - Khi user cài một kit bất kỳ (coder, writer, etc.), common skills cũng được cài theo
|
|
12
|
+
2. **Được đề cập trong ARCHITECTURE.md** của mỗi kit
|
|
13
|
+
3. **Có workflow riêng** - Chỉ được gọi khi user sử dụng slash command tương ứng
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 📁 Directory Structure
|
|
18
|
+
|
|
19
|
+
```plaintext
|
|
20
|
+
common/
|
|
21
|
+
├── COMMON.md # This file - documentation
|
|
22
|
+
├── skills/ # Common skills
|
|
23
|
+
│ └── filter-skill/ # Workspace filtering skill
|
|
24
|
+
│ ├── SKILL.md
|
|
25
|
+
│ └── scripts/
|
|
26
|
+
│ └── workspace_analyzer.py
|
|
27
|
+
└── workflows/ # Common workflows
|
|
28
|
+
└── filter.md # /filter command
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🧩 Common Skills
|
|
34
|
+
|
|
35
|
+
| Skill | Description | Workflow |
|
|
36
|
+
| -------------- | -------------------------------------------------------------------------- | --------- |
|
|
37
|
+
| `filter-skill` | Tự động phân tích workspace và bật/tắt skills/agents phù hợp với techstack | `/filter` |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🔄 How It Works
|
|
42
|
+
|
|
43
|
+
### Installation
|
|
44
|
+
|
|
45
|
+
Khi user chạy `npx @neyugn/agent-kits`:
|
|
46
|
+
|
|
47
|
+
1. User chọn kit (e.g., `coder`)
|
|
48
|
+
2. Installer copy kit vào workspace
|
|
49
|
+
3. Installer copy `common/` skills vào cùng vị trí
|
|
50
|
+
4. Common skills được merge vào architecture của kit
|
|
51
|
+
|
|
52
|
+
### Usage
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# User gọi workflow để filter skills
|
|
56
|
+
/filter
|
|
57
|
+
|
|
58
|
+
# AI sẽ:
|
|
59
|
+
# 1. Phân tích workspace (package.json, pubspec.yaml, etc.)
|
|
60
|
+
# 2. Xác định techstack
|
|
61
|
+
# 3. Đề xuất enable/disable skills
|
|
62
|
+
# 4. Hỏi user xác nhận + techstack tương lai
|
|
63
|
+
# 5. Lưu kết quả vào .agent/workspace-profile.json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 📊 Integration with Kits
|
|
69
|
+
|
|
70
|
+
Mỗi kit's `ARCHITECTURE.md` PHẢI đề cập:
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## 🔗 Common Skills
|
|
74
|
+
|
|
75
|
+
This kit inherits from the **Common Skills Layer**. See `common/COMMON.md` for:
|
|
76
|
+
|
|
77
|
+
- `/filter` - Workspace-aware skill filtering
|
|
78
|
+
- [Future common skills...]
|
|
79
|
+
|
|
80
|
+
Common skills are automatically installed and available in all kits.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🚀 Future Common Skills (Planned)
|
|
86
|
+
|
|
87
|
+
| Skill | Description | Status |
|
|
88
|
+
| ----------------- | ----------------------------------------------- | ------- |
|
|
89
|
+
| `context-manager` | Quản lý context length, tự động tóm tắt history | Planned |
|
|
90
|
+
| `memory-skill` | Lưu trữ và recall thông tin quan trọng | Planned |
|
|
91
|
+
| `preference-sync` | Đồng bộ preferences của user giữa các sessions | Planned |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 📝 Adding Common Skills
|
|
96
|
+
|
|
97
|
+
1. Create skill folder in `common/skills/`
|
|
98
|
+
2. Create workflow in `common/workflows/`
|
|
99
|
+
3. Update this file's Skills table
|
|
100
|
+
4. Update all kits' ARCHITECTURE.md to reference
|
|
101
|
+
|
|
102
|
+
---
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: filter-skill
|
|
3
|
+
description: Automatically analyze workspace and enable/disable skills/agents based on detected techstack. Reduces noise from irrelevant skills.
|
|
4
|
+
category: common
|
|
5
|
+
trigger: manual
|
|
6
|
+
workflow: /filter
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Filter Skill
|
|
10
|
+
|
|
11
|
+
> Workspace-aware skill/agent filtering for optimal AI performance.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🎯 Purpose
|
|
16
|
+
|
|
17
|
+
Filter Skill solves the **skill overload** problem - when too many skills are loaded but aren't relevant to the current project. This skill:
|
|
18
|
+
|
|
19
|
+
1. **Analyzes techstack** of the workspace
|
|
20
|
+
2. **Recommends enable/disable** for skills/agents
|
|
21
|
+
3. **Asks user confirmation** before applying changes
|
|
22
|
+
4. **Persists profile** for use in subsequent sessions
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 🔍 Detection Criteria
|
|
27
|
+
|
|
28
|
+
### Package Managers & Config Files
|
|
29
|
+
|
|
30
|
+
| File/Pattern | Detected Techstack |
|
|
31
|
+
| ------------------ | --------------------------------------- |
|
|
32
|
+
| `package.json` | Node.js, check dependencies for details |
|
|
33
|
+
| `pubspec.yaml` | Flutter/Dart |
|
|
34
|
+
| `pyproject.toml` | Python (Poetry/PDM) |
|
|
35
|
+
| `requirements.txt` | Python (pip) |
|
|
36
|
+
| `Cargo.toml` | Rust |
|
|
37
|
+
| `go.mod` | Go |
|
|
38
|
+
| `build.gradle` | Android (Java/Kotlin) |
|
|
39
|
+
| `Podfile` | iOS |
|
|
40
|
+
| `composer.json` | PHP |
|
|
41
|
+
| `Gemfile` | Ruby |
|
|
42
|
+
|
|
43
|
+
### Framework Markers
|
|
44
|
+
|
|
45
|
+
| File/Pattern | Framework | Enable Skills |
|
|
46
|
+
| ---------------------- | ---------------- | --------------------------------------------- |
|
|
47
|
+
| `next.config.*` | Next.js | react-patterns, frontend-design, seo-patterns |
|
|
48
|
+
| `vite.config.*` | Vite | react-patterns, frontend-design |
|
|
49
|
+
| `angular.json` | Angular | typescript-patterns, frontend-design |
|
|
50
|
+
| `nuxt.config.*` | Nuxt.js | frontend-design, seo-patterns |
|
|
51
|
+
| `tailwind.config.*` | Tailwind CSS | tailwind-patterns |
|
|
52
|
+
| `prisma/schema.prisma` | Prisma | database-design, postgres-patterns |
|
|
53
|
+
| `drizzle.config.*` | Drizzle | database-design |
|
|
54
|
+
| `docker-compose.*` | Docker | docker-patterns |
|
|
55
|
+
| `Dockerfile` | Docker | docker-patterns |
|
|
56
|
+
| `k8s/`, `kubernetes/` | Kubernetes | kubernetes-patterns |
|
|
57
|
+
| `.github/workflows/` | GitHub Actions | github-actions |
|
|
58
|
+
| `.gitlab-ci.yml` | GitLab CI | gitlab-ci-patterns |
|
|
59
|
+
| `terraform/`, `*.tf` | Terraform | terraform-patterns |
|
|
60
|
+
| `socket.io`, `ws` | WebSocket (deps) | realtime-patterns |
|
|
61
|
+
| `bullmq`, `bee-queue` | Queue (deps) | queue-patterns |
|
|
62
|
+
|
|
63
|
+
### Dependency Analysis (package.json)
|
|
64
|
+
|
|
65
|
+
| Dependency Pattern | Enable Skills |
|
|
66
|
+
| ----------------------- | ----------------------------------- |
|
|
67
|
+
| `react`, `react-dom` | react-patterns |
|
|
68
|
+
| `next` | react-patterns, seo-patterns |
|
|
69
|
+
| `@tanstack/react-query` | react-patterns |
|
|
70
|
+
| `graphql`, `@apollo` | graphql-patterns |
|
|
71
|
+
| `redis`, `ioredis` | redis-patterns |
|
|
72
|
+
| `pg`, `postgres` | postgres-patterns |
|
|
73
|
+
| `socket.io*` | realtime-patterns |
|
|
74
|
+
| `bullmq`, `bee-queue` | queue-patterns |
|
|
75
|
+
| `passport`, `@auth` | auth-patterns |
|
|
76
|
+
| `openai`, `langchain` | ai-rag-patterns, prompt-engineering |
|
|
77
|
+
| `playwright` | e2e-testing |
|
|
78
|
+
| `cypress` | e2e-testing |
|
|
79
|
+
| `jest`, `vitest` | testing-patterns |
|
|
80
|
+
| `eslint`, `prettier` | clean-code |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 📋 Workflow Steps
|
|
85
|
+
|
|
86
|
+
### Phase 1: Analysis
|
|
87
|
+
|
|
88
|
+
```plaintext
|
|
89
|
+
1. Scan workspace root for config files
|
|
90
|
+
2. Parse package managers (package.json, pubspec.yaml, etc.)
|
|
91
|
+
3. Detect framework markers
|
|
92
|
+
4. Analyze dependencies
|
|
93
|
+
5. Build techstack profile
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Phase 2: Recommendation
|
|
97
|
+
|
|
98
|
+
```plaintext
|
|
99
|
+
1. Map techstack → required skills/agents
|
|
100
|
+
2. Identify unused skills (candidates for disable)
|
|
101
|
+
3. Identify missing skills (candidates for enable)
|
|
102
|
+
4. Generate recommendation table
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Phase 3: User Confirmation
|
|
106
|
+
|
|
107
|
+
AI will ask the user:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## 🔍 Workspace Analysis Complete
|
|
111
|
+
|
|
112
|
+
**Detected Techstack:**
|
|
113
|
+
|
|
114
|
+
- Next.js 14 (App Router)
|
|
115
|
+
- TypeScript
|
|
116
|
+
- Tailwind CSS
|
|
117
|
+
- Prisma + PostgreSQL
|
|
118
|
+
- Redis
|
|
119
|
+
|
|
120
|
+
**Recommended Skills (Enable):**
|
|
121
|
+
| Skill | Reason |
|
|
122
|
+
|-------|--------|
|
|
123
|
+
| react-patterns | Next.js detected |
|
|
124
|
+
| tailwind-patterns | tailwind.config.js found |
|
|
125
|
+
| postgres-patterns | Prisma with PostgreSQL |
|
|
126
|
+
| redis-patterns | ioredis in dependencies |
|
|
127
|
+
|
|
128
|
+
**Recommended to Disable:**
|
|
129
|
+
| Skill | Reason |
|
|
130
|
+
|-------|--------|
|
|
131
|
+
| flutter-patterns | No pubspec.yaml |
|
|
132
|
+
| react-native-patterns | No mobile setup |
|
|
133
|
+
| queue-patterns | No queue dependencies |
|
|
134
|
+
|
|
135
|
+
**Questions:**
|
|
136
|
+
|
|
137
|
+
1. Do you want to apply these changes?
|
|
138
|
+
2. Are there any techstacks you plan to add in the future? (e.g., mobile, CI/CD)
|
|
139
|
+
3. Are there any skills you want to force enable/disable?
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Phase 4: Apply & Persist
|
|
143
|
+
|
|
144
|
+
```plaintext
|
|
145
|
+
1. Update .agent/workspace-profile.json
|
|
146
|
+
2. (Optional) Update ARCHITECTURE.md skills section
|
|
147
|
+
3. Confirm changes to user
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📄 Workspace Profile Format
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"version": "1.0",
|
|
157
|
+
"generatedAt": "2026-02-05T12:00:00Z",
|
|
158
|
+
"techstack": {
|
|
159
|
+
"languages": ["typescript", "python"],
|
|
160
|
+
"frameworks": ["nextjs", "tailwindcss"],
|
|
161
|
+
"databases": ["postgresql"],
|
|
162
|
+
"tools": ["docker", "github-actions"]
|
|
163
|
+
},
|
|
164
|
+
"skills": {
|
|
165
|
+
"enabled": [
|
|
166
|
+
"clean-code",
|
|
167
|
+
"react-patterns",
|
|
168
|
+
"typescript-patterns",
|
|
169
|
+
"tailwind-patterns",
|
|
170
|
+
"database-design",
|
|
171
|
+
"postgres-patterns",
|
|
172
|
+
"docker-patterns",
|
|
173
|
+
"github-actions"
|
|
174
|
+
],
|
|
175
|
+
"disabled": [
|
|
176
|
+
"flutter-patterns",
|
|
177
|
+
"react-native-patterns",
|
|
178
|
+
"mobile-design",
|
|
179
|
+
"queue-patterns",
|
|
180
|
+
"gitlab-ci-patterns"
|
|
181
|
+
],
|
|
182
|
+
"userOverrides": {
|
|
183
|
+
"force-enabled": ["ai-rag-patterns"],
|
|
184
|
+
"force-disabled": []
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"agents": {
|
|
188
|
+
"disabled": ["mobile-developer", "queue-specialist"]
|
|
189
|
+
},
|
|
190
|
+
"futureTechstack": ["react-native", "kubernetes"]
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 🚫 Never Disable (Core Skills)
|
|
197
|
+
|
|
198
|
+
These skills are ALWAYS enabled regardless of techstack:
|
|
199
|
+
|
|
200
|
+
- `clean-code`
|
|
201
|
+
- `brainstorming`
|
|
202
|
+
- `plan-writing`
|
|
203
|
+
- `systematic-debugging`
|
|
204
|
+
- `testing-patterns`
|
|
205
|
+
- `security-fundamentals`
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 🔧 Manual Override
|
|
210
|
+
|
|
211
|
+
User can override any recommendation:
|
|
212
|
+
|
|
213
|
+
```markdown
|
|
214
|
+
/filter --force-enable ai-rag-patterns
|
|
215
|
+
/filter --force-disable mobile-design
|
|
216
|
+
/filter --reset # Reset to default (enable all)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 📊 Integration Points
|
|
222
|
+
|
|
223
|
+
### With GEMINI.md / CLAUDE.md
|
|
224
|
+
|
|
225
|
+
Rule files should check `workspace-profile.json` when loading skills:
|
|
226
|
+
|
|
227
|
+
```markdown
|
|
228
|
+
## Skill Loading Protocol
|
|
229
|
+
|
|
230
|
+
1. Check if `.agent/workspace-profile.json` exists
|
|
231
|
+
2. If exists, respect enabled/disabled lists
|
|
232
|
+
3. Core skills always loaded regardless of profile
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### With Orchestrator
|
|
236
|
+
|
|
237
|
+
Orchestrator agent should respect skill filtering when routing tasks.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## ⚠️ Limitations
|
|
242
|
+
|
|
243
|
+
1. **Static analysis only** - Does not execute code to detect
|
|
244
|
+
2. **Config-based** - Relies on config files, may miss dynamic setups
|
|
245
|
+
3. **Monorepo** - Needs improvement to handle multiple packages
|
|
246
|
+
|
|
247
|
+
---
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Workspace Analyzer for Filter Skill
|
|
4
|
+
|
|
5
|
+
Analyzes workspace to detect techstack and recommend skill filtering.
|
|
6
|
+
This script provides structured JSON output for AI agents to process.
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
python3 workspace_analyzer.py [workspace_path]
|
|
10
|
+
python3 workspace_analyzer.py .
|
|
11
|
+
python3 workspace_analyzer.py /path/to/project
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from datetime import datetime
|
|
19
|
+
from typing import Dict, List, Optional, Any
|
|
20
|
+
|
|
21
|
+
# =============================================================================
|
|
22
|
+
# Detection Mappings
|
|
23
|
+
# =============================================================================
|
|
24
|
+
|
|
25
|
+
# Config files → Techstack detection
|
|
26
|
+
CONFIG_MAPPINGS = {
|
|
27
|
+
"package.json": {"type": "package_manager", "tech": "nodejs"},
|
|
28
|
+
"pubspec.yaml": {"type": "package_manager", "tech": "flutter"},
|
|
29
|
+
"pyproject.toml": {"type": "package_manager", "tech": "python"},
|
|
30
|
+
"requirements.txt": {"type": "package_manager", "tech": "python"},
|
|
31
|
+
"Cargo.toml": {"type": "package_manager", "tech": "rust"},
|
|
32
|
+
"go.mod": {"type": "package_manager", "tech": "go"},
|
|
33
|
+
"build.gradle": {"type": "package_manager", "tech": "android"},
|
|
34
|
+
"build.gradle.kts": {"type": "package_manager", "tech": "android"},
|
|
35
|
+
"Podfile": {"type": "package_manager", "tech": "ios"},
|
|
36
|
+
"composer.json": {"type": "package_manager", "tech": "php"},
|
|
37
|
+
"Gemfile": {"type": "package_manager", "tech": "ruby"},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# Framework markers → Skills
|
|
41
|
+
FRAMEWORK_MAPPINGS = {
|
|
42
|
+
"next.config.js": ["react-patterns", "seo-patterns", "frontend-design"],
|
|
43
|
+
"next.config.mjs": ["react-patterns", "seo-patterns", "frontend-design"],
|
|
44
|
+
"next.config.ts": ["react-patterns", "seo-patterns", "frontend-design"],
|
|
45
|
+
"vite.config.js": ["react-patterns", "frontend-design"],
|
|
46
|
+
"vite.config.ts": ["react-patterns", "frontend-design"],
|
|
47
|
+
"angular.json": ["typescript-patterns", "frontend-design"],
|
|
48
|
+
"nuxt.config.js": ["frontend-design", "seo-patterns"],
|
|
49
|
+
"nuxt.config.ts": ["frontend-design", "seo-patterns"],
|
|
50
|
+
"tailwind.config.js": ["tailwind-patterns"],
|
|
51
|
+
"tailwind.config.ts": ["tailwind-patterns"],
|
|
52
|
+
"tailwind.config.mjs": ["tailwind-patterns"],
|
|
53
|
+
"Dockerfile": ["docker-patterns"],
|
|
54
|
+
"docker-compose.yml": ["docker-patterns"],
|
|
55
|
+
"docker-compose.yaml": ["docker-patterns"],
|
|
56
|
+
".gitlab-ci.yml": ["gitlab-ci-patterns"],
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
# Directory patterns → Skills
|
|
60
|
+
DIRECTORY_MAPPINGS = {
|
|
61
|
+
".github/workflows": ["github-actions"],
|
|
62
|
+
"k8s": ["kubernetes-patterns"],
|
|
63
|
+
"kubernetes": ["kubernetes-patterns"],
|
|
64
|
+
"terraform": ["terraform-patterns"],
|
|
65
|
+
"prisma": ["database-design", "postgres-patterns"],
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# NPM dependencies → Skills (substring matching)
|
|
69
|
+
NPM_DEPENDENCY_MAPPINGS = {
|
|
70
|
+
"react": ["react-patterns"],
|
|
71
|
+
"next": ["react-patterns", "seo-patterns"],
|
|
72
|
+
"@tanstack/react-query": ["react-patterns"],
|
|
73
|
+
"vue": ["frontend-design"],
|
|
74
|
+
"graphql": ["graphql-patterns"],
|
|
75
|
+
"@apollo": ["graphql-patterns"],
|
|
76
|
+
"redis": ["redis-patterns"],
|
|
77
|
+
"ioredis": ["redis-patterns"],
|
|
78
|
+
"pg": ["postgres-patterns"],
|
|
79
|
+
"postgres": ["postgres-patterns"],
|
|
80
|
+
"@prisma/client": ["database-design", "postgres-patterns"],
|
|
81
|
+
"drizzle-orm": ["database-design"],
|
|
82
|
+
"socket.io": ["realtime-patterns"],
|
|
83
|
+
"ws": ["realtime-patterns"],
|
|
84
|
+
"bullmq": ["queue-patterns"],
|
|
85
|
+
"bee-queue": ["queue-patterns"],
|
|
86
|
+
"passport": ["auth-patterns"],
|
|
87
|
+
"@auth": ["auth-patterns"],
|
|
88
|
+
"next-auth": ["auth-patterns"],
|
|
89
|
+
"openai": ["ai-rag-patterns", "prompt-engineering"],
|
|
90
|
+
"langchain": ["ai-rag-patterns"],
|
|
91
|
+
"@langchain": ["ai-rag-patterns"],
|
|
92
|
+
"playwright": ["e2e-testing"],
|
|
93
|
+
"@playwright": ["e2e-testing"],
|
|
94
|
+
"cypress": ["e2e-testing"],
|
|
95
|
+
"jest": ["testing-patterns"],
|
|
96
|
+
"vitest": ["testing-patterns"],
|
|
97
|
+
"eslint": ["clean-code"],
|
|
98
|
+
"prettier": ["clean-code"],
|
|
99
|
+
"typescript": ["typescript-patterns"],
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# All available skills (from ARCHITECTURE.md)
|
|
103
|
+
ALL_SKILLS = [
|
|
104
|
+
"clean-code", "api-patterns", "database-design", "testing-patterns",
|
|
105
|
+
"security-fundamentals", "performance-profiling", "brainstorming",
|
|
106
|
+
"plan-writing", "systematic-debugging", "realtime-patterns",
|
|
107
|
+
"multi-tenancy", "queue-patterns", "docker-patterns", "kubernetes-patterns",
|
|
108
|
+
"auth-patterns", "github-actions", "gitlab-ci-patterns", "prompt-engineering",
|
|
109
|
+
"react-patterns", "typescript-patterns", "e2e-testing", "postgres-patterns",
|
|
110
|
+
"redis-patterns", "graphql-patterns", "ai-rag-patterns",
|
|
111
|
+
"monitoring-observability", "terraform-patterns", "flutter-patterns",
|
|
112
|
+
"react-native-patterns", "seo-patterns", "accessibility-patterns",
|
|
113
|
+
"mermaid-diagrams", "i18n-localization", "mobile-design",
|
|
114
|
+
"documentation-templates", "tailwind-patterns", "frontend-design",
|
|
115
|
+
"ui-ux-pro-max", "nodejs-best-practices"
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
# Core skills that should NEVER be disabled
|
|
119
|
+
CORE_SKILLS = [
|
|
120
|
+
"clean-code",
|
|
121
|
+
"brainstorming",
|
|
122
|
+
"plan-writing",
|
|
123
|
+
"systematic-debugging",
|
|
124
|
+
"testing-patterns",
|
|
125
|
+
"security-fundamentals"
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
# =============================================================================
|
|
129
|
+
# Analyzer Class
|
|
130
|
+
# =============================================================================
|
|
131
|
+
|
|
132
|
+
class WorkspaceAnalyzer:
|
|
133
|
+
def __init__(self, workspace_path: str):
|
|
134
|
+
self.workspace = Path(workspace_path).resolve()
|
|
135
|
+
self.detected_techs: List[str] = []
|
|
136
|
+
self.detected_frameworks: List[str] = []
|
|
137
|
+
self.recommended_skills: set = set()
|
|
138
|
+
self.config_files_found: List[str] = []
|
|
139
|
+
self.dependencies: Dict[str, List[str]] = {}
|
|
140
|
+
|
|
141
|
+
def analyze(self) -> Dict[str, Any]:
|
|
142
|
+
"""Run full workspace analysis."""
|
|
143
|
+
if not self.workspace.exists():
|
|
144
|
+
return self._error(f"Workspace not found: {self.workspace}")
|
|
145
|
+
|
|
146
|
+
# Step 1: Scan config files
|
|
147
|
+
self._scan_config_files()
|
|
148
|
+
|
|
149
|
+
# Step 2: Scan framework markers
|
|
150
|
+
self._scan_framework_markers()
|
|
151
|
+
|
|
152
|
+
# Step 3: Scan directories
|
|
153
|
+
self._scan_directories()
|
|
154
|
+
|
|
155
|
+
# Step 4: Parse dependencies
|
|
156
|
+
self._parse_dependencies()
|
|
157
|
+
|
|
158
|
+
# Step 5: Build recommendations
|
|
159
|
+
return self._build_result()
|
|
160
|
+
|
|
161
|
+
def _scan_config_files(self):
|
|
162
|
+
"""Scan for package manager config files."""
|
|
163
|
+
for filename, info in CONFIG_MAPPINGS.items():
|
|
164
|
+
filepath = self.workspace / filename
|
|
165
|
+
if filepath.exists():
|
|
166
|
+
self.config_files_found.append(filename)
|
|
167
|
+
self.detected_techs.append(info["tech"])
|
|
168
|
+
|
|
169
|
+
def _scan_framework_markers(self):
|
|
170
|
+
"""Scan for framework-specific config files."""
|
|
171
|
+
for filename, skills in FRAMEWORK_MAPPINGS.items():
|
|
172
|
+
filepath = self.workspace / filename
|
|
173
|
+
if filepath.exists():
|
|
174
|
+
self.config_files_found.append(filename)
|
|
175
|
+
self.recommended_skills.update(skills)
|
|
176
|
+
# Extract framework name
|
|
177
|
+
framework = filename.split(".")[0].replace("_", "-")
|
|
178
|
+
if framework not in ["Dockerfile", "docker-compose"]:
|
|
179
|
+
self.detected_frameworks.append(framework)
|
|
180
|
+
|
|
181
|
+
def _scan_directories(self):
|
|
182
|
+
"""Scan for special directories."""
|
|
183
|
+
for dirname, skills in DIRECTORY_MAPPINGS.items():
|
|
184
|
+
dirpath = self.workspace / dirname
|
|
185
|
+
if dirpath.exists() and dirpath.is_dir():
|
|
186
|
+
self.config_files_found.append(f"{dirname}/")
|
|
187
|
+
self.recommended_skills.update(skills)
|
|
188
|
+
|
|
189
|
+
def _parse_dependencies(self):
|
|
190
|
+
"""Parse dependencies from package managers."""
|
|
191
|
+
# Parse package.json
|
|
192
|
+
package_json = self.workspace / "package.json"
|
|
193
|
+
if package_json.exists():
|
|
194
|
+
try:
|
|
195
|
+
with open(package_json, 'r') as f:
|
|
196
|
+
data = json.load(f)
|
|
197
|
+
|
|
198
|
+
all_deps = {}
|
|
199
|
+
all_deps.update(data.get("dependencies", {}))
|
|
200
|
+
all_deps.update(data.get("devDependencies", {}))
|
|
201
|
+
|
|
202
|
+
self.dependencies["npm"] = list(all_deps.keys())
|
|
203
|
+
|
|
204
|
+
# Match dependencies to skills
|
|
205
|
+
for dep_name in all_deps.keys():
|
|
206
|
+
for pattern, skills in NPM_DEPENDENCY_MAPPINGS.items():
|
|
207
|
+
if pattern in dep_name:
|
|
208
|
+
self.recommended_skills.update(skills)
|
|
209
|
+
except (json.JSONDecodeError, IOError):
|
|
210
|
+
pass
|
|
211
|
+
|
|
212
|
+
# Parse pubspec.yaml (Flutter)
|
|
213
|
+
pubspec = self.workspace / "pubspec.yaml"
|
|
214
|
+
if pubspec.exists():
|
|
215
|
+
self.recommended_skills.add("flutter-patterns")
|
|
216
|
+
self.recommended_skills.add("mobile-design")
|
|
217
|
+
|
|
218
|
+
def _build_result(self) -> Dict[str, Any]:
|
|
219
|
+
"""Build final analysis result."""
|
|
220
|
+
# Add core skills (always recommended)
|
|
221
|
+
self.recommended_skills.update(CORE_SKILLS)
|
|
222
|
+
|
|
223
|
+
# Determine which skills to disable
|
|
224
|
+
enabled = list(self.recommended_skills)
|
|
225
|
+
disabled = [s for s in ALL_SKILLS if s not in enabled]
|
|
226
|
+
|
|
227
|
+
# Remove core skills from disabled (safety check)
|
|
228
|
+
disabled = [s for s in disabled if s not in CORE_SKILLS]
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
"success": True,
|
|
232
|
+
"analyzedAt": datetime.now().isoformat(),
|
|
233
|
+
"workspacePath": str(self.workspace),
|
|
234
|
+
"detection": {
|
|
235
|
+
"configFiles": self.config_files_found,
|
|
236
|
+
"technologies": list(set(self.detected_techs)),
|
|
237
|
+
"frameworks": list(set(self.detected_frameworks)),
|
|
238
|
+
"dependencies": self.dependencies
|
|
239
|
+
},
|
|
240
|
+
"recommendations": {
|
|
241
|
+
"enable": sorted(enabled),
|
|
242
|
+
"disable": sorted(disabled),
|
|
243
|
+
"coreSkills": CORE_SKILLS
|
|
244
|
+
},
|
|
245
|
+
"summary": {
|
|
246
|
+
"totalSkillsAvailable": len(ALL_SKILLS),
|
|
247
|
+
"recommendedEnabled": len(enabled),
|
|
248
|
+
"recommendedDisabled": len(disabled),
|
|
249
|
+
"coreSkillsCount": len(CORE_SKILLS)
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
def _error(self, message: str) -> Dict[str, Any]:
|
|
254
|
+
"""Return error result."""
|
|
255
|
+
return {
|
|
256
|
+
"success": False,
|
|
257
|
+
"error": message,
|
|
258
|
+
"analyzedAt": datetime.now().isoformat()
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
# =============================================================================
|
|
263
|
+
# Main
|
|
264
|
+
# =============================================================================
|
|
265
|
+
|
|
266
|
+
def main():
|
|
267
|
+
# Get workspace path from args or use current directory
|
|
268
|
+
if len(sys.argv) > 1:
|
|
269
|
+
workspace_path = sys.argv[1]
|
|
270
|
+
else:
|
|
271
|
+
workspace_path = "."
|
|
272
|
+
|
|
273
|
+
analyzer = WorkspaceAnalyzer(workspace_path)
|
|
274
|
+
result = analyzer.analyze()
|
|
275
|
+
|
|
276
|
+
# Output as JSON for AI to parse
|
|
277
|
+
print(json.dumps(result, indent=2))
|
|
278
|
+
|
|
279
|
+
# Exit code based on success
|
|
280
|
+
sys.exit(0 if result.get("success") else 1)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
if __name__ == "__main__":
|
|
284
|
+
main()
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze workspace and enable/disable skills/agents based on techstack
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /filter - Workspace Skill Filtering
|
|
6
|
+
|
|
7
|
+
## Trigger
|
|
8
|
+
|
|
9
|
+
User calls `/filter` or requests "filter skills", "optimize skills for this project"
|
|
10
|
+
|
|
11
|
+
## Agent
|
|
12
|
+
|
|
13
|
+
No specific agent required - this skill is standalone.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
- Currently in a workspace with code
|
|
18
|
+
|
|
19
|
+
## Critical Rules
|
|
20
|
+
|
|
21
|
+
1. **ALWAYS ASK** - Always ask user confirmation before applying changes
|
|
22
|
+
2. **NEVER DISABLE CORE** - Never disable core skills (clean-code, testing-patterns, etc.)
|
|
23
|
+
3. **PERSIST RESULTS** - Save results to `.agent/workspace-profile.json`
|
|
24
|
+
4. **ASK FUTURE STACK** - Ask user about planned future techstack additions
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow Steps
|
|
29
|
+
|
|
30
|
+
### Step 1: Analyze Workspace
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
1. Read filter-skill SKILL.md to understand detection criteria
|
|
34
|
+
2. Scan workspace for config files:
|
|
35
|
+
- package.json, pubspec.yaml, pyproject.toml, Cargo.toml, go.mod
|
|
36
|
+
- next.config.*, vite.config.*, angular.json, nuxt.config.*
|
|
37
|
+
- Dockerfile, docker-compose.*, k8s/, kubernetes/
|
|
38
|
+
- .github/workflows/, .gitlab-ci.yml
|
|
39
|
+
- prisma/, drizzle.config.*, terraform/
|
|
40
|
+
3. Parse dependencies if package manager exists
|
|
41
|
+
4. Build techstack profile
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Step 2: Generate Recommendations
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
1. Load skill definitions from ARCHITECTURE.md
|
|
48
|
+
2. Map detected techstack → required skills
|
|
49
|
+
3. Identify skills to ENABLE (missing but needed)
|
|
50
|
+
4. Identify skills to DISABLE (present but not needed)
|
|
51
|
+
5. Build recommendation table
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Step 3: Present to User
|
|
55
|
+
|
|
56
|
+
Display in this format:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
## 🔍 Workspace Analysis Complete
|
|
60
|
+
|
|
61
|
+
### Detected Techstack
|
|
62
|
+
|
|
63
|
+
| Category | Technology |
|
|
64
|
+
| --------- | ----------------------- |
|
|
65
|
+
| Language | TypeScript, Python |
|
|
66
|
+
| Framework | Next.js 14 (App Router) |
|
|
67
|
+
| Styling | Tailwind CSS v4 |
|
|
68
|
+
| Database | PostgreSQL (Prisma) |
|
|
69
|
+
| Cache | Redis |
|
|
70
|
+
| CI/CD | GitHub Actions |
|
|
71
|
+
|
|
72
|
+
### Recommended Changes
|
|
73
|
+
|
|
74
|
+
#### ✅ Skills to ENABLE:
|
|
75
|
+
|
|
76
|
+
| Skill | Reason |
|
|
77
|
+
| ----------------- | ------------------------ |
|
|
78
|
+
| react-patterns | Next.js detected |
|
|
79
|
+
| tailwind-patterns | tailwind.config.js found |
|
|
80
|
+
| postgres-patterns | Prisma + PostgreSQL |
|
|
81
|
+
|
|
82
|
+
#### ❌ Skills to DISABLE:
|
|
83
|
+
|
|
84
|
+
| Skill | Reason |
|
|
85
|
+
| ---------------- | ------------------------ |
|
|
86
|
+
| flutter-patterns | No pubspec.yaml found |
|
|
87
|
+
| mobile-design | No mobile setup detected |
|
|
88
|
+
|
|
89
|
+
#### 🔒 Core Skills (always ON):
|
|
90
|
+
|
|
91
|
+
- clean-code, testing-patterns, security-fundamentals, brainstorming, plan-writing
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Confirmation Questions:
|
|
96
|
+
|
|
97
|
+
1. **Do you agree with the changes above?** (yes/no/customize)
|
|
98
|
+
|
|
99
|
+
2. **Are there any techstacks you plan to add in the future?**
|
|
100
|
+
(e.g., mobile app, Kubernetes, different CI/CD...)
|
|
101
|
+
|
|
102
|
+
3. **Are there any skills you want to force enable or disable?**
|
|
103
|
+
(e.g., keep ai-rag-patterns even though not currently used)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Step 4: Process User Response
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Based on user answer:
|
|
110
|
+
|
|
111
|
+
If YES:
|
|
112
|
+
→ Apply all recommended changes
|
|
113
|
+
→ Save to workspace-profile.json
|
|
114
|
+
|
|
115
|
+
If NO / CUSTOMIZE:
|
|
116
|
+
→ Ask which changes to skip/modify
|
|
117
|
+
→ Apply only approved changes
|
|
118
|
+
→ Save to workspace-profile.json
|
|
119
|
+
|
|
120
|
+
If user mentions FUTURE techstack:
|
|
121
|
+
→ Add to futureTechstack array
|
|
122
|
+
→ Keep relevant skills enabled (don't disable)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Step 5: Save Profile
|
|
126
|
+
|
|
127
|
+
Create/Update `.agent/workspace-profile.json`:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"version": "1.0",
|
|
132
|
+
"generatedAt": "ISO timestamp",
|
|
133
|
+
"analyzedBy": "filter-skill v1.0",
|
|
134
|
+
"techstack": { ... },
|
|
135
|
+
"skills": {
|
|
136
|
+
"enabled": [...],
|
|
137
|
+
"disabled": [...],
|
|
138
|
+
"userOverrides": { ... }
|
|
139
|
+
},
|
|
140
|
+
"agents": {
|
|
141
|
+
"disabled": [...]
|
|
142
|
+
},
|
|
143
|
+
"futureTechstack": [...]
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Step 6: Confirm
|
|
148
|
+
|
|
149
|
+
```markdown
|
|
150
|
+
## ✅ Workspace Profile Saved!
|
|
151
|
+
|
|
152
|
+
**File:** `.agent/workspace-profile.json`
|
|
153
|
+
|
|
154
|
+
**Summary:**
|
|
155
|
+
|
|
156
|
+
- Skills enabled: 15
|
|
157
|
+
- Skills disabled: 8
|
|
158
|
+
- Agents disabled: 2
|
|
159
|
+
- Future techstack tracked: 2
|
|
160
|
+
|
|
161
|
+
**Next steps:**
|
|
162
|
+
|
|
163
|
+
- Profile will be automatically loaded in subsequent sessions
|
|
164
|
+
- Run `/filter --reset` to re-enable all skills
|
|
165
|
+
- Run `/filter` again when project adds new techstack
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Output Format
|
|
171
|
+
|
|
172
|
+
Final result is the `workspace-profile.json` file saved to disk.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Exit Conditions
|
|
177
|
+
|
|
178
|
+
- User confirms and profile is saved successfully
|
|
179
|
+
- User cancels mid-process (no save)
|
|
180
|
+
- Error during analysis (report error, no save)
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Examples
|
|
185
|
+
|
|
186
|
+
### Example 1: Next.js + Tailwind Project
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
User: /filter
|
|
190
|
+
|
|
191
|
+
AI: [Analyze workspace...]
|
|
192
|
+
|
|
193
|
+
Detected: Next.js 14, TypeScript, Tailwind CSS, Prisma, PostgreSQL
|
|
194
|
+
|
|
195
|
+
Recommend ENABLE: react-patterns, tailwind-patterns, postgres-patterns
|
|
196
|
+
Recommend DISABLE: flutter-patterns, mobile-design, queue-patterns
|
|
197
|
+
|
|
198
|
+
User: yes, future I might add mobile app
|
|
199
|
+
|
|
200
|
+
AI: [Save profile with futureTechstack: ["react-native"]]
|
|
201
|
+
[Keep mobile-design enabled for future use]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Example 2: Python ML Project
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
User: /filter
|
|
208
|
+
|
|
209
|
+
AI: [Analyze workspace...]
|
|
210
|
+
|
|
211
|
+
Detected: Python 3.11, Poetry, FastAPI, PostgreSQL, OpenAI
|
|
212
|
+
|
|
213
|
+
Recommend ENABLE: api-patterns, postgres-patterns, ai-rag-patterns
|
|
214
|
+
Recommend DISABLE: react-patterns, flutter-patterns, tailwind-patterns, mobile-design
|
|
215
|
+
|
|
216
|
+
User: customize, keep testing-patterns and docker-patterns
|
|
217
|
+
|
|
218
|
+
AI: [Apply with user customization]
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neyugn/agent-kits",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Universal AI Agent Toolkit - Skills, Agents, and Workflows for any AI coding assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
|
-
"kits"
|
|
11
|
+
"kits",
|
|
12
|
+
"common"
|
|
12
13
|
],
|
|
13
14
|
"keywords": [
|
|
14
15
|
"ai",
|