Agent skill
api-test-gen
Skill de generation automatique de tests API. Scanne les endpoints d'un projet (API Platform, Express, etc.) et genere des tests couvrant les cas nominaux, les erreurs, les autorisations et les cas limites. Supporte PHPUnit ApiTestCase (Symfony) et peut s'adapter a d'autres frameworks. Ce skill devrait etre utilise quand l'utilisateur veut ajouter des tests a des endpoints existants ou generer une couverture de test pour un domaine.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/api-test-gen
SKILL.md
api-test-gen
But
Generer des tests API automatiques (PHPUnit ApiTestCase ou equivalent) pour les endpoints existants.
Modes
Mode A : --endpoint {route}
Generer les tests pour un endpoint specifique.
Mode B : --entity {nom}
Generer les tests pour tous les endpoints d'une entite.
Mode C : --domain {domaine}
Generer les tests pour un domaine complet.
Mode D : --coverage
Analyser la couverture de tests existante et proposer les manquants.
Workflow
- Identifier les endpoints : lire les attributs ApiResource/routes
- Pour chaque endpoint, generer :
- Test nominal (happy path)
- Test d'autorisation (acces refuse, roles insuffisants)
- Test de validation (donnees invalides, champs manquants)
- Test de cas limites (entite inexistante, donnees vides)
- Suivre les patterns de test de
~/evan-workflow/technos/symfony/patterns/testing.md - Generer les fixtures necessaires
- Verifier que les tests passent
Conventions
- Un fichier de test par entite :
tests/Api/{Entity}Test.php - DataProviders pour les variations de roles
- Methodes helper pour les assertions courantes (
assertJsonContains,assertResponseStatusCodeSame)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?