Skip to content
cccskills
FreePublished on GitHubEnglish overview

coding-standards

Apply shared coding conventions to new modules, reviews, and refactoring. Guides descriptive naming, readable structure, updates that preserve existing data, and error handling, giving teams a consistent basis for checking code quality.

OriginalShow the original description

Convenciones de codificación base entre proyectos para nomenclatura, legibilidad, inmutabilidad y revisión de calidad de código. Usar skills de frontend o backend para patrones específicos de frameworks.

AI rating90/ 100See how to install

Good for

  • Setting coding conventions for a new project
  • Reviewing code readability and maintainability
  • Refactoring duplication and deeply nested logic
  • Introducing coding conventions to new contributors

Overview

What it does

Review code naming and structure against shared conventions to make code readable and maintainable. The guidance covers clear variable and function names, updates that create new values instead of changing existing data directly, error handling, and type declarations. It also helps identify duplicate logic, long functions, deeply nested conditions, and unexplained numeric values, with guidance for simplifying the structure. Examples focus on TypeScript and JavaScript, and you can also review comments and test names.

When it helps

Use it when deciding how to write a new project or module, or when aligning the criteria used in code reviews. It also helps organize existing code and share coding conventions with people joining the project.

Example requests

  • “Review this code for naming, duplicate logic, and error handling.”
  • “Make these deeply nested conditions and long functions easier to read.”
  • “Align the new module’s naming and file organization with our shared conventions.”

Notes

The main focus is basic conventions shared across projects. For React-specific structure, the guidance points to frontend-patterns. For server structure and API design, it points to backend-patterns or api-design.

This overview was written by AI (OpenAI Codex) from the public SKILL.md. Check the original below for the exact behavior.

Objective evaluation

AI rated this skill on four points using only the contents of its SKILL.md. Stars and popularity are not taken into account.

Clear instructionsIs it clear when to use it and what it does?
AGoodIt specifies new development, review, and refactoring as use cases, with an explicit scope including naming.
Concrete stepsAre steps, inputs, outputs, and examples spelled out?
BPartly lackingNaming and immutability have contrasting examples, but no review sequence or output format is specified.
SafetyAre sending data, deleting files, and running commands disclosed?
AGoodIt includes illustrative code but no instructions to transmit data externally, delete files, or read credentials.
Easy setupDoes it need few tools or API keys, and are they documented?
AGoodConsulting the conventions requires no additional tool installation or API keys.

The total counts each point as A = 25, B = 15, C = 5. Rated by AI (OpenAI Codex) as of Oct 19, 2026. Treat it as a guide and read the original before installing.

Disagree? Request a re-evaluation

Tell us which point is wrong and why. No login needed. We will check it against the SKILL.md, redo the evaluation, and show the result here.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

Files included (1)

  • SKILL.md13.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Estándares de Codificación y Buenas Prácticas

Convenciones de codificación base aplicables en todos los proyectos.

Este skill es el suelo compartido, no el manual detallado de frameworks.

  • Usar frontend-patterns para React, estado, formularios, renderizado y arquitectura UI.
  • Usar backend-patterns o api-design para capas de repositorio/servicio, diseño de endpoints, validación y aspectos específicos del servidor.
  • Usar rules/common/coding-style.md cuando necesites la capa de reglas reutilizables más corta en lugar de un recorrido completo del skill.

Cuándo Activar

  • Iniciar un nuevo proyecto o módulo
  • Revisar código para calidad y mantenibilidad
  • Refactorizar código existente para seguir convenciones
  • Hacer cumplir consistencia en nomenclatura, formato o estructura
  • Configurar reglas de linting, formato o verificación de tipos
  • Incorporar nuevos colaboradores a las convenciones de codificación

Límites de Alcance

Activar este skill para:

  • nomenclatura descriptiva
  • valores predeterminados de inmutabilidad
  • legibilidad, KISS, DRY y aplicación de YAGNI
  • expectativas de manejo de errores y revisión de code smells

No usar este skill como fuente principal para:

  • Composición, hooks o patrones de renderizado de React
  • Arquitectura backend, diseño de API o capas de base de datos
  • Orientación específica de frameworks cuando ya existe un skill ECC más específico

Principios de Calidad de Código

1. Legibilidad Primero

  • El código se lee más de lo que se escribe
  • Nombres claros para variables y funciones
  • Código auto-documentado preferido sobre comentarios
  • Formato consistente

2. KISS (Keep It Simple, Stupid)

  • La solución más simple que funcione
  • Evitar sobreingeniería
  • Sin optimización prematura
  • Fácil de entender > código inteligente

