{"record":{"id":"ad08ac7a3dd53d27","repo":"multica-ai/multica","slug":"content-content-stdin-and-content-file-are","errorCode":null,"errorMessage":"--content, --content-stdin, and --content-file are mutually exclusive","messagePattern":"--content, --content-stdin, and --content-file are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":198,"sourceCode":"// trimmed, so agents can round-trip generated SKILL.md content exactly.\nfunc resolveSkillContentFlag(cmd *cobra.Command) (string, bool, error) {\n\tuseStdin, _ := cmd.Flags().GetBool(\"content-stdin\")\n\tinline, _ := cmd.Flags().GetString(\"content\")\n\tfilePath, _ := cmd.Flags().GetString(\"content-file\")\n\tinlineSet := cmd.Flags().Changed(\"content\")\n\n\tsources := 0\n\tif inlineSet {\n\t\tsources++\n\t}\n\tif useStdin {\n\t\tsources++\n\t}\n\tif filePath != \"\" {\n\t\tsources++\n\t}\n\tif sources > 1 {\n\t\treturn \"\", false, fmt.Errorf(\"--content, --content-stdin, and --content-file are mutually exclusive\")\n\t}\n\n\tif useStdin {\n\t\tdata, err := io.ReadAll(os.Stdin)\n\t\tif err != nil {\n\t\t\treturn \"\", false, fmt.Errorf(\"read stdin for --content-stdin: %w\", err)\n\t\t}\n\t\treturn skillContentBytesToString(data, \"stdin content for --content-stdin\")\n\t}\n\tif filePath != \"\" {\n\t\tdata, err := os.ReadFile(filePath)\n\t\tif err != nil {\n\t\t\treturn \"\", false, fmt.Errorf(\"read file for --content-file: %w\", err)\n\t\t}\n\t\treturn skillContentBytesToString(data, \"file content for --content-file\")\n\t}\n\tif inlineSet {\n\t\treturn inline, true, nil","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L180-L216","documentation":"Input validation in the skill create/update content resolution: more than one of --content, --content-stdin, and --content-file was supplied. The CLI counts the provided sources and rejects counts above one because there is no defined precedence among them, so the user's intended content would be ambiguous.","triggerScenarios":"Any `multica skill create` or `multica skill update` invocation combining flags, e.g. `--content '{...}' --content-file ./skill.md`, or `--content-stdin` together with either of the others.","commonSituations":"Copy-pasted command lines accumulating flags; shell scripts that default both a heredoc and a file; muscle memory from tools where later flags override earlier ones.","solutions":["Inspect the command line and keep exactly one content source flag.","For file-based content use only --content-file; for piped content use only --content-stdin.","If scripting with optional sources, build the flag list conditionally instead of passing all."],"exampleFix":"# before\nmultica skill create --name lint --content-file ./skill.md --content 'x'\n# after\nmultica skill create --name lint --content-file ./skill.md","handlingStrategy":"validation","validationCode":"# Shell: build content flags exclusively\nCONTENT_FLAGS=()\n[ -n \"$CONTENT\" ] && CONTENT_FLAGS+=(--content \"$CONTENT\")\n[ -n \"$CONTENT_FILE\" ] && CONTENT_FLAGS+=(--content-file \"$CONTENT_FILE\")\n[ \"${#CONTENT_FLAGS[@]}\" -gt 2 ] && { echo \"pick one content source\"; exit 2; }  # >1 pair means >1 source","typeGuard":null,"tryCatchPattern":"Match 'mutually exclusive' in stderr and report which of --content/--content-stdin/--content-file were combined; fail fast in wrappers instead of picking a winner.","preventionTips":["Pass exactly one content flag per command.","Build flag arrays conditionally in scripts.","Prefer --content-file for deterministic scripted content."],"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"}