Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions tools/smoke-test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@ const path = require('path');
const { execFileSync } = require('child_process');
const yaml = require('yaml');

// Parse CLI arguments
const args = process.argv.slice(2);
const flags = {};
for (let i = 0; i < args.length; i++) {
if (args[i] === '--json') {
flags.json = true;
} else if (args[i] === '--verbose' || args[i] === '-v') {
flags.verbose = true;
} else if (args[i] === '--no-color') {
flags.nocolor = true;
} else if (args[i] === '--help' || args[i] === '-h') {
console.log(`Codex Visual Builder Guild - Smoke Test

Usage: node tools/smoke-test.cjs [options]

Options:
--json Output results as JSON
--verbose, -v Show detailed per-check output
--no-color Disable ANSI color output
--help, -h Show this help message
`);
process.exit(0);
}
}
const JSON_OUTPUT = flags.json;
const VERBOSE = flags.verbose;
const NO_COLOR = flags.nocolor;

const ROOT = path.resolve(__dirname, '..');
const DESIGN_DIR = path.join(ROOT, 'design');
const BUNDLE_FILE = path.join(ROOT, 'bundles', 'codex-visual-builder-loop.yaml');
Expand Down Expand Up @@ -193,6 +221,17 @@ if (process.exitCode) {
process.exit(process.exitCode);
}

if (JSON_OUTPUT) {
console.log(JSON.stringify({
passed: process.exitCode ? false : true,
skills_count: skills.length,
bundle_id: bundle.id,
codex_install: 'passed',
unresolved_delegates: unresolved.length === 0 ? [] : unresolved
}));
process.exit(0);
}

console.log('Smoke test passed');
console.log(`- skills: ${skills.length}`);
console.log(`- bundle: ${bundle.id}`);
Expand Down
38 changes: 37 additions & 1 deletion tools/validate-h70-cplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,37 @@ const fs = require('fs');
const path = require('path');
const yaml = require('yaml');

const SOURCE_DIR =
// Parse CLI arguments
const args = process.argv.slice(2);
const flags = {};
for (let i = 0; i < args.length; i++) {
if (args[i] === '--verbose' || args[i] === '-v') {
flags.verbose = true;
} else if (args[i] === '--json') {
flags.json = true;
} else if (args[i] === '--no-color') {
flags.nocolor = true;
} else if (args[i] === '--dir' || args[i] === '-d') {
flags.dir = args[++i];
} else if (args[i] === '--help' || args[i] === '-h') {
console.log(`H70-C+ Format Validator

Usage: node tools/validate-h70-cplus.js [options]

Options:
--verbose, -v Show detailed per-skill output
--json Output results as JSON
--no-color Disable ANSI color output
--dir, -d PATH Validate skills in specific directory
--help, -h Show this help message
`);
process.exit(0);
}
}
const VERBOSE = flags.verbose;
const JSON_OUTPUT = flags.json;
const NO_COLOR = flags.nocolor;
const SOURCE_DIR = flags.dir ||
process.env.SPAWNER_H70_SKILLS_DIR ||
process.env.H70_SKILLS_LAB_DIR ||
path.resolve(__dirname, '..');
Expand Down Expand Up @@ -229,6 +259,7 @@ function main() {
// Skip non-H70-C+ files
if (!content.includes('format: H70-C+')) {
skipped++;
if (VERBOSE) console.log(` ⏭️ Skipped (not H70-C+): ${path.relative(SOURCE_DIR, filePath)}`);
continue;
}

Expand All @@ -245,8 +276,13 @@ function main() {
invalid++;
totalErrors += result.errors.length;
invalidSkills.push(result);
if (VERBOSE) {
console.log(` ❌ Invalid: ${result.relativePath}`);
result.errors.forEach(e => console.log(` Error: ${e}`));
}
} else {
valid++;
if (VERBOSE) console.log(` ✅ Valid: ${result.relativePath}`);
}

if (result.warnings.length > 0) {
Expand Down