<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vivek Jangid</title>
    <description>The latest articles on DEV Community by Vivek Jangid (@vivekjangid).</description>
    <link>https://dev.to/vivekjangid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3967619%2F91737a9f-7994-4b5f-8bea-10fef4ef4591.jpeg</url>
      <title>DEV Community: Vivek Jangid</title>
      <link>https://dev.to/vivekjangid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vivekjangid"/>
    <language>en</language>
    <item>
      <title>Claude Code Slash Commands &amp; CLAUDE.md: How I Automate Project Setup, Architecture Enforcement, and Code Reviews</title>
      <dc:creator>Vivek Jangid</dc:creator>
      <pubDate>Sun, 14 Jun 2026 07:25:20 +0000</pubDate>
      <link>https://dev.to/vivekjangid/claude-code-slash-commands-claudemd-how-i-automate-project-setup-architecture-enforcement-and-50hb</link>
      <guid>https://dev.to/vivekjangid/claude-code-slash-commands-claudemd-how-i-automate-project-setup-architecture-enforcement-and-50hb</guid>
      <description>&lt;p&gt;Most developers treat AI coding tools like a smarter autocomplete. You type a comment, you get a suggestion, you hit tab to accept. Honestly, that's maybe 10% of what these tools are actually capable of.&lt;/p&gt;

&lt;p&gt;For the last several months I've been building a workflow around Claude Code that goes a lot deeper than autocomplete. It's a mix of three things: a custom project config that teaches Claude my team's architecture patterns, custom slash commands that handle multi-step engineering workflows, and MCP integrations that wire Claude into the infrastructure we already use every day.&lt;/p&gt;

&lt;p&gt;The payoff has been real. Scaffolding a new feature with the right folder structure, Zod schemas, API routes, hooks, and tests used to eat up about two hours of my day. Now it takes roughly five minutes, and it follows our conventions every single time.&lt;/p&gt;

&lt;p&gt;How the pieces fit together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────┐
│ Developer │
└─────┬─────┘
      │  natural language
      ▼
┌──────────────┐
│ Claude Code  │
└──────┬───────┘
       │
       ├─ reads ─────►  CLAUDE.md        (architecture rules)
       ├─ runs ──────►  Slash Commands   (scaffold, audit, review)
       └─ connects ──►  MCP Servers      (Figma, Slack, GitHub)
                              │
                              ▼
                       ┌───────────────────┐
                       │  Generated Code   │  ◄─ all three feed in here,
                       │                   │     following team conventions
                       └───────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's exactly how I set it up.&lt;/p&gt;

&lt;h2&gt;
  
  
  CLAUDE.md: Teaching Claude Your Architecture
&lt;/h2&gt;

&lt;p&gt;Every project I work on gets a &lt;code&gt;CLAUDE.md&lt;/code&gt; file at the root. I think of it as documentation that both humans and AI will actually read. When Claude Code starts a session it loads this file and treats it as instructions for how to behave inside your codebase.&lt;/p&gt;

&lt;p&gt;This is a simplified version of the one I use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project: Analytics Dashboard&lt;/span&gt;

&lt;span class="gu"&gt;## Architecture Overview&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Next.js 15 App Router with TypeScript strict mode
&lt;span class="p"&gt;-&lt;/span&gt; BFF pattern: API routes orchestrate backend services
&lt;span class="p"&gt;-&lt;/span&gt; Zod schemas define all I/O boundaries
&lt;span class="p"&gt;-&lt;/span&gt; React Query for server state, Zustand for client state
&lt;span class="p"&gt;-&lt;/span&gt; TailwindCSS for styling, no CSS-in-JS

&lt;span class="gu"&gt;## Folder Structure Convention&lt;/span&gt;
src/
├── app/              # Next.js routes and API handlers
├── components/
│   ├── ui/           # Reusable primitives (Button, Card, Skeleton)
│   └── features/     # Feature-specific components
├── hooks/            # Custom React hooks
├── lib/              # Utilities, formatters, validators
├── types/            # Zod schemas + inferred TypeScript types
└── data/             # Mock data and seed generators

&lt;span class="gu"&gt;## Rules&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; NEVER use &lt;span class="sb"&gt;`as`&lt;/span&gt; type assertions for API responses, always use Zod.parse
&lt;span class="p"&gt;-&lt;/span&gt; NEVER put server data in Zustand, use React Query
&lt;span class="p"&gt;-&lt;/span&gt; ALL new API routes must validate with Zod before returning data
&lt;span class="p"&gt;-&lt;/span&gt; Feature components must NOT import from other feature folders
&lt;span class="p"&gt;-&lt;/span&gt; Use dynamic imports for heavy chart libraries (Highcharts)

