johnnystefan/test-saas-business/pattern-memento
Claude Code and agent skill by johnnystefan/test-saas-business
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Teaches and applies the Memento behavioral design pattern — capturing and externalizing an object's internal state without violating encapsulation, enabling state restoration. Trigger: When implementing undo/redo, snapshots, or state history features.
Install
npx vskill@latest install johnnystefan/test-saas-business/pattern-mementoSKILL.md
The same SKILL.md was published earlier as johnnystefan/test-saas-business/pattern-memento.
Skill: Implement Memento Pattern
Purpose
Captures and externalizes an object's internal state without violating encapsulation, so the object can be restored to this state later.
Procedural Instructions
- Define Originator: The class whose state needs saving. It creates mementos and uses them to restore itself.
- Define Memento: A value object that stores the Originator's state. It should be immutable.
- Define Caretaker: Responsible for keeping track of the mementos (history) but never modifies them.
- Encapsulation Strategy: Use nested classes (if supported) or restricted interfaces to keep the state private from the Caretaker.
TypeScript Example
Payoff
- Safety: Allows producing snapshots of an object's state without violating its encapsulation.
- Clean Originator: Offloads history management to the Caretaker.
Security
- Security scanPassed, 100 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-memento/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-memento)