Automated summary
Audits an existing API Platform project for configuration, security, performance and best practices issues, generating a structured audit report.
Strengths
- Comprehensive coverage of key aspects (configuration, security, performance, architecture)
- Automated verification of API Platform-specific best practices
- Structured report with scores and recommendations
Limitations
- Requires an existing Symfony/API Platform project
- Cannot detect complex business logic issues
- Results depend on naming conventions quality
When performing a quality, security or performance audit on an existing API Platform application, or before going into production.
For projects that do not use API Platform, or when you need a generic code analysis without a structured report.
Security analysis
SafeThe skill performs a read-only audit of an API Platform project using file reading and analysis commands. It explicitly states no modifications are made, and no destructive or exfiltration commands are instructed. Bash is allowed, but the scope is limited to investigative tasks like reading configuration and running analysis utilities (e.g., composer show), posing minimal risk.
No concerns found
How this analysis is madeExamples
Run an API Platform audit on my project to check best practices, security, and performance.Audit my API Platform project and list all API resources with their security settings, serialization groups, and filters.Perform a full audit of my API Platform project and generate a compliance report with scores.name: api-platform:audit description: Audite un projet API Platform existant et produit un rapport de bonnes pratiques, performances et sécurité model: sonnet allowed-tools: [Read, Grep, Glob, Bash] version: 1.0.0 license: MIT
API Platform Audit
Audite un projet API Platform existant pour vérifier les bonnes pratiques, la sécurité, les performances et la cohérence de configuration.
Instructions à Exécuter
IMPORTANT : Exécute ce workflow étape par étape :
1. Détecter la configuration API Platform
- Vérifier
composer.jsonpour la version d'API Platform installée - Chercher la configuration dans
config/packages/api_platform.yamlouconfig/packages/api_platform.php - Identifier le format de configuration utilisé (attributs PHP, YAML, XML)
2. Inventorier les resources API
- Chercher tous les fichiers avec
#[ApiResource]via Grep - Chercher les configurations YAML/XML si utilisées
- Pour chaque resource, noter :
- Opérations exposées
- Groupes de sérialisation
- Filtres configurés
- Configuration de sécurité
- State providers/processors personnalisés
3. Audit des bonnes pratiques
Vérifier pour chaque resource :
Configuration :
- [ ] Opérations explicitement déclarées (pas les opérations par défaut implicites)
- [ ] Groupes de sérialisation configurés (read/write séparés)
- [ ] Pagination configurée (pas de pagination désactivée sans raison)
- [ ] Format de réponse cohérent (JSON-LD, JSON:API, HAL)
Sécurité :
- [ ] Attribut
securitydéfini sur les opérations sensibles (POST, PUT, PATCH, DELETE) - [ ] Pas d'exposition de données sensibles (mots de passe, tokens, données internes)
- [ ] Validation configurée sur les opérations d'écriture
- [ ] CORS correctement configuré (
nelmio_cors) - [ ] Rate limiting si exposé publiquement
Performances :
- [ ] HTTP caching configuré (Cache-Control, ETag, Vary)
- [ ] Eager loading pour éviter les requêtes N+1 (forceEager, fetchEager)
- [ ] Index Doctrine sur les colonnes filtrées/triées
- [ ] Pagination activée avec une taille de page raisonnable (pas de
pagination_enabled: falsesur de grandes collections) - [ ] Groupes de sérialisation limitant les données retournées
Architecture :
- [ ] DTOs utilisés quand la représentation diffère de l'entité
- [ ] State Providers/Processors pour la logique métier complexe
- [ ] Pas de logique métier dans les entités Doctrine
- [ ] Extensions Doctrine pour le filtrage global (soft delete, tenant)
4. Audit de la configuration globale
Vérifier dans config/packages/api_platform.yaml :
api_platform:
title: 'Mon API' # Titre défini
version: '1.0.0' # Version définie
formats: # Formats explicites
jsonld: ['application/ld+json']
defaults:
pagination_items_per_page: 30 # Pagination par défaut raisonnable
pagination_client_enabled: true # Contrôle client de la pagination
mapping:
paths: ['%kernel.project_dir%/src/Entity']
5. Audit des tests
- Chercher les tests API dans
tests/avec Grep - Vérifier la couverture de tests :
- [ ] Tests pour chaque resource exposée
- [ ] Tests de validation
- [ ] Tests de sécurité (accès non autorisé)
- [ ] Tests de filtres
6. Audit des dépendances
- Vérifier les versions des packages API Platform dans
composer.lock - Identifier les versions obsolètes
- Vérifier la compatibilité entre packages
7. Produire le rapport d'audit
Générer un rapport structuré :
## Rapport d'audit API Platform
### Résumé
- Resources API : {nombre}
- Opérations totales : {nombre}
- Score global : {score}/100
### Resources auditées
| Resource | Opérations | Sécurité | Sérialisation | Filtres | Tests |
|----------|-----------|----------|---------------|---------|-------|
| Product | 6/6 | OK | OK | 3 | Oui |
| User | 4/6 | WARN | MISSING | 0 | Non |
### Problèmes critiques
1. [CRITIQUE] Resource User sans sécurité sur POST
2. [CRITIQUE] Mot de passe exposé dans la sérialisation User
### Avertissements
1. [WARN] Pas de groupes de sérialisation sur Product
2. [WARN] Pagination désactivée sur LargeCollection
### Recommandations
1. Ajouter security: "is_granted('ROLE_ADMIN')" sur User POST
2. Ajouter #[Groups(['user:read'])] et exclure le mot de passe
3. Configurer le HTTP caching pour les resources en lecture seule
### Couverture de tests
- Resources testées : {x}/{total}
- Tests manquants : {liste}
### Versions
- api-platform/core: {version} (dernière: {dernière})
- symfony/framework-bundle: {version}
Critères d'audit
Score de sécurité (sur 40)
| Critère | Points | |---------|--------| | Security sur opérations d'écriture | 15 | | Pas de données sensibles exposées | 10 | | Validation sur les inputs | 10 | | CORS configuré | 5 |
Score de qualité (sur 30)
| Critère | Points | |---------|--------| | Groupes de sérialisation | 10 | | Opérations explicites | 10 | | DTOs quand nécessaire | 5 | | Documentation OpenAPI | 5 |
Score de performance (sur 15)
| Critère | Points | |---------|--------| | HTTP caching | 5 | | Pagination configurée | 5 | | Pas de N+1 queries | 5 |
Score de tests (sur 15)
| Critère | Points | |---------|--------| | Couverture des resources | 10 | | Tests de sécurité | 5 |
Notes
- L'audit est en lecture seule, aucune modification n'est effectuée
- Le rapport peut être sauvegardé dans
docs/audit/si demandé - Les scores sont indicatifs et basés sur les bonnes pratiques API Platform
- Relancer l'audit après corrections pour vérifier l'amélioration
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/api-platform-audit-mmh8qrz0/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/api-platform-audit-mmh8qrz0' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/api-platform-audit-mmh8qrz0/download' --output '.skill-downloads/api-platform-audit-mmh8qrz0/SKILL.md.part' && mv '.skill-downloads/api-platform-audit-mmh8qrz0/SKILL.md.part' '.skill-downloads/api-platform-audit-mmh8qrz0/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.
Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/api-platform-audit-mmh8qrz0/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.