Home

>

Codespell Codeing Assistant

>

Built-in Spells

Using the Codespell Coding Assistant

Step
3

Built-in Spells (Chat Mode)

To begin, right-click on any function in your code and select “Add to Chat”. This opens the function in the Codespell Chat Panel, where you can apply various spells using the / command.
Spell
Purpose
/explain
Breaks down the function and explains its logic, flow, returns, and usage.
/doc
Generates a complete docstring in the language’s standard format.
/unit-test
Creates a unit test file based on the function context and framework.
/optimize
Refactors or simplifies long/complex functions based on user prompt.
/clear
Clears all current chats and resets the assistant interface.
Each spell is automatically tailored to the language and framework of the current file. For instance, JavaScript code will generate unit tests using Jest, while Java files will use JUnit.
Apply Options:
Apply: Automatically replaces existing code with the AI-generated version.
Copy: Manually copy results to your desired file.
Fig 7: Shows how typing / triggers the available Spells menu within the editor