3. DRY (Don't Repeat Yourself)

  • Extraer lógica común en funciones
  • Crear componentes reutilizables
  • Compartir utilidades entre módulos
  • Evitar programación por copiar y pegar

4. YAGNI (You Aren't Gonna Need It)

  • No construir features antes de que sean necesarias
  • Evitar generalidad especulativa
  • Agregar complejidad solo cuando sea requerido
  • Empezar simple, refactorizar cuando sea necesario

Estándares TypeScript/JavaScript

Nomenclatura de Variables

// PASS: BIEN: Nombres descriptivos
const marketSearchQuery = 'election'
const isUserAuthenticated = true
const totalRevenue = 1000

// FAIL: MAL: Nombres poco claros
const q = 'election'
const flag = true
const x = 1000

Nomenclatura de Funciones

// PASS: BIEN: Patrón verbo-sustantivo
async function fetchMarketData(marketId: string) { }
function calculateSimilarity(a: number[], b: number[]) { }
function isValidEmail(email: string): boolean { }

// FAIL: MAL: Poco claro o solo sustantivo
async function market(id: string) { }
function similarity(a, b) { }
function email(e) { }

Patrón de Inmutabilidad (CRÍTICO)

// PASS: SIEMPRE usar el operador spread
const updatedUser = {
  ...user,
  name: 'New Name'
}

const updatedArray = [...items, newItem]

// FAIL: NUNCA mutar directamente
user.name = 'New Name'  // MAL
items.push(newItem)     // MAL

Manejo de Errores

// PASS: BIEN: Manejo de errores comprensivo
async function fetchData(url: string) {
  try {
    const response = await fetch(url)

    if (!response.ok) {
      throw new Error(`HTTP ${response.status}: ${response.statusText}`)
    }

    return await response.json()
  } catch (error) {
    console.error('Fetch failed:', error)
    throw new Error('Failed to fetch data')
  }
}

// FAIL: MAL: Sin manejo de errores
async function fetchData(url) {
  const response = await fetch(url)
  return response.json()
}

Buenas Prácticas de Async/Await

// PASS: BIEN: Ejecución paralela cuando sea posible
const [users, markets, stats] = await Promise.all([
  fetchUsers(),
  fetchMarkets(),
  fetchStats()
])

// FAIL: MAL: Secuencial cuando no es necesario
const users = await fetchUsers()
const markets = await fetchMarkets()
const stats = await fetchStats()

Seguridad de Tipos

// PASS: BIEN: Tipos apropiados
interface Market {
  id: string
  name: string
  status: 'active' | 'resolved' | 'closed'
  created_at: Date
}

function getMarket(id: string): Promise<Market> {
  // Implementación
}

// FAIL: MAL: Usar 'any'
function getMarket(id: any): Promise<any> {
  // Implementación
}

Buenas Prácticas de React

Estructura de Componentes

// PASS: BIEN: Componente funcional con tipos
interface ButtonProps {
  children: React.ReactNode
  onClick: () => void
  disabled?: boolean
  variant?: 'primary' | 'secondary'
}

export function Button({
  children,
  onClick,
  disabled = false,
  variant = 'primary'
}: ButtonProps) {
  return (
    <button
      onClick={onClick}
      disabled={disabled}
      className={`btn btn-${variant}`}
    >
      {children}
    </button>
  )
}

// FAIL: MAL: Sin tipos, estructura poco clara
export function Button(props) {
  return <button onClick={props.onClick}>{props.children}</button>
}

Custom Hooks

// PASS: BIEN: Custom hook reutilizable
export function useDebounce<T>(value: T, delay: number): T {
  const [debouncedValue, setDebouncedValue] = useState<T>(value)

  useEffect(() => {
    const handler = setTimeout(() => {
      setDebouncedValue(value)
    }, delay)

    return () => clearTimeout(handler)
  }, [value, delay])

  return debouncedValue
}

// Uso
const debouncedQuery = useDebounce(searchQuery, 500)

Gestión de Estado

// PASS: BIEN: Actualizaciones de estado correctas
const [count, setCount] = useState(0)

// Actualización funcional para estado basado en el estado previo
setCount(prev => prev + 1)

// FAIL: MAL: Referencia de estado directa
setCount(count + 1)  // Puede estar obsoleta en escenarios async

Renderizado Condicional

// PASS: BIEN: Renderizado condicional claro
{isLoading && <Spinner />}
{error && <ErrorMessage error={error} />}
{data && <DataDisplay data={data} />}

// FAIL: MAL: Infierno de ternarios
{isLoading ? <Spinner /> : error ? <ErrorMessage error={error} /> : data ? <DataDisplay data={data} /> : null}

Estándares de Diseño de API

Convenciones de API REST

GET    /api/markets              # Listar todos los markets
GET    /api/markets/:id          # Obtener market específico
POST   /api/markets              # Crear nuevo market
PUT    /api/markets/:id          # Actualizar market (completo)
PATCH  /api/markets/:id          # Actualizar market (parcial)
DELETE /api/markets/:id          # Eliminar market

# Parámetros de consulta para filtrado
GET /api/markets?status=active&limit=10&offset=0

Formato de Respuesta

// PASS: BIEN: Estructura de respuesta consistente
interface ApiResponse<T> {
  success: boolean
  data?: T
  error?: string
  meta?: {
    total: number
    page: number
    limit: number
  }
}

// Respuesta exitosa
return NextResponse.json({
  success: true,
  data: markets,
  meta: { total: 100, page: 1, limit: 10 }
})

// Respuesta de error
return NextResponse.json({
  success: false,
  error: 'Invalid request'
}, { status: 400 })

Validación de Entrada

import { z } from 'zod'

// PASS: BIEN: Validación con esquema
const CreateMarketSchema = z.object({
  name: z.string().min(1).max(200),
  description: z.string().min(1).max(2000),
  endDate: z.string().datetime(),
  categories: z.array(z.string()).min(1)
})

export async function POST(request: Request) {
  const body = await request.json()

  try {
    const validated = CreateMarketSchema.parse(body)
    // Proceder con datos validados
  } catch (error) {
    if (error instanceof z.ZodError) {
      return NextResponse.json({
        success: false,
        error: 'Validation failed',
        details: error.errors
      }, { status: 400 })
    }
  }
}

Organización de Archivos

Estructura del Proyecto

src/
├── app/                    # Next.js App Router
│   ├── api/               # Rutas API
│   ├── markets/           # Páginas de markets
│   └── (auth)/           # Páginas de auth (grupos de rutas)
├── components/            # Componentes React
│   ├── ui/               # Componentes UI genéricos
│   ├── forms/            # Componentes de formulario
│   └── layouts/          # Componentes de layout
├── hooks/                # Custom React hooks
├── lib/                  # Utilidades y configuraciones
│   ├── api/             # Clientes API
│   ├── utils/           # Funciones auxiliares
│   └── constants/       # Constantes
├── types/                # Tipos TypeScript
└── styles/              # Estilos globales

Nomenclatura de Archivos

components/Button.tsx          # PascalCase para componentes
hooks/useAuth.ts              # camelCase con prefijo 'use'
lib/formatDate.ts             # camelCase para utilidades
types/market.types.ts         # camelCase con sufijo .types

Comentarios y Documentación

Cuándo Comentar

// PASS: BIEN: Explicar el POR QUÉ, no el QUÉ
// Usar backoff exponencial para evitar sobrecargar la API durante interrupciones
const delay = Math.min(1000 * Math.pow(2, retryCount), 30000)

// Usando mutación deliberadamente aquí por rendimiento con arrays grandes
items.push(newItem)

// FAIL: MAL: Declarar lo obvio
// Incrementar contador en 1
count++

// Establecer nombre al nombre del usuario
name = user.name

JSDoc para APIs Públicas

/**
 * Busca markets usando similitud semántica.
 *
 * @param query - Consulta de búsqueda en lenguaje natural
 * @param limit - Número máximo de resultados (por defecto: 10)
 * @returns Array de markets ordenados por puntuación de similitud
 * @throws {Error} Si la API de OpenAI falla o Redis no está disponible
 *
 * @example
 * ```typescript
 * const results = await searchMarkets('election', 5)
 * console.log(results[0].name) // "Trump vs Biden"
 * ```
 */
export async function searchMarkets(
  query: string,
  limit: number = 10
): Promise<Market[]> {
  // Implementación
}

Buenas Prácticas de Rendimiento

Memoización

import { useMemo, useCallback } from 'react'

// PASS: BIEN: Memoizar cómputos costosos
const sortedMarkets = useMemo(() => {
  return markets.sort((a, b) => b.volume - a.volume)
}, [markets])

// PASS: BIEN: Memoizar callbacks
const handleSearch = useCallback((query: string) => {
  setSearchQuery(query)
}, [])

Carga Diferida

import { lazy, Suspense } from 'react'

// PASS: BIEN: Cargar componentes pesados de forma diferida
const HeavyChart = lazy(() => import('./HeavyChart'))

export function Dashboard() {
  return (
    <Suspense fallback={<Spinner />}>
      <HeavyChart />
    </Suspense>
  )
}

Consultas de Base de Datos

// PASS: BIEN: Seleccionar solo las columnas necesarias
const { data } = await supabase
  .from('markets')
  .select('id, name, status')
  .limit(10)

// FAIL: MAL: Seleccionar todo
const { data } = await supabase
  .from('markets')
  .select('*')

Estándares de Pruebas

Estructura de Pruebas (Patrón AAA)

test('calculates similarity correctly', () => {
  // Arrange (Preparar)
  const vector1 = [1, 0, 0]
  const vector2 = [0, 1, 0]

  // Act (Actuar)
  const similarity = calculateCosineSimilarity(vector1, vector2)

  // Assert (Verificar)
  expect(similarity).toBe(0)
})

Nomenclatura de Pruebas

// PASS: BIEN: Nombres de prueba descriptivos
test('returns empty array when no markets match query', () => { })
test('throws error when OpenAI API key is missing', () => { })
test('falls back to substring search when Redis unavailable', () => { })

// FAIL: MAL: Nombres de prueba vagos
test('works', () => { })
test('test search', () => { })

Detección de Code Smells

Vigilar estos anti-patrones:

1. Funciones Largas

// FAIL: MAL: Función > 50 líneas
function processMarketData() {
  // 100 líneas de código
}

// PASS: BIEN: Dividir en funciones más pequeñas
function processMarketData() {
  const validated = validateData()
  const transformed = transformData(validated)
  return saveData(transformed)
}

2. Anidamiento Profundo

// FAIL: MAL: 5+ niveles de anidamiento
if (user) {
  if (user.isAdmin) {
    if (market) {
      if (market.isActive) {
        if (hasPermission) {
          // Hacer algo
        }
      }
    }
  }
}

// PASS: BIEN: Retornos tempranos
if (!user) return
if (!user.isAdmin) return
if (!market) return
if (!market.isActive) return
if (!hasPermission) return

// Hacer algo

3. Números Mágicos

// FAIL: MAL: Números sin explicación
if (retryCount > 3) { }
setTimeout(callback, 500)

// PASS: BIEN: Constantes con nombre
const MAX_RETRIES = 3
const DEBOUNCE_DELAY_MS = 500

if (retryCount > MAX_RETRIES) { }
setTimeout(callback, DEBOUNCE_DELAY_MS)

Recuerda: La calidad del código no es negociable. El código claro y mantenible permite el desarrollo rápido y la refactorización confiada.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

accessibility

FreeSummaryAI rating 100

Design and audit interfaces for Web, iOS, and Android using WCAG 2.2 accessibility guidance. Check screen-reader labels, keyboard navigation, contrast, and control sizes to identify barriers and guide implementation for people using assistive technology.

  • Adding descriptive labels to icon-only buttons
  • Reviewing keyboard navigation and modal focus
  • Checking contrast and control sizes
affaan-m/ECC284.1KUpdated Oct 16, 2026

agent-architecture-audit

FreeSummaryAI rating 80

Investigate unreliable AI agents across 12 layers, including instructions, memory, tool execution, and display. Use code and logs to trace failures, rank findings by severity, and produce an ordered repair plan that prioritizes code changes.

  • Investigating failures that appear only inside an agent application
  • Tracing old conversation content leaking into new sessions
  • Checking skipped or falsely claimed tool execution
affaan-m/ECC284.1KUpdated Oct 16, 2026

agent-eval

FreeSummaryAI rating 80

Compare coding agents on tasks from your own codebase. Define success checks, run agents in separate Git working directories, and report pass rates, available API costs, completion time, and consistency across repeated trials.

  • Comparing coding agents on real development tasks
  • Evaluating a new tool or model before adoption
  • Checking performance after agent updates
affaan-m/ECC284.1KUpdated Oct 16, 2026

agent-harness-construction

FreeSummaryAI rating 100

Design and refine an AI agent’s available actions, tool inputs, and result formats. Define recovery steps for errors, manage the information kept in context, and evaluate changes through completion rates, retries, and cost per successful task.

  • Define an AI agent’s tool set and input formats
  • Make tool results and next steps easier to interpret
  • Specify safe retries and stopping conditions
affaan-m/ECC284.1KUpdated Oct 16, 2026

agent-introspection-debugging

FreeSummaryAI rating 100

Diagnose failed AI agent runs by capturing errors, checking likely causes, and choosing small, reversible recovery actions. The workflow produces a structured report of the failure, recovery steps, and evidence, helping explain repeated retries or stalled progress.

  • Diagnosing repeated tool calls with no progress
  • Investigating quality loss as context grows
  • Checking file paths and environment mismatches
affaan-m/ECC284.1KUpdated Oct 16, 2026

agent-introspection-debugging

FreeSummaryAI rating 100

Diagnose AI agent runs that fail repeatedly, loop through tools, or lose track of the task. Capture errors and environment details, test a focused recovery action, and produce a report explaining the evidence and outcome.

  • Diagnosing repeated failures in an agent run
  • Investigating loops through the same tool calls
  • Reviewing output degradation as context grows
affaan-m/ECC284.1KUpdated Oct 5, 2026

See all skills by affaan-m

Report a problem with this skill