Initial commit
This commit is contained in:
12
.claude-plugin/plugin.json
Normal file
12
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "leapmultix-skill-bundle-size-optimizer",
|
||||||
|
"description": "Skill bundle-size-optimizer from LeapMultix",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"author": {
|
||||||
|
"name": "Julien LE SAUX",
|
||||||
|
"email": "contact@jls42.org"
|
||||||
|
},
|
||||||
|
"skills": [
|
||||||
|
"./skills"
|
||||||
|
]
|
||||||
|
}
|
||||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# leapmultix-skill-bundle-size-optimizer
|
||||||
|
|
||||||
|
Skill bundle-size-optimizer from LeapMultix
|
||||||
45
plugin.lock.json
Normal file
45
plugin.lock.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||||
|
"pluginId": "gh:jls42/leapmultix:leapmultix-marketplace/skills/bundle-size-optimizer",
|
||||||
|
"normalized": {
|
||||||
|
"repo": null,
|
||||||
|
"ref": "refs/tags/v20251128.0",
|
||||||
|
"commit": "d992c725f3a044efb5bad38f399e146aee32601a",
|
||||||
|
"treeHash": "a015df28cf3a421761e908717eb0bb1c4cfa5e43a9a540676f30c76efed958ed",
|
||||||
|
"generatedAt": "2025-11-28T10:19:11.281203Z",
|
||||||
|
"toolVersion": "publish_plugins.py@0.2.0"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||||
|
"branch": "master",
|
||||||
|
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||||
|
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||||
|
},
|
||||||
|
"manifest": {
|
||||||
|
"name": "leapmultix-skill-bundle-size-optimizer",
|
||||||
|
"description": "Skill bundle-size-optimizer from LeapMultix",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "README.md",
|
||||||
|
"sha256": "44a206f7e950d99e54c562d65e547d837904a794c8c7a29a41d4f844c8c63ebb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".claude-plugin/plugin.json",
|
||||||
|
"sha256": "8bfcbd4527b78df32fc76f77d506f6fdbbfdecd0d9503fb4f16a3488179b3e58"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "skills/bundle-size-optimizer/SKILL.md",
|
||||||
|
"sha256": "c577ed2817ce33a9515baf7c986e2c7c14628eb66c09ae996db594eb31d361ea"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dirSha256": "a015df28cf3a421761e908717eb0bb1c4cfa5e43a9a540676f30c76efed958ed"
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"scannedAt": null,
|
||||||
|
"scannerVersion": null,
|
||||||
|
"flags": []
|
||||||
|
}
|
||||||
|
}
|
||||||
100
skills/bundle-size-optimizer/SKILL.md
Normal file
100
skills/bundle-size-optimizer/SKILL.md
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
---
|
||||||
|
name: optimizing-bundle-size
|
||||||
|
description: Analyzes and reduces JavaScript bundle size for fast loading. Use when adding dependencies, before releases, or if bundle exceeds 200KB
|
||||||
|
allowed-tools: Read, Grep, Glob, Bash
|
||||||
|
---
|
||||||
|
|
||||||
|
# Optimiseur de Taille de Bundle
|
||||||
|
|
||||||
|
Optimise taille des bundles JavaScript pour chargement rapide et performance mobile.
|
||||||
|
|
||||||
|
## Quand utiliser
|
||||||
|
|
||||||
|
- Ajout de nouvelles dépendances
|
||||||
|
- Bundle > 200 KB (gzipped)
|
||||||
|
- Avant chaque release
|
||||||
|
- Optimisation mobile (3G/4G)
|
||||||
|
- Audit de performance
|
||||||
|
|
||||||
|
## Cibles de taille
|
||||||
|
|
||||||
|
- Bundle initial : < 100 KB (gzipped)
|
||||||
|
- Bundle total : < 500 KB
|
||||||
|
- Modules individuels : < 50 KB
|
||||||
|
|
||||||
|
## Stratégies essentielles
|
||||||
|
|
||||||
|
### Tree Shaking
|
||||||
|
|
||||||
|
- Imports nommés (pas `import *`)
|
||||||
|
- Imports spécifiques de modules externes
|
||||||
|
- Named exports (pas d'export default d'objets)
|
||||||
|
|
||||||
|
### Code Splitting
|
||||||
|
|
||||||
|
- Import dynamique avec `import()`
|
||||||
|
- Lazy loading de composants lourds
|
||||||
|
- Vérifier lazy loading des modes de jeu
|
||||||
|
|
||||||
|
### Minification & Compression
|
||||||
|
|
||||||
|
- Minifier actif en production
|
||||||
|
- Gzip/Brotli sur serveur (-70% taille)
|
||||||
|
- Source maps pour debug
|
||||||
|
|
||||||
|
### Éliminer duplications
|
||||||
|
|
||||||
|
- Détecter code similaire entre modules
|
||||||
|
- Extraire logique partagée
|
||||||
|
- Cherche jeux arcade avec patterns similaires
|
||||||
|
|
||||||
|
## Outils d'analyse
|
||||||
|
|
||||||
|
**Scripts npm :**
|
||||||
|
|
||||||
|
- `npm run analyze:dependencies` - Dépendances non utilisées
|
||||||
|
- `npm run dead-code` - Exports/fonctions jamais appelés
|
||||||
|
- `npm run analyze:globals` - Variables globales
|
||||||
|
- `npm run analyze:assets` - Assets volumineux
|
||||||
|
|
||||||
|
**Mesurer impact :**
|
||||||
|
|
||||||
|
- Taille gzippée avant/après
|
||||||
|
- Lighthouse CI (Performance > 90)
|
||||||
|
- Tests mobile 3G/4G
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
1. **Analyser :** Lancer scripts npm d'analyse
|
||||||
|
2. **Identifier :** Code mort, modules lourds, imports sous-optimaux
|
||||||
|
3. **Optimiser :** Une stratégie à la fois (lazy loading > tree shaking > minification)
|
||||||
|
4. **Mesurer :** Taille gzippée, temps chargement, Lighthouse
|
||||||
|
5. **Valider :** Tests passent, mobile performant
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
- [ ] Scripts d'analyse exécutés
|
||||||
|
- [ ] Imports optimisés (spécifiques, pas wildcard)
|
||||||
|
- [ ] Code mort retiré
|
||||||
|
- [ ] Lazy loading vérifié
|
||||||
|
- [ ] Minification/Gzip activés
|
||||||
|
- [ ] Lighthouse > 90 (Performance)
|
||||||
|
- [ ] Bundle < 100 KB (gzipped)
|
||||||
|
|
||||||
|
## En cas de doute
|
||||||
|
|
||||||
|
**Règles absolues :**
|
||||||
|
|
||||||
|
1. Toujours mesurer avant/après
|
||||||
|
2. Une optimisation à la fois
|
||||||
|
3. Priorité : lazy loading > tree shaking > minification
|
||||||
|
4. Mobile 3G/4G = référence
|
||||||
|
5. Tests passent après chaque changement
|
||||||
|
|
||||||
|
**Workflow minimal :**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run analyze:dependencies # Identifier code mort
|
||||||
|
npm run dead-code # Vérifier exports non utilisés
|
||||||
|
npm run analyze:assets # Vérifier assets volumineux
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user