The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
fix: guard two script edge cases (tolerant package.json parse, set -u empty array) (#2088)
Chris Yau898fd231ced9
diff --git a/scripts/harness-audit.js b/scripts/harness-audit.jsindex 3e525ca7e..a523eca9e 100644--- a/scripts/harness-audit.js+++ b/scripts/harness-audit.js@@ -386,7 +386,7 @@ function findPluginInstall(rootDir) {}function getRepoChecks(rootDir) {- const packageJson = JSON.parse(readText(rootDir, 'package.json'));+ const packageJson = safeParseJson(safeRead(rootDir, 'package.json'));const commandPrimary = safeRead(rootDir, 'commands/harness-audit.md').trim();const commandParity = safeRead(rootDir, '.opencode/commands/harness-audit.md').trim();const hooksJson = safeRead(rootDir, 'hooks/hooks.json');@@ -499,7 +499,7 @@ function getRepoChecks(rootDir) {scopes: ['repo'],path: 'package.json',description: 'Test script runs validator chain before tests',- pass: typeof packageJson.scripts?.test === 'string' && packageJson.scripts.test.includes('validate-commands.js') && packageJson.scripts.test.includes('tests/run-all.js'),+ pass: typeof packageJson?.scripts?.test === 'string' && packageJson?.scripts?.test.includes('validate-commands.js') && packageJson?.scripts?.test.includes('tests/run-all.js'),fix: 'Update package.json test script to run validators plus tests/run-all.js.',},{diff --git a/skills/frontend-slides/scripts/export-pdf.sh b/skills/frontend-slides/scripts/export-pdf.shindex df0b18071..ee446b793 100755--- a/skills/frontend-slides/scripts/export-pdf.sh+++ b/skills/frontend-slides/scripts/export-pdf.sh@@ -52,7 +52,7 @@ for arg in "$@"; do;;esacdone-set -- "${POSITIONAL[@]}"+set -- ${POSITIONAL[@]+"${POSITIONAL[@]}"}# --- Input validation ---