💻 Coding

Rust clap CLI from a Command Brief (No Invented Crates)

Scaffold a Rust CLI with clap from a command brief. Do not invent crates, features, or versions not locked in Inputs.

0.0
0Reviews
P
August 27, 2026

Prompt

Act as a Rust clap CLI sketcher who only uses a pasted command brief. You write a clap-based CLI skeleton (Cargo.toml stub + main/args). You do not invent crates, features, or crate versions not locked in Inputs. This is not a full production app, not a Tokio service, and not a Python argparse 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]
- Rust edition I lock (2021/2024/UNKNOWN): [Edition]
- clap version I lock (or UNKNOWN): [Clap]
- Extra crates I may name: [Crates or NONE]
- Words I must not use: [Banned]
- What I must never invent: [Never]
- Output format: [Format]
- Language for comments: [Lang]
- Error style I allow (thiserror/anyhow/UNKNOWN): [Errors]

Generate:
1. Honesty ledger: Brief, Edition, Clap, Crates, Errors, Lang. Forbidden: extra crates, inventing clap 5 if UNKNOWN.
2. Cargo.toml stub: package name from Brief. clap dependency only if Clap locked; else write CLAP VERSION UNKNOWN and leave a placeholder comment.
3. Args sketch: derive Parser. Subcommands and flags only from Brief.
4. main sketch: match subcommands. No network calls unless Brief says so.
5. Crates: attach only Crates. If Brief needs serde and Crates is NONE, write NOT IN INPUTS.
6. Errors: only Errors style. If UNKNOWN, print UNKNOWN and do not pick anyhow by default.
7. Refuse: inventing tokio, inventing reqwest, inventing clap macros not needed.
8. Compliance pass: quote Banned and Never. Format as Format.

Constraints:
- Rust clap CLI from Brief only. Not a full app and not a Python port.
- Never invent crates 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.
Edition: 2021
Clap: 4.5 as pasted (do not invent 5.x)
Crates: NONE (do not invent serde or tokio)
Banned: unwrap_everywhere, todo!, reqwest invent, tokio invent
Never: invent crates, invent clap 5, invent a config file format
Format: ledger + cargo stub + args + main + refuse + gaps
Lang: English comments
Errors: UNKNOWN (do not pick anyhow)

Example Output

1. Ledger. Bin tidewatch. Subcommands check (--path, --json), list (--limit default 20). No network. Edition 2021. Clap 4.5. Crates NONE. Errors UNKNOWN. Lang English. Forbidden: serde invent, tokio invent, reqwest invent, clap 5, config format invent, unwrap_everywhere, todo!.

2. Cargo.toml stub.
[package]
name = "tidewatch"
edition = "2021"
[dependencies]
clap = { version = "4.5", features = ["derive"] }
# Extra crates: NONE. serde NOT IN INPUTS. tokio NOT IN INPUTS.

3. Args sketch.
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "tidewatch")]
struct Cli { #[command(subcommand)] cmd: Commands }
#[derive(Subcommand)]
enum Commands {
  Check { #[arg(long)] path: String, #[arg(long)] json: bool },
  List { #[arg(long, default_value_t = 20)] limit: usize },
}

4. main sketch.
fn main() {
  let cli = Cli::parse();
  match cli.cmd {
    Commands::Check { path, json } => { /* check path; json flag only */ }
    Commands::List { limit } => { /* list with limit */ }
  }
}

5. Crates. NONE. If JSON output needs serde: NOT IN INPUTS.

6. Errors. UNKNOWN. Do not default to anyhow. Do not invent thiserror.

7. Refuse. tokio refused. reqwest refused. clap 5 refused. Config file format NOT IN BRIEF.

8. Compliance. Clap 4.5 locked. Banned cut. Format ledger+cargo+args+main+refuse+gaps. Gaps: error crate choice, serde decision, sample path fixture, CI target, MSRV.

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...