It technically quite easy. All data about books and shelves placed in \system\library file, in standard SQLite format. Database structure is easy too, only 3 table to deal with:
t_shelf contains f_id_shelf - id of the record, f_name - name of shelf.
t_item contains f_id_item - id of the book in db, f_title - title
t_shelf_link contains f_item_id - points to t_item record and f_shelf_id - points to the shelf id.
I tried to manually add/modify delete shelf records with DB Browser for SQLite - works without any problem.
Unfortunately I am not a real programmer, so I hope somebody else can write the code
I put a copy of /system/library file in attachment in hope somebody might be interested to enhance calibre