DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to set coding style rules for a repo from existing code with AI Goodpractice

Turn the code style of a reference codebase into a repo rule that the AI follows.

Short answer: Open the target repo in your AI-enabled IDE, such as Cursor, VS Code, or Claude Code; then Get the path or URL of a reference folder whose code style you want to copy; Prompt the AI: analyze the code style from the reference folder in depth and apply it as a rule for this repo. All steps.

Who it is forA developer starting a new project, or adding AI to an existing one, who wants the AI to keep a consistent code style.

The problemWithout rules, AI output drifts and the code style can go out of hand quickly.

The outcomeA repo rule that captures the code style of a reference folder and that the AI applies to the target repo.

What you need first

  • An AI-enabled IDE such as Cursor, VS Code, or Claude Code
  • A project folder or repo to apply the setup to
  • Access to an AI model; the guide's author uses a mix of Claude, ChatGPT and Grok through Cursor

Steps

  1. Open the target repo in your AI-enabled IDE, such as Cursor, VS Code, or Claude Code.
  2. Get the path or URL of a reference folder whose code style you want to copy.
  3. Prompt the AI: analyze the code style from the reference folder in depth and apply it as a rule for this repo.
  4. Review the rule the AI writes, and refine the prompt if the result is vague.
  5. Decide whether the rule belongs to the repo or to your user rules, then save it. The guide says code style usually fits the repo.

Prompt for your agent

Using the ai_goodpractice guide workflow, analyze the code style of <reference folder path> in depth and write it as a repo rule for <target repo path>. Expected output: one rule file describing naming, formatting and structure. Verify that each rule points to a pattern actually found in the reference folder.

Caveat. The rule is only as good as the reference code you pick, so choose a reference codebase you actually want the AI to copy.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for xop01/ai_goodpractice and "Set coding style rules for a repo from existing code"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer