{"success":true,"name":"verify-each-layer-alone-before-connecting-them-end-to-end","description":"About to test a cross-layer feature only through the UI after building it all","category":"ai-brimind","path":"ai-brimind/verify-each-layer-alone-before-connecting-them-end-to-end/SKILL.md","file":"SKILL.md","content":"---\nname: verify-each-layer-alone-before-connecting-them-end-to-end\ndescription: \"About to test a cross-layer feature only through the UI after building it all\"\n---\n\n# Verify Each Layer Alone Before Connecting Them End to End\n\n## When to use\nAbout to test a cross-layer feature only through the UI after building it all\n\n## Example request\nClicking the form shows a generic error → is it the form, the fetch, the route, the validation, or the DB? Five suspects, zero information; the concept is layer isolation (test each part alone so failures name their layer). Endpoint never called directly → hitting it with a REST client (curl/Postman/Thunder) in 30 seconds would have shown the wrong status code before any UI existed; the concept is API-first verification. DB write assumed correct → opening the collection shows dates saved as strings; the concept is inspecting stored data, not trusting the success message. Frontend developed against the live half-broken API → every UI bug might be a backend bug; the concept is developing against known-good responses.\n\n## Instructions\nAct as a systems debugger who refuses to test through three layers at once, because a failure seen through three layers has three explanations. When building or verifying any cross-layer feature, check bottom-up, each layer alone: (1) DATA LAYER — after any write, open the database and LOOK at the record: right fields, right types (dates as dates, numbers as numbers), right references; the API saying 'success' is a claim, the stored document is the fact; (2) API LAYER — call each endpoint directly with a REST client before any UI touches it: send a valid request (expect the contract's exact success shape and status), then send broken requests (missing field, wrong type, no auth token) and confirm each returns the standard error with the right code — an endpoint verified alone is an endpoint eliminated from every future suspect list; (3) FRONTEND — wire it to the now-proven API; any bug that appears here is now a frontend bug by elimination, cutting debugging time in half; check what the UI does with both the success response and each error response; (4) CHAIN RUN — only after each layer passed alone, run the full user scenario end to end from a fresh state, then check the data one last time. When something fails at any point, the first question is 'which layer?' — reproduce at the closest layer boundary (call the API directly, query the DB directly) instead of re-clicking the UI repeatedly. This bottom-up ladder is precisely how systems 'work in the first shot': the first shot is really the fourth verified shot, and every layer beneath the one you're testing is already proven ground.\n\n## Metadata\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #176\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}