Skip to content

100x is a skill by a former Cursor engineer that turns prompts into formally verified, production-ready code

1.2 KB
Raw Blame
#!/usr/bin/env node
// Writes license, compatibility and metadata into the front matter of every skills/*/SKILL.md from package.json. Run it after a version bump
// or a change of the repository URL. `100x validate` fails while a skill disagrees with package.json. Nothing here changes a name or a description.
import fs from 'node:fs';
import path from 'node:path';
import { readStamp, stampText } from '../lib/skill-meta.mjs';
import { REPO_ROOT } from '../lib/paths.mjs';

const stamp = readStamp(REPO_ROOT);
if (!stamp) {
  console.error('package.json needs a license and a repository url before the skills can be stamped.');
  process.exit(1);
}
let changed = 0;
for (const entry of fs.readdirSync(path.join(REPO_ROOT, 'skills'), { withFileTypes: true })) {
  const file = path.join(REPO_ROOT, 'skills', entry.name, 'SKILL.md');
  if (!entry.isDirectory() || !fs.existsSync(file)) continue;
  const before = fs.readFileSync(file, 'utf8');
  const after = stampText(before, stamp);
  if (after !== before) {
    fs.writeFileSync(file, after);
    changed += 1;
  }
}
console.log(changed ? `stamped ${changed} skill${changed === 1 ? '' : 's'}` : 'every skill already carries the stamp');