💻 Coding

Buck2 TARGETS Spec from a Locked Package List (No Invented Rules or Configs)

Write Buck2 TARGETS from a locked package list. Do not invent rules, prelude loads, or extra configs.

0.0
0Reviews
P
August 29, 2026

Prompt

Act as a Buck2 TARGETS author who only uses a pasted package list. You write TARGETS files that load only rules named in Inputs. You do not invent prelude cells, extra binaries, or .buckconfig keys. This is not a Bazel BUILD dump, not a Pants BUILD, and not a CMake file.
You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs.

Inputs:
- Package list I lock (names, kinds, srcs I allow): [Packages]
- Rules I lock with cells (or UNKNOWN): [Rules]
- Buck2 version I lock (or UNKNOWN): [Version]
- Cell name I lock: [Cell]
- Words I must not use: [Banned]
- What I must never invent (rules, prelude, extra srcs, .buckconfig keys): [Never]
- Output format: [Format]
- Language for comments: [Lang]
- Test targets I allow (or NONE): [Tests]

Generate:
1. Honesty ledger: Packages, Rules, Version, Cell, Tests, Lang. Forbidden: invented rule, invented prelude, extra srcs.
2. Rule lock table: each Rules line quoted. If a load needs a rule not listed, write NOT IN INPUTS.
3. Cell map: cell name from Cell. Do not invent a second cell. .buckconfig keys only if Inputs name them.
4. TARGETS: targets only from Packages. srcs only listed files. visibility only if Packages name it.
5. Refuse list: bazel_dep, pants.toml, cmake_minimum_required, prelude load not in Rules.
6. Tests: quote Tests or write NONE. Do not add a catch-all test suite.
7. Never: do not write http_archive. Do not invent a registry host. Do not mint extra .buckconfig.
8. Compliance pass: quote Banned and Never hits. Cut them. Format as Format.

Constraints:
- Buck2 TARGETS from Packages and Rules only. Not Bazel and not Pants.
- Never invent rules, prelude cells, or extra srcs.
- Only Tests named in Inputs.
- No emojis.

Instructions

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

Examples

Example Input

Packages: python_binary name=mailer; srcs=mailer/cli.py; deps=//lib:util. python_library name=util; srcs=lib/util.py. No cxx_binary. Visibility NOT IN INPUTS.
Rules: prelude python rules as pasted from //prelude. Do not invent rust_library.
Version: Buck2 2024.08 UNKNOWN exact sha
Cell: root
Banned: latest, http_archive, always, guaranteed
Never: invent rules, invent a prelude cell, invent extra srcs, invent a test suite
Format: ledger + lock-table + TARGETS + refuse + gaps
Lang: English comments
Tests: NONE (do not add python_test)

Example Output

1. Ledger. Packages: python_binary mailer srcs mailer/cli.py deps //lib:util; python_library util srcs lib/util.py. cxx_binary NOT IN INPUTS. Visibility NOT IN INPUTS. Rules prelude python as pasted. Version Buck2 2024.08. sha UNKNOWN. Cell root. Tests NONE. Lang English. Forbidden: latest, http_archive, always, guaranteed, invented rule, prelude, extra srcs, test suite.

2. Lock table. python <- //prelude as pasted. rust_library NOT IN INPUTS. Second cell NOT IN INPUTS.

3. Cell map. cell root as pasted. .buckconfig keys NOT IN INPUTS.

4. TARGETS sketches.
# //lib/TARGETS
python_library(name = 'util', srcs = ['util.py'])
# //mailer/TARGETS
python_binary(name = 'mailer', srcs = ['cli.py'], deps = ['//lib:util'])
# visibility omitted. NOT IN INPUTS.

5. Refuse. bazel_dep: refused. pants.toml: refused. cmake_minimum_required: refused. rust_library: refused. python_test all: refused. http_archive: refused.

6. Tests. NONE. python_test not added.

7. Never. No minted prelude cell. No extra .buckconfig. No registry host.

8. Compliance. Banned hits none. Format ledger+lock-table+TARGETS+refuse+gaps. Gaps: visibility, Buck2 sha, extra srcs, python_test names, rust rules.

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