2026-02-18 15:16:11 -08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
const path = require('path');
|
|
|
|
|
|
Port upstream skill scripts into v2.4.1: deterministic workflow steps run as Node scripts beside each SKILL.md (specs, pathfinder, feedback payload, commit message, review scope, agent files, handoff path) with tests, the prompt limit rises to 20,000 chars, upstream review fixes are folded in (linked agent files never overwrite AGENTS.md, review stops with no base, paste-safe commit commands, Pathfinder number high-water mark and dry runs), and web console workspace folders are remembered per project and spec, with Finalize forgetting an archived spec's list
2026-10-04 12:17:05 -07:00
|
|
|
const CHAR_LIMIT = 20000;
|
2026-02-18 15:16:11 -08:00
|
|
|
const srcDir = path.join(__dirname, '..', 'src');
|
|
|
|
|
|
2026-05-23 06:58:20 -07:00
|
|
|
// Note: readdirSync is non-recursive, so files in subdirectories like
|
2026-06-01 16:39:35 -07:00
|
|
|
// plan2code-review-references/ are automatically excluded from
|
2026-05-23 06:58:20 -07:00
|
|
|
// the character limit check. Reference files have no char limit.
|
2026-02-18 15:16:11 -08:00
|
|
|
const files = fs.readdirSync(srcDir)
|
2026-09-28 19:37:41 -07:00
|
|
|
.filter(f => /^plan2code(-.*)?\.md$/.test(f))
|
2026-02-18 15:16:11 -08:00
|
|
|
.sort();
|
|
|
|
|
|
|
|
|
|
const failures = [];
|
|
|
|
|
|
|
|
|
|
for (const file of files) {
|
|
|
|
|
const filePath = path.join(srcDir, file);
|
|
|
|
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
|
|
|
const charCount = content.length;
|
|
|
|
|
if (charCount > CHAR_LIMIT) {
|
|
|
|
|
failures.push({ file: path.join('src', file), charCount });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (failures.length > 0) {
|
|
|
|
|
console.error('Character limit exceeded:');
|
|
|
|
|
console.error('');
|
|
|
|
|
for (const { file, charCount } of failures) {
|
|
|
|
|
console.error(` ${file}: ${charCount} / ${CHAR_LIMIT} (+${charCount - CHAR_LIMIT} over)`);
|
|
|
|
|
}
|
|
|
|
|
console.error('');
|
|
|
|
|
console.error(`${failures.length} file(s) over the ${CHAR_LIMIT} character limit.`);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(`All ${files.length} files under ${CHAR_LIMIT} characters \u2713`);
|
|
|
|
|
process.exit(0);
|