ast-visitor-pattern
A skill from the Prisma ORM repository's contributed skills describing when and how to model TypeScript discriminated unions as frozen classes with a visitor, instead of switch statements.
Was der Skill vermittelt
A skill from the Prisma ORM repository's contributed skills describing when and how to model TypeScript discriminated unions as frozen classes with a visitor, instead of switch statements. It applies when a set of variants, such as commands or tree nodes, is dispatched on in two or more places, and only for three or more variants; smaller cases keep a plain union and switch. The agent writes a hidden abstract base class with a kind field, an accept method and a freeze helper, a visitor interface with one method per variant, readonly subclasses and an exported union, and always builds instances with new, since frozen object literals break instanceof and accept.
Funktionen
- Decide when a visitor beats a switch statement
- Write frozen variant classes with an accept method
- Define a visitor interface per union
Überblick
- Herausgeber
- Prisma
- Tool
- Code-Review
Installation
Das Projekt dokumentiert keine Installationsschritte, die wir bestätigen konnten. Zur Anleitung des Projekts
MCP-Server und Skills können Code auf deinem Rechner ausführen und auf deine Daten zugreifen. Prüfe den Quellcode, bevor du etwas installierst.
Details
| Angabe | Wert | Quelle |
|---|---|---|
| Typ | Skill | |
| Tool | Code-Review | |
| Herausgeber | Prisma | Quelle |
| Offizieller Status | In der Dokumentation nicht angegeben | |
| Braucht API-Key oder Anmeldung | In der Dokumentation nicht angegeben | |
| Enthält Skripte | Nein | Quelle |
| Plattformen | In der Dokumentation nicht angegeben | |
| KI-Clients | In der Dokumentation nicht angegeben | |
| Lizenz | Apache-2.0 | Quelle |
| Preis | In der Dokumentation nicht angegeben | |
| Aktivität | Letzter Commit am 11. Nov. 202647.664 GitHub-SterneKeine Download-Daten verfügbar (nicht auf npm oder PyPI) | Quelle |
| Links | Repository Website |
Mehr von Prisma
1 Server · 16 Skills
- prisma-8 (Skill)
- prisma-cli (Skill)
- prisma-client-api (Skill)
- prisma-compute (Skill)
- prisma-driver-adapter-implementation (Skill)
- prisma-mongodb-upgrade (Skill)
Auch zu finden unter: Code-Review
Quellen
- Skill-Datei (SKILL.md)github.com/prisma/orm · Belegt: Enthält Skripte10. Nov. 2026
- GitHub-Repositorygithub.com/prisma/orm · Belegt: Herausgeber, Aktivität, Lizenz11. Nov. 2026
- Ordner im Repository (ast-visitor-pattern)github.com/prisma/orm · Belegt: Enthält Skripte10. Nov. 2026