Synthèse automatique
Une méthode de développement piloté par les tests qui impose d'écrire le plus petit test échouant avant le code, et de justifier explicitement tout contournement de la boucle.
Points forts
- Boucle rouge-vert-découpe en sept étapes précises, avec l'exigence de lire la raison de l'échec avant d'écrire le code
- Critères d'abandon honnêtes (mocks fragiles, infra end-to-end lente, churn de fixtures) et obligation de nommer à voix haute pourquoi on saute le test
- Garde-fous clairs : ne jamais affaiblir une assertion ni modifier un test existant pour faire passer une implémentation douteuse
- Exige la preuve concrète : nom du test, échec observé avant le correctif, exécution verte après
Limites
- Indépendant du langage et du framework : il délègue aux conventions du projet et ne fournit aucune syntaxe d'assertion concrète
- Ne traite ni les tests d'intégration ou end-to-end, ni les tests de performance ou basés sur des propriétés
- L'efficacité dépend de l'exécution réelle des tests par l'agent, que la skill peut seulement demander
Pour démarrer un nouveau comportement dont le chemin de test est peu coûteux, ou pour corriger un bug reproductible dans un test.
Pour du code exploratoire, des changements d'interface visuelle ou d'infrastructure où le seul test disponible serait lent, end-to-end ou saturé de mocks.
Analyse de sécurité
SûrThis is a pure instructional document about test-driven development. It declares no tools, contains no code, no shell commands, no network or file operations, and no attempts to alter agent behavior beyond ordinary workflow guidance. There is no execution surface and no instruction-injection content.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Add a rate limit to our /login endpoint using TDD: write a failing test for the 6th attempt within a minute, then implement the smallest code that makes it pass.Bug: parse_duration('1h30m') returns None instead of 5400. Reproduce it in a test that fails on current main, then fix it and show me the passing run.This fix touches our Celery worker startup and signal handling. Tell me whether the test path is worth it here; if not, say why and name the check you used instead.name: tdd description: Write the failing test before the code that satisfies it, for new behaviour and for bug fixes, and stop when the test path is not worth its cost. Covers the red-green loop, what a first test should assert, when to skip the loop honestly, and the evidence to report. Use when starting behaviour that has a cheap test path, or fixing a bug that can be reproduced in a test. Triggers - "tdd", "write a failing test first", "regression test", "reproduce this in a test", "test first".
TDD
Make the behaviour executable before making it work. The point is not ceremony: a test written first describes what the caller needs, while a test written after describes what the code happens to do.
Write the test in the style the project already uses. Where the project ships a test skill for the language, that skill wins. Failing that, read two neighbouring test files and follow them. Failing both, the shape is: named as a sentence, built from setup, mock, test and verify blocks separated by blank lines, and carrying no comments.
That shape is also the fastest way to write step 2. Name the behaviour, write the verify block first, then work backwards to the setup that makes it reachable.
The loop
- Name the behaviour. One sentence, in the caller's terms. That sentence is the test name, and if it will not come out as a sentence the behaviour is not understood well enough to write yet.
- Write the smallest failing test. It asserts the behaviour, never the implementation you are about to write.
- Run it, and read the failure. It must fail for the reason you expect. A test that passes immediately is testing something else. A test that fails on a missing import is not evidence yet.
- Write the smallest code that passes. Not the general case, not the version with the options object nobody asked for.
- Run it again. Green.
- Clean up while green. Both sides: the code, and the test that is now longer than it needs to be.
- Repeat for the next behaviour, not the next line.
For a bug, the same loop with step 1 fixed for you: the test is the reproduction, and it must fail before the fix and pass after it.
What the first test asserts
The behaviour a caller would notice. Not the shape of an intermediate value, not the number of times a collaborator was called, not a snapshot of a structure.
Start at the boundary that is cheap to call. The unit is whatever has a real seam, which is often a function two layers in rather than the exported one.
When to skip
Do not force a test. Skip the loop when the only available test would need broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, or a fixture churn larger than the change.
Skipping is a decision you say out loud, not one you make silently. Name why the test path is not worth it and what you did instead: a script, a manual reproduction, a screenshot from the real app, a log assertion.
Prefer no test to a bad test. A bad test is one that mostly exercises mocks, encodes the implementation, depends on timing or global state, or would be deleted the moment it had proved the fix.
Guardrails
- Never change an existing test to match a wrong implementation.
- Never weaken an assertion to get to green. Either the behaviour changed, and the test name changes with it, or there is a bug.
- Keep a regression test focused on its bug. Unrelated coverage is a separate change.
- A flaky bug still gets a deterministic test. Pin the signal, not the timing.
- If the bug is one of a class, land the focused test first and consider the siblings after.
Report the evidence
Not "added a test". Name the test, the failure it produced before the fix, and the run that passed after. If failing-first could not be shown, say why, and name the check used instead.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/tdd-failing-test-before-code-mveranxa' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/tdd-failing-test-before-code-mveranxa/download' --output '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md.part' && mv '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md.part' '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md' && test -s '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/tdd' && cp -R '.skill-downloads/tdd-failing-test-before-code-mveranxa' '.claude/skills/tdd'Cursor
test -f '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md' && test -s '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/tdd' && cp -R '.skill-downloads/tdd-failing-test-before-code-mveranxa' '.cursor/skills/tdd'Codex
test -f '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md' && test -s '.skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/tdd' && cp -R '.skill-downloads/tdd-failing-test-before-code-mveranxa' '.agents/skills/tdd'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/tdd-failing-test-before-code-mveranxa'openskills read 'tdd-failing-test-before-code-mveranxa'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/tdd-failing-test-before-code-mveranxa/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Comparaison de performances ClickHouse
Testing
Évaluez les résultats de tests de performance ClickHouse, analysez les régressions de PR, comparez avec l'historique et vérifiez la fiabilité des mesures.
Analyse des rapports de performance CI
Testing
Analyse les rapports de comparaison de performance CI pour une PR ClickHouse. Recoupe l'historique master pour distinguer les vraies régressions des tests instables.
Méthode Santa
Testing
Vérification adversarial multi-agents avec deux réviseurs indépendants. La sortie est vérifiée deux fois et corrigée itérativement jusqu'à ce que les deux acceptent avant publication.