insert_sibling
Insert content before or after a named symbol (function, class, method, or top-level assignment) for precise placement relative to another symbol.
Instructions
Insert content as a sibling of a named symbol (function, class, method,
or top-level assignment). Pass position="before" or position="after".
Use this when: You need precise placement relative to another top-level
symbol -- e.g. a helper function immediately before its caller, a
constant immediately above the class that uses it.
Don't use this when: You just want to append to the end of the file ->
use add_top_level. You're inserting inside a function body ->
use insert_in_body (with at, after, or before).
Example: target="LRUCache" content="CACHE_SIZE = 100" position="before"
target="LRUCache"
content="RELATED_CONSTANT = 42"
position="after"Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes | ||
| position | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |