{"record":{"id":"94a5fa0c23e7f143","repo":"multica-ai/multica","slug":"no-fields-to-update-use-name-description-94a5fa","errorCode":null,"errorMessage":"no fields to update; use --name, --description, --content, or --config","messagePattern":"no fields to update; use --name, --description, --content, or --config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":376,"sourceCode":"\t}\n\tcontent, hasContent, err := resolveSkillContentFlag(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif hasContent {\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\n\t\tif err := json.Unmarshal([]byte(v), &config); err != nil {\n\t\t\treturn fmt.Errorf(\"--config must be valid JSON: %w\", err)\n\t\t}\n\t\tbody[\"config\"] = config\n\t}\n\n\tif len(body) == 0 {\n\t\treturn fmt.Errorf(\"no fields to update; use --name, --description, --content, or --config\")\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar result map[string]any\n\tif err := client.PutJSON(ctx, \"/api/skills/\"+args[0], body, &result); err != nil {\n\t\treturn fmt.Errorf(\"update skill: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, result)\n\t}\n\n\tfmt.Printf(\"Skill updated: %s (%s)\\n\", strVal(result, \"name\"), strVal(result, \"id\"))\n\treturn nil\n}","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L358-L394","documentation":"Validation in `multica skill update <id>`: after collecting optional fields (--name, --description, --content, --config), the request body map is empty, meaning no field was actually provided. The CLI refuses to send an empty PUT because it would be a no-op at best and ambiguous at worst. Note that --content with empty bytes is rejected earlier by the empty-content check, so this specifically means no flags changed anything.","triggerScenarios":"Running `multica skill update <id>` with no field flags at all, or with flags whose values are empty strings that the collection code skips.","commonSituations":"Scripts passing update flags conditionally where every condition evaluated false; interactive users expecting update to open an editor; copy-pasted create commands with the field flags removed.","solutions":["Include at least one field flag: --name, --description, --content/--content-file/--content-stdin, or --config.","In scripts, assert at least one update variable is set before invoking multica.","Use `multica skill get <id>` first to see current values and decide what to change."],"exampleFix":"# before\nmultica skill update abc123\n# after\nmultica skill update abc123 --description 'New description'","handlingStrategy":"validation","validationCode":"# Assert at least one update field is set before invoking\n[ -n \"$NAME$DESC$CONFIG\" ] || [ -n \"$CONTENT_FILE\" ] || { echo \"no fields to update\"; exit 2; }\nmultica skill update \"$SKILL_ID\" ${NAME:+--name \"$NAME\"} ${DESC:+--description \"$DESC\"} ${CONFIG:+--config \"$CONFIG\"} ${CONTENT_FILE:+--content-file \"$CONTENT_FILE\"}","typeGuard":null,"tryCatchPattern":"Match 'no fields to update' and surface it as a usage bug in the caller (missing arguments), not a server problem; nothing was sent, so no rollback is needed.","preventionTips":["Require at least one update field in script argument parsing.","Use `multica skill get` to review current values before updating.","Don't expect update to be interactive — it never opens an editor."],"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"}