afrexai-claude-code-production
Complete Claude Code productivity system — project setup, prompting patterns, sub-agent orchestration, context management, debugging, refactoring, TDD, and shipping 10X faster. Zero scripts needed.
Install / Use
npx skills add LeoYeAI/openclaw-master-skills --skill afrexai-claude-code-productionInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of afrexai-claude-code-production
afrexai-claude-code-production scores 90/100 on our quality scale, 1216th of 2,790 Automation skills we index (top 44%).
Its SKILL.md is 21 KB long, well organised into 69 sections with 23 code examples: a thorough specification that gives an agent plenty to work with.
With 2,149 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-30 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-30. Automated pattern scan on 2026-09-30. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
afrexai-claude-code-production compared with similar skills
All 4 of these similar skills score higher than afrexai-claude-code-production; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| afrexai-claude-code-production (this skill)by LeoYeAI | 90 | 2.1k | 4mo ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
Frequently asked questions
- How do I install afrexai-claude-code-production?
- Run
npx skills add LeoYeAI/openclaw-master-skills --skill afrexai-claude-code-production. The install tabs above show the steps for each supported agent. - Which AI agents does afrexai-claude-code-production work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is afrexai-claude-code-production safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is afrexai-claude-code-production still maintained?
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubname: afrexai-claude-code-production version: "1.0.0" description: "Complete Claude Code productivity system — project setup, prompting patterns, sub-agent orchestration, context management, debugging, refactoring, TDD, and shipping 10X faster. Zero scripts needed." author: "AfrexAI" license: "MIT" metadata: {"openclaw":{"emoji":"⚡"}}
Claude Code Production Engineering
The complete methodology for shipping production code with Claude Code at 10X speed. Not installation scripts — actual patterns, workflows, and techniques that compound your output.
Quick Health Check (run mentally before every session)
| Signal | Healthy | Fix |
|--------|---------|-----|
| CLAUDE.md exists at project root | ✅ | Create one (see §1) |
| .claueignore configured | ✅ | Add noise directories |
| Session context under 60% | ✅ | /compact or start fresh |
| Clear task scope before prompting | ✅ | Write task brief first |
| Tests exist for target code | ✅ | Write tests first (§7) |
| Git clean before big changes | ✅ | Commit or stash |
| Sub-agents for parallel work | ✅ | Use /new or Task tool |
| Verifying output, not trusting blindly | ✅ | Always review diffs |
Score: /8. Below 6 = slow, buggy sessions. Fix before coding.
1. Project Setup — CLAUDE.md Architecture
CLAUDE.md is your project's brain. Claude reads it at session start. A good one saves thousands of tokens per session.
Template
# Project: [name]
## Tech Stack
- Language: TypeScript (strict mode)
- Framework: Next.js 15 App Router
- Database: PostgreSQL via Drizzle ORM
- Testing: Vitest + Playwright
- Styling: Tailwind CSS v4
## Architecture Rules
- Max 50 lines per function, 300 lines per file
- One responsibility per file
- All exports typed — no `any`
- Errors as values (Result type), not thrown exceptions
- Database: migrations via `drizzle-kit generate` then `drizzle-kit push`
## File Structure
src/
app/ → Next.js routes (thin — call services)
lib/ → Business logic (pure functions)
db/ → Schema, migrations, queries
components/ → UI (server components default, 'use client' only when needed)
types/ → Shared type definitions
## Commands
- `pnpm dev` — start dev server
- `pnpm test` — run vitest
- `pnpm test:e2e` — run playwright
- `pnpm lint` — eslint + tsc --noEmit
- `pnpm db:generate` — generate migration
- `pnpm db:push` — apply migration
## Conventions
- Imports: absolute from `@/` (mapped to `src/`)
- Naming: camelCase functions, PascalCase components/types, SCREAMING_SNAKE constants
- Commits: conventional commits (feat:, fix:, refactor:, test:, docs:)
- PRs: always create branch, never commit to main directly
CLAUDE.md Rules
- Be specific — "TypeScript strict" not "use types." Stack versions, not just names.
- Include commands — Claude needs to know how to run things. Exact commands, not descriptions.
- Architecture decisions — document WHY, not just what. "Errors as values because we use Result type" tells Claude the pattern.
- Keep it under 200 lines — CLAUDE.md is read every session. Bloat wastes tokens.
- Update when patterns change — stale CLAUDE.md causes Claude to fight your codebase.
- Nested CLAUDE.md — subdirectories can have their own. Claude merges them. Use for monorepo packages.
.claueignore
node_modules/
.next/
dist/
coverage/
*.lock
.git/
*.min.js
*.map
public/assets/
Rule: if Claude doesn't need to read it, ignore it. Large lock files and build artifacts waste context.
2. Prompting Patterns — The 5 That Matter
Pattern 1: Task Brief (use for any non-trivial work)
Task: Add user authentication with magic links
Context: Using Resend for email, no password system exists yet
Constraints:
- Server actions only (no API routes)
- Session via httpOnly cookies
- Token expires in 15 minutes
Acceptance: User enters email → receives link → clicks → logged in → cookie set
Start with: the database schema for sessions and tokens
Why it works: scope + constraints + acceptance criteria + starting point. Claude doesn't wander.
Pattern 2: Show, Don't Tell
Bad: "Make the API more robust"
Good: "Add input validation to POST /api/users — validate email format, name 1-100 chars, reject extra fields. Return 422 with field-level errors matching this shape: { errors: { field: string, message: string }[] }"
Rule: if you can't describe the exact output shape, you don't know what you want yet. Think first.
Pattern 3: Incremental Refinement
Step 1: "Create the database schema for a todo app with projects and tasks"
[review output]
Step 2: "Now add the CRUD service layer for tasks — pure functions, no framework imports"
[review output]
Step 3: "Now the API routes that call those services — input validation with zod"
Why: Claude produces better code in focused steps than in one massive prompt. Each step builds verified context.
Pattern 4: Fix With Evidence
Bad: "It's broken"
Good: "Running pnpm test gives this error:
TypeError: Cannot read properties of undefined (reading 'id')
at getUserById (src/lib/users.ts:23:15)
The function expects a User object but receives undefined when the database query returns no rows. Add a null check and return a Result type."
Rule: paste the actual error. Claude is excellent at fixing bugs when it can see the stack trace.
Pattern 5: Architecture Discussion
I'm deciding between these approaches for real-time updates:
A) Server-Sent Events from Next.js API routes
B) WebSocket via separate service
C) Polling every 5 seconds
Context: 500 concurrent users, updates every 30 seconds on average, deployed on Vercel.
What are the tradeoffs? Recommend one with reasoning.
Use this for decisions, not implementation. Get the answer, THEN switch to Task Brief for building.
3. Context Management — The #1 Productivity Lever
Context Is Milk — It Spoils
| Context % | Action |
|-----------|--------|
| 0-30% | Fresh. Do complex work here. |
| 30-60% | Good. Continue current task. |
| 60-80% | Getting stale. Finish current unit, then compact. |
| 80%+ | Dangerous. /compact immediately or start new session. |
When to Start Fresh (/new)
- Switching to unrelated task
- Context above 70%
- Claude starts repeating itself or making mistakes it didn't make earlier
- After shipping a feature (clean slate for next one)
When to Compact (/compact)
- Mid-task but context bloating from exploration
- After a debugging session (lots of error output consumed context)
- Before a complex implementation step
Context-Efficient Habits
- Don't paste entire files — reference by path. Claude can read them.
- Don't re-explain — if it's in CLAUDE.md, don't repeat it in prompts.
- Use specific file paths — "Look at
src/lib/auth.tsline 45" not "look at the auth code." - Close tangents — if Claude goes down a rabbit hole, redirect immediately. Don't let bad output consume context.
- One concern per message — "Fix the auth bug AND refactor the database layer AND add tests" = context explosion. Sequential > parallel in a single session.
4. Sub-Agent Orchestration — Parallel Productivity
When to Use Sub-Agents
| Scenario | Pattern | |----------|---------| | Independent features | Spawn sub-agent per feature | | Tests + implementation | One agent writes tests, main writes code | | Research + build | Sub-agent researches API docs, main builds | | Refactor + maintain | Sub-agent refactors module A, main works on B | | Code review | Sub-agent reviews your PR with fresh eyes |
Task Tool Pattern (Claude Code native)
Use the Task tool to:
1. Research the Stripe API for subscription billing
2. Return: webhook event types we need, API calls for create/update/cancel, error codes to handle
Task tool spawns a sub-agent with its own context. Results come back summarized. Perfect for research that would bloat your main context.
Handoff Documents
When a sub-agent finishes complex work, have it write a HANDOFF.md:
## What Was Done
- Implemented Stripe webhook handler at src/app/api/webhooks/stripe/route.ts
- Added 4 event handlers: checkout.session.completed, invoice.paid, invoice.payment_failed, customer.subscription.deleted
## Key Decisions
- Used Stripe SDK v14 (not raw HTTP) for type safety
- Webhook signature verification via stripe.webhooks.constructEvent()
- Idempotency: check processed_events table before handling
## What's Next
- Wire up subscription status updates to user table
- Add retry logic for failed database writes
- E2E test with Stripe CLI: `stripe trigger checkout.session.completed`
## Gotchas
- Must use raw body (not parsed JSON) for signature verification
- Next.js App Router: export const runtime = 'nodejs' (not edge)
5. Debugging Workflow — Systematic, Not Random
The DEBUG Protocol
Describe the symptom (what you see vs. what you expect) Error output (paste full stack trace, not summary) Bisect (when did it last work? what changed?) Unit isolate (can you reproduce in a test?) Generate hypothesis (ask Claude for 3 possible causes, ranked)
Effective Bug Prompts
Bug: Users see stale data after updating their profile.
Expected: After PUT /api/profile, the profile page shows updated data.
Actual: Old data persists until hard refresh (Cmd+Shift+R).
Stack:
- Next.js 15 App Router
- Server component fetches user data
- Client component with form calls server action
- Server action calls db.update()
Hypothesis: Next.js is caching the server component fetch. Need to revalidate.
Can you confirm and show me the fix?
When Claude Gets Stuck
- Add constraints — "The fix must not change the API contract" narrows the search space.
- Share what you've tried — "I already tried revalidatePath('/profile') and it didn't work because..."
- Ask for alternatives — "Give me 3 different approaches to solve this, with tradeoffs."
- Fresh session — sometimes the context is poisoned. Start clean with just the bug description.
6. Refactoring Patterns — Safe Large-Scale Changes
The Refactoring Safety Net
Before any refactoring session:
Before we start refactoring:
1. Run the test suite and confirm it passes: `pnpm test`
2. Commit current state: `git add -A && git commit -m "chore: pre-refactor checkpoint"`
3. Create a branch: `git checkout -b refactor/[description]`
Safe Refactoring Prompts
Extract function:
Extract the email validation logic from src/lib/users.ts (lines 34-67) into a separate
function `validateEmail` in src/lib/validation.ts. Update all imports. Run tests after.
Rename across codebase:
Rename the `getUserData` function to `fetchUserProfile` across the entire codebase.
This includes: function definition, all call sites, all imports, all test references.
Run `pnpm test` and `pnpm lint` after to verify nothing broke.
Split large file:
src/lib/api.ts is 800 lines. Split it into:
- src/lib/api/users.ts (user-related functions)
- src/lib/api/projects.ts (project-related functions)
- src/lib/api/shared.ts (shared types and helpers)
- src/lib/api/index.ts (re-exports for backward compatibility)
Preserve all existing exports from the index file so no external imports break.
Run tests after each file move.
Multi-File Refactoring Rules
- One type of change at a time — don't rename AND restructure AND optimize simultaneously.
- Run tests after each step — catch breaks early, not after 20 files changed.
- Preserve exports — use index.ts re-exports so consumers don't break.
- Commit incrementally — one commit per logical change, not one giant commit.
7. Test-Driven Development With Claude Code
The TDD Loop
Step 1: "Write a failing test for: creating a user with valid email stores them in the database"
Step 2: [verify test fails for the r
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Scrapling
103.6k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
