{"record":{"id":"70dd65ddbd30b7b1","repo":"jackwener/OpenCLI","slug":"name-required-70dd65","errorCode":null,"errorMessage":"name required","messagePattern":"name required","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/skill-fs.js","lineNumber":104,"sourceCode":"    },\n});\n\n// -------- skill-fs-show --------\ncli({\n    site: 'trae-solo',\n    name: 'skill-fs-show',\n    access: 'read',\n    description: 'Print a skill\\'s SKILL.md content + on-disk path.',\n    domain: 'localhost',\n    browser: false,\n    strategy: Strategy.LOCAL,\n    args: [\n        { name: 'name', positional: true, required: true, help: 'Skill name (folder under ~/.trae/skills/)' },\n    ],\n    columns: ['Field', 'Value'],\n    func: async (args) => {\n        const name = String(args.name || '').trim();\n        if (!name) throw new ArgumentError('name required');\n        const dir = path.join(TRAE_SKILLS_DIR, name);\n        if (!fs.existsSync(dir)) {\n            throw new CommandExecutionError(`Skill \"${name}\" not found.`, `Tried: ${dir}`);\n        }\n        const meta = parseSkillMd(dir);\n        const skillMd = path.join(dir, 'SKILL.md');\n        const content = fs.existsSync(skillMd) ? fs.readFileSync(skillMd, 'utf-8') : '(no SKILL.md)';\n        return [\n            { Field: 'Name', Value: meta.name },\n            { Field: 'Path', Value: dir },\n            { Field: 'Description', Value: (meta.description || '').slice(0, 200) },\n            { Field: 'Tags', Value: (meta.tags || []).join(', ') },\n            { Field: 'Author', Value: meta.author },\n            { Field: 'Version', Value: meta.version },\n            { Field: 'Files', Value: fs.readdirSync(dir).join(', ').slice(0, 200) },\n            { Field: 'SKILL.md (head)', Value: content.slice(0, 1200) },\n        ];\n    },","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/skill-fs.js#L86-L122","documentation":"Thrown as an ArgumentError when the required positional 'name' argument is missing or only whitespace. The command validates args.name before doing any filesystem work, since a skill lookup without a name is meaningless.","triggerScenarios":"Calling the skill-fs show/detail command without the positional name, or with an empty/whitespace string (e.g. name=\"\" or name=\"   \").","commonSituations":"Scripting the CLI with an unquoted variable that expands to empty; forgetting the positional argument; passing flags only and assuming a default skill.","solutions":["Pass the skill folder name as the positional argument, e.g. the command with 'my-skill'.","In scripts, guard the variable: [ -n \"$SKILL\" ] || exit 1 before invoking.","Use --help to confirm argument order and required flags."],"exampleFix":"// before\nawait run(['skill-fs', 'show', ''])\n// after\nawait run(['skill-fs', 'show', 'my-skill'])","handlingStrategy":"validation","validationCode":"function requireSkillName(args) {\n  const name = String(args.name || '').trim();\n  if (!name) throw new Error('Pass a skill name, e.g. skill-fs show <name>');\n  return name;\n}","typeGuard":"function isNonEmptyString(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await skillFsShow(name);\n} catch (e) {\n  if (e instanceof ArgumentError && /name required/.test(e.message)) {\n    // print usage / prompt for the name\n  } else throw e;\n}","preventionTips":["Always pass the positional name; quote shell variables so they don't expand empty.","Validate user input is non-empty before calling.","Check --help for required arguments."],"tags":["argument","validation","cli"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}