Using Claude Code to Generate Boilerplate
This is a member-only chapter. Log in with your Signal Over Noise membership email to continue.
Log in to readModule 2 · Section 6 of 8
Using Claude Code to Generate Boilerplate
This is where AI-assisted development earns its place. Once you have a working empty site, you can ask Claude Code to generate components rather than writing them from scratch.
Open Claude Code in your project directory (claude in the terminal). A useful starting prompt:
This is an Astro project. I need a nav component that:
- Shows a site name linking to /
- Has navigation links (Home, About, Blog)
- Highlights the active link based on the current page
- Uses CSS custom properties for colours (--color-text, --color-primary)
- Is responsive, collapsing to a hamburger on mobile
Read src/layouts/BaseLayout.astro first so the component fits the existing pattern.
The “read the existing file first” instruction matters. Without it, Claude Code generates plausible-looking components that don’t match your conventions. With it, it works within what you’ve already built.