Skip to content

Instantly share code, notes, and snippets.

@architjn
Created May 18, 2025 11:25
Show Gist options
  • Save architjn/1a6b52526d52061f404e471a93fa92ca to your computer and use it in GitHub Desktop.
Save architjn/1a6b52526d52061f404e471a93fa92ca to your computer and use it in GitHub Desktop.
---
description: Enforce existing style and limit edits to user’s request
globs: ["**/*.js","**/*.ts","**/*.jsx","**/*.tsx"]
alwaysApply: true
---
# Style Integrity
## Indentation
- Keep tabs or spaces as in the file.
- Match the file’s indent size exactly.
## Quotes
- Use single/double to mirror existing lines.
- Never flip quotes in unchanged code.
## Semicolons
- Preserve the file’s semicolon style.
- Only add/remove if user asks.
## Line Endings & Spacing
- Mirror LF or CRLF.
- Keep blank lines intact.
- Don’t auto-wrap long lines.
## Comments
- Retain comment placement and format.
- Don’t reflow or rewrap blocks.
# Edit Scope
- Touch only lines that satisfy the user’s request.
- Include related lines if needed to make code work.
- Skip any code with no impact on the request.
# Confidence Threshold
- Change only when ≥ 90% confident.
- If unsure, skip the line and ask the user.
# Off-Limits
- No full-file reformat.
- No renames, refactors, or lint fixes.
- No new imports/deps unless asked.
# Exceptions
- If style errors break the build, apply the minimal fix.
- If the user wants a style change, prompt before changing.
# Diff Hygiene
- Show only edited lines in the diff.
- Strip trailing spaces on lines you edit.
- Group related edits together.
# Transparency
- Begin with:
`Changed <N> lines in <file>`
- No extra commentary unless asked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment