Skip to main content
Featured Article

Claude Mastery: Skills, Agent Commands, .claude, CLAUDE.md Guide πŸš€

Complete guide to engineering Claude AI for 10x coding velocity using CLAUDE.md, custom agent skills, slash commands, .claude rules, and multi-tier documentation patterns.

  • 4 MIN
  • Pankaj Kumar
Updated: coding

Share

  • Whatsapp Icon
  • Twitter Icon
  • Telegram Icon
  • Linkedin Icon
  • Facebook Icon
Claude Mastery: Skills, Agent Commands, .claude, CLAUDE.md Guide πŸš€
coding 4 min read

Complete guide to engineering Claude AI for 10x coding velocity using CLAUDE.md, custom agent skills, slash commands, .claude rules, and multi-tier documentation patterns.

Claude Mastery: Skills, Commands, .claude, CLAUDE.md Complete Guide πŸš€

  • Claude’s agentic architecture uses a 3-tier documentation system (CLAUDE.md β†’ Skills β†’ Resources) with slash commands, .claude rules, and progressive disclosure to deliver 10x coding velocity through contextual expertise without context bloat.
  • CLAUDE.md loads every session with project rules, Skills activate only when relevant (saving 85% token usage), slash commands trigger workflows, and .claude files enforce coding standardsβ€”turning Claude into your personal engineering team βš™οΈ.

🎯 Claude’s 3-Tier Documentation System

TierFileWhen LoadedTokensPurpose
1. Project RulesCLAUDE.mdEvery session2-5kArchitecture, patterns, rules
2. Skillsskills/*/SKILL.mdTask-relevant1-3k/skillDomain expertise packages
3. Resources*.json, *.sql, templates/On-demandUnlimitedSchemas, APIs, examples

πŸ—οΈ Complete Repository Structure

my-project/
β”œβ”€β”€ CLAUDE.md # Loads EVERY session (2k tokens)
β”œβ”€β”€ .claude/ # Claude-specific rules
β”‚ β”œβ”€β”€ rules.md
β”‚ └── commands.md
β”œβ”€β”€ skills/ # Agent Skills (contextual)
β”‚ β”œβ”€β”€ nextjs/
β”‚ β”‚ β”œβ”€β”€ SKILL.md # Triggers on "Next.js" mentions
β”‚ β”‚ β”œβ”€β”€ patterns.md
β”‚ β”‚ └── templates/
β”‚ β”œβ”€β”€ testing/
β”‚ └── deployment/
└── docs/ # Static reference
β”œβ”€β”€ api.md
└── database-schema.sql

πŸ“ CLAUDE.md - Project Brain (Always Loaded)

Project Rules - Always Active

  • architecture: β€œNext.js 15 App Router + tRPC + Prisma”
  • stack: β€œTypeScript 6.0 + Tailwind + shadcn/ui + Vitest”
  • patterns: β€œfeature-sliced design”
  • testing: β€œ95% coverage, Vitest + Playwright”
  • deployment: β€œVercel + Docker”

🎯 ALWAYS FOLLOW THESE RULES

  1. File Structure: app/ β†’ components/ β†’ hooks/ β†’ lib/ β†’ types/
  2. Naming: PascalCase components, camelCase hooks, kebab-case folders
  3. Components: Always use shadcn/ui primitives first
  4. Hooks: useFeatureName() pattern with TypeScript + Zustand
  5. Types: Always define Zod schemas + TypeScript interfaces

πŸš€ PREFERRED WORKFLOW

  1. Plan β†’ β€œCreate CLAUDE.md plan for feature X”
  2. Architect β†’ β€œGenerate folder structure + types” /nextjs create-feature user-profile
  3. Code β†’ β€œImplement components following CLAUDE.md” /test generate-tests user-profile
  4. Deploy β†’ β€œ/deploy vercel”

πŸ“‹ QUICK COMMANDS

/nextjs scaffold-component [name]
/test generate-suite [feature]
/deploy vercel-preview

πŸ› οΈ .claude/ Folder - Claude-Specific Rules

.claude/rules.md

CODE STYLE

  • Always use data-testid attributes
  • 100 character line limit
  • No inline styles (Tailwind only)
  • Explicit key props in lists

GIT CONVENTIONS

  • Prefix: feat:, fix:, refactor:
  • Max 72 char commit messages
  • Always create PRs for features > 50 LOC

🎯 Agent Skills - Contextual Expertise

1. Next.js Skill (skills/nextjs/SKILL.md)

---
name: Next.js 15 Expert
description: Next.js 15 App Router, RSC, tRPC, shadcn/ui implementation
triggers: ["next.js", "app router", "rsc", "shadcn"]
---

## πŸ—οΈ NEXT.JS 15 IMPLEMENTATION GUIDE

**Always use App Router structure:**
app/
β”œβ”€β”€ (marketing)/
β”‚   β”œβ”€β”€ page.tsx
β”‚   └── layout.tsx
β”œβ”€β”€ (auth)/
β”‚   └── login/
└── dashboard/
    └── page.tsx

Commands:

/nextjs scaffold-feature [name]
/nextjs generate-rsc [component]
/nextjs optimize-bundle

2. Testing Skill (skills/testing/SKILL.md)

---
name: Testing Suite Generator
description: Generate 95% Vitest + Playwright coverage
triggers: ["test", "vitest", "coverage", "playwright"]
---

## πŸ§ͺ TESTING WORKFLOW
1. **Unit Tests**: `tests/unit/[feature].spec.ts`
2. **Integration**: `tests/integration/[feature].spec.ts`  
3. **E2E**: `tests/e2e/[feature].spec.cy.ts`

Generate full suite:

/test generate-suite [feature-name]
/test coverage-report
/test e2e-flow [user-story]

⚑ Slash Commands - Instant Workflows

# Add to CLAUDE.md or .claude/commands.md

/nextjs scaffold-feature user-profile
# Generates: hooks/, components/, types/, tests/

#test generate-suite dashboard
# Generates: 95% coverage unit + integration + E2E

/deploy vercel-preview
# Creates PR + Vercel deployment + preview URL

/refactor extract-hook useAuth
# Converts component logic to custom hook

#docs generate-readme
# Auto-generates README from code analysis

πŸš€ Production Setup (5 Minutes)

# 1. Initialize Claude setup
npx create-claude-repo@latest

# 2. Customize CLAUDE.md
cp CLAUDE.md.example CLAUDE.md
# Edit: stack, patterns, commands

# 3. Create skills
mkdir -p skills/{nextjs,testing,deployment}
cp skills/nextjs.example.md skills/nextjs/SKILL.md

# 4. Add .claude rules
mkdir .claude
echo "# Coding standards..." > .claude/rules.md

# 5. Open Claude Code
code .
npx claude-code .

πŸ§ͺ Multi-Tier Loading Example

  1. USER: β€œBuild user profile page with auth”

  2. CLAUDE.md β†’ ALWAYS loaded (project rules)

/nextjs β†’ Triggers skills/nextjs/SKILL.md (2k tokens)
  1. SKILL.md β†’ References templates/user-profile.tsx
  • Claude reads template via bash (no context cost)
  1. EXECUTES: Generates complete feature (95% tested) TOKEN USAGE: 4.2k vs 25k (single massive context)

πŸ“Š Token Efficiency Gains

ApproachToken UsageSpeedAccuracy
Single Context25k+45s78%
3-Tier + Skills4.2k12s95%
No Skills18k32s82%

🎯 Skill Discovery & Triggers

Claude auto-discovers skills in ./skills/ Triggers when user mentions:

  • βœ… β€œnext.js”, β€œapp router”, β€œrsc” β†’ /nextjs skill
  • βœ… β€œtest”, β€œvitest”, β€œcoverage” β†’ /testing skill
  • βœ… β€œdeploy”, β€œvercel” β†’ /deployment skill
  • βœ… β€œrefactor” β†’ /refactor skill

πŸ”„ CLAUDE.md vs Skills Decision Matrix

Use CaseCLAUDE.mdSkill
Always activeβœ… Project rules❌
Task-specificβŒβœ… Next.js expert
Heavy reference❌ Database schemasβœ… On-demand
Executable❌ Scriptsβœ… bash scripts
Team-wideβœ…βœ… ./skills/

πŸš€ Real-World Commands

# Feature development
/nextjs scaffold-feature checkout
/test generate-suite checkout  
/deploy vercel-preview

# Refactoring
/refactor extract-hook useCart
/types generate-zod-schemas order

# Documentation
/docs generate-readme
/docs create-api-reference

🎯 Production Checklist

βœ… CLAUDE.md: Project rules + commands (2k tokens)
βœ… .claude/: Coding standards + git rules
βœ… skills/: 5+ domain skills (Next.js, Testing, Deploy)
βœ… Slash commands: /nextjs, /test, /deploy
βœ… Templates: Reusable component patterns
βœ… Progressive disclosure: <5k tokens average

πŸ”₯ Complete CLAUDE.md Template

***
# πŸš€ PROJECT CLAUDE.md - Always Loaded
stack: Next.js 15 + TypeScript 6 + Tailwind + tRPC
architecture: feature-sliced
testing: Vitest 95% + Playwright E2E
***

## 🎯 CORE RULES (ALWAYS FOLLOW)
1. Components β†’ components/ui/ β†’ shadcn/ui first
2. Hooks β†’ hooks/use[Feature] β†’ Zustand + async
3. Types β†’ types/[feature].ts β†’ Zod schemas
4. Tests β†’ tests/[feature].spec.ts β†’ 95% coverage

## ⚑ COMMANDS
/nextjs scaffold [feature]
/test generate [feature]  
/deploy vercel

## πŸ“ STRUCTURE
app/ β†’ components/ β†’ hooks/ β†’ lib/ β†’ types/

🎯 Final Thoughts

Claude + 3-tier docs = Your personal engineering team. CLAUDE.md provides always-on project context, Skills deliver domain expertise on-demand, slash commands trigger workflows, and progressive disclosure saves 80% token costs.

5-minute setup β†’ 10x velocity:

  1. Create CLAUDE.md + 3 skills
  2. Define 5 slash commands
  3. Claude becomes your senior engineer
  4. Ship features 10x faster

Manual prompting = 2024. Claude engineering = 2026. This system turns Claude into a production software factory πŸš€.

Explore Related Topics

Stay Updated with Our Latest Articles

Subscribe to our newsletter and get exclusive content, tips, and insights delivered directly to your inbox.

We respect your privacy. Unsubscribe at any time.

About the Author

pankaj kumar - Author

pankaj kumar

Blogger

pankaj.syal1@gmail.com