From coding-standards
Interview a developer to extract their coding preferences, analyze their codebase for patterns, and generate/update coding-standards files. Use when onboarding a new project, onboarding a new developer, or when standards need a refresh.
How this skill is triggered — by the user, by Claude, or both
Slash command
/coding-standards:coding-interviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Extract a developer's coding DNA through structured conversation and codebase analysis. Produces or updates `~/.claude/skills/coding-standards/` files.
Extract a developer's coding DNA through structured conversation and codebase analysis. Produces or updates ~/.claude/skills/coding-standards/ files.
Before asking anything, analyze the codebase to understand what patterns already exist. This prevents asking obvious questions the code already answers.
Run these searches in parallel:
package.json, tsconfig.json, framework configsOutput of Phase 1: Internal notes (not shown to user yet). A profile of what the codebase already tells us.
Present what you found as a "Code Style Profile" — a summary of their patterns organized by category. Then ask targeted questions about things the code DOESN'T answer.
Template:
Based on your codebase, here's what I see as your coding style:
## Component Architecture
- [observed pattern]
- [observed pattern]
## TypeScript
- [observed pattern]
## State Management
- [observed pattern]
## Backend
- [observed pattern]
## File Organization
- [observed pattern]
**Questions I couldn't answer from the code:**
1. [Specific question about an ambiguous pattern]
2. [Question about a preference not visible in code]
3. [Question about something inconsistent across files]
Good questions to ask:
Bad questions (the code already answers):
Go through each coding-standards topic, presenting your understanding and asking for confirmation or correction. One topic per message, not all at once.
Topic order:
For each topic:
After confirming all topics, identify what's NOT covered:
Based on the interview, generate or update the coding-standards files:
If new project (/coding-interview new):
~/.claude/skills/coding-standards/ structureIf refresh (/coding-interview refresh):
If extend (/coding-interview extend):
The standards are only useful if the codebase actually passes them. This phase catches existing violations and helps fix them.
Run the pre-commit hook against the FULL codebase (not just staged files):
# Temporarily stage everything to simulate a full check
git stash
git add -A
./scripts/check-coding-standards.sh
git reset HEAD .
git stash pop
Report results:
"Ran the standards against your full codebase. Found:
- X BLOCKING violations across Y files
- Z warnings across W files
- Top 3 patterns to fix: [list]"
For each violation category, ask the developer:
Found 12 files with `any` type usage. Options:
A) Fix all now (I'll refactor each to use proper types)
B) Fix the worst 3, create a ticket for the rest
C) Accept as-is and lower severity to WARNING
D) Add to .coding-standards-ignore (tech debt, will fix later)
Never auto-fix without asking. Present the plan, let them choose.
When the developer chooses to fix, group refactors into logical batches:
Batch 1: Type extraction (extract inline types to domain types.ts files)
- components/course/course-card.tsx -> components/course/types.ts
- components/workshop/feedback-form.tsx -> components/workshop/types.ts
... 8 more files
Batch 2: Constant centralization (move duplicated constants to shared location)
- COURSE_SLUG defined in 3 files -> src/lib/constants.ts
... 4 more constants
Batch 3: Component reuse (replace inline styling with DLS components)
- custom card div in feature-card.tsx -> use <Card> from DLS
... 2 more files
Batch 4: Backend auth gaps (add auth guards to unprotected functions)
- convex/courses.ts:listDrafts -> add requireAdmin()
... 3 more functions
Rules for refactoring:
refactor(standards): [batch description]For tech debt the developer accepts but wants to track:
# .coding-standards-ignore
# Lines here are known violations accepted as tech debt.
# Format: file:rule:reason
#
# Review quarterly. Remove lines as violations are fixed.
src/legacy/old-dashboard.tsx:any:legacy code, full rewrite planned Q3
convex/migrations/backfill_users.ts:audit-fields:one-time migration, won't run again
The pre-commit hook should skip files/rules listed here. Add to the hook:
IGNORE_FILE=".coding-standards-ignore"
is_ignored() {
local file="$1" rule="$2"
[ -f "$IGNORE_FILE" ] && grep -q "^${file}:${rule}:" "$IGNORE_FILE"
}
After all refactoring batches:
./scripts/check-coding-standards.sh
Expected output:
PASSED — all clean (or PASSED with N accepted warnings)
Checked X files
If clean, confirm:
"Your codebase now passes all coding standards. The pre-commit hook will enforce these going forward. Any new violations will be caught before commit."
Suggest to the developer:
"To keep standards healthy over time:
- Run
/coding-interview refreshquarterly to check for drift- Run
/lintbefore shipping features for a deep audit- Review
.coding-standards-ignorequarterly — delete fixed violations- When you add a new pattern or convention, run
/coding-interview extendto codify it"
The generated standards must be:
~/.claude/skills/coding-standards/
├── SKILL.md # Entry point + manifest
├── lint-config.md # Severity levels
├── rules/
│ ├── reuse-first.md # Extend vs create philosophy
│ ├── component-architecture.md # Component anatomy, props, CVA
│ ├── naming-conventions.md # All naming rules
│ ├── file-organization.md # Domain-driven structure
│ ├── types-and-constants.md # Type/constant reuse hierarchy
│ ├── typescript-quality.md # Strict mode, type patterns
│ ├── react-patterns.md # Server/client, hooks, anti-patterns
│ ├── tailwind-and-tokens.md # Styling rules (if Tailwind)
│ ├── state-management.md # Where state lives
│ ├── [backend].md # Backend-specific (convex/prisma/etc)
│ ├── security.md # Auth, validation, secrets
│ ├── error-handling.md # Boundaries, retry, resilience
│ └── general-quality.md # Idioms, comments, defensive coding
└── checklists/
├── before-creating.md # Pre-coding guard
└── before-committing.md # Post-write checklist
Not all files are needed for every project. Skip files for areas the project doesn't use (e.g., skip convex-backend.md for a Prisma project).
After generating all files, integrate them so Claude always sees the standards:
Global CLAUDE.md (~/.claude/CLAUDE.md):
coding-standards/SKILL.md to auto-loaded skills listProject CLAUDE.md (if exists):
~/.claude/skills/coding-standards/"Existing lint/organize skills (if they exist):
coding-standards/lint-config.md for severityDelete redundant files:
Confirm with developer:
"Standards are set up. Here's what changed:
- Created: [N] rule files in coding-standards/
- Updated: CLAUDE.md (removed [N] lines of duplicated rules)
- Deleted: [list of old files]
- Pre-commit hook: [installed/offered]
From now on, coding-standards/ is the single source of truth. Use
/coding-interview refreshanytime to re-analyze."
| File | Purpose |
|---|---|
stack-detection.md | What to look for per language/framework. Analysis templates for TS, Python, Go, Rust, Ruby, PHP, mobile. |
hook-generation.md | Pre-commit hook templates per ecosystem. Husky, pre-commit, Lefthook, raw git hooks. Check blocks for TS, Python, Go, Rust, Ruby, PHP + universal checks. |
After generating standards, ALWAYS offer to set up enforcement:
hook-generation.md for the right hook system + check blocksscripts/check-coding-standards.sh with stack-appropriate checksnpx claudepluginhub likeahuman-ai/likeahuman --plugin coding-standardsGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.