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

Prompt Details

Model
(claude-5-sonnet)
Token size
2,152
Example input
[TASK]: Add validation so a legacy customer form cannot save an empty phone number. [ADDITIONAL_CONTEXT]: ASP.NET WebForms application. The page already validates other required fields inside the existing Save button handler.
Example output
1. Recommended approach Add a check for an empty phone number inside the Save button handler where the form's other required-field validations already run — this location is a fact established directly by the user (Confirmed). The new check should follow whatever validation approach the existing required-field checks in that handler already use, rather than introducing a different or new validation style. The concrete mechanism (a validator control, an inline conditional, or something else) has not been provided or observed, so it is not specified here. 2. Files/components affected The legacy customer form's Save button handler — logical location only, Confirmed per the user-provided context (ASP.NET WebForms page; the handler already validates other required fields). The specific file name, class name, and method name are Needs context, since none were provided or observed. Responsibility of the change: prevent the save from proceeding when the phone number is empty. Why it must change: it is the confirmed location where the equivalent behavior for other required fields already exists. The form's markup, only if the existing required-field validations are implemented through markup-declared controls rather than entirely in code-behind. Whether this applies is Needs context — no information about how the sibling validations are implemented was provided or observed. No claim is made that these are the only files affected; that would require inspecting the actual handler and page, which has not been done. 3. Existing code to reuse The validation approach already used by the sibling required-field checks in the Save handler should be reused for the phone number field. The concrete implementation of this approach (method, control type, or pattern) is Needs context, since it was not provided or observed. The mechanism already used to report a validation failure to the user on this page (however it works) should also be reused rather than introduced anew. Its concrete form is Needs context. No concrete reusable artifact (method name, control name, class name) can be listed, since none was provided or observed. Stating that "nothing exists to reuse" would also be unsupported without inspection — the correct statement is that reusable behavior likely exists (per the Confirmed fact that sibling validation already runs in this handler), but its concrete form is unverified. 4. Minimal implementation steps Inspect the Save button handler to determine exactly how the existing required-field validations are implemented and how validation failures are reported to the user. Identify the specific field/control holding the phone number value. Add one additional check for the phone number, matching the style and failure-reporting mechanism found in step 1. Position the new check so it runs before the save/persist step, in the same manner as the existing required-field checks, so an empty phone number blocks the save the same way other missing required fields already do. Do not alter the order, logic, wording, or presentation of the existing checks. 5. Why this is the minimal-impact solution The change is confined to one additional condition within a location the user has already confirmed contains equivalent behavior, rather than introducing a new validation path. No new abstraction, helper, or dependency is proposed; the plan explicitly defers to whatever mechanism the repository already uses for sibling required fields. No files, renames, or unrelated formatting are touched. The proposal does not resolve the ambiguity in what "empty" means (e.g., whitespace-only) by assumption; it defers that determination to the existing convention already established by the sibling checks, which must be inspected before implementation. 6. Risks and edge cases Confirmed: The Save handler already validates other required fields (per the user-provided context). Needs context: The exact rule the sibling required-field checks use for "empty" (null/empty only vs. also whitespace) — must be inspected, not assumed, before implementation. Needs context: Whether the phone number field currently has any existing validation, and whether it has a server-side reference usable for a check. Needs context: Whether any other code path (e.g., a separate submission path, or reuse of this form elsewhere) also needs the equivalent check to avoid inconsistent enforcement. Needs context: Whether the phone number value is used downstream in a way that depends on its current (possibly empty) state — this has not been inspected, so no claim about downstream impact can be made either way. 7. Decisions requiring approval Needs context: The precise definition of "empty" to enforce, to be confirmed against the actual convention used by the sibling required-field checks before implementation. Needs context: Whether the existing required-field validation in this handler is implemented in a way that the new check can directly follow, or whether it requires a different approach — to be confirmed by inspection. If inspection shows these can be resolved by directly mirroring the existing pattern with no scope expansion, no additional architectural decision is required beyond confirming the two items above. 8. Implementation status No code changes applied. Awaiting explicit approval to implement.
🌀 Claude

Kiss Legacy Change Planner Webforms

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
Creates KISS, minimal-impact implementation proposals for existing and legacy codebases. It prioritizes repository-native patterns, reuse of existing code, small reviewable diffs, and preservation of legacy behavior and comments. Avoids unnecessary refactors, helpers, abstractions, dependencies and modernization. Designed to plan the safest change before any code is modified.
...more
Added 2 weeks ago
Report
Browse Marketplace