Logotipo de Unit Test Project Conformant

Unit Test Project Conformant

Organización
opendatahub-io
unit-test-project-conformant

Use this skill to write unit tests that strictly conform to the project's existing testing structure, patterns, and style by learning from similar tests before writing anything new.

Descripción general

Editoropendatahub-io
Repositorioai-helpers
Nombre de la habilidadunit-test-project-conformant
Estrellas
39
Forks
76
Archivos incluidos
Solo instrucciones
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por opendatahub-io en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Unit Test Project Conformant en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-code-quality/skills/unit-test-project-conformant
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-code-quality/skills/unit-test-project-conformant .claude/skills/unit-test-project-conformant
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Unit Test Project Conformant en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Unit Test Project Conformant automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Unit Test Project Conformant no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Unit Test (Project-Conformant) Skill

This skill ensures the agent does not invent test structure and instead learns how the project already tests similar code, then writes the new test in the same style, location, and pattern.

The goal is for the new test to be indistinguishable from existing tests.

When to Use

  • Use this skill every time a unit test must be written or modified.
  • Use this skill when adding coverage for new functions, classes, or behavior.
  • Use this skill when refactoring code that requires corresponding test updates.
  • This skill is required whenever the agent is tempted to create a “clean” or “ideal” test structure.

Instructions

Step 1 — Discover How the project Tests Similar Code

Before writing any test:

  • Identify the file, function, or class to be tested.
  • Search the project for tests covering:
    • The same module
    • The same directory
    • Similar functions
    • Similar classes
    • Similar behavior
  • Use search terms such as:
    • Function name
    • Class name
    • Module name
    • Error messages
    • Public API names

You must examine at least 2–3 similar tests before proceeding.


Step 2 — Extract the Test Pattern

From the discovered tests, learn:

  • Where tests are located
  • File naming conventions
  • Test naming conventions
  • Whether tests are:
    • Standalone functions
    • Inside classes
    • Parametrized
    • Fixture-driven
    • Integration-style
  • Assertion style
  • Mocking style
  • Helper utilities used
  • What is intentionally not tested

You are learning the project’s testing contract.


Step 3 — Decide Where the Test Belongs

Follow existing structure exactly:

  • If similar code is tested in a shared file → add to that file
  • If similar code is tested inside a class → add a method there
  • If similar tests extend parametrization → extend it
  • If similar behavior is only tested indirectly → do the same

Do not create a new test file unless similar tests do.


Step 4 — Match Style Exactly

Mirror the project’s style for:

  • Function and variable names
  • Imports
  • Assertion style
  • Fixtures
  • Mocking
  • Test utilities
  • Formatting and layout

Do not introduce new libraries, helpers, or patterns.


Step 5 — Respect How the project Chooses to Test

If similar methods:

  • Are tested indirectly
  • Are tested via integration tests
  • Are not given standalone unit tests

Then you must follow the same pattern.

Do not create standalone unit tests if the project does not.


Step 6 — Match the Level of Coverage

Match the project’s expectations:

  • If tests check only success paths → do the same
  • If tests include edge cases → include them
  • If tests include error cases → include them
  • If tests use heavy mocking → do the same
  • If tests avoid mocking → avoid it

Do not over-test compared to existing patterns.


Step 7 — Reuse Existing Helpers and Fixtures

Search for and reuse:

  • Fixtures
  • Base test classes
  • Utilities
  • Custom assertions
  • Shared setup logic

Do not recreate logic that already exists.


Step 8 — Write the Test Last

Only after completing all discovery steps should you write the test.

The result should look like it was written by the same author as the surrounding tests.


Anti-Patterns (Never Do These)

  • Creating new test structure because it seems “better”
  • Writing standalone tests when the project does not
  • Introducing new testing frameworks
  • Adding excessive assertions not seen elsewhere
  • Adding mocks where the project avoids them
  • Guessing where tests belong without searching

Final Checklist

Before finishing, confirm:

  • Test is in the correct location
  • Naming matches existing tests
  • Structure matches existing tests
  • Assertions match existing tests
  • Fixtures/helpers are reused
  • No new patterns introduced
  • Coverage level matches similar tests

Gotchas

  • Always search for at least 2-3 similar tests before writing anything; skipping discovery leads to non-conformant structure.
  • Do not create a new test file unless the project already uses separate files for similar test scopes.
  • Match the project's mocking strategy exactly — introducing mocks where the project avoids them (or vice versa) will make the test inconsistent.

Examples

text
/unit-test-project-conformant write a test for the parse_config() function in src/config.py
text
/unit-test-project-conformant add test coverage for the new validate_input method in models/user.py

Use the ask questions tool if you need to clarify requirements with the user.

Preguntas frecuentes

¿Qué hace la habilidad de IA Unit Test Project Conformant?

Use this skill to write unit tests that strictly conform to the project's existing testing structure, patterns, and style by learning from similar tests before writing anything new.

¿Por qué usar Unit Test Project Conformant en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Unit Test Project Conformant está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Unit Test Project Conformant en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-code-quality/skills/unit-test-project-conformant. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Unit Test Project Conformant?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Unit Test Project Conformant?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Unit Test Project Conformant con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Unit Test Project Conformant?

Sí. opendatahub-io la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