ai-agent-config 1.0.3 → 1.0.5
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/bin/cli.js +0 -0
- package/package.json +1 -1
- package/scripts/installer.js +56 -13
- package/scripts/platforms.js +4 -0
package/bin/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/scripts/installer.js
CHANGED
|
@@ -107,6 +107,41 @@ function getAvailableWorkflows() {
|
|
|
107
107
|
.map((name) => name.replace(".md", ""));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Copy workflows as skills for Claude Code
|
|
112
|
+
* Claude Code doesn't support workflows directory, so we convert them to skills
|
|
113
|
+
*/
|
|
114
|
+
function copyWorkflowsAsSkills(skillsPath, force = false) {
|
|
115
|
+
const results = [];
|
|
116
|
+
|
|
117
|
+
if (!fs.existsSync(REPO_WORKFLOWS_DIR)) {
|
|
118
|
+
return results;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const workflowFiles = fs.readdirSync(REPO_WORKFLOWS_DIR).filter((f) => f.endsWith(".md"));
|
|
122
|
+
|
|
123
|
+
for (const wfFile of workflowFiles) {
|
|
124
|
+
const workflowName = wfFile.replace(".md", "");
|
|
125
|
+
const srcPath = path.join(REPO_WORKFLOWS_DIR, wfFile);
|
|
126
|
+
const destDir = path.join(skillsPath, workflowName);
|
|
127
|
+
const destPath = path.join(destDir, "SKILL.md");
|
|
128
|
+
|
|
129
|
+
// Create skill directory
|
|
130
|
+
if (!fs.existsSync(destDir)) {
|
|
131
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (fs.existsSync(destPath) && !force) {
|
|
135
|
+
results.push({ name: workflowName, skipped: 1, copied: 0 });
|
|
136
|
+
} else {
|
|
137
|
+
fs.copyFileSync(srcPath, destPath);
|
|
138
|
+
results.push({ name: workflowName, skipped: 0, copied: 1 });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return results;
|
|
143
|
+
}
|
|
144
|
+
|
|
110
145
|
/**
|
|
111
146
|
* Install skills and workflows to a specific platform
|
|
112
147
|
*/
|
|
@@ -145,19 +180,27 @@ function installToPlatform(platform, options = {}) {
|
|
|
145
180
|
});
|
|
146
181
|
}
|
|
147
182
|
|
|
148
|
-
//
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
183
|
+
// Handle workflows based on platform
|
|
184
|
+
if (fs.existsSync(REPO_WORKFLOWS_DIR)) {
|
|
185
|
+
// Claude Code: Copy workflows as skills (workflows → skills/<name>/SKILL.md)
|
|
186
|
+
if (platform.name === "claude" && skillsPath) {
|
|
187
|
+
const workflowResults = copyWorkflowsAsSkills(skillsPath, force);
|
|
188
|
+
results.workflows = workflowResults;
|
|
189
|
+
}
|
|
190
|
+
// Other platforms (Antigravity): Copy workflows to workflows directory
|
|
191
|
+
else if (workflowsPath) {
|
|
192
|
+
const workflowFiles = fs.readdirSync(REPO_WORKFLOWS_DIR).filter((f) => f.endsWith(".md"));
|
|
193
|
+
|
|
194
|
+
for (const wfFile of workflowFiles) {
|
|
195
|
+
const srcPath = path.join(REPO_WORKFLOWS_DIR, wfFile);
|
|
196
|
+
const destPath = path.join(workflowsPath, wfFile);
|
|
197
|
+
|
|
198
|
+
if (fs.existsSync(destPath) && !force) {
|
|
199
|
+
results.workflows.push({ name: wfFile.replace(".md", ""), skipped: 1, copied: 0 });
|
|
200
|
+
} else {
|
|
201
|
+
fs.copyFileSync(srcPath, destPath);
|
|
202
|
+
results.workflows.push({ name: wfFile.replace(".md", ""), skipped: 0, copied: 1 });
|
|
203
|
+
}
|
|
161
204
|
}
|
|
162
205
|
}
|
|
163
206
|
}
|
package/scripts/platforms.js
CHANGED
|
@@ -18,6 +18,7 @@ const SUPPORTED = [
|
|
|
18
18
|
displayName: "Claude Code",
|
|
19
19
|
configDir: ".claude",
|
|
20
20
|
skillsDir: "skills",
|
|
21
|
+
workflowsDir: "workflows",
|
|
21
22
|
commandsDir: "commands",
|
|
22
23
|
get configPath() {
|
|
23
24
|
return path.join(HOME, this.configDir);
|
|
@@ -25,6 +26,9 @@ const SUPPORTED = [
|
|
|
25
26
|
get skillsPath() {
|
|
26
27
|
return path.join(HOME, this.configDir, this.skillsDir);
|
|
27
28
|
},
|
|
29
|
+
get workflowsPath() {
|
|
30
|
+
return path.join(HOME, this.configDir, this.workflowsDir);
|
|
31
|
+
},
|
|
28
32
|
get commandsPath() {
|
|
29
33
|
return path.join(HOME, this.configDir, this.commandsDir);
|
|
30
34
|
},
|