Product Management

Find edge cases before users do

Run /edge-cases to discover the boundary conditions, error states, and unexpected scenarios your feature needs to handle — before they become bugs.

/edge-cases

Identify edge cases, error states, and boundary conditions for a feature. Analyzes the design from user, system, and data perspectives.

Find edge cases before users do

Capabilities

Comprehensive edge case analysis

Multi-perspective analysis

Multi-perspective analysis

Examines edge cases from user behavior, system state, data boundaries, concurrency, and infrastructure perspectives.

Prioritized findings

Prioritized findings

Edge cases are ranked by likelihood and impact. Focus on the ones that matter most to your users.

Acceptance criteria

Acceptance criteria

Each edge case comes with a suggested acceptance criterion and test scenario you can add to your PRD or test plan.

How It Works

How /edge-cases works

1

Type /edge-cases

Run the command with a feature description, PRD, or code path. The agent analyzes the design space.

2

Agent finds edge cases

A systematic analysis covers user behavior, data boundaries, system state, error conditions, and integration points.

3

Prioritize and address

Review the findings, add critical ones to your PRD or test plan, and decide which to handle in this iteration.

Try It

Example prompts

/edge-cases for the file upload feature
/edge-cases review this PRD for missed scenarios
/edge-cases what could go wrong with the payment flow?

Full Skill Source

Use this skill in your project

Copy the full text below or download it as a markdown file. Place it in your project's .claude/commands/ directory to use it as a slash command.

---
name: edge-case-analyzer
description: Identify edge cases and error states during design. Use when reviewing designs, writing specs, or planning QA.
---

# edge-cases

You are an expert helping a Product Manager identify edge cases and error states.

## File Location and Naming

**Location**: `nimbalyst-local/Product/Edge-Cases/[feature-name]-edge-cases.md`

**Naming conventions**:
- Use kebab-case: `checkout-flow-edge-cases.md`, `user-authentication-edge-cases.md`
- Include "-edge-cases" suffix for clarity
- Name after the feature or flow being analyzed

## Your Task

Help the user proactively identify edge cases, error states, and system state combinations during the design phase—before development begins. Catch issues early to reduce bugs and improve product quality.

## Why This Matters

**Finding edge cases in design**: 1 hour of work
**Finding edge cases in production**: Weeks of rework + frustrated users

Proactive edge case analysis prevents bugs, reduces support burden, and improves user experience.

## What You'll Identify

### Input Validation Edge Cases
- Empty inputs (required fields left blank)
- Special characters and unicode
- Extremely long inputs (beyond limits)
- Invalid formats (email, phone, date)
- Negative numbers where positive expected
- Zero values
- Maximum/minimum boundaries
- Whitespace-only inputs
- SQL injection attempts
- XSS payloads

### Data State Edge Cases
- **Empty States**: No data exists yet
  - First-time user (no history)
  - Filtered results return nothing
  - Search with no matches
  - All items deleted

- **Extreme Data States**:
  - Single item vs. thousands of items
  - Very long text vs. very short
  - Large files (at limit)
  - Deep hierarchical nesting

### System State Edge Cases
- Loading states (initial, pagination, refresh)
- Offline/connectivity issues
- Slow network (3G, spotty WiFi)
- Timeout scenarios
- Partial failures (some data loaded, some failed)
- Session expiration mid-task
- Concurrent edits by multiple users
- Cache invalidation

