Instruction file imported from sethdford/Just-Call-Me-Al (
.cursor/rules/commands.mdc). Copyright stays with the author.
Terminal Command Usage Rules
-
Safety First
- Double-check commands that modify or delete files (
rm,mv). - Be cautious with commands requiring
sudoor root privileges. - Understand the impact of potentially long-running or resource-intensive commands.
- Double-check commands that modify or delete files (
-
Clarity and Intent
- Prefer explicit commands over complex chains where possible.
- Use comments (#) in scripts to explain non-obvious commands.
- Use meaningful variable names in scripts.
-
Idempotency
- Where possible, make scripts idempotent (running them multiple times produces the same result).
- Use checks (e.g.,
if [ -f file ]) before creating or modifying resources.
-
Error Handling
- Check exit codes (
$?in bash/zsh) after critical commands in scripts. - Use
set -ein shell scripts to exit immediately on error. - Provide informative error messages.
- Check exit codes (
-
Git Commands
- Follow Conventional Commits for commit messages (
<type>[scope]: <description>). - Keep commits small and focused.
- Use branches for feature development and bug fixes.
- Rebase or merge appropriately based on team workflow.
- Follow Conventional Commits for commit messages (
-
Build/Test Commands
- Use standard build commands (
cargo build,cargo test,cargo check). - Use
cargo clippyfor linting. - Use
cargo fmtfor formatting.
- Use standard build commands (
-
Environment Management
- Be aware of the current working directory (
pwd). - Use relative paths where appropriate, absolute paths when necessary for clarity.
- Manage environment variables carefully (e.g., using
.envfiles anddotenv).
- Be aware of the current working directory (