add_field
Add a class field or attribute at the top of a class body following fields-before-methods convention. Use to insert class attributes in Python, fields in JavaScript/TypeScript, or member variables in C++.
Instructions
Add a field/attribute/member at the top of a class body (fields-before-methods convention).
Use this when: You're adding a class attribute (Python), class field (JS/TS),
or member variable (C++).
Don't use this when: You're adding a method -> use add_method.
Example: class_target="LRUCache" content=' version = "1.0"'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| class_target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |