Skip to content

Instantly share code, notes, and snippets.

@Njoxpy
Created April 21, 2026 16:39
Show Gist options
  • Select an option

  • Save Njoxpy/f174a4ffbbcb70731f5cdbbca156bf06 to your computer and use it in GitHub Desktop.

Select an option

Save Njoxpy/f174a4ffbbcb70731f5cdbbca156bf06 to your computer and use it in GitHub Desktop.
Three reusable AI prompts to capture your code style, turn it into a project-specific style guide, and generalize it for reuse across any stack.

Code Style Prompts

Three reusable AI prompts to capture your code style, turn it into a project-specific style guide, and generalize it for reuse across any stack.

Run them in order in a fresh AI chat. Works with any language, framework, or platform.


Prompt 1 — Point the AI at your code style

I've written code in a specific style in <folder-or-path> of this project. Before I ask you to do anything, take a look at it and tell me you understand the conventions I'm using — folder layout, file naming, how I structure modules, error handling, response shapes, auth, logging, and any other patterns you notice. Don't suggest changes, don't refactor, just confirm you've read it.


Prompt 2 — Turn that style into a reusable doc

Now produce a style-guide document based on the code you just read. I'll feed this document to an AI in future sessions so it generates new code in the exact same style I've already established.

Requirements:

  • Ask clarifying questions first (scope, framing, location). Don't assume anything before the doc outline is agreed.
  • Framing = hybrid: terse imperative rules at the top so an AI can scan them, then worked templates and rationale below for a human reader. Include short verbatim excerpts from my code so the AI has concrete shape to pattern-match against.
  • Cover everything that makes my code mine: folder structure, file naming, module system, the exact order of any bootstrap/setup steps, templates for each layer I have (e.g. routes/controllers/models, or components/hooks/stores, or screens/widgets/services — whatever applies to this stack), auth/session pattern, error/response conventions, validation approach, logging, config/env, file uploads or I/O if present, dependency baseline, and an ordered "how to add a new feature" checklist.
  • Save it as a single Markdown file in a docs/ folder at the repo root.
  • Do not invent conventions I haven't used. Only document what's actually in the code.

Prompt 3 — Make it portable across projects and stacks

Now produce a second, generic version of the style guide I can reuse across other projects — not just this one, and not tied to this specific tech stack.

Requirements:

  • Strip everything project-specific: feature names, enum values, admin credentials, company names, URLs, hardcoded domains. Replace with placeholders (<feature>, <entity>, <your-resource>, etc.) and short notes explaining what to substitute.
  • Strip stack-specific things that don't transfer. Keep the conventions that do transfer (naming style, module system, error handling philosophy, response-shape principles, "how to add a feature" checklist, separation between layers, auth flow shape) phrased in a way that applies to whatever stack I'm using next — backend framework, frontend framework, mobile, CLI, whatever.
  • Where a rule only makes sense on a specific stack, mark it clearly (e.g. "Node/Express only: …" or "React only: …") so I can drop those sections when reusing the doc on a different stack.
  • Keep the same hybrid framing: imperative rules at top, templates and rationale below, ordered "how to add a new feature" checklist at the end.
  • Save it outside this repo at ~/.claude/style-guide.md (or similar user-global location) so it's available to any future project regardless of stack.
  • The goal: I can point any AI at that one file, tell it the stack I'm using, and get code that matches the conventions I've already settled on — without the file being locked to one project or one language.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment