insert_symbol
Add a new function, method, or class next to an existing symbol, anchored by name so batch edits survive line changes and new code matches neighbours.
Instructions
Add a new function, method or class next to an existing one. Classes are addressable, so a class is a valid anchor and a valid thing to insert. Anchoring to a symbol rather than a line number is what makes this usable in a batch: the anchor does not move when everything above it changes. The anchor is also shown to the worker as a style reference, so the new code matches its neighbours.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anchor | Yes | Existing symbol to position against. 'Class::method' when ambiguous. | |
| context | No | ||
| position | Yes | Anchored to a class, 'end_of_class' appends a member to that class — the direct way to add a method to it. Anchored to a member, it appends to the class the member belongs to. | |
| file_path | Yes | ||
| instruction | Yes | What the new symbol should be. Say 'output only the symbol' to avoid getting a whole class back. | |
| allow_secrets | No |