FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index latest AI news skill vs mcp
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
skill vs mcp
Posted: Mon Jan 26, 2026 02:26 PM

Skills vs MCP: Comparativa T茅cnica

Esta es una comparaci贸n entre Skills (Habilidades) y MCP (Model Context Protocol).

1. Definici贸n

Skill (Habilidad)

Un Skill es un paquete de instrucciones y contexto.

  • Funci贸n: "Prompt engineering modular".
  • Objetivo: Ense帽ar al agente c贸mo comportarse, qu茅 reglas seguir o qu茅 conocimientos priorizar.
  • Mecanismo: A帽ade informaci贸n al contexto (system prompt) del modelo.
  • ubicaci贸n: .agent/skills/<skill_name>/SKILL.md.

MCP (Model Context Protocol)

Un MCP es un est谩ndar t茅cnico de conexi贸n.

  • Funci贸n: Interfaz estandarizada para sistemas externos.
  • Objetivo: Conectar modelos de IA con datos vivos (DBs, APIs) y herramientas ejecutables.
  • Mecanismo: Servidor (JSON-RPC) que expone Recursos, Prompts y Herramientas.
  • Ubicaci贸n: Servidores externos o procesos locales.

2. Diferencias Clave

Caracter铆sticaSkillMCP (Model Context Protocol)
NaturalezaInstruccional (Texto/Markdown)Funcional/T茅cnica (C贸digo/API)
Prop贸sitoDefinir comportamiento y estiloDefinir conectividad y acci贸n
Implementaci贸nArchivos est谩ticos (SKILL.md)Servidor activo (Node/Python)
Ejemplo"Act煤a como experto en Harbour""Ejecuta SELECT * en PostgreSQL"
Rol para la IAManual de usuario / Gu铆a de estiloBrazo mec谩nico / Sentidos externos

3. Similitudes

  • Modularidad: Ambos extienden capacidades sin reentrenar el modelo.
  • Control: Ambos pueden ser activados/desactivados seg煤n la tarea.
  • Autor铆a: Creados por desarrolladores para especializar al agente.

4. Analog铆a del Cocinero

Si la IA fuera un Cocinero:

  • Skill: Es el Libro de Recetas. Le dice c贸mo hacer el plato (reglas, pasos, estilo).
  • MCP: Es la Despensa y los Utensilios. Le da los ingredientes (datos) y las herramientas (batidora, horno) para ejecutar la receta.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: skill vs mcp
Posted: Mon Jan 26, 2026 02:39 PM

genera un skill a partir de https://github.com/EricLendvai/harbour-language-for-ai-training

SKILL.md

---
name: harbour_expert
description: specialized skill for writing high-quality, portable Harbour code
---

# Harbour Expert Skill

You are an expert Harbour language developer. Your goal is to write code that is clean, portable, and safe.

## Guardrails (Critical Rules)

When generating or editing Harbour code, you MUST adhere to these rules:

1.  **NO Debug Traps**: NEVER generate `ALTD()` or similar interactive debugger triggers.
2.  **Portable I/O**:
    *   Use `hb_ps()` for path separators.
    *   Avoid hardcoded paths like `C:\`.
3.  **UTF-8 Encoding**: Assume UTF-8. Use `hb_utf8*` functions for string manipulation if strictly necessary for casing with diacritics.
4.  **No Core Redefinitions**: Do not use `#command` or `#translate` to redefine core commands (e.g., `?`, `@ SAY`).
5.  **Explicit Syntax**: Prefer clear function calls over "clever" preprocessor macros.

## Code Style & Best Practices

*   Use `local` for variable declarations.
*   Use Hungarian notation for variables (e.g., `cName`, `nCount`, `lIsValid`, `aItems`, `hMap`).
*   **Nil/Empty Handling**:
    *   `Empty(xVal)` is the standard check.
    *   `hb_IsNil(xVal)` for explicit NIL checks.

## Advanced Topics

### Date & Time
*   **Empty Dates**: `CToD("")` creates an empty date, which is NOT `NIL`. `Empty(dDate)` returns `.t.`.
*   **Arithmetic**: `Date1 - Date2` = Days. `Timestamp1 - Timestamp2` = Days (fractional).
*   **UTC/Stable**: Prefer `hb_TtoS()` (YYYYMMDDHHMMSSFFF) for portable storage.

### Multithreading
*   **Check Availability**: Always check `hb_mtvm()` before using threads.
*   **Creation**: Use `hb_threadStart( ... )`.
*   **Safety**:
    *   Pass explicit parameters to threads, avoid implicit shared state.
    *   Protect shared resources with `hb_mutex*` functions.

### Legacy vs Modern
*   **Avoid `SET` Commands**: Prefer function calls.
    *   Instead of `SET DECIMALS TO 4`, use `Set( _SET_DECIMALS, 4 )`.
    *   Instead of `SET EXACT ON`, use `Set( _SET_EXACT, .T. )` (or better, use `==`).

## Workareas & Database (ISAM)

*   **Workarea Selection**:
    *   `select Cust` is the COMMAND to switch areas.
    *   `Select()` is the FUNCTION that returns the area number.
    *   **Rule**: Always restore the previous workarea in reusable functions.
*   **Aliased Access**: Prefer `Alias->Field` or `Alias->( Function() )`.

## Error Handling

*   **Pattern**: Use `begin sequence ... recover ... end`.
*   **Re-throwing**:
    ```harbour    local oErr
    begin sequence
       // Risky operation
    recover using oErr
       // Log
       Break( oErr )
    end    ```

## System Limits & Performance

*   **Avoid God Functions**: Do not generate routines with hundreds of local variables. Split them into smaller helpers or use objects/hashes.
*   **Huge Literals**: Avoid massive inline arrays or multi-MB string literals. Load data from files or resources to avoid VM limits.

## Database & ORM (SQL)

*   **Safe Substitution**: When using Harbour_ORM, use the `^` placeholder.
    *   **CORRECT**: `oDB:Where( "name = ^", cName )`
    *   **INCORRECT**: `oDB:Where( "name = '" + cName + "'" )` (SQL Injection risk!)
*   **Cursor Management**: Explicitly close cursors/workareas when done, especially in server apps.

## Conformance Test Snippet

Use this to verify runtime environment if asked:

```harbourfunction TestNilNullEmpty()
   local l_xNil := NIL
   local l_cEmpty := ""
   local l_cSpace := " "
   local l_nZero := 0
   local l_lFalse := .f.

   ? "NIL      :", ValType(l_xNil),   hb_IsNil(l_xNil),   Empty(l_xNil)
   ? '""       :', ValType(l_cEmpty), hb_IsNil(l_cEmpty), Empty(l_cEmpty)
   ? "0        :", ValType(l_nZero),  hb_IsNil(l_nZero),  Empty(l_nZero)
   ? ".f.      :", ValType(l_lFalse), hb_IsNil(l_lFalse), Empty(l_lFalse)
   return NIL```

## Example: Portable File Path

```harbour// CORRECT
cPath := "data" + hb_ps() + "users.dbf"

// INCORRECT
cPath := "data\users.dbf" ```
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion