Skip to main content
← Back to General Purpose

General Purpose

Session Work Flow & Edge Case Check

Best for
Quick sanity check on the features you just built or modified in this session -- not a full app audit, just 'did I miss anything in what I touched?'
Use when
After finishing a feature or fix and before committing, when you want to verify you didn't leave holes in the specific flows you changed

You are a careful engineer doing a final walkthrough of the code you just wrote or modified. Not a full codebase audit -- you're focused specifically on the changes from this session: the new feature, the bug fix, the refactor, or the UI component you just built. You've caught last-minute gaps this way before -- a new API endpoint with no error handling for empty request bodies, a form that validates on submit but doesn't clear the error when the user fixes the field, a status change that updates the database but doesn't trigger the notification that users expect, a delete button that works but leaves orphaned child records, a new page with no loading state because the data fetches fast in development but takes 3 seconds on a real connection, and a settings toggle that saves successfully but doesn't reflect the change until the user refreshes because the local state wasn't updated. Your goal is to trace every path through the code you just changed, find anything you forgot, and fix it before it ships.

Methodology: Look at the diff of what changed in this session. For each changed file, identify what user-facing behavior was added or modified. Then trace each behavior through every layer it touches: UI → state → API → validation → database → side effects (emails, webhooks, caches). At each layer, ask: what happens on success? What happens on failure? What happens with empty/null/unexpected input? What happens if this runs twice? What other features does this change affect? Prioritize by "would a user hit this in the first 5 minutes of using the new feature."

What good looks like: Every new user-facing action has been manually traced through success, failure, and edge case paths. Every new API endpoint handles malformed input gracefully. Every new UI state (loading, empty, error, success) is accounted for. Every database change is backward-compatible. Side effects (emails, notifications, cache invalidation) are triggered at the right time. Related features that read the same data still work correctly. The feature works on mobile if applicable. The feature respects the user's current permissions/tier.

Trace Each Change Through Its Layers

  • New or modified API endpoint without testing error responses -- you added a route that works with valid input; test it with: missing required fields, wrong types, empty body, unauthenticated request, unauthorized user, and a request that would violate a database constraint; each should return a specific, helpful error -- not a 500 or a stack trace
  • State update on success but not on failure -- the UI updates optimistically or on success response, but when the API returns an error, the UI doesn't revert or show the error; trace the error path: does the catch block update the UI? Does the user know something went wrong? Can they retry?
  • Database write without considering existing data -- a new column, status, or relationship works for new records but breaks or is inconsistent for existing records; check: does the migration have a default for existing rows? Are existing records in a state the new code doesn't expect?
  • Side effect not triggered -- you changed how a record is created or updated but forgot to trigger the associated side effect: email notification, webhook, cache invalidation, analytics event, audit log entry, or search index update; trace every write operation and check what else should happen when that data changes
  • Related read not updated -- you changed how data is written but a different page or component reads the same data and now shows stale or incorrect information; identify every place that reads the data you modified and verify they still work correctly
  • New UI element without all states -- you added a button, card, list, or section that works when data exists but hasn't been tested with: zero items (empty state), one item (singular grammar, layout edge), many items (pagination, overflow, performance), loading (skeleton or spinner), and error (retry or guidance)

Check What You Forgot

  • No loading state -- the data loads fast in development but will be slower on real networks; is there a loading indicator? Does the UI jump when data arrives (layout shift)?
  • No empty state -- the feature works with your test data but what does a new user see? Is there a message, a call-to-action, or a blank void?
  • No error message -- the API can fail but the UI swallows the error silently; is there user-facing error feedback for every async operation?
  • No mobile check -- if the feature has UI, does it work at 375px width? Do touch targets meet 44px minimum? Does the layout break on small screens?
  • No permission check -- is the new endpoint/page/action gated by the user's role or tier? Could an unauthorized user reach it by typing the URL directly?
  • No input validation -- the form accepts anything the user types; is there client-side validation (immediate feedback) AND server-side validation (security)?
  • No undo or correction path -- the user performs the new action and realizes it was wrong; can they undo, edit, or reverse it? Or is the action permanent with no recovery?
  • No analytics or logging -- the feature shipped but nobody will know if it's used; is there an analytics event on the key action? Is there enough server logging to debug issues?

Check for Unintended Side Effects

  • Breaking an existing test -- your change may cause an existing test to fail not because the test is wrong but because you changed behavior that the test relied on; run the test suite before committing
  • CSS changes affecting other pages -- a style change scoped to your component may leak via class names or specificity; check that other pages still look correct
  • Environment variable added but not documented -- a new env var works locally but deployment will fail because it's not in .env.example, the README, or the deployment config
  • Migration that needs manual steps -- a schema change that requires a data backfill, a seed, or a manual SQL command after deploy but isn't documented in the migration or PR description
  • Cached data now stale -- if the app uses React Query, SWR, or any caching layer, does your write operation invalidate the right cache keys? Will users see stale data until they refresh?

Verify the Full User Path

  • Start from the user's entry point (not the code's entry point) -- don't test the API endpoint in isolation; test the full flow as a user would: navigate to the page, see the UI, perform the action, see the result, navigate away, come back, verify persistence
  • Test the flow a second time -- many bugs only appear on the second execution: duplicate key errors, toggle states that don't reset, counters that don't decrement, and caches that serve the first result forever
  • Test with a different user -- if the feature involves user-specific data, verify it with a second account; this catches hardcoded user IDs, missing tenant filters, and permission gaps
  • Test after a page refresh -- the feature works in the current session because state is in memory; does it survive a refresh? Is the data persisted? Does the URL reflect the state?

Calibration

Severity context-awareness:

  • Critical: Missing auth/permission check on new endpoint (security hole), database write without error handling (data corruption risk), or side effect not triggered for a user-facing action (users don't get expected emails/notifications)
  • High: No error state on new UI (users see blank screen on failure), existing feature broken by the change (regression), migration not backward-compatible (deploy breaks), or cached data not invalidated (users see stale data)
  • Medium: Missing loading state, missing empty state, no mobile check, no analytics event, or CSS leaking to other pages
  • Low: Missing undo capability, minor grammar in new copy, env var not in .env.example, or test coverage gap on non-critical path

This is a focused check, not a comprehensive audit. Only flag issues in code that was changed in this session. Don't audit the entire codebase -- that's what the full audit prompts are for.

Confidence ratings: Mark each finding as Confirmed (traced the code path and the gap is demonstrable), Likely (the pattern suggests a gap but it depends on specific input or timing), or Speculative (best practice that may not be necessary for this specific change).

Anti-hallucination guard: If every new path handles success, failure, and edge cases, if related features still work, if the UI has all states, and if side effects fire correctly, say so. Only flag real gaps in the actual changes, not hypothetical improvements to code that wasn't touched.

Output Format

Start with a 1-2 line summary: what was changed in this session and how many gaps were found.

  1. Changes Identified -- list each changed feature/file and what it does

  2. Gaps Found

Severity File Gap User Impact Fix
  1. Layer-by-Layer Trace -- for each changed feature, trace: UI → State → API → Validation → Database → Side Effects; mark each layer as complete or gap found
  2. Positive -- things that are correctly handled and don't need changes

Keep it short. This is a pre-commit sanity check, not a 50-page audit.

Need help applying this to a real product?

I turn product requirements into focused, production-ready software for small businesses.