PromptBase
Upgrade
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
(claude-5-sonnet)
Token size
3,693
Example input
[DELETE THIS TEXT AND PASTE YOUR BRIEF: TASK: describe in plain language what you're building or fixing, the language/stack if relevant, and what's not working or what you're aiming for — at least 10 words. A-LEVEL: optional, from 1 — single script — to 8 — full layered system — leave blank for auto. S-LEVEL: optional, from 1 — single function — to 5 — multi-module system — leave blank for auto. Advanced, optional: PRIORITY AXES / CONFLICT — leave blank for auto-detection, or specify manually using the axis names above if you already know which qualities you want.]: TASK: Fix a Python function that crashes when the input list is empty — it's a quick utility script, not a big project.
Example output
--- MODE: Standalone CODE CATEGORY: Bug fix in a small Python utility script 🔍 Auto-detected: Priority axes K9 Edge-Case Coverage, K7 Error Handling, K1 Readability, K10 Best-Practice Benchmark, target weak points -Edge-Case Coverage (empty list missed) and -Error Handling (unguarded crash), A-LEVEL≈2, S-LEVEL≈2 (based on: "quick utility script, not a big project" implies low abstraction and very few components) — override anything above by specifying it manually in your brief. TOP-3 DIRECTIONS: 1️⃣ K7 Error Handling + K9 Edge-Case Coverage + K1 Readability (k=3) — high focal strength 🟢 BEST-FIT — READY-TO-USE PROMPT BELOW Type: A | Compatibility: Partial — Readability fits A2, but Error Handling and Edge-Case Coverage usually want S3-S5, so they are adapted into a single guard clause Core: K7–K9 | Weak link: K1–K9 2️⃣ K7 + K9 + K1 + K10 Best-Practice Benchmark (k=4) — medium-high focal strength Type: A | Compatibility: Partial — K1 and K10 fit A2 and S2, but K7 and K9 lean toward more components 3️⃣ K7 + K9 + K5 Stability (k=3) — medium focal strength Type: B | Compatibility: Partial — K5 fits S2, but K7 and K9 lean toward more components ──────────────────── 🟢 READY-TO-USE PROMPT (based on 1️⃣): You are helping fix a bug in a small Python utility script. The function ✏️[FUNCTION NAME] crashes when it receives an empty list. Keep the fix minimal and readable. Structure: Keep everything in the existing function. Do not add classes, modules, or helper layers. Handle the empty case with a guard clause at the top of the function that returns early, so the main logic below stays unchanged and easy to follow. Use clear names and at most one short comment explaining why the guard exists. Error handling: On an empty list, the function should return ✏️[EMPTY-LIST RETURN VALUE]. Do not use a broad try/except to hide the crash. Fix the root cause by checking the input explicitly. If the function is called with None or a non-list, let Python's normal exception surface rather than masking it. Edge cases: Verify behavior for an empty list, a single-element list, and a normal multi-element list. Confirm that results for non-empty inputs are identical to the original behavior. Testability: Add 3-5 simple assert-based checks (or pytest functions if pytest is already used) covering the cases above. Keep them in the same file under an `if __name__ == "__main__":` block or in a small test file. Performance: Keep the original time complexity. The guard clause should add only a constant-time check, with no extra passes over the data and no copying of the list. Output: First give a 2-3 sentence explanation of the root cause, then the corrected function, then the checks. Do not change the function signature. Negative prompt / avoid: wrapping the whole function in try/except; bare `except:`; silently swallowing errors; refactoring into classes or multiple modules; adding dependencies; changing the signature or return type for non-empty inputs; over-engineered input validation; rewriting working logic that isn't part of the bug. ──────────────────── ℹ️ "This tool compares architectural strategies and expands the best-fit one into a prompt for an AI coding assistant — it doesn't write, execute, or debug code itself, verify security or license compliance, or guarantee the assistant will follow every instruction. Final decisions, including code review and security review before deployment, remain the user's responsibility. Scoring is heuristic pattern-matching, not a measured metric, and may vary slightly between runs." Assumptions made: - ✏️[FUNCTION NAME]: Your brief didn't name the function, so this is left for you to fill in. - ✏️[EMPTY-LIST RETURN VALUE]: Your brief didn't say what the function should return for an empty list (for example 0, None, an empty list, or a raised error), so please confirm the intended behavior. ❓ Want a different direction? Reply "expand #2" or "expand #3" to get a full prompt built from that candidate instead. 💡 Want to take this further? - Not sure your brief is ready? Search "Coding Query Auditor Rewriter" on PromptBase to audit and rewrite your request before comparing directions. - Have a clear brief already and just want one direct prompt? Search "Coding Instruction Generator" for a single-pass generator. - Got a finished prompt and want it reviewed? Search "Coding Instruction Auditor" to check it against a full quality checklist before use. ⚙️ "Built for Claude Sonnet 5; other AI models, providers, and versions are untested. Use at your own discretion. This tool is not intended as a sole safeguard against attempts to alter its behavior, nor as a substitute for code/security review before production use." ---
Claude

Coding Solutions Finder

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-SONNET
Tested icon
Guide icon
4 examples icon
Free credits icon
📊 Describe your coding task in plain language — this tool auto-detects the relevant architecture qualities, compares 3 strategies, and returns a compatibility check plus one fully expanded, ready-to-use prompt for your AI coding assistant. Covers refactors, new features, system design. ⚠️ Not professional software engineering, security, or code-review advice; not liable for outcomes. Verified on Claude Sonnet 5 — other models/versions may work but are untested.
...more
Updated 1 week ago
Report
Browse Marketplace