{"success":true,"name":"new-data-travels-a-full-pipeline-wire-every-field-through-al","description":"Adding a new field or piece of data to an existing feature","category":"ai-brimind","path":"ai-brimind/new-data-travels-a-full-pipeline-wire-every-field-through-al/SKILL.md","file":"SKILL.md","content":"---\nname: new-data-travels-a-full-pipeline-wire-every-field-through-al\ndescription: \"Adding a new field or piece of data to an existing feature\"\n---\n\n# New Data Travels a Full Pipeline: Wire Every Field Through All Layers or It Silently Doesn't Exist\n\n## When to use\nYou are adding a field (phone, notes, discount) to an existing entity, and the plan covers one or two layers, not the whole path from DB to screen and back.\n\n## Example request\nField added to the Mongoose schema and the form → but the endpoint's validation whitelist rejects it, or the response projection omits it; the user types it, saves, reloads — gone; a field is only real when EVERY station on its pipeline passes it. The classic silent chain: form input → request body → border validation → service → schema → DB → query projection → API response → frontend state → display; a field dropped at ANY station vanishes without error. Saved fine but never displays → the write path was wired, the read path was not; the pipeline has two directions and both need walking. A field only ever computed and shown, never stored → shorter pipeline on purpose; the discipline is knowing WHICH stations your field must pass, then checking each.\n\n## Instructions\nAct as a rail inspector for data: every field in your app travels a fixed line of stations — form input, request payload, border validation, service logic, schema, database, query projection, response shaping, frontend state, render — and 'adding a field' means granting it passage through EVERY station on its route, because any single station that doesn't know about it will drop it silently: no error, no log, just a value that types in and never comes back, which is among the most common and most confusing full-stack bugs a junior meets. When adding any field, do this: (1) Write the field's route first: does it go user→DB (editable), DB→user (displayed), or both? List the stations on that route for YOUR stack — in a Next.js/Mongoose app typically: form state, submit payload, endpoint validation schema, service function, Mongoose schema, (migration for existing records, per your migration discipline), query select/projection, response shape, frontend rendering — and treat the list as a checklist, not an intuition. (2) Wire the stations in dependency order per your safe-ordering discipline: schema and migration first, then backend validation and response, then frontend — and remember the stations that REJECT unknowns are the sneakiest droppers: a validation whitelist, a response projection, a toPublicUser mapper — the very mechanisms your other disciplines rightly installed are the ones that must be explicitly told about the newcomer; safety layers filter by default, that is their job. (3) Update the contract as you pass the API station per your contract discipline — the new field appears in the written request/response examples, so the next session doesn't rediscover it by debugging. (4) Verify with the round-trip test, both directions: enter a value in the UI, save, hard-reload, see it again (write path proven), and check it in the DB directly once (no station silently transformed it); for display-only fields, seed a value in the DB and confirm it reaches the screen. (5) When a field 'doesn't save', debug it AS a pipeline per your hop-testing discipline: check the request payload in the network tab, then what validation passed, then what hit the DB — the station where the value disappears is the culprit, and it is found by walking, not guessing. Only call the field added when the round trip passes — a field that exists in three of nine stations doesn't partially exist; to the user, it doesn't exist at all.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #249\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}