Logo: Unit Test Project Conformant

Unit Test Project Conformant

Organisatioun
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.

Iwwersiicht

Editeuropendatahub-io
Repositoryai-helpers
Skill-Nummunit-test-project-conformant
Stären
39
Forks
76
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    opendatahub-io huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Unit Test Project Conformant an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-code-quality/skills/unit-test-project-conformant
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Unit Test Project Conformant an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Unit Test Project Conformant automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Unit Test Project Conformant net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Unit Test Project Conformant op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Unit Test Project Conformant besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Unit Test Project Conformant an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-code-quality/skills/unit-test-project-conformant an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Unit Test Project Conformant benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Unit Test Project Conformant benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Unit Test Project Conformant domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Unit Test Project Conformant gratis?

Jo. opendatahub-io huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