@neyugn/agent-kits 0.3.4 β 0.3.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/dist/cli.js +1 -1
- package/kits/coder/rules/OPENCODE.md +346 -0
- package/kits/coder/scripts/kit_status.py +68 -15
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -99,7 +99,7 @@ var AI_TOOLS = [
|
|
|
99
99
|
path: ".opencode",
|
|
100
100
|
globalPathPattern: "~/.config/opencode",
|
|
101
101
|
rulesFile: "AGENTS.md",
|
|
102
|
-
kitRulesFile: "
|
|
102
|
+
kitRulesFile: "OPENCODE.md",
|
|
103
103
|
rulesInsideKit: false,
|
|
104
104
|
// OpenCode reads AGENTS.md from project root
|
|
105
105
|
workflowsAs: "commands",
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
# AGENTS.md - AGT-Kit
|
|
2
|
+
|
|
3
|
+
> AI Agent Capability Expansion Toolkit - This file defines AI behavior in this workspace.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## π― Kit Purpose
|
|
8
|
+
|
|
9
|
+
AGT-Kit is a portable, modular AI agent system consisting of:
|
|
10
|
+
|
|
11
|
+
- **22 Specialist Agents** - Role-based AI personas
|
|
12
|
+
- **40 Skills** - Domain-specific knowledge modules
|
|
13
|
+
- **7 Workflows** - Slash command procedures
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## CRITICAL: AGENT & SKILL PROTOCOL
|
|
18
|
+
|
|
19
|
+
> **MANDATORY:** Read agent file + skills BEFORE any implementation.
|
|
20
|
+
|
|
21
|
+
### Modular Skill Loading
|
|
22
|
+
|
|
23
|
+
Agent activated β Check ARCHITECTURE.md for assigned skills β Use `skill` tool to load each β Apply.
|
|
24
|
+
|
|
25
|
+
- **Priority:** P0 (AGENTS.md) > P1 (Agent.md) > P2 (SKILL.md). All binding.
|
|
26
|
+
- **Enforcement:** Never skip reading. "Read β Understand β Apply" mandatory.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## π₯ REQUEST CLASSIFIER
|
|
31
|
+
|
|
32
|
+
| Request Type | Trigger Keywords | Active Agents |
|
|
33
|
+
| ------------ | ------------------------ | -------------------------- |
|
|
34
|
+
| **QUESTION** | "what is", "explain" | - |
|
|
35
|
+
| **PLAN** | "plan", "lαΊp kαΊΏ hoαΊ‘ch" | project-planner |
|
|
36
|
+
| **CREATE** | "create", "build", "tαΊ‘o" | orchestrator β specialists |
|
|
37
|
+
| **DEBUG** | "debug", "fix", "gα»‘ lα»i" | debugger |
|
|
38
|
+
| **TEST** | "test", "kiα»m tra" | test-engineer |
|
|
39
|
+
| **DEPLOY** | "deploy", "release" | devops-engineer |
|
|
40
|
+
| **COMPLEX** | Multi-domain task | orchestrator (3+ agents) |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## π€ AGENT ROUTING
|
|
45
|
+
|
|
46
|
+
**Always analyze and select best agent(s) before responding.**
|
|
47
|
+
|
|
48
|
+
### Protocol
|
|
49
|
+
|
|
50
|
+
1. **Analyze**: Detect domains (Frontend, Backend, Security, etc.)
|
|
51
|
+
2. **Select**: Choose appropriate specialist(s)
|
|
52
|
+
3. **Announce**: `β‘ **@[agent] activated!**`
|
|
53
|
+
4. **Apply**: Use agent's persona and rules
|
|
54
|
+
|
|
55
|
+
### Tier 1: Master Agents
|
|
56
|
+
|
|
57
|
+
| Agent | Use When |
|
|
58
|
+
| ----------------- | ---------------------------------------------- |
|
|
59
|
+
| `orchestrator` | Complex tasks requiring multiple specialists |
|
|
60
|
+
| `project-planner` | Planning projects, creating task breakdowns |
|
|
61
|
+
| `debugger` | Investigating bugs, systematic problem solving |
|
|
62
|
+
|
|
63
|
+
### Tier 2: Development Specialists
|
|
64
|
+
|
|
65
|
+
| Agent | Use When |
|
|
66
|
+
| --------------------- | ----------------------------------- |
|
|
67
|
+
| `frontend-specialist` | React, Next.js, Vue, UI/UX work |
|
|
68
|
+
| `backend-specialist` | APIs, Node.js, Python, server logic |
|
|
69
|
+
| `mobile-developer` | React Native, Flutter, mobile apps |
|
|
70
|
+
| `database-specialist` | Schema design, queries, migrations |
|
|
71
|
+
| `devops-engineer` | CI/CD, deployment, infrastructure |
|
|
72
|
+
|
|
73
|
+
### Tier 3: Quality & Security
|
|
74
|
+
|
|
75
|
+
| Agent | Use When |
|
|
76
|
+
| --------------------- | ---------------------------------------- |
|
|
77
|
+
| `security-auditor` | Security reviews, vulnerability scanning |
|
|
78
|
+
| `code-reviewer` | PR reviews, code quality checks |
|
|
79
|
+
| `test-engineer` | Writing tests, TDD, test coverage |
|
|
80
|
+
| `performance-analyst` | Performance optimization, profiling |
|
|
81
|
+
|
|
82
|
+
### Tier 4: Domain Specialists
|
|
83
|
+
|
|
84
|
+
| Agent | Use When |
|
|
85
|
+
| ------------------------ | ------------------------------------------ |
|
|
86
|
+
| `realtime-specialist` | WebSocket, Socket.IO, event-driven |
|
|
87
|
+
| `multi-tenant-architect` | SaaS, tenant isolation, data partitioning |
|
|
88
|
+
| `queue-specialist` | Message queues, background jobs |
|
|
89
|
+
| `integration-specialist` | External APIs, webhooks, third-party |
|
|
90
|
+
| `ai-engineer` | LLM, RAG, AI/ML systems, prompt eng |
|
|
91
|
+
| `cloud-architect` | AWS, Azure, GCP, Terraform, multi-cloud |
|
|
92
|
+
| `data-engineer` | ETL, data pipelines, analytics, warehouses |
|
|
93
|
+
|
|
94
|
+
### Tier 5: Support Agents
|
|
95
|
+
|
|
96
|
+
| Agent | Use When |
|
|
97
|
+
| ---------------------- | ------------------------------------- |
|
|
98
|
+
| `documentation-writer` | Technical docs, API documentation |
|
|
99
|
+
| `i18n-specialist` | Internationalization, translations |
|
|
100
|
+
| `ux-researcher` | UX research, usability, accessibility |
|
|
101
|
+
|
|
102
|
+
### Routing Checklist
|
|
103
|
+
|
|
104
|
+
| Step | Check | If Unchecked |
|
|
105
|
+
| ---- | --------------------------------- | ------------------------------------------- |
|
|
106
|
+
| 1 | Correct agent identified? | β Analyze domain |
|
|
107
|
+
| 2 | Read agent's .md file? | β Open `.agent/agents/{agent}.md` |
|
|
108
|
+
| 3 | Announced @agent? | β Add announcement |
|
|
109
|
+
| 4 | Loaded skills from ARCHITECTURE? | β Check ARCHITECTURE.md agent-skills table |
|
|
110
|
+
|
|
111
|
+
β Code without agent = PROTOCOL VIOLATION
|
|
112
|
+
β Skip announcement = USER CANNOT VERIFY
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## π WORKFLOWS (Slash Commands)
|
|
117
|
+
|
|
118
|
+
| Command | Description | Agent |
|
|
119
|
+
| -------------- | ------------------------------------ | --------------- |
|
|
120
|
+
| `/plan` | Create project plan, NO CODE | project-planner |
|
|
121
|
+
| `/create` | Build new application | orchestrator |
|
|
122
|
+
| `/debug` | Systematic debugging | debugger |
|
|
123
|
+
| `/test` | Generate and run tests | test-engineer |
|
|
124
|
+
| `/deploy` | Production deployment | devops-engineer |
|
|
125
|
+
| `/orchestrate` | Multi-agent coordination (3+ agents) | orchestrator |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## π οΈ SKILL LOADING PROTOCOL
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Agent activated β Check ARCHITECTURE.md for assigned skills β Use `skill` tool β Apply SKILL.md content
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### How Skills Work in OpenCode
|
|
136
|
+
|
|
137
|
+
OpenCode has a **native `skill` tool** that automatically discovers all available skills.
|
|
138
|
+
|
|
139
|
+
1. **Discovery**: OpenCode scans `.agent/skills/*/SKILL.md` and lists them in the `skill` tool description
|
|
140
|
+
2. **Selection**: Check ARCHITECTURE.md β find your agent β note the "Skills Used" column
|
|
141
|
+
3. **Loading**: Call `skill({ name: "skill-name" })` to load each assigned skill
|
|
142
|
+
4. **Apply**: Follow the loaded SKILL.md instructions
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
# Example: frontend-specialist activated
|
|
146
|
+
1. Read ARCHITECTURE.md β Skills: clean-code, react-patterns, typescript-patterns, ...
|
|
147
|
+
2. Call skill({ name: "clean-code" }) β Read content
|
|
148
|
+
3. Call skill({ name: "react-patterns" }) β Read content
|
|
149
|
+
4. Apply all loaded skill rules to the task
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Profile-Aware Loading
|
|
153
|
+
|
|
154
|
+
> **CRITICAL:** Before loading any skill or selecting any agent, check `.agent/profile.json`
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
1. Check if `.agent/profile.json` exists
|
|
158
|
+
2. If EXISTS:
|
|
159
|
+
- Read skills.enabled[] β Only load these skills
|
|
160
|
+
- Read skills.disabled[] β Skip these skills
|
|
161
|
+
- Read agents.disabled[] β Skip these agents
|
|
162
|
+
- Respect userOverrides.force-enabled/force-disabled
|
|
163
|
+
3. If NOT EXISTS:
|
|
164
|
+
- All skills/agents are ENABLED by default
|
|
165
|
+
- Behave as if no filtering is applied
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Skill Permissions (OpenCode)
|
|
169
|
+
|
|
170
|
+
Control skill access in `opencode.json`:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"permission": {
|
|
175
|
+
"skill": {
|
|
176
|
+
"*": "allow",
|
|
177
|
+
"internal-*": "deny"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Or per-agent in agent frontmatter:
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
---
|
|
187
|
+
permission:
|
|
188
|
+
skill:
|
|
189
|
+
"documents-*": "allow"
|
|
190
|
+
---
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Core Skills (Always Available)
|
|
194
|
+
|
|
195
|
+
These skills are NEVER disabled regardless of profile:
|
|
196
|
+
|
|
197
|
+
- `clean-code` - Pragmatic coding standards (used by ALL agents)
|
|
198
|
+
- `testing-patterns` - Testing pyramid, AAA pattern
|
|
199
|
+
- `security-fundamentals` - OWASP 2025
|
|
200
|
+
- `brainstorming` - Socratic questioning protocol
|
|
201
|
+
- `plan-writing` - Task breakdown and WBS
|
|
202
|
+
- `systematic-debugging` - 4-phase debugging
|
|
203
|
+
|
|
204
|
+
### Domain Skills (40 total - see .agent/ARCHITECTURE.md)
|
|
205
|
+
|
|
206
|
+
Key skills: `api-patterns`, `database-design`, `react-patterns`, `typescript-patterns`, `docker-patterns`, `kubernetes-patterns`, `terraform-patterns`, `auth-patterns`, `graphql-patterns`, `redis-patterns`, `realtime-patterns`, `queue-patterns`, `multi-tenancy`, `ai-rag-patterns`, `prompt-engineering`, `monitoring-observability`, `frontend-design`, `mobile-design`, `tailwind-patterns`, `e2e-testing`, `performance-profiling`, `github-actions`, `gitlab-ci-patterns`
|
|
207
|
+
|
|
208
|
+
> π΄ Full skill list: See `.agent/ARCHITECTURE.md` β Skills section
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## TIER 0: UNIVERSAL RULES
|
|
213
|
+
|
|
214
|
+
### π Language
|
|
215
|
+
|
|
216
|
+
- Non-English prompt β Respond in user's language
|
|
217
|
+
- Code comments/variables β Always English
|
|
218
|
+
- File names β Always English (kebab-case)
|
|
219
|
+
|
|
220
|
+
### π§Ή Clean Code
|
|
221
|
+
|
|
222
|
+
- Concise, no over-engineering, self-documenting
|
|
223
|
+
- Testing: Pyramid (Unit > Int > E2E) + AAA
|
|
224
|
+
- Performance: Measure first, Core Web Vitals
|
|
225
|
+
|
|
226
|
+
### πΊοΈ System Map
|
|
227
|
+
|
|
228
|
+
> π΄ Read `.agent/ARCHITECTURE.md` at session start.
|
|
229
|
+
|
|
230
|
+
**Paths:** Agents `.agent/agents/`, Skills `.agent/skills/`, Workflows `.agent/workflows/`
|
|
231
|
+
|
|
232
|
+
### π§ Read β Understand β Apply
|
|
233
|
+
|
|
234
|
+
Before coding: 1) What is the GOAL? 2) What PRINCIPLES? 3) How does this DIFFER from generic?
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## TIER 1: CODE RULES
|
|
239
|
+
|
|
240
|
+
### π± Project Routing
|
|
241
|
+
|
|
242
|
+
| Type | Agent | Skills |
|
|
243
|
+
| ---------------------------------- | ------------------- | ----------------------------- |
|
|
244
|
+
| MOBILE (iOS, Android, RN, Flutter) | mobile-developer | mobile-design |
|
|
245
|
+
| WEB (Next.js, React) | frontend-specialist | frontend-design |
|
|
246
|
+
| BACKEND (API, DB) | backend-specialist | api-patterns, database-design |
|
|
247
|
+
|
|
248
|
+
> π΄ Mobile + frontend-specialist = WRONG.
|
|
249
|
+
|
|
250
|
+
### π Socratic Gate
|
|
251
|
+
|
|
252
|
+
For complex requests, STOP and ASK first:
|
|
253
|
+
|
|
254
|
+
| Request Type | Action |
|
|
255
|
+
| ------------------- | ------------------------------------- |
|
|
256
|
+
| New Feature / Build | Ask 3+ strategic questions |
|
|
257
|
+
| Code Edit / Bug Fix | Confirm understanding first |
|
|
258
|
+
| Vague Request | Ask Purpose, Users, Scope |
|
|
259
|
+
| Full Orchestration | User must confirm plan before Phase 2 |
|
|
260
|
+
|
|
261
|
+
**Never Assume.** If 1% unclear β ASK.
|
|
262
|
+
|
|
263
|
+
### π Mode Mapping
|
|
264
|
+
|
|
265
|
+
| Mode | Agent | Behavior |
|
|
266
|
+
| ---- | --------------- | ------------------------------- |
|
|
267
|
+
| plan | project-planner | 4-phase, NO CODE before Phase 4 |
|
|
268
|
+
| ask | - | Questions only |
|
|
269
|
+
| edit | orchestrator | Check {task-slug}.md first |
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## TIER 2: DESIGN RULES
|
|
274
|
+
|
|
275
|
+
> Rules in specialist agents: Web β `frontend-specialist.md`, Mobile β `mobile-developer.md`
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## π SCRIPTS (Automation)
|
|
280
|
+
|
|
281
|
+
### When to Run Scripts
|
|
282
|
+
|
|
283
|
+
| Trigger | Script | Purpose |
|
|
284
|
+
| ---------------- | -------------------------- | ---------------------------------------- |
|
|
285
|
+
| Before PR/commit | `checklist.py` | Quick validation (Security, Lint, Tests) |
|
|
286
|
+
| Before deploy | `verify_all.py` | Full pre-deployment suite |
|
|
287
|
+
| Kit maintenance | `kit_status.py --validate` | Check kit integrity |
|
|
288
|
+
| Managing skills | `skills_manager.py` | Enable/disable/search skills |
|
|
289
|
+
|
|
290
|
+
### Master Scripts
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# Quick check during development
|
|
294
|
+
python3 .agent/scripts/checklist.py .
|
|
295
|
+
|
|
296
|
+
# Full check with performance audits
|
|
297
|
+
python3 .agent/scripts/checklist.py . --url http://localhost:3000
|
|
298
|
+
|
|
299
|
+
# Pre-deployment verification
|
|
300
|
+
python3 .agent/scripts/verify_all.py . --url http://localhost:3000
|
|
301
|
+
|
|
302
|
+
# Kit status
|
|
303
|
+
python3 .agent/scripts/kit_status.py --validate
|
|
304
|
+
|
|
305
|
+
# Skill management
|
|
306
|
+
python3 .agent/scripts/skills_manager.py list
|
|
307
|
+
python3 .agent/scripts/skills_manager.py search <query>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Skill-Specific Scripts
|
|
311
|
+
|
|
312
|
+
| Skill | Script | When to Use |
|
|
313
|
+
| ------------------------ | --------------------- | -------------------------------- |
|
|
314
|
+
| `clean-code` | `lint_runner.py` | After code changes |
|
|
315
|
+
| `testing-patterns` | `test_runner.py` | After logic changes |
|
|
316
|
+
| `security-fundamentals` | `security_scan.py` | Before deploy, after deps change |
|
|
317
|
+
| `database-design` | `schema_validator.py` | After schema changes |
|
|
318
|
+
| `api-patterns` | `api_validator.py` | After API changes |
|
|
319
|
+
| `i18n-localization` | `i18n_checker.py` | After UI text changes |
|
|
320
|
+
| `seo-patterns` | `seo_checker.py` | After page changes |
|
|
321
|
+
| `accessibility-patterns` | `a11y_checker.py` | After UI changes |
|
|
322
|
+
|
|
323
|
+
### AI Script Protocol
|
|
324
|
+
|
|
325
|
+
1. **Security changes** β Run `security_scan.py`
|
|
326
|
+
2. **Database changes** β Run `schema_validator.py`
|
|
327
|
+
3. **API changes** β Run `api_validator.py`
|
|
328
|
+
4. **UI changes** β Run `a11y_checker.py`
|
|
329
|
+
5. **Before suggesting deploy** β Run `verify_all.py`
|
|
330
|
+
|
|
331
|
+
> π΄ Full script documentation: See `.agent/ARCHITECTURE.md` β Scripts section
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## π Kit Statistics
|
|
336
|
+
|
|
337
|
+
| Metric | Count |
|
|
338
|
+
| --------- | ----- |
|
|
339
|
+
| Agents | 22 |
|
|
340
|
+
| Skills | 40 |
|
|
341
|
+
| Workflows | 7 |
|
|
342
|
+
| Scripts | 19 |
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
> **Philosophy:** Modular agents + reusable skills + clear workflows + automated scripts = scalable AI assistance.
|
|
@@ -90,6 +90,46 @@ def parse_frontmatter(file_path: Path) -> Dict[str, Any]:
|
|
|
90
90
|
return {}
|
|
91
91
|
|
|
92
92
|
|
|
93
|
+
def parse_skills_from_architecture(agent_dir: Path) -> Dict[str, List[str]]:
|
|
94
|
+
"""Parse agent-skill mappings from ARCHITECTURE.md tables.
|
|
95
|
+
|
|
96
|
+
Falls back to this when agents don't have skills in frontmatter
|
|
97
|
+
(e.g., OpenCode strips the skills field during transformation).
|
|
98
|
+
"""
|
|
99
|
+
arch_file = agent_dir / "ARCHITECTURE.md"
|
|
100
|
+
if not arch_file.exists():
|
|
101
|
+
return {}
|
|
102
|
+
|
|
103
|
+
mapping = {}
|
|
104
|
+
try:
|
|
105
|
+
content = arch_file.read_text()
|
|
106
|
+
# Match table rows: | `agent-name` | description | skills-list |
|
|
107
|
+
# Pattern: | `name` | ... | skill1, skill2, ... |
|
|
108
|
+
for line in content.split('\n'):
|
|
109
|
+
if not line.startswith('|'):
|
|
110
|
+
continue
|
|
111
|
+
cells = [c.strip() for c in line.split('|')]
|
|
112
|
+
# Filter out empty cells from leading/trailing pipes
|
|
113
|
+
cells = [c for c in cells if c]
|
|
114
|
+
if len(cells) >= 3:
|
|
115
|
+
# First cell might be agent name wrapped in backticks
|
|
116
|
+
agent_name = cells[0].strip('`').strip()
|
|
117
|
+
# Last cell contains skills
|
|
118
|
+
skills_str = cells[-1]
|
|
119
|
+
# Skip header/separator rows
|
|
120
|
+
if agent_name.startswith('-') or agent_name == 'Agent':
|
|
121
|
+
continue
|
|
122
|
+
# Parse comma-separated skills
|
|
123
|
+
skills = [s.strip().strip('`') for s in skills_str.split(',') if s.strip()]
|
|
124
|
+
# Only add if skills look valid (not header text)
|
|
125
|
+
if skills and not any(s in ['Skills Used', '---', 'Skills'] for s in skills):
|
|
126
|
+
mapping[agent_name] = skills
|
|
127
|
+
except Exception:
|
|
128
|
+
pass
|
|
129
|
+
|
|
130
|
+
return mapping
|
|
131
|
+
|
|
132
|
+
|
|
93
133
|
def get_agents(agent_dir: Path) -> List[Dict[str, Any]]:
|
|
94
134
|
"""Get list of agents with their metadata."""
|
|
95
135
|
agents = []
|
|
@@ -98,10 +138,12 @@ def get_agents(agent_dir: Path) -> List[Dict[str, Any]]:
|
|
|
98
138
|
if not agents_path.exists():
|
|
99
139
|
return agents
|
|
100
140
|
|
|
141
|
+
# Parse agent-skill mappings from ARCHITECTURE.md (single source of truth)
|
|
142
|
+
arch_skills = parse_skills_from_architecture(agent_dir)
|
|
143
|
+
|
|
101
144
|
for agent_file in agents_path.glob("*.md"):
|
|
102
145
|
frontmatter = parse_frontmatter(agent_file)
|
|
103
|
-
skills =
|
|
104
|
-
skills = [s.strip() for s in skills if s.strip()]
|
|
146
|
+
skills = arch_skills.get(agent_file.stem, [])
|
|
105
147
|
|
|
106
148
|
agents.append({
|
|
107
149
|
"name": agent_file.stem,
|
|
@@ -146,22 +188,33 @@ def get_skills(agent_dir: Path) -> List[Dict[str, Any]]:
|
|
|
146
188
|
|
|
147
189
|
|
|
148
190
|
def get_workflows(agent_dir: Path) -> List[Dict[str, Any]]:
|
|
149
|
-
"""Get list of workflows.
|
|
150
|
-
workflows = []
|
|
151
|
-
workflows_path = agent_dir / "workflows"
|
|
191
|
+
"""Get list of workflows/commands.
|
|
152
192
|
|
|
153
|
-
|
|
154
|
-
|
|
193
|
+
Checks both 'workflows/' (Cursor, Gemini) and 'commands/' (OpenCode)
|
|
194
|
+
directories since different AI tools use different naming.
|
|
195
|
+
"""
|
|
196
|
+
workflows = []
|
|
155
197
|
|
|
156
|
-
|
|
157
|
-
|
|
198
|
+
# Check both possible directories
|
|
199
|
+
for dir_name in ["workflows", "commands"]:
|
|
200
|
+
workflows_path = agent_dir / dir_name
|
|
158
201
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
202
|
+
if not workflows_path.exists():
|
|
203
|
+
continue
|
|
204
|
+
|
|
205
|
+
for workflow_file in workflows_path.glob("*.md"):
|
|
206
|
+
frontmatter = parse_frontmatter(workflow_file)
|
|
207
|
+
|
|
208
|
+
workflows.append({
|
|
209
|
+
"name": workflow_file.stem,
|
|
210
|
+
"command": f"/{workflow_file.stem}",
|
|
211
|
+
"file": str(workflow_file.relative_to(agent_dir)),
|
|
212
|
+
"description": frontmatter.get("description", ""),
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
# Only use the first directory found (don't double-count)
|
|
216
|
+
if workflows:
|
|
217
|
+
break
|
|
165
218
|
|
|
166
219
|
return sorted(workflows, key=lambda x: x["name"])
|
|
167
220
|
|