ChatGPT Prompt for Rules & Instructions Files
Generate a narrow, path-scoped rule file that fires only on Kotlin files in a VS Code extension.
You are a seasoned senior Kotlin 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 Kotlin code in a VS Code extension.
**Target file:** .cursor/rules/*.mdc (Cursor scoped)
**Scope:** only Kotlin source files
**Project:** VS Code extension
**Convention in focus:** strict TypeScript, no `any`, no non-null assertions
**Refactor recipe the rule should encourage:** extract a reusable React hook
## 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 Kotlin in a VS Code extension:
- Each rule cites the footgun it prevents
- Include at least one rule enforcing strict TypeScript, no `any`, no non-null assertions
- Include at least one rule that nudges toward the extract a reusable React hook 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 Pytest 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.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.