Claude Prompt for Rules & Instructions Files
Generate a narrow, path-scoped rule file that fires only on Bash files in a Rails monolith.
More prompts for Rules & Instructions Files.
Port an existing Continue.dev rules file into the Windsurf format, preserving intent and adapting to Windsurf's capabilities.
Port an existing Codeium rules file into the Windsurf format, preserving intent and adapting to Windsurf's capabilities.
Ready-to-paste Windsurf rules/instructions file tuned for Spring Boot service codebases owned by solo founder. Enforces SQL migrations must be reversible.
Generate a narrow, path-scoped rule file that fires only on Swift files in a Go microservice.
Ready-to-paste Zed Assistant rules/instructions file tuned for VS Code extension codebases owned by 100+ engineer enterprise. Enforces never use default exports -- named only.
Ready-to-paste Windsurf rules/instructions file tuned for Kubernetes operator codebases owned by YC-batch pre-seed team. Enforces use composition over inheritance.
You are a seasoned senior Bash engineer specializing in {{specialty}}. Your work has helped hundreds of {{clientType}} achieve measurable results.
Write a narrowly-scoped rule file -- not a whole-repo ruleset -- that applies only to Bash code in a Rails monolith.
**Target file:** CLAUDE.md (Claude Code project memory)
**Scope:** only Bash source files
**Project:** Rails monolith
**Convention in focus:** no direct DOM access in React -- refs or portals only
**Refactor recipe the rule should encourage:** collapse nested if-else into a lookup table
## Why scoped rules
A single monolithic rules file pollutes every AI turn with irrelevant context. Scoped rules (e.g. `.cursor/rules/*.mdc` with `globs`, or a dedicated `CLAUDE.md` imported via `@path`) only load when relevant files are in play. Smaller, precise prompts -> better output.
## Required output
### Header / frontmatter
For Cursor scoped rules (`.mdc`):
```
---
description: <concise purpose>
globs: **/*.{ext1,ext2}
alwaysApply: false
---
```
For Claude Code, use a short `CLAUDE.md` in the relevant subfolder (Claude Code recursively reads CLAUDE.md from the cwd up to the repo root).
### Body (40-80 lines)
1. **Applies to** -- exact glob(s) and a one-line purpose
2. **Hard rules** (5-8 imperatives) specific to Bash in a Rails monolith:
- Each rule cites the footgun it prevents
- Include at least one rule enforcing no direct DOM access in React -- refs or portals only
- Include at least one rule that nudges toward the collapse nested if-else into a lookup table refactor when appropriate
3. **Preferred idioms** with one-line code shape examples (describe the shape, do not paste real code unless short)
4. **Forbidden idioms** with the wrong shape shown
5. **Testing note** -- which Playwright patterns match these files
6. **Escape hatch** -- when a human should override the rule (and how to signal it in a comment)
## Style
- Every bullet is an imperative
- No prose paragraphs longer than 2 sentences
- No "we recommend" -- use "do" / "do not"
- Use precise technical terminology appropriate for the audience
- Include code examples, configurations, or specifications where relevant
- Document assumptions, prerequisites, and dependencies
- Provide error handling and edge case considerations
Provide a ready-to-use template with placeholder markers {{like_this}} that the user can fill in. Include instructions for each placeholder.