opencode-workflow/skills/design-patterns/iterator/SKILL.md

16 lines
654 B
Markdown

# Iterator Pattern
## Description
Provide a method to sequentially access elements of an aggregate object without exposing its internal representation.
## Use Cases
Load this skill when you need to solve design problems described by this pattern in your code.
## Guidelines
1. Analyze whether current code structure matches the pattern's intent.
2. Refactor or implement following the pattern's typical structure.
3. Ensure the pattern introduction reduces coupling or improves flexibility.
## Detailed Reference
For more details, diagrams, and code examples: [Iterator Pattern - RefactoringGuru](https://refactoringguru.cn/design-patterns/iterator)