&lt;span class="gu"&gt;## Naming Conventions&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Components: PascalCase (MetricCard.tsx)
&lt;span class="p"&gt;-&lt;/span&gt; Hooks: camelCase with 'use' prefix (useRealtimeMetrics.ts)
&lt;span class="p"&gt;-&lt;/span&gt; Types: PascalCase, co-located with Zod schemas
&lt;span class="p"&gt;-&lt;/span&gt; API routes: kebab-case folders (api/analytics/route.ts)

&lt;span class="gu"&gt;## Tech Stack Details&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Highcharts 12.x (auto-init ESM, no manual module registration)
&lt;span class="p"&gt;-&lt;/span&gt; Zod 3.x (use .issues not .errors for error access)
&lt;span class="p"&gt;-&lt;/span&gt; React Query v5 (TanStack Query)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It looks like ordinary documentation, but the effect is bigger than you'd expect. One command reads it and produces a whole feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────┐
│ You type:                │
│   /scaffold-feature      │
│   user-retention         │
└──────────────┬───────────┘
               │  reads config
               ▼
┌──────────────────────────┐
│ Claude reads CLAUDE.md   │
└──────────────┬───────────┘
               │  generates
               ├──────────►  types/retention.ts              (Zod schemas)
               ├──────────►  api/retention/route.ts          (BFF + Zod)
               ├──────────►  hooks/useRetention.ts           (React Query)
               └──────────►  components/features/retention/  (UI + Skeleton)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I tell Claude "scaffold a new analytics feature for user retention," here's what comes back:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The correct folder structure under &lt;code&gt;components/features/retention/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Zod schemas in &lt;code&gt;types/retention.ts&lt;/code&gt; with proper inferred types&lt;/li&gt;
&lt;li&gt;A React Query hook in &lt;code&gt;hooks/useRetentionData.ts&lt;/code&gt; with Zod parsing in the queryFn&lt;/li&gt;
&lt;li&gt;An API route in &lt;code&gt;app/api/retention/route.ts&lt;/code&gt; with Zod validation&lt;/li&gt;
&lt;li&gt;Components with dynamic chart imports and skeleton loaders&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of it follows our conventions, and I don't have to go back and fix anything by hand. To me that's the line between "AI that writes code" and "AI that writes code the way your team writes code."&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom Slash Commands: Multi-Step Workflows in One Command
&lt;/h2&gt;

&lt;p&gt;Slash commands are reusable prompts you trigger by typing them. Each one lives as a Markdown file in &lt;code&gt;.claude/commands/&lt;/code&gt;, so once that folder is committed to the repo, the whole team has the same commands. I've written one for each of the workflows I repeat most often.&lt;/p&gt;

&lt;p&gt;A quick note on naming, because it trips people up. Claude Code also has a separate feature called Skills, which Claude reaches for on its own when it spots a task that matches. The only real difference is who pulls the trigger: a Skill fires automatically when Claude decides it's relevant, while a slash command fires when you type it. For the workflows below I want explicit, on-demand control over exactly when they run, so I use slash commands. If you'd rather Claude invoke one of these on its own, the same Markdown can be packaged as a Skill instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Command: Scaffold a New Feature
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# /scaffold-feature&lt;/span&gt;

When the user says "scaffold [feature-name]", create the following:
&lt;span class="p"&gt;
1.&lt;/span&gt; Types file: &lt;span class="sb"&gt;`src/types/[feature-name].ts`&lt;/span&gt;
&lt;span class="p"&gt;   -&lt;/span&gt; Define Zod schemas for the API response
&lt;span class="p"&gt;   -&lt;/span&gt; Export inferred TypeScript types
&lt;span class="p"&gt;   -&lt;/span&gt; Include a response schema with discriminated union (success/error)
&lt;span class="p"&gt;
2.&lt;/span&gt; API route: &lt;span class="sb"&gt;`src/app/api/[feature-name]/route.ts`&lt;/span&gt;
&lt;span class="p"&gt;   -&lt;/span&gt; GET handler that returns mock data
&lt;span class="p"&gt;   -&lt;/span&gt; Zod validation before response
&lt;span class="p"&gt;   -&lt;/span&gt; Proper error handling with typed error responses
&lt;span class="p"&gt;
3.&lt;/span&gt; React Query hook: &lt;span class="sb"&gt;`src/hooks/use[FeatureName].ts`&lt;/span&gt;
&lt;span class="p"&gt;   -&lt;/span&gt; queryFn that fetches from the API route
&lt;span class="p"&gt;   -&lt;/span&gt; Zod parsing in the queryFn (validate before caching)
&lt;span class="p"&gt;   -&lt;/span&gt; Proper queryKey hierarchy: ['[feature-name]', ...params]
&lt;span class="p"&gt;
4.&lt;/span&gt; Component: &lt;span class="sb"&gt;`src/components/features/[feature-name]/[FeatureName].tsx`&lt;/span&gt;
&lt;span class="p"&gt;   -&lt;/span&gt; Client component using the hook
&lt;span class="p"&gt;   -&lt;/span&gt; Loading skeleton while data loads
&lt;span class="p"&gt;   -&lt;/span&gt; Error state handling
&lt;span class="p"&gt;
5.&lt;/span&gt; Barrel export: &lt;span class="sb"&gt;`src/components/features/[feature-name]/index.ts`&lt;/span&gt;

Follow all conventions from CLAUDE.md. Use existing UI components from
src/components/ui/ where applicable.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So when I type &lt;code&gt;/scaffold-feature user-retention&lt;/code&gt;, Claude generates five files that are architecturally correct, use the right patterns, and match our naming. There's no copy-pasting from a sibling feature, and nobody forgets the Zod validation along the way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Command: Performance Audit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# /perf-audit&lt;/span&gt;

Analyze the current page/component for performance issues:
&lt;span class="p"&gt;
1.&lt;/span&gt; Check for missing dynamic imports on heavy dependencies
&lt;span class="p"&gt;2.&lt;/span&gt; Look for components that should be wrapped in React.memo
&lt;span class="p"&gt;3.&lt;/span&gt; Identify React Query hooks missing staleTime configuration
&lt;span class="p"&gt;4.&lt;/span&gt; Find Highcharts options not wrapped in useMemo
&lt;span class="p"&gt;5.&lt;/span&gt; Check for layout components that cause unnecessary re-renders
&lt;span class="p"&gt;6.&lt;/span&gt; Verify error boundaries exist at route level
&lt;span class="p"&gt;7.&lt;/span&gt; Check for proper Suspense boundaries around lazy components

Report findings as a checklist with file paths and specific fixes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Command: Pre-PR Review
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# /pre-review&lt;/span&gt;

Before I create a PR, review my changes for:
&lt;span class="p"&gt;
1.&lt;/span&gt; Architecture violations:
&lt;span class="p"&gt;   -&lt;/span&gt; Server data in Zustand instead of React Query
&lt;span class="p"&gt;   -&lt;/span&gt; Cross-feature imports (feature A importing from feature B internals)
&lt;span class="p"&gt;   -&lt;/span&gt; &lt;span class="sb"&gt;`as`&lt;/span&gt; type assertions on API responses (should use Zod)
&lt;span class="p"&gt;   -&lt;/span&gt; Business logic in components (should be in hooks or utils)
&lt;span class="p"&gt;
2.&lt;/span&gt; Performance issues:
&lt;span class="p"&gt;   -&lt;/span&gt; Missing lazy loading for heavy components
&lt;span class="p"&gt;   -&lt;/span&gt; Missing memoization on expensive computations
&lt;span class="p"&gt;   -&lt;/span&gt; React Query hooks without staleTime
&lt;span class="p"&gt;   -&lt;/span&gt; Unnecessary re-renders from unstable references
&lt;span class="p"&gt;
3.&lt;/span&gt; Convention violations:
&lt;span class="p"&gt;   -&lt;/span&gt; File naming doesn't match conventions
&lt;span class="p"&gt;   -&lt;/span&gt; Missing Zod schemas for new API routes
&lt;span class="p"&gt;   -&lt;/span&gt; Missing error boundaries for new routes
&lt;span class="p"&gt;   -&lt;/span&gt; Missing loading states

Flag each issue with severity: [BLOCK] must fix, [WARN] should fix, [NOTE] nice to fix.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This catches the kinds of things a linter never will: architectural drift, state management tiers getting crossed, and conventions slowly slipping over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Initialization: The Full Setup
&lt;/h2&gt;

&lt;p&gt;When I kick off a brand new project, I have a command that stands up the entire development environment for me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# /init-project&lt;/span&gt;

