{"record":{"id":"b3365cfe56258a9e","repo":"different-ai/openwork","slug":"extensions-add-instructions-required","errorCode":"extensions.add_instructions_required","errorMessage":"extensions.add_instructions_required","messagePattern":"extensions\\.add_instructions_required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/app/src/react-app/domains/settings/state/extensions-store.ts","lineNumber":2257,"sourceCode":"    kind: LibraryAuthorableKind,\n    input: CreateLibraryItemInput,\n  ): Promise<string> {\n    const description = input.description.trim();\n    const instructions = input.instructions.trim();\n    const drafts = input.components?.filter((component) => component.name.trim() && component.content.trim()) ?? [];\n    if (!input.name.trim()) {\n      throw new Error(t(\"extensions.add_name_required\"));\n    }\n    if (kind === \"mcp\") {\n      if (!instructions) {\n        throw new Error(t(\"extensions.add_mcp_url_required\"));\n      }\n    } else if (kind !== \"plugin\") {\n      if (!description) {\n        throw new Error(t(\"extensions.add_description_required\"));\n      }\n      if (!instructions) {\n        throw new Error(t(\"extensions.add_instructions_required\"));\n      }\n    }\n    if (kind === \"plugin\" && drafts.length === 0) {\n      throw new Error(t(\"extensions.add_plugin_component_required\"));\n    }\n\n    const settings = readDenSettings();\n    const token = settings.authToken?.trim() ?? \"\";\n    const orgId = settings.activeOrgId?.trim() ?? \"\";\n    if (!token || !orgId) {\n      throw new Error(t(\"extensions.add_sign_in_required\"));\n    }\n    const client = createDenClient({\n      baseUrl: settings.baseUrl,\n      token,\n    });\n    const body = denLibraryPluginCreateRequest(kind, {\n      ...input,","sourceCodeStart":2239,"sourceCodeEnd":2275,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/state/extensions-store.ts#L2239-L2275","documentation":"For library kinds other than 'mcp' and 'plugin', createLibraryItem also requires instructions (usage/content). If input.instructions trims to empty, the localized message t('extensions.add_instructions_required') is thrown.","triggerScenarios":"Calling createLibraryItem(kind, input) where kind is neither 'mcp' nor 'plugin' and input.instructions is empty or whitespace-only (after description already passed validation).","commonSituations":"Submitting the add form without writing the body/instructions; programmatic creation of skill/command entries with metadata only; a form reset leaving the instructions textarea empty while other fields persisted.","solutions":["Provide non-empty input.instructions before calling.","Validate the instructions field in the form layer before submit.","Check ordering: description is validated first, so if you see this error the description was fine but the body is missing."],"exampleFix":"// before\nawait createLibraryItem('agent', { name: 'a', description: 'd', instructions: '  ' });\n// after\nconst instructions = form.instructions.trim();\nif (!instructions) { showFieldError('instructions', t('extensions.add_instructions_required')); return; }\nawait createLibraryItem('agent', { ...form, instructions });","handlingStrategy":"validation","validationCode":"if (kind !== 'mcp' && kind !== 'plugin' && !input.instructions.trim()) {\n  showFieldError('instructions', t('extensions.add_instructions_required')); return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await createLibraryItem(kind, input);\n} catch (e) {\n  if (e instanceof Error && e.message === t('extensions.add_instructions_required')) {\n    showFieldError('instructions', e.message);\n  } else throw e;\n}","preventionTips":["Require the instructions textarea for non-MCP/non-plugin kinds","Trim before submit so whitespace-only content is rejected early","Preserve draft content across form resets","Mirror the store's validation order in the form"],"tags":["validation","i18n","form"],"backgroundTag":"missing-required-argument","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}