From 1280d6286c0c7097789ab7982d91e7fb3d461c88 Mon Sep 17 00:00:00 2001 From: driasim Date: Thu, 4 Jun 2026 19:57:54 +0000 Subject: [PATCH 1/2] Add --verbose flag to H70-C+ validator Adds proper CLI argument parsing for --verbose/-v, --json, --no-color, --dir/-d, and --help/-h flags to the validate-h70-cplus.js tool. --verbose enables per-skill detailed output showing validation status for each file as it's processed. --- tools/validate-h70-cplus.js | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/tools/validate-h70-cplus.js b/tools/validate-h70-cplus.js index aac382c..02dd1cc 100644 --- a/tools/validate-h70-cplus.js +++ b/tools/validate-h70-cplus.js @@ -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, '..'); @@ -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; } @@ -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) { From 71875cce12512e79dc6ce46759e9559533bbcfab Mon Sep 17 00:00:00 2001 From: driasim Date: Thu, 4 Jun 2026 19:58:43 +0000 Subject: [PATCH 2/2] Add --json flag to smoke test Adds CLI argument parsing for --json, --verbose, --no-color, and --help flags to the smoke-test.cjs tool. --json outputs structured JSON results suitable for programmatic consumption. --- tools/smoke-test.cjs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tools/smoke-test.cjs b/tools/smoke-test.cjs index 5d92409..1c6dd69 100644 --- a/tools/smoke-test.cjs +++ b/tools/smoke-test.cjs @@ -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'); @@ -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}`);