| name | object-oriented |
| description | Convert files to object-oriented programming style with optional NLP instructions. |
| argument-hint | <files> [instructions] |
| user-invocable | true |
| disable-model-invocation | true |
Object-Oriented Programming Conversion
Convert the specified files to an object-oriented programming style, appropriate to the language of each file.
Files and instructions: $ARGUMENTS
Core principles to apply
- Encapsulation: group related data and behaviour into classes or objects, hiding internal state behind well-defined interfaces
- Single responsibility: each class should have one clear purpose and reason to change
- Composition over inheritance: prefer composing objects from smaller, focused components rather than deep inheritance hierarchies
- Polymorphism: use interfaces, abstract classes, or protocols to define shared behaviour across different types
- Abstraction: expose only what consumers need, keep implementation details private
- Cohesion: keep related fields and methods together within the same class or module
How to interpret arguments
The arguments are free-form and flexible. They may contain:
- File references of any type and in any format:
@file.ts, file.py, main.go, utils.go, script.sh handler.rb
- Additional natural language instructions alongside file references, such as:
- "and also convert the files imported by the specified file"
- "focus only on the data processing logic"
- "keep the existing function signatures as public methods"
Parse the arguments to identify which files to convert and what additional instructions apply. When additional instructions reference related files (e.g. imports, dependents), follow those instructions to identify and convert those files as well.
Examples
/object-oriented@service.ts @handler.ts — convert these two files
/object-orientedutils.py, helpers.py — comma-separated, no @ prefix
/object-oriented@app.go and also convert the files it imports — convert with extended scope
/object-oriented@processor.rb focus only on the data transformation methods — convert with targeted instructions
How to proceed
- Read each specified file to understand its current structure and language
- If the user included additional instructions (e.g. "also convert imported files"), follow them to identify further files
- For each file, apply the object-oriented principles above using idiomatic constructs for that file's language
- Preserve the existing functionality — the conversion should not change what the code does, only how it is structured
- Respect the repository's coding style rules while making the conversion