Why I Built This Agent
As a product designer, I've noticed something that happens all the time: people only design for the perfect user journey (what we call the "happy path").
The happy path is great for testing if your product idea makes sense. But when it's time to actually build your product, you need to think about all the different ways people might use it - including the messy, unexpected ways.
These alternative paths are super important because they:
Make your product work in real-world situations
Can surprise users in a good way by handling tricky scenarios
Help create a solid product experience
I thought: what if I could use AI to help people spot these edge cases before they become problems?
Part 1: Brainstorming with Claude
Starting Out
I began by asking Claude (my go-to AI assistant) to look at some of my designs and suggest edge cases.
It did a pretty good job! It found relevant issues and even pointed out things I hadn't thought about.
Claude's reply:
Looking at this SWR (South Western Railway) train ticket booking app, I'll identify the edge cases that would need consideration from a UX design perspective:
1. **Empty search fields**
- What happens if users attempt to search without entering departure/arrival stations?
- How to handle partial entry (only one station entered)?
2. **Same station selection**
- What if users select the same station for both departure and arrival?
- Should there be a validation or warning?
3. **Non-serviced routes**
- How to handle routes not serviced by SWR trains
- Clear messaging if no direct routes exist between stations
4. **Station name ambiguity**
- How to handle similarly named stations
- Autocomplete/suggestion behavior for partial station names
5. **Date/time selection edge cases**
- Past dates/times selected
- Late night journeys crossing midnight
- Holiday/special schedule dates
- Planned engineering works affecting service
6. **Ticket availability**
- Handling sold-out trains
- Limited seat availability notifications
- First class vs. standard availability differences
7. **User preferences persistence**
- Saving recent/favorite journeys
- Remembering user preferences for return journeys
8. **Accessibility considerations**
- Screen reader compatibility for station input
- Color contrast for visual impairments
- Keyboard navigation for the station swap button
9. **Connection issues**
- Offline mode behavior
- Handling API timeouts when searching
- Data persistence if app closes during booking
10. **Multiple travelers**
- UI adjustments for multiple passengers
- Group booking discounts visibility
- Children/senior citizen ticket options
11. **Return journey handling**
- Single vs. return trip UI differences
- Return date constraints based on departure
12. **Payment failures**
- Graceful error handling
- Session timeout during payment
- Saved payment method errors
13. **Regional/international differences**
- Station naming conventions across regions
- International border crossings if applicable
14. **Device-specific considerations**
- Small screen adaptations
- Landscape mode handling
- Tablet optimization
15. **Recent searches and suggestions**
- How to display and prioritize suggestions
- Clearing search history
This analysis covers the essential edge cases that would need to be addressed to create a robust and user-friendly train ticket booking experience.But there was a problem - unless I showed Claude the entire workflow, it could only give me generic suggestions that weren't specific to product flows.
Changing Direction
So I had a new idea: what if I made a tool that generated edge cases before you even started designing? Users could just type out their planned user flow, and the AI would analyse it.
I asked Claude:
"I want to build an edgecase generator where users can input a user flow diagram and the LLM will analyse it and produce edge cases for the user flow."
Claude helped me figure out different ways users could describe their flows:
USER FLOW: Account Registration
START: Landing Page
STEP 1: Registration Form
Description: User enters their account information
User inputs: Email, password, name, date of birth
System actions: Validates email format and password strength
Possible next steps: Submit form, Cancel
[... and so on] Or a simpler way:
FLOW: Payment Checkout
Cart Review → Shipping Info → Payment Details → Order Confirmation
Details:
- Cart Review: User can edit quantities, remove items, or apply coupon
- Shipping Info: Address entry, shipping method selection
[... and so on] Testing My Idea
Once I was happy with the way users would input their flows, I wanted to focus on the output reports. So I asked Claude to help, again.
And this is the suggestion I got:
The results looked good! This confirmed my concept would work. This is the stage where I would make additions to the report but my goal was to build an agent and I would optimise the results based on user feedback. So I continued ahead.
Creating the Agent Prompt
With Claude's help, I created this prompt for my agent:
You are an Edge Case Generator, an expert system specialized in analyzing user flows to identify potential issues, edge conditions, and failure scenarios.
INSTRUCTIONS:
1. Analyze the provided user flow (described as steps with arrows like "A → B → C" or in a more detailed format).
2. Generate a comprehensive list of edge cases that could occur in this flow, focusing on:
- Navigation issues (e.g., skipping steps, back navigation, deep linking)
- Input validation problems (e.g., empty fields, invalid data, extreme values)
- State management challenges (e.g., session timeouts, concurrent edits)
- Environmental factors (e.g., network failures, device limitations)
- User behavior variations (e.g., interruptions, repeated actions)
[... and more details about formatting and examples] Part 2: Building on Agent.ai
Now I was ready to turn my idea into an actual agent!
Step 1: Setting Up on Agent.ai
First, you'll need to create an account on Agent.ai if you don't have one.
Step 2: Creating a New Agent
Once you've signed in, you can navigate to "Agent Builder" & click on the Create Agent button to start.
I chose the 'Call an LLM' template.
Then gave the agent a name & description before navigating to the 'Actions' tab.
In the 'Actions' tab, you would want to modify each step as follows:
A: Define user input
B: Choose LLM & paste prompt
C: Define an output format (optional)
Step 3: Testing It Out
Before publishing, I tested my agent with a few different user flows to make sure it gave helpful results.
Step 4: Publishing My Agent
When I was happy with the results, I clicked "Publish" to make my agent available for others to use.
To publish publicly, you will need to send it for approval. Takes about a day.
The Results
My agent now takes simple inputs like:
Sign Up → Verify Email → Create Profile → Dashboard And gives back a list of potential problems to watch out for, organised by type, with suggestions on how to fix them.
This helps people:
Spot potential issues early
Build better products from the start
Think beyond the ideal path
Create better tests
Try It Yourself!
Want to use my agent? Here's how:
Sign up for Agent.ai
Search for the Edge Case Generator agent
Type in your user flow
See what edge cases you might need to consider!
If you try my Edge Case Generator, let me know what you think! Did it find issues you hadn't considered?













Edge case is a challenge to deal with indeed! Great that you explored in this area.
Never heard of agent.ai before. How was the experience? Is it different from other common automation tools like Zapier?
I love this so much. Edge cases, etc are such an underutilized necessity in design documentation.