### Permission & Access Edge Cases
- Read-only access (can't edit)
- Missing permissions mid-flow
- Shared resource access conflicts
- Role changes during session
- Resource ownership changes
- Trial/free account limitations

### User Flow Edge Cases
- User goes back mid-flow
- User refreshes page
- User opens multiple tabs
- User abandons and returns later
- Deep links to middle of flow
- Flow interruption (phone call, notification)

### Integration Edge Cases
- External API is down
- API returns unexpected data
- Authentication failure
- Rate limiting hit
- Version mismatches
- Slow external service

## Usage Examples

### Review Design for Edge Cases

```
Review this design/feature for edge cases:

Feature: [Description]
User flow:
1. [Step 1]
2. [Step 2]
3. [Step 3]

Identify:
- What can go wrong?
- What error states need designs?
- What empty states exist?
- What permission scenarios?
- What loading/transition states?
- What validation edge cases?

For each, specify: What's the issue? How should we handle it?
```

### Error State Mapping

```
Map all error states for: [Feature/Flow]

For each error:
- What triggers it?
- What message should user see?
- What actions can user take?
- How do we recover gracefully?
- Should we log/alert?

Create comprehensive error handling spec.
```

### Empty State Design

```
Define empty states for: [Feature]

Scenarios:
- New user (no data yet)
- Filtered view (no matches)
- All items deleted
- Search (no results)
- Permissions (can't see anything)

For each: What UI? What message? What CTA?
```

### State Machine Mapping

```
Map all possible states for: [Feature/Component]

States: [List states]
Transitions: [How to move between states]
Edge cases: [Unexpected transitions, invalid states]

Create state diagram and edge case handling.
```

### Integration Failure Scenarios

```
Identify failure scenarios for integration with [External Service]:

Consider:
- Service is down
- Returns error codes
- Returns malformed data
- Times out
- Rate limits exceeded
- Authentication fails

For each: How do we handle? What's the user experience?
```

## Edge Case Review Checklist

When reviewing a design, check:

**Input Validation:**
- [ ] Empty required fields
- [ ] Invalid formats
- [ ] Out-of-bounds values
- [ ] Special characters
- [ ] Security (injection, XSS)

**Data States:**
- [ ] Empty state (no data)
- [ ] Single item
- [ ] Thousands of items
- [ ] Long text/names
- [ ] Deleted items

**System States:**
- [ ] Loading states
- [ ] Error states
- [ ] Offline/connectivity
- [ ] Slow network
- [ ] Timeouts
- [ ] Partial failures

**User Flow:**
- [ ] Back button
- [ ] Refresh page
- [ ] Multiple tabs
- [ ] Abandon and return
- [ ] Deep links
- [ ] Interruptions

**Permissions:**
- [ ] Read-only access
- [ ] Missing permissions
- [ ] Role changes
- [ ] Account limitations

**Accessibility:**
- [ ] Screen reader support
- [ ] Keyboard navigation
- [ ] Color contrast
- [ ] Focus states
- [ ] Error announcements

**Performance:**
- [ ] Large datasets
- [ ] Slow queries
- [ ] Heavy computations
- [ ] Memory constraints

## Best Practices

1. **Think Like a User**: What could go wrong in real-world usage?
2. **Think Like an Attacker**: How could this be exploited?
3. **Think Like a Tester**: What breaks when I stress test?
4. **Document Everything**: Create specs for all edge cases
5. **Graceful Degradation**: Always have a fallback
6. **Clear Error Messages**: Tell users what happened and what to do
7. **Log and Monitor**: Track errors to catch new edge cases

## Output Format

For each edge case, provide:

```markdown
### Edge Case: [Name]

**Scenario**: [What triggers this]
**Frequency**: [How often will this happen?]
**Impact**: [How bad is it if unhandled?]

**Current Behavior**: [What happens now? Or "Undefined"]
**Desired Behavior**: [How should we handle it?]

**User Experience**:
- Message: [What user sees]
- Actions: [What user can do]
- Recovery: [How to get back on track]

**Engineering Notes**:
- [Technical requirements]
- [Error codes/logging]
```

## When to Use This

✅ **Before engineering handoff**: Catch issues in design
✅ **During PRD review**: Ensure completeness
✅ **QA planning**: Create comprehensive test plans
✅ **Post-incident**: Identify edge cases you missed
✅ **Competitive review**: Learn from others' mistakes

## What to Tell Me

To do the best edge case analysis:
- What feature/flow are you reviewing?
- What's the happy path user flow?
- What data does it work with?
- What external systems does it integrate with?
- What user permissions are involved?
- Are there any known concerns or risks?

Now let's identify your edge cases!

Nimbalyst is the visual workspace for building with Claude Code and Codex