joabgonzalez/ai-agents-skills/code-conventions
Claude Code and agent skill by joabgonzalez/ai-agents-skills
- community
Checking that the SKILL.md file is still in the repository.
Universal coding principles: DRY, security by default, null guards, and YAGNI. Trigger: When writing or reviewing code in any language or technology.
Install
npx vskill@latest install joabgonzalez/ai-agents-skills/code-conventionsSKILL.md
The same SKILL.md was published earlier as joabgonzalez/ai-agents-skills/code-conventions.
Code Conventions
Universal coding principles and meta-conventions: how to write clean, secure, and robust code regardless of language or framework. Covers naming, file structure, organization, and active quality principles. Tech-specific conventions live in their respective skills.
When to Use
- Writing new functions, classes, or modules in any language
- Applying quality principles during code generation
- Naming variables, functions, classes, files across any technology
- Organizing code structure and project layout
- Reviewing code for general best practices
- Establishing cross-project standards
Don't use for:
- TypeScript-specific patterns (import type, no any) → use typescript skill
- Framework-specific patterns (hooks, JSX) → use react/vue/etc skill
- Accessibility → a11y skill
- Architecture decisions → architecture-patterns skill
- Linting/formatting tools → code-quality skill
Critical Patterns
Universal rules only. TypeScript/JS-specific patterns (import type, no any, static imports) → see typescript skill.
✅ REQUIRED: Consistent Naming
Apply across any language:
Booleans: is, has, should prefixes (isActive, hasPermission).
Callbacks: handle or on prefix (handleClick, onSubmit).
Abbreviations: Well-known OK (HTTP, API, URL, ID). Avoid custom (userId OK, usrId not).
Acronyms: Treat as words (HttpService not HTTPService, apiKey not aPIKey).
✅ REQUIRED: Single Responsibility per File
Rule: File name = single, clear responsibility. If you can't name it clearly, it does too much.
✅ REQUIRED: No Dead Code
✅ REQUIRED: Avoid Variable Shadowing
Rule: Inner scope names must not shadow outer scope names.
DELEGATE: Import Organization (TypeScript/JS)
For import type, named vs namespace imports, barrel exports → see typescript or javascript skill.
✅ REQUIRED: DRY — No Duplicate Logic
Before writing new logic, check if it already exists. Extract when the same logic appears in 2+ places.
✅ REQUIRED: Security by Default (Non-Negotiable)
These rules are inviolable — never produce code that violates them.
Rules:
- Never concatenate external input into queries or shell commands
- Never hardcode secrets, tokens, or credentials in source
- Validate all external input at the system boundary, not in inner layers
- State-changing endpoints require an auth check
✅ REQUIRED: Robustness — Fail Fast, No Swallow
✅ REQUIRED: YAGNI — Don't Build What Isn't Needed Today
Signals of YAGNI violation:
- Config parameters with only one possible value today
- Abstractions for "when we eventually need X"
- Commented-out code "just in case"
- Feature flags for unplanned functionality
Decision Tree
Quick reference:
- Naming a variable/function? → camelCase
- Naming a class/component? → PascalCase
- Naming a constant? → UPPER_SNAKE_CASE
- Naming a file? → kebab-case (non-component), PascalCase (component)
- File has too many responsibilities? → Split by SRP
- Unused import/variable/function? → Delete it
- Variable name conflicts with outer scope? → Rename to avoid shadowing
- Logic duplicated in 2+ places? → Extract (DRY)
- Input from user, API, or file? → Validate at boundary, parameterize queries
- Value could be null? → Guard at entry, fail fast
- Building for a future use case? → YAGNI — don't
- TypeScript-specific question? → See typescript skill
Example
Naming and structure conventions applied to a user authentication module.
Every file has one clear name that matches its single responsibility. No utils.ts, no shadowed variables, no commented-out code.
Edge Cases
File naming conflicts: Match export name (UserService.ts exports UserService). Use index.ts for barrel exports.
Shared utilities: A file named utils.ts with 10+ unrelated helpers violates SRP. Split by domain (dateUtils.ts, stringUtils.ts).
Dead code in tests: Test helpers are used by tests. Not dead code. Only delete helpers with zero test callers.
Shadowing in destructuring: const { id } = user; const { id } = item; — avoid repeated names in same scope. Rename: const { id: userId } = user;
Resources
- naming-conventions.md — Boolean prefixes, acronyms, descriptive names
- code-structure.md — SRP for files, feature vs layer grouping, colocation
- documentation-standards.md — JSDoc, inline comments, README guidelines
TypeScript-specific conventions (import type, no any, static imports) → typescript
Related: code-quality, architecture-patterns
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/code-conventions/SKILL.md
Popularity
- Repository stars
- 9
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/joabgonzalez/ai-agents-skills/code-conventions)