{"record":{"id":"99871f828f852475","repo":"jackwener/OpenCLI","slug":"keyword-cannot-be-empty","errorCode":null,"errorMessage":"keyword cannot be empty","messagePattern":"keyword cannot be empty","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/skill.js","lineNumber":115,"sourceCode":"// -------- skill-search --------\ncli({\n    site: 'trae-solo',\n    name: 'skill-search',\n    access: 'read',\n    description: 'Filter Skills Marketplace by keyword.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'keyword', positional: true, required: true, help: 'Search keyword (substring)' },\n        { name: 'limit', type: 'int', required: false, default: 50, help: 'Max rows' },\n    ],\n    columns: ['Index', 'Name', 'Description'],\n    func: async (page, kwargs) => {\n        await switchToPanel(page, 'Skills');\n        await ensureSkillsTab(page, 'Skills Marketplace');\n        const keyword = String(kwargs.keyword || '').trim();\n        if (!keyword) throw new ArgumentError('keyword cannot be empty');\n\n        const kwJson = JSON.stringify(keyword);\n        await page.evaluate(`(function() {\n      const inp = document.querySelector('input[placeholder=\"Search\"]');\n      if (!inp) return;\n      inp.focus();\n      const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;\n      setter.call(inp, ${kwJson});\n      inp.dispatchEvent(new Event('input', { bubbles: true }));\n    })()`);\n        await page.wait(0.7);\n\n        const items = await page.evaluate(`(function() {\n      const cards = Array.from(document.querySelectorAll('.marketplace-card-v2')).filter((c) => c.offsetParent);\n      return cards.map((c, i) => {\n        const logo = c.querySelector('.skill-logo-svg');\n        const name = (logo && logo.getAttribute('aria-label')) || '';\n        const full = (c.innerText || '').replace(/\\\\s+/g, ' ').trim();","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/skill.js#L97-L133","documentation":"Thrown as an ArgumentError when the --keyword option for the marketplace search command is missing, empty, or whitespace-only. Search requires a non-empty query before typing into the marketplace search input.","triggerScenarios":"Calling the skill-search command without kwargs.keyword, or with keyword=\"\" / \"   \".","commonSituations":"Scripted invocations where the keyword variable is unset or empty; user forgot the --keyword flag; quoting issues in shell causing the value to be dropped.","solutions":["Pass a non-empty keyword, e.g. --keyword \"code review\".","Guard the value in scripts before calling: if (!kw.trim()) throw/skip.","Check shell quoting so the keyword isn't consumed as a separate flag."],"exampleFix":"// before\nawait skillSearch({ keyword: '' })\n// after\nawait skillSearch({ keyword: 'react' })","handlingStrategy":"validation","validationCode":"function requireKeyword(kwargs) {\n  const kw = String(kwargs.keyword || '').trim();\n  if (!kw) throw new Error('Pass --keyword \"<search term>\"');\n  return kw;\n}","typeGuard":"function isNonEmptyKeyword(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await skillSearch({ keyword: kw });\n} catch (e) {\n  if (e instanceof ArgumentError && /keyword cannot be empty/.test(e.message)) {\n    // prompt for a keyword or abort the workflow\n  } else throw e;\n}","preventionTips":["Always pass --keyword with a quoted value.","Trim and check the keyword in scripts before invoking.","Beware shell quoting that swallows the argument."],"tags":["argument","validation","search"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}