{"record":{"id":"914bd4c8bd79e622","repo":"multica-ai/multica","slug":"skill-ids-is-required-comma-separated-skill-ids-914bd4","errorCode":null,"errorMessage":"--skill-ids is required (comma-separated skill IDs)","messagePattern":"--skill-ids is required \\(comma-separated skill IDs\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1052,"sourceCode":"\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar result json.RawMessage\n\tif err := client.PutJSON(ctx, \"/api/agents/\"+args[0]+\"/skills\", body, &result); err != nil {\n\t\treturn fmt.Errorf(\"set agent skills: %w\", err)\n\t}\n\n\treturn printAgentSkillsMutationResult(cmd, args[0], result)\n}\n\nfunc runAgentSkillsAdd(cmd *cobra.Command, args []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !cmd.Flags().Changed(\"skill-ids\") {\n\t\treturn fmt.Errorf(\"--skill-ids is required (comma-separated skill IDs)\")\n\t}\n\tcleanIDs := cleanSkillIDsFlag(cmd)\n\tif len(cleanIDs) == 0 {\n\t\treturn fmt.Errorf(\"--skill-ids must include at least one skill ID\")\n\t}\n\tbody := map[string]any{\n\t\t\"skill_ids\": cleanIDs,\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar result json.RawMessage\n\tif err := client.PostJSON(ctx, \"/api/agents/\"+args[0]+\"/skills/add\", body, &result); err != nil {\n\t\treturn fmt.Errorf(\"add agent skills: %w\", err)\n\t}\n\n\treturn printAgentSkillsMutationResult(cmd, args[0], result)","sourceCodeStart":1034,"sourceCodeEnd":1070,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1034-L1070","documentation":"Returned by `multica agent skills add <id>` when the --skill-ids flag was not explicitly provided. Unlike set, add requires at least one non-empty id (a separate check rejects an emptied list, since cleanSkillIDsFlag trims and drops blanks), so the flag itself must be present and non-trivial.","triggerScenarios":"Running `multica agent skills add agt_1` without --skill-ids, or passing only whitespace/empty values that cleanSkillIDsFlag reduces to zero ids (which then triggers the follow-up '--skill-ids must include at least one skill ID' error).","commonSituations":"Scripts that append skill ids conditionally; passing an empty variable; comma-placement mistakes like `--skill-ids ,abc` that still yield ids but `--skill-ids ,` yields none.","solutions":["Pass at least one concrete id: `multica agent skills add <id> --skill-ids sk_abc`","Ensure variables are populated before composing the command in scripts","To add several at once, use comma separation: `--skill-ids sk_a,sk_b`","Check `--help` for the exact flag name if unsure"],"exampleFix":"# before\nmultica agent skills add agt_1\n# Error: --skill-ids is required (comma-separated skill IDs)\n\n# after\nmultica agent skills add agt_1 --skill-ids sk_abc","handlingStrategy":"validation","validationCode":"[ -n \"${SKILL_IDS//,/}\" ] || { echo 'at least one skill id required'; exit 1; }\nmultica agent skills add \"$AGENT_ID\" --skill-ids \"$SKILL_IDS\"","typeGuard":"func hasSkillIDs(ids []string) bool {\n\tfor _, id := range ids {\n\t\tif strings.TrimSpace(id) != \"\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","tryCatchPattern":"if !cmd.Flags().Changed(\"skill-ids\") {\n\treturn fmt.Errorf(\"--skill-ids is required (comma-separated skill IDs)\")\n}\nif len(cleanIDs) == 0 {\n\treturn fmt.Errorf(\"--skill-ids must include at least one skill ID\")\n}","preventionTips":["Pass at least one concrete, previously verified skill id","Populate the flag variable before composing the command","Use comma separation for multiple ids instead of repeating the flag incorrectly"],"tags":["cli","usage","validation","skills"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}