{"record":{"id":"563b8b607c1a7826","repo":"garrytan/gstack","slug":"unknown-explain-level-val-use-default-or-t","errorCode":null,"errorMessage":"Unknown explain level: ${val}. Use 'default' or 'terse'.","messagePattern":"Unknown explain level: (.+?)\\. Use 'default' or 'terse'\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/gen-skill-docs.ts","lineNumber":143,"sourceCode":"    throw new Error(`Unknown catalog mode: ${val}. Use 'trim' (default) or 'full'.`);\n  }\n  return val;\n})();\n\n// ─── Explain-level Overlay ──────────────────────────────────\n// --explain-level=terse compresses preamble prose (writing-style, completeness,\n// confusion-protocol, context-health) to a single pointer line at gen time.\n// Default keeps the runtime-conditional behavior (sections render unconditionally,\n// the model skips them when EXPLAIN_LEVEL: terse appears in the preamble echo).\n// Opt-in via the build flag so most users get the runtime-flexible default.\nconst EXPLAIN_LEVEL_ARG = process.argv.find(a => a.startsWith('--explain-level'));\nconst EXPLAIN_LEVEL: 'default' | 'terse' = (() => {\n  if (!EXPLAIN_LEVEL_ARG) return 'default';\n  const val = EXPLAIN_LEVEL_ARG.includes('=')\n    ? EXPLAIN_LEVEL_ARG.split('=')[1]\n    : process.argv[process.argv.indexOf(EXPLAIN_LEVEL_ARG) + 1];\n  if (val !== 'default' && val !== 'terse') {\n    throw new Error(`Unknown explain level: ${val}. Use 'default' or 'terse'.`);\n  }\n  return val;\n})();\n\n// ─── Out-dir (dev workspace render isolation) ───────────────\n// --out-dir <abs-dir> redirects Claude SKILL.md + section output to a separate\n// (untracked) directory instead of writing in place, AND rewrites the literal\n// section-base path (`~/.claude/skills/gstack/<skill>/sections/`) inside the\n// generated content to point at the out-dir, so section Reads resolve to the\n// rendered copy rather than the global install. Used by bin/dev-setup to render\n// the gbrain `:user` variant for a Conductor workspace without dirtying tracked\n// source. Default (unset) = in-place, behavior unchanged. Claude host only.\nconst OUT_DIR_ARG = process.argv.find(a => a.startsWith('--out-dir'));\nconst OUT_DIR: string | null = (() => {\n  if (!OUT_DIR_ARG) return null;\n  const val = OUT_DIR_ARG.includes('=')\n    ? OUT_DIR_ARG.split('=')[1]\n    : process.argv[process.argv.indexOf(OUT_DIR_ARG) + 1];","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/scripts/gen-skill-docs.ts#L125-L161","documentation":"The EXPLAIN_LEVEL IIFE in scripts/gen-skill-docs.ts:143 accepts only 'default' (sections render unconditionally; the model skips them when EXPLAIN_LEVEL: terse appears in the preamble echo) or 'terse' (compresses preamble prose at gen time). Other values throw.","triggerScenarios":"Passing `--explain-level=verbose`, `--explain-level=quiet`, or `--explain-level terse2`. Confusing this with a numeric verbosity scale.","commonSituations":"Trying familiar verbosity words (quiet/verbose) that aren't supported. Copying a flag from another tool.","solutions":["Omit the flag to keep the runtime-flexible default","Pass exactly `--explain-level=terse` to compress preamble prose at gen time","Use `--explain-level=default` to be explicit"],"exampleFix":"// before\nbun run gen:skill-docs -- --explain-level=quiet\n// after\nbun run gen:skill-docs -- --explain-level=terse","handlingStrategy":"type-guard","validationCode":"const VALID = new Set(['default', 'terse']);\nconst arg = process.argv.find(a => a.startsWith('--explain-level'));\nconst val = arg?.includes('=') ? arg.split('=')[1] : process.argv[process.argv.indexOf(arg!) + 1];\nif (val != null && !VALID.has(val)) {\n  console.error('--explain-level must be one of: default, terse');\n  process.exit(2);\n}","typeGuard":"const isExplainLevel = (v: string): v is 'default' | 'terse' => v === 'default' || v === 'terse';","tryCatchPattern":null,"preventionTips":["Remember only two values exist (no numeric scale)","Default is fine for most users — omit the flag","Use 'terse' only when you intentionally want preamble compression at gen time"],"tags":["cli","argument-validation","build","explain-level"],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}