{"record":{"id":"5a679c4b8f89f0ca","repo":"multica-ai/multica","slug":"name-is-required-5a679c","errorCode":null,"errorMessage":"--name is required","messagePattern":"--name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":302,"sourceCode":"\trows := [][]string{{\n\t\tstrVal(skill, \"id\"),\n\t\tstrVal(skill, \"name\"),\n\t\tstrVal(skill, \"description\"),\n\t\tstrVal(skill, \"created_at\"),\n\t}}\n\tcli.PrintTable(os.Stdout, headers, rows)\n\treturn nil\n}\n\nfunc runSkillCreate(cmd *cobra.Command, _ []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tname, _ := cmd.Flags().GetString(\"name\")\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"--name is required\")\n\t}\n\n\tbody := map[string]any{\n\t\t\"name\": name,\n\t}\n\tif v, _ := cmd.Flags().GetString(\"description\"); v != \"\" {\n\t\tbody[\"description\"] = v\n\t}\n\tcontent, hasContent, err := resolveSkillContentFlag(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif hasContent && content != \"\" {\n\t\tbody[\"content\"] = content\n\t}\n\tif cmd.Flags().Changed(\"config\") {\n\t\tv, _ := cmd.Flags().GetString(\"config\")\n\t\tvar config any","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L284-L320","documentation":"Simple flag validation in `multica skill create`: --name was omitted or passed empty. name is the only required field in the create body, and the API would reject the request without it, so the CLI fails fast before any network call.","triggerScenarios":"Running `multica skill create` without --name, or with `--name ''` (e.g. an unset shell variable expanded to empty).","commonSituations":"Shell scripts where $SKILL_NAME was never set; assuming the name can be derived from --content-file's filename; flag renamed between versions.","solutions":["Pass a non-empty --name: `multica skill create --name <name>`.","In scripts, guard: `: \"${SKILL_NAME:?SKILL_NAME must be set}\" before invoking multica.","Check `multica skill create --help` for the current flag set if upgrading from an older CLI."],"exampleFix":"# before\nmultica skill create --content-file ./skill.md\n# after\nmultica skill create --name lint --content-file ./skill.md","handlingStrategy":"validation","validationCode":": \"${SKILL_NAME:?SKILL_NAME must be non-empty}\"\nmultica skill create --name \"$SKILL_NAME\"","typeGuard":null,"tryCatchPattern":"Match '--name is required' in stderr and fail the wrapper with a missing-argument error; there is nothing to retry — the command never reached the network.","preventionTips":["Set required env vars with `: ${VAR:?msg}` guards in scripts.","Check `--help` after CLI upgrades for flag changes.","Treat --name as mandatory in every skill create invocation."],"tags":["go","cli","validation","flags","skills"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}