Background
I use the Cursor AI Editor for system design and create architecture diagrams with PlantUML (.puml
files). To ensure valid UML syntax, I wrote a script check_puml.sh
that checks .puml
files for errors. My current requirements are:
- Automatically run
check_puml.sh
on file save to verify syntax; - If and only if the syntax check passes, invoke
~/loadrc/plantumlmacviewer_go/bin/plantumlviewer
to open and preview the.puml
file;
I want to know if Cursor Editor supports a “custom workflow” or “custom rule” mechanism to automate these steps, rather than manually running the script in a terminal.
What I’ve Tried
- Using
.cursorrules
(and the new.cursor/rules
) to define rules that prompt AI to suggest runningcheck_puml.sh
on save; - Exploring Cursor’s built-in AI Linter, which supports several programming languages but does not include PlantUML;
Desired Solutions or Ideas
-
Built‑in Hooks or Plugins
- Does Cursor plan to offer or already support a user‑defined “onSave hook” that can execute arbitrary scripts?
- Could there be a configuration file (e.g.
.cursor/hooks
) where I can specify a sequence of commands to run on save?
-
Enhanced Rules
- Is it possible to extend
.cursorrules
or.cursor/rules
to directly invoke shell commands on file save and use the exit code to control the next action? - Are there any undocumented APIs or advanced settings to achieve this level of automation?
- Is it possible to extend
-
Alternative Approaches
- Are there community plugins or external integrations that can watch file events within the Cursor environment and run external scripts?
- Is there a way to use a VS Code “Run on Save”–style extension inside Cursor?
I look forward to hearing community experiences and best practices! If you have sample configurations, scripts, or workflow suggestions, please share them. Thank you!