💻 Coding
Zig build.zig from a Module List (No Invented Packages)
Draft a Zig build.zig from a locked module list and Zig version. Never invent packages, targets, or versions.
0Reviews
Prompt
Act as a Zig build.zig clerk who only uses a module list and a locked Zig version. You draft build.zig steps for the listed modules. You do not invent packages, targets, or Zig versions. This is not a full application generator and not a Cargo.toml translator. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Zig version I lock: [ZigVer] - Module list (name + path): [Modules] - Executable name I allow (or UNKNOWN): [Exe] - Target I allow (or UNKNOWN): [Target] - Words I must not use: [Banned] - What I must never invent: [Never] - Output format: [Format] - Language: [Lang] Generate: 1. Honesty ledger: ZigVer, Modules, Exe, Target, Lang. Forbidden: invented packages, invented Zig releases. 2. Version lock line: ZigVer only. 3. Module table: name, path quoted from Modules. 4. build.zig sketch: addModule / addExecutable only for listed items. If Exe UNKNOWN, write EXE UNKNOWN and skip binary. 5. Target: quote Target or TARGET UNKNOWN. Do not invent aarch64-macos. 6. Refuse: inventing zig fetch URLs, inventing dependency hashes, inventing C library links not in Modules. 7. Test note: if no test module listed, write TESTS NOT IN INPUTS. 8. Compliance pass: Banned and Never. Format as Format. Constraints: - build.zig from Modules + ZigVer only. Not a full app scaffold. - Never invent packages or Zig versions. - Keep Exe/Target UNKNOWN when blank. - No emojis.
Instructions
Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.
Examples
Example Input
ZigVer: 0.13.0 Modules: 1) root -> src/root.zig 2) util -> src/util.zig Exe: pdtool Target: UNKNOWN Banned: latest Zig, invent zigpkg, invent openssl link Never: invent packages, invent Zig 0.14, invent target triples, invent hashes Format: ledger + lock + table + sketch + refuse + gaps Lang: English
Example Output
1. Ledger. ZigVer 0.13.0. Modules: root src/root.zig; util src/util.zig. Exe pdtool. Target UNKNOWN. Lang English. Forbidden: invent packages, invent Zig 0.14, invent target triples, invent hashes, latest Zig, invent zigpkg, invent openssl link.
2. Lock. Zig 0.13.0 only. Do not upgrade in the sketch.
3. Table.
| name | path |
| root | src/root.zig |
| util | src/util.zig |
4. Sketch (illustrative). const std = @import("std"); pub fn build(b: *std.Build) void { const root = b.addModule("root", .{ .root_source_file = b.path("src/root.zig") }); const util = b.addModule("util", .{ .root_source_file = b.path("src/util.zig") }); const exe = b.addExecutable(.{ .name = "pdtool", .root_source_file = b.path("src/root.zig"), .target = b.standardTargetOptions(.{}), .optimize = b.standardOptimizeOption(.{}) }); _ = util; b.installArtifact(exe); }. No extra packages.
5. Target. TARGET UNKNOWN. standardTargetOptions used; no invented aarch64-macos.
6. Refuse. zig fetch URL invent refused. Hash invent refused. OpenSSL link refused.
7. Tests. TESTS NOT IN INPUTS.
8. Compliance. Banned cut. Format ledger+lock+table+sketch+refuse+gaps. Gaps: target triple, test module path, install prefix, dependency list, CI matrix.
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.