agent-skills-standard 1.3.1 → 1.3.2
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/index.js +1 -1
- package/dist/scripts/calculate-tokens.js +29 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const program = new commander_1.Command();
|
|
|
10
10
|
program
|
|
11
11
|
.name('agent-skills-standard')
|
|
12
12
|
.description('A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, Windsurf, and more.')
|
|
13
|
-
.version('1.3.
|
|
13
|
+
.version('1.3.2');
|
|
14
14
|
program
|
|
15
15
|
.command('init')
|
|
16
16
|
.description('Initialize a .skillsrc configuration file interactively')
|
|
@@ -140,20 +140,37 @@ async function main() {
|
|
|
140
140
|
// Update README.md table
|
|
141
141
|
const readmePath = path.join(__dirname, '../../../README.md');
|
|
142
142
|
if (fs_extra_1.default.existsSync(readmePath)) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
const readmeContent = fs_extra_1.default.readFileSync(readmePath, 'utf-8');
|
|
144
|
+
const lines = readmeContent.split('\n');
|
|
145
|
+
let updated = false;
|
|
146
|
+
for (let i = 0; i < lines.length; i++) {
|
|
147
|
+
const line = lines[i];
|
|
148
|
+
if (!line.includes('|'))
|
|
149
|
+
continue;
|
|
150
|
+
for (const category of categories) {
|
|
151
|
+
// Create a flexible regex: "nextjs" -> /next.*js/i to match "Next.js"
|
|
152
|
+
const flexibleCategory = category.split('').join('.*');
|
|
153
|
+
const categoryMatch = new RegExp(`\\*\\*.*${flexibleCategory}.*\\*\\*`, 'i').test(line);
|
|
154
|
+
if (categoryMatch) {
|
|
155
|
+
const metrics = results[category];
|
|
156
|
+
const cells = line.split('|');
|
|
157
|
+
if (cells.length >= 6) {
|
|
158
|
+
// Update Skills (index 4) and Avg. Footprint (index 5)
|
|
159
|
+
// Desired format: | 10 | ~503 tokens |
|
|
160
|
+
cells[4] = ` ${metrics.totalSkills}`.padEnd(8);
|
|
161
|
+
cells[5] = ` ~${metrics.avgTokensPerSkill} tokens `
|
|
162
|
+
.trimEnd()
|
|
163
|
+
.padEnd(16);
|
|
164
|
+
lines[i] = cells.join('|');
|
|
165
|
+
updated = true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
153
168
|
}
|
|
154
169
|
}
|
|
155
|
-
|
|
156
|
-
|
|
170
|
+
if (updated) {
|
|
171
|
+
fs_extra_1.default.writeFileSync(readmePath, lines.join('\n'));
|
|
172
|
+
console.log('✅ Updated README.md support table');
|
|
173
|
+
}
|
|
157
174
|
}
|
|
158
175
|
}
|
|
159
176
|
main().catch(console.error);
|