johnnystefan/test-saas-business/pattern-visitor
Claude Code and agent skill by johnnystefan/test-saas-business
- community
Checking that the SKILL.md file is still in the repository.
Teaches and applies the Visitor behavioral design pattern — separating an algorithm from the object structure it operates on, enabling new operations without modifying existing classes. Trigger: When adding operations to a stable class hierarchy without modifying those classes.
Install
npx vskill@latest install johnnystefan/test-saas-business/pattern-visitorSKILL.md
The same SKILL.md was published earlier as johnnystefan/test-saas-business/pattern-visitor.
Skill: Implement Visitor Pattern
Purpose
Separates an algorithm from the object structure on which it operates, allowing you to add new operations to existing object structures without modifying them.
Procedural Instructions
- Declare Visitor Interface: Define a "visit" method for each class in the object structure.
- Declare Element Interface: Add an
accept(visitor)method to the base of the object structure. - Implement Accept in Elements: Each concrete class calls the visitor method corresponding to its own class (
Double Dispatch). - Implement Concrete Visitors: Create a class for each new operation that needs to be performed across the object structure.
TypeScript Example
Payoff
- OCP: Add new behaviors that work with objects of different classes without changing those classes.
- SRP: Moves multiple versions of the same behavior into a single Visitor class.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/design-patterns/behaviorals/pattern-visitor/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/johnnystefan/test-saas-business/pattern-visitor)