# Examples: [Skill Domain]

Real-world examples demonstrating [Skill Name] in practice.

---

## Example 1: Basic Usage

**Scenario**: [Describe a simple, common scenario]

[Additional context or problem statement]

**Code**:
```python
# Basic implementation
code_example_here()
```

**Expected Output**:
```
expected output or result
```

**Explanation**:
- What the code does
- Why this approach works
- Key concepts demonstrated

**Related Concept**: See [SKILL.md](SKILL.md) section "[Related Section]"

---

## Example 2: Intermediate Pattern

**Scenario**: [Describe a more complex scenario]

[Context about when this pattern is useful]

**Code**:
```python
# Intermediate implementation with error handling
code_example_with_patterns()
```

**Expected Output**:
```
expected output here
```

**Key Points**:
- Pattern 1 from main Skill
- Pattern 2 from main Skill
- Error handling strategy

**Variations**:
- How to modify for similar use case 1
- How to modify for similar use case 2

**Related Concept**: See [SKILL.md](SKILL.md) section "[Related Section]"

---

## Example 3: Advanced Use Case

**Scenario**: [Describe a complex, less common scenario]

[Problem statement and why this is challenging]

**Code**:
```python
# Advanced implementation combining multiple patterns
advanced_implementation()
```

**Expected Output**:
```
expected output or results
```

**Why This Works**:
- How principles from [SKILL.md](SKILL.md) apply
- Why this approach is optimal for this scenario
- Performance considerations

**Edge Cases Handled**:
- Edge case 1 and how it's handled
- Edge case 2 and how it's handled
- Edge case 3 and how it's handled

**Performance**:
- Time complexity: O(...)
- Space complexity: O(...)
- Optimization techniques used

**Related Concept**: See [SKILL.md](SKILL.md) section "[Related Section]"

---

## Example 4: Edge Case / Error Handling

**Scenario**: [Describe an unusual or error scenario]

[Why this edge case matters]

**Problem Code** (What NOT to do):
```python
# This approach fails in certain conditions
bad_approach()
# ❌ Problem: [What goes wrong]
```

**Solution Code**:
```python
# Proper error handling
correct_approach()
# ✅ Why this works: [Explanation]
```

**Input**:
```
test_input_here
```

**Output**:
```
expected_output_here
```

**Key Takeaway**: [Learning point from this example]

**Related Concept**: See [SKILL.md](SKILL.md) section "[Anti-patterns]"

---

## Common Patterns Demonstrated

### Pattern 1: [Pattern Name]

Used in: Example 1, Example 2

Description: [Explain what this pattern accomplishes]

Quick reference:
```
Pattern pseudocode or key steps
```

### Pattern 2: [Pattern Name]

Used in: Example 2, Example 3

Description: [Explain what this pattern accomplishes]

Quick reference:
```
Pattern pseudocode or key steps
```

### Pattern 3: [Pattern Name]

Used in: Example 3, Example 4

Description: [Explain what this pattern accomplishes]

Quick reference:
```
Pattern pseudocode or key steps
```

---

## Troubleshooting Common Issues

### Issue 1: [Common Problem]

**Symptoms**: [What the user observes]

**Root Cause**: [Why it happens]

**Solution**:
```python
# Fixed approach
solution_code()
```

**Reference**: See Example [X] for similar scenario

### Issue 2: [Common Problem]

**Symptoms**: [What the user observes]

**Root Cause**: [Why it happens]

**Solution**:
```python
# Fixed approach
solution_code()
```

**Reference**: See [reference.md](reference.md) for details

---

## Quick Reference by Use Case

| Use Case | Best Example | Pattern | Key Concept |
|----------|--------------|---------|-------------|
| Getting started | Example 1 | Basic Pattern | Fundamentals |
| Production use | Example 2 | Standard Pattern | Best practices |
| Complex scenario | Example 3 | Advanced Pattern | Optimization |
| Error handling | Example 4 | Error Pattern | Robustness |

---

## Testing Examples

Each example includes test cases to verify correctness:

### Example 1 Tests

```python
def test_example_1_basic():
    result = basic_function()
    assert result == expected_value

def test_example_1_with_input():
    result = basic_function("input")
    assert result == expected_value
```

### Example 2 Tests

```python
def test_example_2_intermediate():
    result = intermediate_function()
    assert result.valid == True

def test_example_2_error_handling():
    with pytest.raises(ValueError):
        intermediate_function(bad_input)
```

---

## Performance Benchmarks

| Example | Input Size | Time | Memory | Notes |
|---------|-----------|------|--------|-------|
| Example 1 | 100 items | 10ms | 1MB | Basic |
| Example 2 | 1K items | 50ms | 5MB | Optimized |
| Example 3 | 10K items | 200ms | 20MB | Advanced |
| Example 4 | Edge case | 5ms | 0.5MB | Error handling |

---

## Next Steps

After reviewing these examples:

1. **Understand the basics**: Start with Example 1
2. **Learn patterns**: Study Examples 2-3
3. **Handle edge cases**: Review Example 4
4. **Reference detailed docs**: See [SKILL.md](SKILL.md) and [reference.md](reference.md)
5. **Run your own tests**: Modify examples for your use case

---

## Related Resources

- [SKILL.md](SKILL.md) — Main framework and concepts
- [reference.md](reference.md) — Detailed API and configuration reference
- `scripts/` — Automated tools and utilities
- `templates/` — Reusable code templates

---

## Version & Updates

**Version**: 0.1.0
**Last Updated**: 2025-10-22
**Framework**: MoAI-ADK + Claude Code Skills

### Example History

- v0.1.0: Initial examples added
