From the Super Mario Wiki
Mario receives the Ruby Star after Vivian joins his team to help him get his name, appearance, and teammates back. Together, they confront Doopliss (who is disguised as Mario). Ultimately, Vivian and the real Mario defeat the doppelganger and recover the Ruby Star.
This Crystal Star teaches Mario the move Art Attack, which costs four SP. The player has a limited amount of time (which is not displayed) to draw circles around enemies with the Ruby Star. Encircling an enemy completely causes maximum damage, while cutting corners cuts the damage. If the player fully draws a circle around an enemy, it will cause three HP damage. If most of it is inside the circle, then two HP damage is dealt. If only part of it is in the circle, then one HP of damage is caused. The player can draw circles around multiple enemies, in which case all enemies inside the circle will be damaged. Obviously, this attack works best against smaller enemies, as bigger ones take much longer to circle completely.