@sylphx/flow 2.16.1 → 2.17.0
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 +20 -0
- package/assets/{slash-commands/guideline-account-security.md → skills/account-security/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-admin.md → skills/admin/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-auth.md → skills/auth/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-billing.md → skills/billing/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-code-quality.md → skills/code-quality/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-data-architecture.md → skills/data-architecture/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-database.md → skills/database/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-delivery.md → skills/delivery/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-discovery.md → skills/discovery/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-growth.md → skills/growth/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-i18n.md → skills/i18n/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-ledger.md → skills/ledger/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-observability.md → skills/observability/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-operability.md → skills/operability/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-performance.md → skills/performance/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-pricing.md → skills/pricing/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-privacy.md → skills/privacy/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-pwa.md → skills/pwa/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-referral.md → skills/referral/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-security.md → skills/security/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-seo.md → skills/seo/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-storage.md → skills/storage/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-support.md → skills/support/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-trust-safety.md → skills/trust-safety/SKILL.md} +2 -3
- package/assets/{slash-commands/guideline-uiux.md → skills/uiux/SKILL.md} +2 -3
- package/assets/slash-commands/continue.md +6 -13
- package/assets/slash-commands/review.md +8 -32
- package/package.json +1 -1
- package/src/core/attach-manager.ts +54 -5
- package/src/core/backup-manager.ts +5 -0
- package/src/core/flow-executor.ts +14 -5
- package/src/core/template-loader.ts +35 -0
- package/src/targets/claude-code.ts +1 -0
- package/src/types/target.types.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @sylphx/flow
|
|
2
2
|
|
|
3
|
+
## 2.17.0 (2025-12-18)
|
|
4
|
+
|
|
5
|
+
### ✨ Features
|
|
6
|
+
|
|
7
|
+
- **skills:** implement skills loading and attach pipeline ([8d720b8](https://github.com/SylphxAI/flow/commit/8d720b8118ffe19e14d50aaacd9282bd5d42e702))
|
|
8
|
+
|
|
9
|
+
## 2.16.2 (2025-12-17)
|
|
10
|
+
|
|
11
|
+
### 🐛 Bug Fixes
|
|
12
|
+
|
|
13
|
+
- **commands:** tell LLM to use SlashCommand tool for /review and /continue ([6983015](https://github.com/SylphxAI/flow/commit/6983015b97e89a48e973106828672b8b3000dce8))
|
|
14
|
+
|
|
15
|
+
### ♻️ Refactoring
|
|
16
|
+
|
|
17
|
+
- **assets:** convert guidelines to Skills (model-invoked) ([2eb8d01](https://github.com/SylphxAI/flow/commit/2eb8d01162f00a127c5666c8afd9b63fc477ea42))
|
|
18
|
+
|
|
19
|
+
### 🔧 Chores
|
|
20
|
+
|
|
21
|
+
- trigger release workflow ([69d661c](https://github.com/SylphxAI/flow/commit/69d661c582157650df855a3a31e21ad6a8b3e7bf))
|
|
22
|
+
|
|
3
23
|
## 2.16.1 (2025-12-17)
|
|
4
24
|
|
|
5
25
|
### ♻️ Refactoring
|
package/assets/{slash-commands/guideline-account-security.md → skills/account-security/SKILL.md}
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: account-security
|
|
3
|
+
description: Account security - MFA, sessions, recovery. Use when protecting user accounts.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Account Security Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: auth
|
|
3
|
+
description: Authentication patterns - sign-in, SSO, passkeys, sessions. Use when implementing auth flows.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Auth Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: billing
|
|
3
|
+
description: Billing - Stripe, webhooks, subscriptions. Use when implementing payments.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Billing Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: code-quality
|
|
3
|
+
description: Code quality - patterns, testing, maintainability. Use for code review.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Code Quality Guideline
|
package/assets/{slash-commands/guideline-data-architecture.md → skills/data-architecture/SKILL.md}
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: data-architecture
|
|
3
|
+
description: Data architecture - models, relationships. Use when designing data structures.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Data Architecture Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: discovery
|
|
3
|
+
description: Feature discovery - competitive analysis. Use when exploring features.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Discovery Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: observability
|
|
3
|
+
description: Observability - logging, metrics, tracing. Use when adding monitoring.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Observability Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: operability
|
|
3
|
+
description: Operations - deployment, rollback, feature flags. Use for ops tooling.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Operability Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: performance
|
|
3
|
+
description: Performance - Core Web Vitals, bundle size. Use when optimizing speed.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Performance Guideline
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
4
|
-
agent: coder
|
|
2
|
+
name: trust-safety
|
|
3
|
+
description: Trust and safety - abuse prevention, rate limiting. Use when fighting bad actors.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Trust Safety Guideline
|
|
@@ -58,24 +58,17 @@ These questions reveal incompleteness that checklists miss.
|
|
|
58
58
|
|
|
59
59
|
5. **Fix completely** — Don't patch. Understand root cause. Implement proper solution. Test it works.
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Skills
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Domain knowledge auto-activates when relevant. Available skills:
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
/review auth — Auth flow issues
|
|
67
|
-
/review security — Validation gaps, injection risks
|
|
68
|
-
/review database — Schema issues, missing indexes
|
|
69
|
-
/review performance — Slow paths, bundle bloat
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Full list: auth, account-security, privacy, billing, pricing, ledger, security, trust-safety, uiux, seo, pwa, performance, i18n, database, data-architecture, storage, observability, operability, delivery, growth, referral, support, admin, discovery, code-quality
|
|
65
|
+
auth, account-security, privacy, billing, pricing, ledger, security, trust-safety, uiux, seo, pwa, performance, i18n, database, data-architecture, storage, observability, operability, delivery, growth, referral, support, admin, discovery, code-quality
|
|
73
66
|
|
|
74
67
|
## Loop
|
|
75
68
|
|
|
76
|
-
After fixing
|
|
69
|
+
After fixing: "Did my fixes introduce new gaps? Did fixing X reveal Y was also broken?"
|
|
77
70
|
|
|
78
|
-
If yes → continue. If no Critical/High issues remain → done.
|
|
71
|
+
If yes → run `/continue` again. If no Critical/High issues remain → done.
|
|
79
72
|
|
|
80
73
|
## Output
|
|
81
74
|
|
|
@@ -94,5 +87,5 @@ If yes → continue. If no Critical/High issues remain → done.
|
|
|
94
87
|
|
|
95
88
|
## Next
|
|
96
89
|
|
|
97
|
-
[/continue again |
|
|
90
|
+
[/continue again | done]
|
|
98
91
|
```
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description: Review codebase by
|
|
3
|
+
description: Review codebase by topic - /review <what to review>
|
|
4
4
|
agent: coder
|
|
5
5
|
args:
|
|
6
6
|
- name: topic
|
|
7
|
-
description: What to review (e.g., auth, security,
|
|
7
|
+
description: What to review (e.g., auth, security, "the login flow", "why it's slow")
|
|
8
8
|
required: true
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -12,42 +12,18 @@ args:
|
|
|
12
12
|
|
|
13
13
|
## Mandate
|
|
14
14
|
|
|
15
|
-
* **Understand first.**
|
|
15
|
+
* **Understand first.** Absorb the principles, then apply judgment.
|
|
16
16
|
* **Think like the failure mode.** Security? Think like an attacker. Performance? Think like a slow network. Auth? Think like a confused user.
|
|
17
17
|
* **Delegate workers** for parallel research. You synthesize and verify.
|
|
18
18
|
* **Fix, don't report.** Implement solutions directly.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Skills
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Domain knowledge is available through Skills that auto-activate based on context:
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
| `/guideline-account-security` | MFA, sessions, account recovery |
|
|
28
|
-
| `/guideline-privacy` | Data handling, consent, GDPR/CCPA |
|
|
29
|
-
| `/guideline-billing` | Stripe, webhooks, subscriptions |
|
|
30
|
-
| `/guideline-pricing` | Pricing models, tiers, feature gating |
|
|
31
|
-
| `/guideline-ledger` | Transactions, audit trails, reconciliation |
|
|
32
|
-
| `/guideline-security` | OWASP, validation, secrets |
|
|
33
|
-
| `/guideline-trust-safety` | Abuse prevention, rate limiting, fraud |
|
|
34
|
-
| `/guideline-uiux` | Design system, accessibility |
|
|
35
|
-
| `/guideline-seo` | Meta tags, structured data, crawlability |
|
|
36
|
-
| `/guideline-pwa` | Service workers, offline, installability |
|
|
37
|
-
| `/guideline-performance` | Core Web Vitals, bundle size, caching |
|
|
38
|
-
| `/guideline-i18n` | Localization, routing, hreflang |
|
|
39
|
-
| `/guideline-database` | Schema, indexes, migrations |
|
|
40
|
-
| `/guideline-data-architecture` | Data models, relationships, integrity |
|
|
41
|
-
| `/guideline-storage` | File uploads, CDN, blob storage |
|
|
42
|
-
| `/guideline-observability` | Logging, metrics, tracing, alerts |
|
|
43
|
-
| `/guideline-operability` | Deployment, rollback, feature flags |
|
|
44
|
-
| `/guideline-delivery` | CI/CD, testing, release process |
|
|
45
|
-
| `/guideline-growth` | Onboarding, activation, retention |
|
|
46
|
-
| `/guideline-referral` | Referral programs, viral loops |
|
|
47
|
-
| `/guideline-support` | Help systems, tickets, documentation |
|
|
48
|
-
| `/guideline-admin` | Admin panel, RBAC, config |
|
|
49
|
-
| `/guideline-discovery` | Feature discovery, competitive analysis |
|
|
50
|
-
| `/guideline-code-quality` | Patterns, testing, maintainability |
|
|
24
|
+
auth, account-security, privacy, billing, pricing, ledger, security, trust-safety, uiux, seo, pwa, performance, i18n, database, data-architecture, storage, observability, operability, delivery, growth, referral, support, admin, discovery, code-quality
|
|
25
|
+
|
|
26
|
+
You don't need to invoke them — they activate when relevant.
|
|
51
27
|
|
|
52
28
|
## Output
|
|
53
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/flow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "One CLI to rule them all. Unified orchestration layer for Claude Code, OpenCode, Cursor and all AI development tools. Auto-detection, auto-installation, auto-upgrade.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,6 +21,8 @@ export interface AttachResult {
|
|
|
21
21
|
agentsOverridden: string[];
|
|
22
22
|
commandsAdded: string[];
|
|
23
23
|
commandsOverridden: string[];
|
|
24
|
+
skillsAdded: string[];
|
|
25
|
+
skillsOverridden: string[];
|
|
24
26
|
rulesAppended: boolean;
|
|
25
27
|
mcpServersAdded: string[];
|
|
26
28
|
mcpServersOverridden: string[];
|
|
@@ -31,7 +33,7 @@ export interface AttachResult {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export interface ConflictInfo {
|
|
34
|
-
type: 'agent' | 'command' | 'mcp' | 'hook';
|
|
36
|
+
type: 'agent' | 'command' | 'skill' | 'mcp' | 'hook';
|
|
35
37
|
name: string;
|
|
36
38
|
action: 'overridden' | 'merged';
|
|
37
39
|
message: string;
|
|
@@ -40,6 +42,7 @@ export interface ConflictInfo {
|
|
|
40
42
|
export interface FlowTemplates {
|
|
41
43
|
agents: Array<{ name: string; content: string }>;
|
|
42
44
|
commands: Array<{ name: string; content: string }>;
|
|
45
|
+
skills: Array<{ name: string; content: string }>;
|
|
43
46
|
rules?: string;
|
|
44
47
|
mcpServers: Array<{ name: string; config: Record<string, unknown> }>;
|
|
45
48
|
hooks: Array<{ name: string; content: string }>;
|
|
@@ -143,6 +146,8 @@ export class AttachManager {
|
|
|
143
146
|
agentsOverridden: [],
|
|
144
147
|
commandsAdded: [],
|
|
145
148
|
commandsOverridden: [],
|
|
149
|
+
skillsAdded: [],
|
|
150
|
+
skillsOverridden: [],
|
|
146
151
|
rulesAppended: false,
|
|
147
152
|
mcpServersAdded: [],
|
|
148
153
|
mcpServersOverridden: [],
|
|
@@ -160,12 +165,17 @@ export class AttachManager {
|
|
|
160
165
|
// 2. Attach commands
|
|
161
166
|
await this.attachCommands(projectPath, target, templates.commands, result, manifest);
|
|
162
167
|
|
|
163
|
-
// 3. Attach
|
|
168
|
+
// 3. Attach skills (if target supports them)
|
|
169
|
+
if (target.config.skillsDir && templates.skills.length > 0) {
|
|
170
|
+
await this.attachSkills(projectPath, target, templates.skills, result, manifest);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// 4. Attach rules (if applicable)
|
|
164
174
|
if (templates.rules) {
|
|
165
175
|
await this.attachRules(projectPath, target, templates.rules, result, manifest);
|
|
166
176
|
}
|
|
167
177
|
|
|
168
|
-
//
|
|
178
|
+
// 5. Attach MCP servers (merge global + template servers)
|
|
169
179
|
const globalMCPServers = await this.loadGlobalMCPServers(target);
|
|
170
180
|
const allMCPServers = [...globalMCPServers, ...templates.mcpServers];
|
|
171
181
|
|
|
@@ -173,12 +183,12 @@ export class AttachManager {
|
|
|
173
183
|
await this.attachMCPServers(projectPath, target, allMCPServers, result, manifest);
|
|
174
184
|
}
|
|
175
185
|
|
|
176
|
-
//
|
|
186
|
+
// 6. Attach hooks
|
|
177
187
|
if (templates.hooks.length > 0) {
|
|
178
188
|
await this.attachHooks(projectPath, target, templates.hooks, result, manifest);
|
|
179
189
|
}
|
|
180
190
|
|
|
181
|
-
//
|
|
191
|
+
// 7. Attach single files
|
|
182
192
|
if (templates.singleFiles.length > 0) {
|
|
183
193
|
await this.attachSingleFiles(projectPath, templates.singleFiles, result, manifest);
|
|
184
194
|
}
|
|
@@ -238,6 +248,45 @@ export class AttachManager {
|
|
|
238
248
|
manifest.backup.commands.flow.push(...itemManifest.flow);
|
|
239
249
|
}
|
|
240
250
|
|
|
251
|
+
/**
|
|
252
|
+
* Attach skills (override strategy)
|
|
253
|
+
* Skills are stored as <domain>/SKILL.md subdirectories
|
|
254
|
+
*/
|
|
255
|
+
private async attachSkills(
|
|
256
|
+
projectPath: string,
|
|
257
|
+
target: Target,
|
|
258
|
+
skills: Array<{ name: string; content: string }>,
|
|
259
|
+
result: AttachResult,
|
|
260
|
+
manifest: BackupManifest
|
|
261
|
+
): Promise<void> {
|
|
262
|
+
const skillsDir = path.join(projectPath, target.config.skillsDir!);
|
|
263
|
+
await fs.mkdir(skillsDir, { recursive: true });
|
|
264
|
+
|
|
265
|
+
for (const skill of skills) {
|
|
266
|
+
// skill.name is like "auth/SKILL.md" - create subdirectory
|
|
267
|
+
const skillPath = path.join(skillsDir, skill.name);
|
|
268
|
+
const skillSubDir = path.dirname(skillPath);
|
|
269
|
+
await fs.mkdir(skillSubDir, { recursive: true });
|
|
270
|
+
|
|
271
|
+
const existed = existsSync(skillPath);
|
|
272
|
+
if (existed) {
|
|
273
|
+
result.skillsOverridden.push(skill.name);
|
|
274
|
+
result.conflicts.push({
|
|
275
|
+
type: 'skill',
|
|
276
|
+
name: skill.name,
|
|
277
|
+
action: 'overridden',
|
|
278
|
+
message: `Skill '${skill.name}' overridden (will be restored on exit)`,
|
|
279
|
+
});
|
|
280
|
+
manifest.backup.skills.user.push(skillPath);
|
|
281
|
+
} else {
|
|
282
|
+
result.skillsAdded.push(skill.name);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
await fs.writeFile(skillPath, skill.content);
|
|
286
|
+
manifest.backup.skills.flow.push(skillPath);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
241
290
|
/**
|
|
242
291
|
* Attach rules (append strategy for AGENTS.md)
|
|
243
292
|
* Uses shared attachRulesFile function
|
|
@@ -38,6 +38,10 @@ export interface BackupManifest {
|
|
|
38
38
|
user: string[];
|
|
39
39
|
flow: string[];
|
|
40
40
|
};
|
|
41
|
+
skills: {
|
|
42
|
+
user: string[];
|
|
43
|
+
flow: string[];
|
|
44
|
+
};
|
|
41
45
|
rules?: {
|
|
42
46
|
path: string;
|
|
43
47
|
originalSize: number;
|
|
@@ -114,6 +118,7 @@ export class BackupManager {
|
|
|
114
118
|
backup: {
|
|
115
119
|
agents: { user: [], flow: [] },
|
|
116
120
|
commands: { user: [], flow: [] },
|
|
121
|
+
skills: { user: [], flow: [] },
|
|
117
122
|
singleFiles: {},
|
|
118
123
|
},
|
|
119
124
|
secrets: {
|
|
@@ -137,6 +137,7 @@ export class FlowExecutor {
|
|
|
137
137
|
joined: false,
|
|
138
138
|
agents: attachResult.agentsAdded.length,
|
|
139
139
|
commands: attachResult.commandsAdded.length,
|
|
140
|
+
skills: attachResult.skillsAdded.length,
|
|
140
141
|
mcp: attachResult.mcpServersAdded.length,
|
|
141
142
|
};
|
|
142
143
|
}
|
|
@@ -184,7 +185,15 @@ export class FlowExecutor {
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
// 3. Clear
|
|
188
|
+
// 3. Clear skills directory (if target supports skills)
|
|
189
|
+
if (target.config.skillsDir) {
|
|
190
|
+
const skillsDir = path.join(projectPath, target.config.skillsDir);
|
|
191
|
+
if (existsSync(skillsDir)) {
|
|
192
|
+
await fs.rm(skillsDir, { recursive: true, force: true });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// 4. Clear hooks directory (in configDir)
|
|
188
197
|
const hooksDir = path.join(projectPath, target.config.configDir, 'hooks');
|
|
189
198
|
if (existsSync(hooksDir)) {
|
|
190
199
|
const files = await fs.readdir(hooksDir);
|
|
@@ -193,7 +202,7 @@ export class FlowExecutor {
|
|
|
193
202
|
}
|
|
194
203
|
}
|
|
195
204
|
|
|
196
|
-
//
|
|
205
|
+
// 5. Clear MCP configuration using target config
|
|
197
206
|
const configPath = path.join(projectPath, target.config.configFile);
|
|
198
207
|
const mcpPath = target.config.mcpConfigPath;
|
|
199
208
|
|
|
@@ -206,7 +215,7 @@ export class FlowExecutor {
|
|
|
206
215
|
}
|
|
207
216
|
}
|
|
208
217
|
|
|
209
|
-
//
|
|
218
|
+
// 6. Clear rules file if target has one defined (for targets like OpenCode)
|
|
210
219
|
// Claude Code puts AGENTS.md in agents directory, handled above
|
|
211
220
|
if (target.config.rulesFile) {
|
|
212
221
|
const rulesPath = path.join(projectPath, target.config.rulesFile);
|
|
@@ -215,7 +224,7 @@ export class FlowExecutor {
|
|
|
215
224
|
}
|
|
216
225
|
}
|
|
217
226
|
|
|
218
|
-
//
|
|
227
|
+
// 7. Clear single files (output styles) - currently none
|
|
219
228
|
// These would be in the configDir if we had any
|
|
220
229
|
const singleFiles: string[] = [];
|
|
221
230
|
for (const fileName of singleFiles) {
|
|
@@ -225,7 +234,7 @@ export class FlowExecutor {
|
|
|
225
234
|
}
|
|
226
235
|
}
|
|
227
236
|
|
|
228
|
-
//
|
|
237
|
+
// 8. Clean up any Flow-created files in project root (legacy bug cleanup)
|
|
229
238
|
// This handles files that were incorrectly created in project root
|
|
230
239
|
const legacySingleFiles = ['silent.md']; // Keep for cleanup of legacy installations
|
|
231
240
|
for (const fileName of legacySingleFiles) {
|
|
@@ -29,6 +29,7 @@ export class TemplateLoader {
|
|
|
29
29
|
const templates: FlowTemplates = {
|
|
30
30
|
agents: [],
|
|
31
31
|
commands: [],
|
|
32
|
+
skills: [],
|
|
32
33
|
rules: undefined,
|
|
33
34
|
mcpServers: [],
|
|
34
35
|
hooks: [],
|
|
@@ -47,6 +48,12 @@ export class TemplateLoader {
|
|
|
47
48
|
templates.commands = await this.loadCommands(commandsDir);
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
// Load skills (skills/<domain>/SKILL.md structure)
|
|
52
|
+
const skillsDir = path.join(this.assetsDir, 'skills');
|
|
53
|
+
if (existsSync(skillsDir)) {
|
|
54
|
+
templates.skills = await this.loadSkills(skillsDir);
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
// Load rules (check multiple possible locations)
|
|
51
58
|
const rulesLocations = [
|
|
52
59
|
path.join(this.assetsDir, 'rules', 'AGENTS.md'),
|
|
@@ -115,6 +122,34 @@ export class TemplateLoader {
|
|
|
115
122
|
return commands;
|
|
116
123
|
}
|
|
117
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Load skills from directory
|
|
127
|
+
* Skills are stored as <domain>/SKILL.md subdirectories
|
|
128
|
+
*/
|
|
129
|
+
private async loadSkills(skillsDir: string): Promise<Array<{ name: string; content: string }>> {
|
|
130
|
+
const skills = [];
|
|
131
|
+
const domains = await fs.readdir(skillsDir);
|
|
132
|
+
|
|
133
|
+
for (const domain of domains) {
|
|
134
|
+
const domainPath = path.join(skillsDir, domain);
|
|
135
|
+
const stat = await fs.stat(domainPath);
|
|
136
|
+
|
|
137
|
+
if (!stat.isDirectory()) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Look for SKILL.md in each domain directory
|
|
142
|
+
const skillFile = path.join(domainPath, 'SKILL.md');
|
|
143
|
+
if (existsSync(skillFile)) {
|
|
144
|
+
const content = await fs.readFile(skillFile, 'utf-8');
|
|
145
|
+
// Name includes subdirectory: "auth/SKILL.md"
|
|
146
|
+
skills.push({ name: `${domain}/SKILL.md`, content });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return skills;
|
|
151
|
+
}
|
|
152
|
+
|
|
118
153
|
/**
|
|
119
154
|
* Load MCP servers configuration
|
|
120
155
|
*/
|
|
@@ -41,6 +41,7 @@ export const claudeCodeTarget: Target = {
|
|
|
41
41
|
rulesFile: undefined, // Rules are included in agent files
|
|
42
42
|
outputStylesDir: undefined, // Output styles are included in agent files
|
|
43
43
|
slashCommandsDir: '.claude/commands',
|
|
44
|
+
skillsDir: '.claude/skills',
|
|
44
45
|
installation: {
|
|
45
46
|
createAgentDir: true,
|
|
46
47
|
createConfigFile: true,
|
|
@@ -35,6 +35,8 @@ export interface TargetConfig {
|
|
|
35
35
|
outputStylesDir?: string;
|
|
36
36
|
/** Slash commands directory (optional, relative to project root) */
|
|
37
37
|
slashCommandsDir?: string;
|
|
38
|
+
/** Skills directory (optional, relative to project root) */
|
|
39
|
+
skillsDir?: string;
|
|
38
40
|
/** Installation-specific configuration */
|
|
39
41
|
installation: {
|
|
40
42
|
/** Whether to create the agent directory */
|
|
@@ -137,4 +139,7 @@ export interface Target {
|
|
|
137
139
|
|
|
138
140
|
/** Setup slash commands for this target (optional - implement if target supports slash commands) */
|
|
139
141
|
setupSlashCommands?(cwd: string, options: CommonOptions): Promise<SetupResult>;
|
|
142
|
+
|
|
143
|
+
/** Setup skills for this target (optional - implement if target supports skills) */
|
|
144
|
+
setupSkills?(cwd: string, options: CommonOptions): Promise<SetupResult>;
|
|
140
145
|
}
|