Cursor rule
.cursor/rules/script.mdcShell script development and unit testing guidelines
Cursor rules
Quality
58/100
Scores the file, not the repository.Length
313 words
9 headings · 3 code blocksRepository
49
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.12345# Shell Script Development67## Script Location89- Place scripts in the `scripts/` directory10- Use descriptive names with `.sh` extension11- Make scripts executable: `chmod +x scripts/script_name.sh`1213## Unit Testing1415### Test Framework1617- Use **Bach** testing framework for shell script unit tests18- Bach is located at `scripts/test/vendor/bach.sh`19- Bach requires Bash 4.3+ (available in nix environment)2021### Test File Structure2223- Test files should be in `scripts/test/` directory24- Use `.test` extension (e.g., `scripts/test/run.sh.test`)25- Test files must be executable2627### Writing Tests28291. Source Bach framework:30```bash31 source "$(dirname "$0")/vendor/bach.sh"32```33342. Create test functions with `test-` prefix:35```bash36 test-my-feature() {37 # Test implementation38 }39```40413. Create assertion functions with `-assert` suffix:42```bash43 test-my-feature-assert() {44 @out "expected output"45 }46```47484. Bach uses dry-run testing - it compares commands executed in test functions with expected commands in assert functions4950### Running Tests5152- Run all tests: `bash scripts/test/run_all_script_tests.sh`53- Run individual test: `bash scripts/test/script_name.test`54- In nix environment: `./scripts/run.sh bash scripts/test/run_all_script_tests.sh`5556### Test Requirements5758- All scripts in `scripts/` should have corresponding tests in `scripts/test/`59- Tests are automatically discovered and run in CI60- Tests must pass before merging6162## CURSOR_DEV Mode Behavior6364When scripts are run with `CURSOR_DEV=true nix develop -c <command>`, the nix shell hook (`scripts/nix_shell_hook.sh`) should:6566- **Output only a one-liner**: `<<running within nix env>>` at the beginning67- **Suppress all other output**: No log messages, environment info, or setup messages should appear68- **Preserve command output**: The actual command's stdout/stderr should be displayed normally69- **Show errors only**: If something goes wrong during setup, errors should still be visible7071This ensures that when running commands via `CURSOR_DEV=true nix develop -c`, users see only:721. The one-liner `<<running within nix env>>`732. The command's actual output7475All hook setup output is suppressed to keep the output clean and focused on the command being executed.76
Also in nerds-odd-e/doughnut
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nerds-odd-e/doughnut.clinerules/daisyui.md · 49 | Cline rules | setuplint-formatstyleui+1 | 57/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/architecture-decisions.mdc · 49 | Cursor rules | no sections | 16/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/backend-code.mdc · 49 | Cursor rules | styletypesdatabasedo-not | 61/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/backend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 73/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/db-migration.mdc · 49 | Cursor rules | stylearchdatabasedeployment | 64/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/e2e-authoring.mdc · 49 | Cursor rules | setupteststylearch+3 | 80/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/e2e-ocr.mdc · 49 | Cursor rules | setuptesting-strategydo-not | 46/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-api.mdc · 49 | Cursor rules | styletesting-strategyapido-not | 57/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-component.mdc · 49 | Cursor rules | testlint-formatstylearch+2 | 76/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-storybook.mdc · 49 | Cursor rules | buildteststyletesting-strategy+1 | 69/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 89/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/general.mdc · 49 | Cursor rules | styledo-not | 49/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/gsd-coexistence.mdc · 49 | Cursor rules | style | 60/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/linting_formating.mdc · 49 | Cursor rules | testlint-formatstylearch+6 | 88/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/mcp-server.mdc · 49 | Cursor rules | buildtestlint-formatarch+2 | 85/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/planning.mdc · 49 | Cursor rules | teststylearchdo-not+1 | 75/100 | 3 days ago | |
| nerds-odd-e/doughnutAGENTS.md · 49 | AGENTS.md | no sections | 47/100 | 3 days ago | |
| nerds-odd-e/doughnutCLAUDE.md · 49 | CLAUDE.md | agent-behaviour | 47/100 | 3 days ago |
Diff against .clinerules/daisyui.md Diff against .cursor/rules/architecture-decisions.mdc Diff against .cursor/rules/backend-code.mdc Diff against .cursor/rules/backend-testing.mdc Diff against .cursor/rules/cli.mdc Diff against .cursor/rules/db-migration.mdc Diff against .cursor/rules/e2e-authoring.mdc Diff against .cursor/rules/e2e-ocr.mdc Diff against .cursor/rules/frontend-api.mdc Diff against .cursor/rules/frontend-component.mdc Diff against .cursor/rules/frontend-storybook.mdc Diff against .cursor/rules/frontend-testing.mdc Diff against .cursor/rules/general.mdc Diff against .cursor/rules/gsd-coexistence.mdc Diff against .cursor/rules/linting_formating.mdc Diff against .cursor/rules/mcp-server.mdc Diff against .cursor/rules/planning.mdc Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