Initialize a new Next.js project with the team's standard setup:
&lt;span class="p"&gt;
1.&lt;/span&gt; Create Next.js app with: TypeScript, TailwindCSS, ESLint, App Router, src/ directory
&lt;span class="p"&gt;2.&lt;/span&gt; Install dependencies: zod, @tanstack/react-query, zustand, highcharts, highcharts-react-official
&lt;span class="p"&gt;3.&lt;/span&gt; Create folder structure matching CLAUDE.md conventions
&lt;span class="p"&gt;4.&lt;/span&gt; Set up path aliases in tsconfig.json
&lt;span class="p"&gt;5.&lt;/span&gt; Create base Zod utility: src/lib/validate.ts (validateResponse function)
&lt;span class="p"&gt;6.&lt;/span&gt; Create base formatting utils: src/lib/format.ts
&lt;span class="p"&gt;7.&lt;/span&gt; Create Skeleton components: src/components/ui/Skeleton.tsx
&lt;span class="p"&gt;8.&lt;/span&gt; Create QueryProvider wrapper: src/providers/QueryProvider.tsx
&lt;span class="p"&gt;9.&lt;/span&gt; Set up ESLint import rules for feature boundaries
&lt;span class="p"&gt;10.&lt;/span&gt; Create CLAUDE.md with the standard project config
&lt;span class="p"&gt;11.&lt;/span&gt; Verify the build passes

The result should be a clean, building project with all conventions baked in from the start.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rather than burning 30 minutes on boilerplate every time, I run one command and end up with a project that's already wired with our architecture patterns, validation utilities, and folder conventions.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP Servers: Connecting Claude to Your Infrastructure
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) servers let Claude reach out to external tools. The three I lean on most:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figma MCP.&lt;/strong&gt; Claude can read design specs straight out of Figma files. When I'm building a new component, I point it at the Figma node and it produces code that matches the design while reusing our existing UI components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Slack MCP.&lt;/strong&gt; Claude can pull in channel messages for context. If a bug got reported in a Slack thread, I hand Claude the thread and it picks up the report, the back-and-forth discussion, and whatever related context is buried in there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub MCP.&lt;/strong&gt; Claude can read PRs, issues, and reviews. Before it starts writing, it can scan related issues and earlier PRs to understand what's already been tried.&lt;/p&gt;

&lt;p&gt;The underlying idea is simple. Pretty much every tool your team touches daily can become context for Claude, and the more context it has, the closer its output lands to how your team actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  How This Changes Daily Development
&lt;/h2&gt;

&lt;p&gt;Here's what a typical feature session looks like for me now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Me: /scaffold-feature user-retention

Claude: [creates 5 files with correct types, API route, hook, component, barrel export]

Me: The retention chart should show weekly cohorts with drilldown by acquisition channel

Claude: [updates the component with Highcharts config, adds drilldown series,
         uses dynamic import, wraps options in useMemo, adds skeleton loader]

Me: /pre-review

Claude: [reviews all changes]
- [NOTE] Consider adding staleTime: 60000 to useRetentionData,
  retention data doesn't change every second
- [WARN] Missing error boundary in the retention route, add error.tsx
- All other checks pass

Me: [fixes the two items, creates PR]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's about 15 minutes for a feature that used to cost me two-plus hours of scaffolding, wiring, and manual review.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Means for Senior Engineers
&lt;/h2&gt;

&lt;p&gt;AI-augmented development doesn't replace architectural thinking. If anything it leans on it harder.&lt;/p&gt;

&lt;p&gt;A senior engineer's job is still to make the calls that matter: which patterns to reach for, where to draw boundaries, which tradeoffs are worth it. AI just speeds up the execution of those calls once you've made them.&lt;/p&gt;

&lt;p&gt;That's why I'd argue the commands you build are basically your architectural judgment written down. A scaffolding command captures your architecture decisions. A pre-review command captures your code review standards. A CLAUDE.md file captures your team's conventions.&lt;/p&gt;

&lt;p&gt;And that's where the leverage actually lives. You make a decision once, encode it as a command or a config, and from then on it applies consistently to every feature. No more "the senior never got around to reviewing that PR" or "the new dev didn't realize we use Zod for API responses."&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;If you want to give this a shot, here's the order I'd recommend:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start with CLAUDE.md.&lt;/strong&gt; Write up your project's architecture overview, your folder conventions, and your non-negotiable rules. This step alone makes Claude noticeably more useful.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pick your three most repetitive workflows.&lt;/strong&gt; The ones you find yourself doing every week. Write a command for each of those first.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep each command focused.&lt;/strong&gt; One command, one workflow. Resist the urge to build a single mega-command that tries to do everything. Small, composable commands that each do one thing well will serve you better.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Iterate.&lt;/strong&gt; Your first CLAUDE.md is going to have gaps. Every time Claude produces something that misses your conventions, go update the config. It compounds over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Share it with your team.&lt;/strong&gt; CLAUDE.md and your commands live in the repo, so everyone gets the same conventions and the same workflows for free.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The engineers who'll get the most out of the next few years aren't the ones who type the fastest. They're the ones who can teach these tools their standards and scale their own judgment across the whole codebase.&lt;/p&gt;

&lt;p&gt;Start with the CLAUDE.md. The rest tends to follow on its own.&lt;/p&gt;




</description>
      <category>ai</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
