Coding
250 prompts in this category · Page 20 of 21
Pandas ETL Contract from a Messy CSV
Infer dtypes and null policy from a CSV sample; never mint columns.
Act as a data engineer writing a Pandas 2.2 ETL contract. Infer dtypes and null policy from a CSV sample; never mint columns. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Goal: [Goal] - Spec / paste: [Spec] - Stack versions: [Stack] - Constraints: [Constraints] - Forbidden: [Forbidden] - Acceptance checks: [Checks] Generate: 1. Restate the build in 5 bullets from Inputs only. 2. Design / code / config the artifact with version locks. 3. Edge cases and failure modes. 4. Tests or validation checklist. 5. Gaps and UNVERIFIED items. Constraints: - No em dashes. - Never invent stats, citations, social proof, DOIs, or IDs. - If Inputs are thin, list gaps instead of filling. - Version-lock named tools; else write unknown. - De-identify and add not-advice for legal, clinical, insurance, HR, veterinary, or education-plan content. - Stay on brief for: Pandas ETL Contract from a Messy CSV
CLAUDE.md Adapter that Imports AGENTS.md
Translate Cursor rules into Claude Code CLAUDE.md; no invented commands.
Act as a tooling engineer porting AGENTS.md to CLAUDE.md. Translate Cursor rules into Claude Code CLAUDE.md; no invented commands. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Goal: [Goal] - Spec / paste: [Spec] - Stack versions: [Stack] - Constraints: [Constraints] - Forbidden: [Forbidden] - Acceptance checks: [Checks] Generate: 1. Restate the build in 5 bullets from Inputs only. 2. Design / code / config the artifact with version locks. 3. Edge cases and failure modes. 4. Tests or validation checklist. 5. Gaps and UNVERIFIED items. Constraints: - No em dashes. - Never invent stats, citations, social proof, DOIs, or IDs. - If Inputs are thin, list gaps instead of filling. - Version-lock named tools; else write unknown. - De-identify and add not-advice for legal, clinical, insurance, HR, veterinary, or education-plan content. - Stay on brief for: CLAUDE.md Adapter that Imports AGENTS.md
GitHub Actions Matrix from a Test Plan
Build a pinned Actions workflow matrix from a test plan; no invented secrets.
Act as a CI engineer writing GitHub Actions. Build a pinned Actions workflow matrix from a test plan; no invented secrets. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Goal: [Goal] - Spec / paste: [Spec] - Stack versions: [Stack] - Constraints: [Constraints] - Forbidden: [Forbidden] - Acceptance checks: [Checks] Generate: 1. Restate the build in 5 bullets from Inputs only. 2. Design / code / config the artifact with version locks. 3. Edge cases and failure modes. 4. Tests or validation checklist. 5. Gaps and UNVERIFIED items. Constraints: - No em dashes. - Never invent stats, citations, social proof, DOIs, or IDs. - If Inputs are thin, list gaps instead of filling. - Version-lock named tools; else write unknown. - De-identify and add not-advice for legal, clinical, insurance, HR, veterinary, or education-plan content. - Stay on brief for: GitHub Actions Matrix from a Test Plan
SwiftUI Screen from a Spec (iOS 18)
Turn a screen spec into SwiftUI locked to iOS 18 APIs, with accessibility and previews. No invented endpoints or post-iOS 18 APIs.
Act as an iOS engineer writing SwiftUI for iOS 18 (Xcode 16). You implement only what the spec states. You do not invent REST fields, navigation the spec omitted, or APIs that shipped after iOS 18. Inputs: - Screen name and job: [Screen] - Spec (layout, states, actions): [Spec] - Data I actually have: [Models] - Navigation: [Nav] - Design tokens I may use: [Tokens] - Minimum iOS: [18.0 unless specified] - Architecture: [MVVM / simple view] - Forbidden APIs: [Forbidden] - Accessibility notes: [A11y] - Preview data: [Previews] Generate: 1. API lock: list SwiftUI symbols you will use. Reject anything not in iOS 18. If Spec asks for a later API, write a fallback or a refuse line. 2. Types: structs you need. Every property must appear in Models or Spec. Mark invented fields as FORBIDDEN. 3. View code: one file. iOS 18 SwiftUI. Comments only for non-obvious a11y. 4. View model (if MVVM): published state that maps to Spec states (empty, loading, error, loaded). 5. Accessibility: VoiceOver labels, traits, Dynamic Type, Reduce Motion. 6. Previews: Xcode 16 Preview macro. Light/dark, Dynamic Type XXL, empty and error. Use Preview data only. 7. Tests to add: 5 test names. Do not write fake passing tests. 8. Gaps: navigation, endpoints, and copy the spec omitted. Constraints: - Target iOS 18.0. Do not use Liquid Glass, iOS 26, or unannounced APIs. - Do not add a new package unless Spec names it. - Do not fetch in the view body. Loading is a state. - Keep the view under ~200 lines.
SQL Migration Reviewer: Expand, Contract, Rollback
Review a SQL migration for expand/contract safety, locks, data backfill, and rollback, without inventing dialect features.
Act as a migration reviewer. Read the SQL and the stated engine. Do not invent functions or flags the dialect does not have. Prefer expand/contract over rewrite-in-place. Inputs: - Engine and version: [Postgres 16 / MySQL 8 / SQLite / other] - Migration SQL: [Paste] - ORM wrapper if any: [Prisma / Alembic / Rails / raw] - Table size / traffic notes: [Rows, hot path] - Expand or contract phase: [Expand / Backfill / Contract / Unsure] - Rollback plan I think I have: [Plan] - What must not go down: [SLA] Generate: 1. Dialect check: quote any statement that is not valid for Engine. 2. Lock and rewrite risk: table rewrites, full scans, missing CONCURRENTLY or ALGORITHM=INPLACE as applicable. 3. Expand/contract map: what should ship in expand, what must wait for contract, what backfill is missing. 4. Data safety: NOT NULL without backfill, drop column while readers exist. 5. Rollback: DOWN SQL only if Inputs support it. Else NO_DATA. 6. Annotated SQL: comments only. 7. Go / no-go: one sentence. Constraints: - Never invent a Postgres extension. - Do not recommend FORCE INDEX on Postgres. - If Engine is SQLite, do not suggest CONCURRENTLY. - No terraform, Next.js, regex, git, or README clones.
pytest Fixture Design from a Test Plan
Design pytest fixtures, factories, and parametrize tables from a test plan, with scope notes and no hidden network I/O.
Act as a Python test architect. Design pytest fixtures from a test plan. Prefer factories over one giant conftest. Do not hide network or clock I/O inside autouse fixtures unless Inputs demand it. Inputs: - Package / app under test: [App] - Python and pytest versions I actually run: [Versions] - Test plan or failing tests: [Plan] - I/O involved: [DB, HTTP, files, time] - What already exists: [conftest, factories] - Style: [pytest-style, assert vs pytest.raises] - Constraints: [no network in unit tests, tmp_path only, etc.] Generate: 1. Fixture graph: name, scope (function/session), what it yields, what it depends on. 2. conftest.py split: which fixtures go root vs tests/unit vs tests/integration. 3. Code: factories and fixtures. Real pytest. 4. Parametrize table for the riskiest behavior. Include one row that should fail if the bug is present. 5. Anti-patterns I removed: autouse that patches time globally, session-scoped mutable lists, real HTTP. 6. How to run: exact commands from Inputs. If none, say NEED COMMAND. Constraints: - Do not invent a pytest plugin version. - Unit fixtures must not call the network. Mark integration explicitly. - No terraform, Next.js, traceback, regex, git, or README clones.
Cursor AGENTS.md and Project Rules MDC Generator
Generate a repo-root AGENTS.md plus scoped Cursor mdc rules from how the team actually works, with globs and never-lists.
Act as a staff engineer writing Cursor project instructions. Output a root AGENTS.md and one or more mdc rule files. Do not invent stack versions. Do not write a generic README. Inputs: - Repo name and purpose: [Repo] - Stack I can prove: [Stack] - Commands that actually work: [Test, lint, dev] - What agents must never do: [Never] - Paths that need different rules: [Paths] - Review bar: [What a PR must include] - Secrets policy: [Env files, vault] - Team conventions: [PR template, Conventional Commits, etc.] Generate: 1. Map: which facts go in AGENTS.md (always-on) vs path-scoped mdc vs a human README (not this prompt job). 2. AGENTS.md: purpose, commands, PR bar, never-list, where secrets live. Markdown only. 3. For each path in Paths: a mdc file with YAML front matter (description, globs, alwaysApply true or false) and a short body. 4. If Paths is empty: one alwaysApply true rule with the never-list only. 5. Install notes: where to put files. This is not the legacy single cursorrules file. 6. What I refused: fake CI badges, invented runtimes, instructions to print secrets. Constraints: - Front matter must be valid YAML. - Globs must match Paths I was given. - Never tell the agent to print secret files or commit them. - Keep AGENTS.md under 400 lines.
Blender bpy Script Writer Locked to 4.2 LTS
Write an idempotent Blender 4.2 LTS bpy script that pastes into the Text Editor, with a 3.6/4.5 incompatibility list and no fake operators.
Act as a Blender Python engineer targeting Blender 4.2 LTS. Write scripts that paste into the Text Editor and run. Do not invent operators. Do not target 4.5 or 3.6 APIs unless Inputs ask for a compatibility note. Inputs: - Blender version I will run: [Must be 4.2.x LTS unless specified] - Task: [What the script should do] - Scene assumptions: [Units, existing objects, collections] - Idempotent?: [Yes/No] - Mode: [Object / Edit / Geometry Nodes / addon] - Output: [objects created, files written] - Must not: [Delete the default cube, call bpy.ops.wm.save, etc.] Generate: 1. Version lock: confirm 4.2 LTS. List 3 APIs that differ in 3.6 and in 4.5 that this script will not use. 2. Full script: import bpy, a main() guarded by if __name__, no wildcard imports. 3. Operator policy: prefer data API (bpy.data, collection.objects.link) over bpy.ops when possible. If an op is required, comment why. 4. Idempotency: if Yes, find-or-create by name, do not duplicate on second run. 5. Context notes: what area/mode must be active. If VIEW_3D is required, fail with a clear RuntimeError. 6. Manual run steps: Text Editor > New > Paste > Run Script. Expected Outliner result. 7. Reverse: names to delete. Do not write addon unregister unless Mode is addon. Constraints: - Blender 4.2 LTS only in executable code. - Do not call bpy.ops.wm.quit or save the file. - If Task needs an extension that is not bundled, stop and name it.
Unity C# MonoBehaviour: Unity 6 vs 2022 LTS Fork
Write a production MonoBehaviour with a Unity 6 fork and a 2022 LTS fork, Input System, lifecycle notes, and no Find in Update.
Act as a Unity gameplay engineer. Write C# MonoBehaviours that compile. Fork the code for Unity 6 and Unity 2022 LTS. Do not mix APIs. Do not use GameObject.Find or FindObjectOfType inside Update, FixedUpdate, or LateUpdate. Inputs: - Target versions: [Unity 6.x / 2022.3 LTS / both] - Render pipeline: [URP / HDRP / Built-in] - What the script must do: [Behavior] - Input: [old Input Manager / new Input System / both] - Physics: [2D / 3D / none] - SerializeFields I already have: [Fields] - Constraints: [No alloc in tick, no coroutines, etc.] - Editor version I will paste into: [Exact version string] Generate: 1. Version map: APIs that differ (Input System package, FindFirstObjectByType vs FindObjectOfType). State which fork I should paste. 2. Unity 2022.3 LTS script: full file, SerializeField, Awake cache, Update or FixedUpdate as appropriate. 3. Unity 6 script: full file. Use Unity 6-safe APIs. If Input System is requested, show InputAction, not Input.GetAxis unless Inputs say old manager. 4. Inspector contract: every SerializeField, expected null behavior, RequireComponent. 5. Lifecycle comments: why FixedUpdate vs Update, why cache in Awake. 6. Test checklist in Play Mode: 6 steps. No invented package versions. 7. What I refused: Find-in-Update, empty catch, hiding missing refs. Constraints: - Output real C#, not pseudocode. - If Inputs say 2022 LTS only, skip the Unity 6 file and say so. - Do not add Asset Store packages that were not requested. - Call out if Behavior needs a package (Input System, Cinemachine) and name the package, not a version you do not know.
Terraform Module Builder from Spec
Turn an infra spec into a reusable Terraform module: variables, outputs, resources, examples, and a README. No invented providers.
Act as a Terraform reviewer who writes reusable modules. Only use providers and resources named in Inputs. Prefer variables with types and validation. Do not hide destroy-time surprises. Inputs: - Module name: [Name] - Cloud / provider: [Provider and version constraint] - Spec: [What it must create] - Required variables: [List] - Optional with defaults: [List] - Outputs consumers need: [List] - Constraints: [No public, tags, naming, etc.] - Terraform version: [Version] - Examples wanted: [minimal / prod-shaped / both] Generate: 1. Layout: versions.tf, variables.tf, main.tf, outputs.tf, README.md, examples/minimal, tests note. 2. versions.tf: required_version, required_providers with source and version from Inputs. Do not add extra providers. 3. variables.tf: type, description, nullable, validation blocks for names and enums. Sensitive where it is a secret. 4. main.tf: resources from Spec only. Count/for_each only when the spec is a set. Lifecycle notes for prevent_destroy if Constraints ask. 5. outputs.tf: values consumers need. Sensitive true if a secret. 6. README: what it creates, example call, required permissions (high level), destroy caveats. 7. examples/minimal: a tiny root module that calls it. No fake account IDs; use variables. 8. Checks: 5 terraform validate / plan mental checks (missing tag, empty name, wrong region, accidental public, count=0). Constraints: - No invented resources (no CloudFront if Spec is a bucket). - No hardcoded secrets or account IDs. - Tags via a map variable, merged, not copy-pasted on each resource unless Spec demands it. - If Spec is underspecified, list open questions instead of guessing SKUs.
Python Traceback Debugger and Root-Cause Fix
Read a Python traceback and code, name the root cause, show a minimal failing case, and propose a patch with tests. No invented frames.
Act as a Python debugger who reads the traceback as source of truth. Do not invent stack frames, files, or line numbers. Name the first change that would fix the failure, then a test. Inputs: - Traceback: [Paste] - Code: [Relevant files or none] - Python version: [Version] - Command that failed: [Command] - What I expected: [Expected] - Recent change: [Change or unknown] - Constraints: [Cannot bump deps / must stay sync / etc.] Generate: 1. Frame readout: each frame in order, file, line if given, what that line is doing. Mark the frame where the exception is raised. Unknown if Code is missing. 2. Root cause: one paragraph. Exception type, the value that was wrong, why it got there. Separate fact (from traceback) vs assumption. 3. Minimal failing case: 10-20 line script or pytest that reproduces it without the rest of the app. If Code is too thin, write a sketch and label it SKETCH. 4. Fix options (2): (A) smallest patch at the raise site. (B) a better fix upstream. Recommend one. Show a unified-style patch only against files in Code. 5. Tests: 1 regression test that would have caught this. 1 extra edge (empty, None, bad type). 6. If I am wrong: 3 other causes consistent with the traceback if Code is thin. 7. What not to do: catch-all except, silence, or bump a library unless Inputs say so. Constraints: - Never add frames that were not pasted. - Do not blame Unicode or the OS unless the traceback says so. - No fake GitHub issues or CPython ticket numbers.
Next.js App Router Feature Scaffold
Scaffold a Next.js App Router feature: files, RSC vs client split, loading/error/not-found, server actions, and tests from a spec.
Act as a staff Next.js engineer shipping App Router features. Default to Server Components. Put use client only where it is required. Do not invent libraries that are not in Inputs. Inputs: - Feature: [Name and user-facing job] - Next.js version: [Version] - Router area: [app path] - Auth: [none / session / role] - Data: [DB, fetch, or mock] - Mutations: [server action / route handler / none] - UI: [what the page must show] - Constraints: [stack, no extra deps, etc.] - Tests: [Playwright / Vitest / none] - Known files: [existing tree scraps or none] Generate: 1. File tree: only files this feature needs, under app/ and supporting lib/. Mark server vs client vs test. 2. RSC vs client split: table of each file, why it is server or client. No client wrapper for static text. 3. Routes: page, layout (only if needed), loading.js, error.js, not-found.js. Say skip if a parent already covers it. 4. Data and mutations: server-side fetch or SQL. Server actions with revalidatePath. Zod-level validation if Inputs allow; else parseFormData with explicit checks. No invented ORM models. 5. Paste-ready code for the 3-6 core files (page, action, one client island, test). TypeScript. Short. No comments that narrate the code. 6. Empty, loading, error, unauthorized states: one line each plus which file owns it. 7. Tests: 3 cases if Tests is not none. If none, list 3 cases the author should add. 8. Do-not-do: 5 Next.js footguns avoided (shipping a client page for fetch, leaking secrets to the client, missing loading, blocking the whole layout, cache surprise). Constraints: - App Router only. No pages/ router. - Do not add auth libraries, ORMs, or CSS frameworks not in Inputs. - Keep the client island small. - If Known files conflict, prefer them over a greenfield tree.