flight-rules 0.15.6 → 0.15.7
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/commands/adapter.d.ts +4 -1
- package/dist/commands/adapter.js +17 -11
- package/package.json +1 -1
- package/payload/AGENTS.md +1 -1
|
@@ -6,7 +6,10 @@ export declare function copyCommandsWithConflictHandling(sourceDir: string, dest
|
|
|
6
6
|
skipped: string[];
|
|
7
7
|
}>;
|
|
8
8
|
/**
|
|
9
|
-
* Copy skill files to a destination directory with conflict handling
|
|
9
|
+
* Copy skill files to a destination directory with conflict handling.
|
|
10
|
+
* Source skills are flat .md files (e.g., web-prototype.md).
|
|
11
|
+
* They are deployed as directories containing SKILL.md (e.g., web-prototype/SKILL.md),
|
|
12
|
+
* which is the format Claude Code expects.
|
|
10
13
|
*/
|
|
11
14
|
export declare function copySkillsWithConflictHandling(sourceDir: string, destDir: string, skipPrompts?: boolean): Promise<{
|
|
12
15
|
copied: string[];
|
package/dist/commands/adapter.js
CHANGED
|
@@ -141,7 +141,10 @@ async function promptForConflict(filename, showBatchOptions) {
|
|
|
141
141
|
return action;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
|
-
* Copy skill files to a destination directory with conflict handling
|
|
144
|
+
* Copy skill files to a destination directory with conflict handling.
|
|
145
|
+
* Source skills are flat .md files (e.g., web-prototype.md).
|
|
146
|
+
* They are deployed as directories containing SKILL.md (e.g., web-prototype/SKILL.md),
|
|
147
|
+
* which is the format Claude Code expects.
|
|
145
148
|
*/
|
|
146
149
|
export async function copySkillsWithConflictHandling(sourceDir, destDir, skipPrompts = false) {
|
|
147
150
|
const copied = [];
|
|
@@ -152,44 +155,47 @@ export async function copySkillsWithConflictHandling(sourceDir, destDir, skipPro
|
|
|
152
155
|
const files = readdirSync(sourceDir).filter(f => f.endsWith('.md'));
|
|
153
156
|
let batchAction = null;
|
|
154
157
|
for (const file of files) {
|
|
158
|
+
const skillName = file.replace(/\.md$/, '');
|
|
155
159
|
const srcPath = join(sourceDir, file);
|
|
156
|
-
const
|
|
160
|
+
const destSkillDir = join(destDir, skillName);
|
|
161
|
+
const destPath = join(destSkillDir, 'SKILL.md');
|
|
157
162
|
if (existsSync(destPath)) {
|
|
158
163
|
if (skipPrompts) {
|
|
159
164
|
cpSync(srcPath, destPath);
|
|
160
|
-
copied.push(
|
|
165
|
+
copied.push(skillName);
|
|
161
166
|
continue;
|
|
162
167
|
}
|
|
163
168
|
if (batchAction === 'replace_all') {
|
|
164
169
|
cpSync(srcPath, destPath);
|
|
165
|
-
copied.push(
|
|
170
|
+
copied.push(skillName);
|
|
166
171
|
continue;
|
|
167
172
|
}
|
|
168
173
|
else if (batchAction === 'skip_all') {
|
|
169
|
-
skipped.push(
|
|
174
|
+
skipped.push(skillName);
|
|
170
175
|
continue;
|
|
171
176
|
}
|
|
172
|
-
const action = await promptForConflict(
|
|
177
|
+
const action = await promptForConflict(skillName, files.length > 1);
|
|
173
178
|
if (action === 'replace_all') {
|
|
174
179
|
batchAction = 'replace_all';
|
|
175
180
|
cpSync(srcPath, destPath);
|
|
176
|
-
copied.push(
|
|
181
|
+
copied.push(skillName);
|
|
177
182
|
}
|
|
178
183
|
else if (action === 'skip_all') {
|
|
179
184
|
batchAction = 'skip_all';
|
|
180
|
-
skipped.push(
|
|
185
|
+
skipped.push(skillName);
|
|
181
186
|
}
|
|
182
187
|
else if (action === 'replace') {
|
|
183
188
|
cpSync(srcPath, destPath);
|
|
184
|
-
copied.push(
|
|
189
|
+
copied.push(skillName);
|
|
185
190
|
}
|
|
186
191
|
else {
|
|
187
|
-
skipped.push(
|
|
192
|
+
skipped.push(skillName);
|
|
188
193
|
}
|
|
189
194
|
}
|
|
190
195
|
else {
|
|
196
|
+
ensureDir(destSkillDir);
|
|
191
197
|
cpSync(srcPath, destPath);
|
|
192
|
-
copied.push(
|
|
198
|
+
copied.push(skillName);
|
|
193
199
|
}
|
|
194
200
|
}
|
|
195
201
|
return { copied, skipped };
|
package/package.json
CHANGED