OOPsie keeps syntax simple, so your ideas stay front and center — while the tool handles code scaffolding, relationships, and output behind the scenes.
It’s not flashy — it just works. Sketch with structure, get real output. That’s OOPsie.
You can find a demo usage at assets/demo.mp4.
OOPsie is a lightweight, indentation-based DSL for sketching object-oriented designs. It emphasizes readability and fast structure definition for scaffolding and diagram generation.
- Indentation is strict and uses tabs (not spaces).
- All top-level entries begin at indent level 0.
- Inside classes, structure is defined by increasing indentation:
- Level 0: class names,
functions:
,schema:
- Level 1:
props:
andmethods:
blocks inside a class - Level 2: actual property/method definitions
- Level 3 (optional): method/function body
- Level 0: class names,
ClassName:
— defines a class (inheritance:Child > Parent
)functions:
— declares global functionsschema:
— reserved for future metadata/config
props:
— declares propertiesmethods:
— declares methods Both are indented one level under the class name.
Properties and methods can be declared in various ways:
Properties:
propertyName: type
propertyTypeWithDefault: type = defaultValue
Methods:
methodName
methodNameWithParams(type: param1, type: param2)
methodNameWithParamsAndBody(type: param1, type: param2)
console.log(`do something with any this[prop] or param`)
Example:
props:
health:number = 100
name:string
createdAt: Date
methods:
takeDamage(amount: number)
isAlive
- Types are optional (especially for JS output)
- Types are recommended for UML, conversion to typed languages (e.g., TypeScript, Java, etc.)
You can prefix properties or methods with:
a
— abstracts
— staticp
— private
Example with modifiers:
props:
p health:number = 100
s version:string = "1.0"
methods:
a move(direction: string)
Function or method bodies can be included (indented one level further):
methods:
attack(target: Player)
console.log("Attacking", target.name)
target.health -= 10
OOPsie is not for writing full implementations — it's for fast OOP scaffolding, diagramming, and code generation in multiple target formats (JS, UML, Mermaid, etc.).
🤝 Contributing & Feedback OOPsie is still a work in progress, and I'd love to hear your thoughts!
Whether you want to:
- Suggest syntax improvements
- Add new output formats (like Python, TypeScript, C++, etc.)
- Help with code generation, refactoring, or testing
- Share feedback or criticisms
- Extend the DSL for interfaces, mixins, or design patterns
You're very welcome to join in!
Feel free to:
- Open an issue
- Fork and submit a PR
- Reach out with questions, feature ideas, or just say hi 🙂
Let’s shape this together into something fun and useful for rapid OOP sketching.