$ recombobulate _
home / tips / ask-claude-to-scaffold-new-features-using-your-existing-code-conventions
0

Ask Claude to Scaffold New Features Using Your Existing Code Conventions

bagwaa @bagwaa · Mar 26, 2026 · Prompting
ask-claude-to-scaffold-new-features-using-your-existing-code-conventions

The best scaffolding follows your project's actual patterns — not framework defaults. Point Claude at your existing code before asking it to build anything new, and it'll match your conventions automatically.

claude "Read the existing PostsController, PostService, PostRepository, and their tests. Now scaffold a complete Comments feature following exactly the same patterns — controller with the same response format, service layer, repository, migrations, and Pest tests structured identically to the Post tests."

Claude picks up on things you didn't think to document: the specific HTTP status codes you return, whether you use DTOs or raw arrays, the way you name test datasets, and whether you favour method injection or constructor injection.

This works across the stack. For a Next.js project:

claude "Read the existing /app/products/ route group — page.tsx, loading.tsx, error.tsx, and the useProducts hook. Scaffold an identical /app/orders/ route group for orders data. Use the same fetch patterns, skeleton loaders, and error boundaries."

The key is giving Claude enough existing context before you ask it to generate:

claude "Before you write anything, read these five files and summarise the patterns you see: naming, structure, error handling, and test style. Then scaffold the new NotificationsModule following those exact patterns."

The explicit summary step catches mismatches before they get written into code.

Claude generates better scaffolding when it reads first — always show it the existing work before asking for the new work.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Describe the Entire Feature in Plain English Before Claude Starts Building

Give Claude the full picture upfront before it writes any code, so it builds the right thing the first time with fewer correction rounds.

bagwaa @bagwaa · 3 hours ago
0
Pass Multiline Prompts to Claude Code with Shell HEREDOCs

Complex prompts are unreadable as escaped single-liners. Use shell HEREDOCs to write clean, structured prompts directly in your scripts.

bagwaa @bagwaa · 6 hours ago
0
Structure Complex Prompts Faster by Speaking Them Aloud

Long multi-step prompts with lots of context are harder to type than to speak — your brain can narrate relationships and constraints faster than your fingers can type them.

bagwaa @bagwaa · 7 hours ago