| name | axel-code-forge |
| description | Use when enforcing Axel's coding standards across any language for architecture, reuse, imports, and maintainability, plus React/Next.js-specific rules only where explicitly stated (for example useEffect and JSX handlers). |
Axel Code Forge
Purpose
Enforce Axel's coding conventions with focus on consistency, reuse, and maintainability. Apply React/Next.js rules only where explicitly marked.
Scope
- General (any language): architecture, modularity, imports, constants, null safety, decomposition, reuse.
- React/Next.js only: rules tied to React/Next APIs or JSX semantics, explicitly tagged.
When to Use
- Any feature or bugfix where code quality matters
- Refactors and file organization
- Code review and quality hardening
- UI implementation with design tokens
Non-Negotiable Rules
- [General] Use absolute imports only. Avoid relative imports in app code.
- [General] Avoid hardcoded values. Use constants, shared config, design tokens, or enums.
- [React/Next] Avoid inline functions in JSX handlers (
onClick, onChange). Define stable handlers.
- [General] Never assume values exist. Guard nullable/optional values before use.
- [React/Next] Keep hooks focused. Avoid long
useEffect and large state blobs.
- [General] No God components. Split large components into atomic, reusable units.
- [General/UI] Prefer project theme/color tokens over raw Tailwind palette classes.
- [General] Avoid comments by default. One concise English comment only for critical context.
- [General/UI] Keep SVGs outside feature pages. Place in icons folder or shared components.
- [General] Prioritize reusable components and utility functions.
- [General] Use feature-based separation (atomic split by concern).
- [General] Follow existing project patterns for shared primitives.
- [React/Next] Follow existing patterns for Redux and custom hooks.
Implementation Checklist
Preferred Refactor Direction
When touching complex files:
- Extract constants and mappings
- Extract row/item subcomponents
- Extract pure helper functions
- Reduce inline object/function creation in render
- Keep behavior identical unless requirements demand change
Auto-Update Protocol
HEFESTO manages this skill. User preferences evolve.
Detection Triggers
Detect when user teaches a preference:
- Explicit: "siempre", "nunca", "preferimos", "regla:", "acordate"
- Implicit: Correcting code with a pattern, repeating a preference
- Review: "esto esta mal porque...", "mejor asi..."
Update Flow
1. HEFESTO detects preference pattern
2. Ask: "Agrego esto a axel-code-forge?"
3. If approved:
a) Check for conflicts with existing rules
b) If conflict: "Esto choca con regla X. Cual priorizamos?"
c) If clear: Add to Non-Negotiable Rules
d) Confirm: "Agregado: [rule summary]"
4. If rejected: Note in session, don't persist
Conflict Resolution
When new rule conflicts with existing:
HEFESTO: "La regla nueva 'always use ternaries'
choca con la existente 'avoid nested ternaries'.
Cual priorizamos?
1. Keep existing, reject new
2. Replace existing with new
3. Merge: allow simple ternaries, avoid nested"
User: "3"
HEFESTO: "Actualizado:
- [General] Use simple ternaries. Avoid nested ternaries (use if/else)."
Rule Format for New Additions
X. [Scope] Rule description in imperative form.
Where:
- X = next number in sequence
- Scope = General | React/Next | General/UI
- Description = clear, actionable statement
Example Updates
User says: "Nunca uses any, siempre unknown"
HEFESTO: "Agrego a axel-code-forge:
14. [General] Never use `any`. Prefer `unknown` with type guards.
Dale?"
User corrects code: Changes arr.map(x => x.id) to arr.map((item) => item.id)
HEFESTO: "Noto que preferis parametros descriptivos en callbacks.
Agrego?
15. [General] Use descriptive parameter names in callbacks (item, user, not x, i).
Dale?"
Validation
Before adding rule, HEFESTO checks:
- Not redundant with existing rule
- Not contradictory to existing rule
- Follows existing rule format
- Is actionable (not vague)
If validation fails, explain why and suggest alternative wording.