What this prompt does
This prompt asks Claude to tune your repository so AI completion tools produce noticeably better suggestions. You supply the [project_type], [tech_stack], and [project_structure], and the model designs the context scaffolding that completion engines read — rules files, rich type definitions, example files, and a domain document — rather than just suggesting code inline.
The structure works because it targets every channel an assistant uses to understand your code. A .cursorrules or copilot-instructions.md file encodes [convention_count] explicit rules; type definitions and docstring templates for your [key_modules] give the model strong type context; example files for each pattern act as implicit few-shot prompts; and a project-level document explaining [domain_context] stops the AI from inventing wrong entity relationships. Barrel files and import structure help it discover related code across [module_count] modules, snippet libraries cover [common_patterns], and workspace settings cap context and exclude build artifacts. Together these shape what the tool sees, which is what shapes what it suggests.
When to use it
- Your AI completions feel generic and keep ignoring your conventions.
- You are starting a new repo and want AI-friendly structure from day one.
- You have a complex
[domain_context]the assistant keeps misunderstanding. - You want consistent suggestions across a team using the same tooling.
- Your
[tech_stack]has rich types that the AI is underusing. - You need a documented set of
[convention_count]rules new contributors and AI both follow.
Example output
Expect concrete artifacts rather than abstract suggestions. You get a drafted rules file with numbered conventions ready to commit, type-definition or docstring templates for your [key_modules] that include generic, union, and branded types where they help, and skeleton example files — a model, a controller, a service, and a test — that serve as implicit few-shot patterns. Alongside those sit a domain-model document describing entities, relationships, and business rules, guidance on barrel-file and import structure to help the AI discover related code across [module_count] modules, snippet definitions with tab-stops for [common_patterns], and recommended workspace settings covering suggestion behavior, context-file limits, and ignored directories like node_modules and build output.
Pro tips
- Make
[convention_count]rules specific and enforceable — "use Zod for input validation," not "write clean code." - Invest most in the domain document; encoding
[domain_context]is the step most teams skip and the one that prevents wrong-relationship hallucinations. - Keep example files real and current, since the AI treats them as few-shot examples and will copy their style verbatim.
- List your actual
[key_modules]so the type context lands where the AI most often guesses wrong. - Re-run the prompt when your
[tech_stack]or conventions change; stale rules files quietly steer the AI toward outdated patterns. - Trim ignored directories carefully so the assistant still sees source it needs while skipping
node_modulesand build output.