playbook/outfitter-agents/plugins/outfitter/templates/skills/multi-file-skill/EXAMPLES.md

5.0 KiB

[YOUR_SKILL_NAME] - Examples

Real-world examples and use cases for [YOUR_SKILL_NAME].

Table of Contents

  1. Basic Examples
  2. Intermediate Examples
  3. Advanced Examples
  4. Integration Examples
  5. Common Scenarios

Basic Examples

Example 1: [Simple Use Case]

Scenario: [Description of the problem this solves]

Solution:

[CODE_EXAMPLE_WITH_DETAILED_COMMENTS]

Output:

[EXPECTED_OUTPUT]

Key Takeaways:

  • [Learning point 1]
  • [Learning point 2]

Example 2: [Another Simple Use Case]

Scenario: [Description]

Solution:

[CODE_EXAMPLE]

Output:

[EXPECTED_OUTPUT]

Intermediate Examples

Example 3: [More Complex Use Case]

Scenario: [Description of a more complex problem]

Step 1: Setup

[SETUP_CODE]

Step 2: Implementation

[IMPLEMENTATION_CODE]

Step 3: Usage

[USAGE_CODE]

Complete Example:

[FULL_CODE_WITH_COMMENTS]

Explanation:

  1. [Explanation of step 1]
  2. [Explanation of step 2]
  3. [Explanation of step 3]

Output:

[EXPECTED_OUTPUT]

Example 4: [Error Handling Example]

Scenario: [Description including potential errors]

Solution:

[CODE_WITH_ERROR_HANDLING]

Testing the Error Handling:

[TEST_CODE_FOR_ERRORS]

Key Points:

  • [Error handling insight 1]
  • [Error handling insight 2]

Advanced Examples

Example 5: [Complex Real-World Scenario]

Scenario: [Detailed description of a production use case]

Architecture Overview:

[ASCII_DIAGRAM_OR_DESCRIPTION]

Implementation:

File 1: [filename]

[CODE_FOR_FILE_1]

File 2: [filename]

[CODE_FOR_FILE_2]

File 3: [filename]

[CODE_FOR_FILE_3]

Configuration: [config-file]

[CONFIGURATION]

Running the Example:

[COMMANDS_TO_RUN]

Expected Behavior: [Detailed description of what should happen]

Trade-offs and Considerations:

  • Advantages: [List]
  • ⚠️ Considerations: [List]
  • 🔧 Customization Options: [List]

Example 6: [Performance-Optimized Example]

Scenario: [Description of performance-critical use case]

Naive Implementation (slower):

[NAIVE_CODE]

Performance: [Benchmark]

Optimized Implementation (faster):

[OPTIMIZED_CODE]

Performance: [Benchmark]

Explanation of Optimizations:

  1. [Optimization 1 and why it helps]
  2. [Optimization 2 and why it helps]
  3. [Optimization 3 and why it helps]

Integration Examples

Example 7: Integration with [External System 1]

Scenario: [Description of integration need]

Setup:

[SETUP_COMMANDS]

Implementation:

[INTEGRATION_CODE]

Usage:

[USAGE_EXAMPLE]

Testing:

[TEST_CODE]

Example 8: CI/CD Pipeline Integration

Scenario: Automating [task] in CI/CD pipeline

GitHub Actions Workflow:

name: [Workflow Name]

on: [push, pull_request]

jobs:
  [job-name]:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: [Step Name]
        run: |
          [COMMANDS]          

      - name: [Another Step]
        run: |
          [MORE_COMMANDS]          

GitLab CI:

[GITLAB_CI_EXAMPLE]

Common Scenarios

Scenario 1: [Common Problem]

Problem: [Description]

Solution:

[SOLUTION_CODE]

Why This Works: [Explanation]


Scenario 2: [Another Common Problem]

Problem: [Description]

Wrong Approach :

[WRONG_CODE]

Why this is wrong: [Explanation]

Correct Approach :

[CORRECT_CODE]

Why this is better: [Explanation]


Scenario 3: [Migration Example]

Problem: Migrating from [old approach] to [new approach]

Before (old way):

[OLD_CODE]

After (new way):

[NEW_CODE]

Migration Steps:

  1. [Step 1]
  2. [Step 2]
  3. [Step 3]

Benefits:

  • [Benefit 1]
  • [Benefit 2]
  • [Benefit 3]

Quick Reference

Common Patterns Cheat Sheet

// Pattern 1: [Name]
[CODE_SNIPPET]

// Pattern 2: [Name]
[CODE_SNIPPET]

// Pattern 3: [Name]
[CODE_SNIPPET]

Troubleshooting Examples

Issue: [Common error message]

[ERROR_OUTPUT]

Solution: [Fix with code example]

Issue: [Another common error]

[ERROR_OUTPUT]

Solution: [Fix with code example]


Community Examples

Examples from real-world usage:

  1. [Project Name]: [Description and link]
  2. [Project Name]: [Description and link]
  3. [Project Name]: [Description and link]

Contributing Examples

Have a great example? Contribute it by:

  1. [Step 1]
  2. [Step 2]
  3. [Step 3]

[Link to contribution guidelines]