💻 Coding

Go cobra CLI from a Command Brief (No Invented Modules)

Scaffold a Go CLI with cobra from a command brief. Do not invent modules, flags, or versions not locked in Inputs.

0.0
0Reviews
P
August 27, 2026

Prompt

Act as a Go cobra CLI sketcher who only uses a pasted command brief. You write a cobra-based CLI skeleton (go.mod stub + root/subcommand files). You do not invent modules, flags, or module versions not locked in Inputs. This is not a full production app, not a cobra-cli generator dump, and not a Rust clap port.
You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs.

Inputs:
- Command brief (bin name, subcommands, flags): [Brief]
- Go version I lock (or UNKNOWN): [Go]
- cobra version I lock (or UNKNOWN): [Cobra]
- Extra modules I may name: [Mods or NONE]
- Words I must not use: [Banned]
- What I must never invent: [Never]
- Output format: [Format]
- Language for comments: [Lang]
- Module path I allow (or UNKNOWN): [Module]

Generate:
1. Honesty ledger: Brief, Go, Cobra, Mods, Module, Lang. Forbidden: extra modules, inventing cobra v2 if UNKNOWN.
2. go.mod stub: module path from Module or MODULE UNKNOWN. cobra require only if Cobra locked; else write COBRA VERSION UNKNOWN.
3. Root command sketch: Use cobra.Command. Subcommands and flags only from Brief.
4. Subcommand stubs: match Brief. No network calls unless Brief says so.
5. Mods: attach only Mods. If Brief needs viper and Mods is NONE, write NOT IN INPUTS.
6. Go version: quote Go or GO VERSION UNKNOWN. Do not default to 1.22 if UNKNOWN.
7. Refuse: inventing gin, inventing gorm, inventing cobra-cli generate output beyond the sketch.
8. Compliance pass: quote Banned and Never. Format as Format.

Constraints:
- Go cobra CLI from Brief only. Not a full app and not a Rust clap port.
- Never invent modules or versions when UNKNOWN.
- Only subcommands named in Brief.
- No emojis.

Instructions

Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.

Examples

Example Input

Brief: bin name tidewatch; subcommands: check (flags --path PATH, --json), list (flag --limit N default 20). No network.
Go: 1.22 as pasted (do not invent 1.23)
Cobra: v1.8 as pasted (do not invent v2)
Mods: NONE (do not invent viper or zap)
Banned: panic everywhere, todo, gin invent, gorm invent
Never: invent modules, invent cobra v2, invent a config file format, invent 1.23
Format: ledger + gomod + root + subcommands + refuse + gaps
Lang: English comments
Module: example.com/tidewatch as pasted

Example Output

1. Ledger. Bin tidewatch. Subcommands check (--path, --json), list (--limit default 20). No network. Go 1.22. Cobra v1.8. Mods NONE. Module example.com/tidewatch. Lang English. Forbidden: viper invent, zap invent, gin invent, gorm invent, cobra v2, config format invent, 1.23, panic everywhere, todo.

2. go.mod stub.
module example.com/tidewatch
go 1.22
require github.com/spf13/cobra v1.8
// Extra modules: NONE. viper NOT IN INPUTS. zap NOT IN INPUTS.

3. Root sketch.
package main
// English comments. root cobra.Command Use: tidewatch. Short from Brief only.
var root = &cobra.Command{Use: "tidewatch"}
func main() { _ = root.Execute() }

4. Subcommands.
checkCmd: Use check; flags --path string, --json bool. No network.
listCmd: Use list; flag --limit int default 20.
root.AddCommand(checkCmd, listCmd)

5. Mods. NONE. If JSON output needs extra encode module: NOT IN INPUTS.

6. Go 1.22 locked. Cobra v1.8 locked. cobra v2 refused.

7. Refuse. gin refused. gorm refused. viper refused. Config file format NOT IN BRIEF.

8. Compliance. Banned cut. Format ledger+gomod+root+subcommands+refuse+gaps. Gaps: error wrapping choice, json encoder, sample path fixture, CI target, MSRV policy.

Missing-data policy: if a field was blank, write NOT IN INPUTS rather than guessing. Lock any tool version named in Inputs; if unnamed, write unknown. No invented testimonials, star ratings, or press logos. If legal, clinical, insurance, HR, education-plan, or veterinary content appears, add a one-line not-advice and de-identify banner. Quote banned-word hits and cut them. End with a gaps list of five bullets the user still owes you. Character and byte caps in the job are hard; print counts when relevant. Refuse to backfill DOIs, exam dumps, PHI, PII, or compensation promises not in Inputs.

Reviews (0)

Please login to leave a review.
Loading reviews...