Markdown Converter
Agent skill for markdown-converter
_This list of prompts is not 100% comprehensive: quick in-line followups are not recorded. Prompts made after public release are not recorded._
Sign in to like and favorite skills
Editor's note: My style of prompting Claude Code is with long Markdown prompts that are comprehensive and ideally give the LLM no wiggle room to interpret intent incorrectly. They are invoked by tagging the file, and then giving the command
. After each prompt, the code is manually reviewed, manually tested to ensure the implementation matches the input prompt, then manually committed to implement
.git
This list of prompts is not 100% comprehensive: quick in-line followups are not recorded. Prompts made after public release are not recorded.
Create a terminal application using the Rust programming language which creates a physics simulation of thousands of balls, leveraging the unique aspects of the terminal to create a unique experience for a terminal application.
Due to terminal display constraints, it cannot visually display thousands of balls, which is intentional. Instead, use clever and unique visual tricks to emulate it. You MUST use Braille unicode characters to simulate up to eight (8) subballs per character location. For example, with the character ⢗, there is spatially five (5) balls at the same spot, with one bell in the top-left-most area of the character, two below it, one ball below that on the left, and one ball in the bottom-right-most area of the character. If there are a large amount of balls spatially in a given character position, additionally color the background to visually simulate the density.
The terminal application MUST include ALL of the FOLLOWING features and constraints:
rapier crate for the physics simulation. Only include 2D functions.
resize events in crossterm as physics: the faster the user resizes the window, the faster and farther the balls are pushedx and y), along with other relevant properties.ALL Rust crates installed MUST use the most up-to-date version possible: check each package to confirm.
Update the
rapier2d crate to the latest version (0.32.0) and rayon crate to the latest version (1.11.0) and ensure all tests pass.
There are a number of bugs related to collisions which you MUST fix:
Balls can get permanently stuck in the four corners of the canvas. Add an invisible collider proportionate to the ball size to prevent it from getting stuck in the corners.
Reduce the repulsing "burst" effect force caused by mouse clicking the canvas by about 25%.
Make it such that if the user holds down the mouse click, it continues to repel the balls until the user lets go of the hold.
The force applied to the balls when resizing the window is WAY too great. The burst force applied should be equivalent to around half of the mouse click after the previous adjustment per character moved.
When the user adds balls by clicking the top 1/4 of the screen, the balls are immediately repulsed. Prevent the repulsing effect when clicking at this area.
The user MUST be able to click-and-hold the top 1/4 of the screen to generate balls repeatedly, with the number of balls increasing significantly over time while the user holds.
Additionally, add another row at the top of the bottom UI rows (i.e. 3 rows total): the new row has roughly-equally spaced numeric digits corresponding to the keyboard position up to 6 digits total in the terminal colors red, green, yellow, blue, magenta, cyan. Make such that when the user presses the keyboard, it creates a repulsing "burst" effect directly upward at that spot. In small terminal windows, you may reduce the quantity of digits but the repulsing "burst" effect MUST still occur at the specified digit the user presses. The user should be able to click the number to cause the same burst.
Furthermore:
2000. Add a CLI command to set the default number of balls on app run.32768 balls as a constant. Prevent the user from adding balls via the click-and-hold method when at this limit, and force the value to the maximum ball limit if the user inputs a value over it.Fix ALL the following changes from the previous plan:
See the attached image screenshot of the current application to view the objects getting stuck in corners, and the too small numeric geysers.
Although the app no longer crashes on load with 10,000 balls, even with 5,000 balls there are still crashes when manipulating the large amounts of balls with lots of physics actions. See attached log.
There is a crash when too many physics operations are happening. It is less likely at low balls but still occurs. The root cause may be a new physics engine tweak in
rapier 0.32.0. Downgrade to rapier 0.31.0 and make appropriate code changes to verify.
When resizing the terminal, it applies the force to ALL the balls which is VERY INCORRECT.
The intended behavior is that if a window resizing pushes the boundaries against the balls. it applies the force against the balls that are "hit" by it, e.g. if the window shrinks, it will hit balls directly adjacent to it depending on the rate of shrinkage.
Target FPS option and ALL corresponding logic from the code. The application MUST run as fast as possible by default.60 FPS Cap toggle option that caps the logical frame rate at 60 FPS. Default OFFThe behaviors for spawning balls are not correct and MUST be fixed:
Space behavior, it does spawn while holding Space, but after holding space for a few seconds, it starts rapidly spawning balls with no control. Logic MUST be similar to the click-and-hold behavior.Two more remaining issues:
Space once, the balls still continue to spawn infinitely after a delay.Add comprehensive support to add shape objects to the level and interactivity with those shapes, with both keyboard and mouse. These shapes are polygonal colliders which interact with the balls.
[S]hapes button.[C]lear button to delete all shapes in the world[S]hapes button is activated:
[S]hapes menu, it is randomly placed but it MUST not be placed in the spawn zone or overlap an edge, or not overlap another shape if possible.., :. or ;, or any characters that could be interpreted as a ball/Braille character.z and x keyboard shortcut to rotate a selected shape clockwise/counterclockwise 45 degrees.Integrate more interactivity with the shape objects and fix ALL bugs related to them:
[S]hapes menu, allow the user to click the desired shape[S]hapes menu is not the correct shape. Double check the logic and ensure it is correct.Delete key.Two more follow up bugs:
Now it is time to allow the shapes to be in differnet colors.
c and v to cycle the the colors of the selected shape forwards/backwards.Additionally, it is possible for balls to fall through lines at an angle. Ensure it is solid. See attached image.
Implement a
Color Mode, where activating the geysers converts the balls the burst directly impacts into the geyser's corresponding color.
Color Mode is a setting in the Options menu, default OFF.Color Mode.Additionally, fix the bug where the asterisk indicators on pressing the geyser only appear one at a time. They should be able to appear on multiple geysers simultaneously.
Make the following changes to Color Mode:
Color Mode to ON.Color Mode, each individual ball has a chance to spawn as a random color other than White. Create an Option in the options menu to specify this probability, with a default of 50%.Add a Save and Load functionality, which saves the level configuration (including shapes and their positions and rotations and colors) and the options settings within a single portable file. The file is saved as a JSON file. You must include
serde (version 1.0.228)
Ensure an
open CLI argument exists where the user provides a JSON and it will automatically be added on load (this supercedes the default shapes on load and default settings on load)
Ensure the app does not crash if the opening JSON is malformed.
Implement a simple interactive file explorer such that can find the specified level JSON to load, which may not be named
level.json.
Add
Save and Load buttons to the default UI that can be clicked.
Make ALL the following changes to the menu at the bottom of the screen:
Colors button, where each letter is colored in the order of terminal red, green, yellow, blue, magenta, cyan. Clicking this button or pressing c toggles Color Mode. Remove the Color Mode option from the Options menu.c shortcut from [C]lear and rename it to Clear.Clear and Shapes button.Additionally, make it such that when a ball is spawned, it is assigned a color, although that color is not displayed if Color Mode is OFF. That way, when the user toggles Color Mode mode, the existing balls will immediately turn into colors without having to spawn new balls.
Make ALL the following changes:
It is possible for balls to become stuck in between a completely sealed area delineated by multiple line shapes. (see attached image)
Verify the shape and collider logic to ensure no balls can enter a completely-sealed area.
Add a
[?] bottom menu option that can be invoked via the ? key which shows a scrollable help menu that contains ALL possible keyboard shortcuts for the terminal application. Ensure this menu can be scrolled by both keyboard and mouse.
The project is near completion, so do an optimized pass for the entire project which makes ALL the FOLLOWING changes:
ballin. Edit the crate name where appropriate in Cargo.toml and code.5000 and set the max number of balls to 1500060 FPS Cap option to Frame CapDuring your pass, you MUST ensure that ALL Rust code follows DRY principles as much as possible, and ensure all algorithms are big-O optimal. You have permission to refactor code to improve DRY and code optimization if necessary.