From 3c8b2a8f683619dd312f6d824f35848dcecad8d9 Mon Sep 17 00:00:00 2001 From: bastien Date: Tue, 21 Apr 2026 22:37:07 +0200 Subject: [PATCH] feat(archetypes): add project archetype library + detection algorithm Introduce ~/.claude/lib/project-archetypes/ with 25 archetype files (web, mobile, APIs, CMS, infra, firmware, etc.) and the detection algorithm in lib/archetype-detector.md. Consumed by /onboard STEP 1 to drive archetype-specific audit stacks and plugin recommendations. Co-Authored-By: Claude --- lib/archetype-detector.md | 139 +++++++++++++++ lib/project-archetypes/_TEMPLATE.md | 75 ++++++++ lib/project-archetypes/astro-static.md | 102 +++++++++++ lib/project-archetypes/cli-tool.md | 102 +++++++++++ lib/project-archetypes/data-notebook.md | 121 +++++++++++++ lib/project-archetypes/desktop-electron.md | 132 ++++++++++++++ .../docker-compose-infra.md | 113 ++++++++++++ lib/project-archetypes/dotfiles-meta.md | 115 ++++++++++++ lib/project-archetypes/drupal.md | 124 +++++++++++++ lib/project-archetypes/firmware-embedded.md | 132 ++++++++++++++ lib/project-archetypes/game-engine-native.md | 166 ++++++++++++++++++ lib/project-archetypes/ghost.md | 114 ++++++++++++ lib/project-archetypes/library.md | 109 ++++++++++++ lib/project-archetypes/mobile-expo.md | 136 ++++++++++++++ lib/project-archetypes/mobile-flutter.md | 146 +++++++++++++++ lib/project-archetypes/nextjs-app-router.md | 109 ++++++++++++ lib/project-archetypes/react-spa.md | 126 +++++++++++++ lib/project-archetypes/rest-api-node.md | 106 +++++++++++ lib/project-archetypes/rest-api-python.md | 114 ++++++++++++ lib/project-archetypes/shopify.md | 109 ++++++++++++ lib/project-archetypes/static-html.md | 105 +++++++++++ lib/project-archetypes/strapi.md | 120 +++++++++++++ lib/project-archetypes/terraform-infra.md | 123 +++++++++++++ lib/project-archetypes/web-game.md | 132 ++++++++++++++ lib/project-archetypes/woocommerce.md | 101 +++++++++++ lib/project-archetypes/wordpress.md | 109 ++++++++++++ 26 files changed, 3080 insertions(+) create mode 100644 lib/archetype-detector.md create mode 100644 lib/project-archetypes/_TEMPLATE.md create mode 100644 lib/project-archetypes/astro-static.md create mode 100644 lib/project-archetypes/cli-tool.md create mode 100644 lib/project-archetypes/data-notebook.md create mode 100644 lib/project-archetypes/desktop-electron.md create mode 100644 lib/project-archetypes/docker-compose-infra.md create mode 100644 lib/project-archetypes/dotfiles-meta.md create mode 100644 lib/project-archetypes/drupal.md create mode 100644 lib/project-archetypes/firmware-embedded.md create mode 100644 lib/project-archetypes/game-engine-native.md create mode 100644 lib/project-archetypes/ghost.md create mode 100644 lib/project-archetypes/library.md create mode 100644 lib/project-archetypes/mobile-expo.md create mode 100644 lib/project-archetypes/mobile-flutter.md create mode 100644 lib/project-archetypes/nextjs-app-router.md create mode 100644 lib/project-archetypes/react-spa.md create mode 100644 lib/project-archetypes/rest-api-node.md create mode 100644 lib/project-archetypes/rest-api-python.md create mode 100644 lib/project-archetypes/shopify.md create mode 100644 lib/project-archetypes/static-html.md create mode 100644 lib/project-archetypes/strapi.md create mode 100644 lib/project-archetypes/terraform-infra.md create mode 100644 lib/project-archetypes/web-game.md create mode 100644 lib/project-archetypes/woocommerce.md create mode 100644 lib/project-archetypes/wordpress.md diff --git a/lib/archetype-detector.md b/lib/archetype-detector.md new file mode 100644 index 0000000..b10f9c4 --- /dev/null +++ b/lib/archetype-detector.md @@ -0,0 +1,139 @@ +# ARCHETYPE DETECTOR + +Logique de détection d'archétype projet consommée par `/onboard` STEP 1. +Aucune exécution autonome — ce fichier documente l'algorithme que le skill applique. + +--- + +## Inputs + +1. Répertoire projet (cwd) +2. Résultat filesystem scan (manifests, structure, deps) +3. Liste des archétypes disponibles : `~/.claude/lib/project-archetypes/*.md` (hors `_TEMPLATE.md`) + +## Algorithme + +### PHASE A — Collect signals + +Lire chaque archétype. Pour chaque archétype, charger les blocs : +- Strong signals (weight=3) +- Medium signals (weight=2) +- Weak signals (weight=1) + +Types de signaux (syntaxe à matcher) : + +| Syntaxe | Vérification | +|---|---| +| `FILE: ` | `test -f ` (relatif au projet root) | +| `DIR: /` | `test -d ` | +| `STRING_IN_FILE: contient ""` | `grep -q "" ` (fichier existe requis) | +| `DEP: contient ""` | parse manifest, vérifie clé `dependencies` OU `devDependencies` contient pkg | +| `EXT: N fichiers .` | `find . -name "*." -not -path "*/node_modules/*" -not -path "*/.git/*" \| wc -l` → >= N | +| `TOOL: ` | `command -v ` existe | +| `REGEX: matches "//"` | grep regex sur fichier | + +### PHASE B — Score each archetype + +Pour chaque archétype : + +``` +score_raw = Σ (signal_matched ? signal_weight : 0) +score_max = Σ signal_weight_total +score_pct = score_raw / score_max (si score_max > 0, sinon 0) +``` + +Aussi compter `strong_hits` : nombre de strong signals matchés. + +### PHASE C — Rank + select + +Classer archétypes par `score_raw` décroissant. + +**Règles de sélection** (dans l'ordre) : + +1. **Un seul archétype avec score_raw ≥ 6 ET strong_hits ≥ 1** → SELECTED, confiance HAUTE. +2. **Top archétype dépasse le 2ème de ≥ 50% ET strong_hits ≥ 1** → SELECTED, confiance MOYENNE. +3. **2-3 archétypes avec scores proches (delta < 30%)** → AMBIGUOUS → demander à l'utilisateur. +4. **Aucun archétype avec score_raw ≥ 3** → UNKNOWN → demander manuellement ou partir d'un gabarit "generic". + +### PHASE D — Composition + +Certains projets sont combinés. Cas de composition détectés AUTOMATIQUEMENT : + +- **WordPress + WooCommerce** : archétype `wordpress` + overlay `woocommerce` (si détecté) +- **Next.js + backend séparé dans monorepo** : plugin-advisor détecte déjà `monorepo`, on applique l'archétype par package +- **Astro + React islands** : archétype principal `astro-static`, noter la présence d'islands React dans les signaux +- **Drupal multi-site** : archétype `drupal` avec flag multisite + +Ne pas inventer de compositions non listées. + +--- + +## Output format + +``` +ARCHETYPE DETECTION +───────────────────── +Scores (top 5) : + 1. score: XX/YY (zz%) — strong: N, medium: N, weak: N [SELECTED | CANDIDATE | REJECTED] + 2. ... + +SELECTED : (confiance : HAUTE | MOYENNE | BASSE | AMBIGU) +COMPOSITION : + +JUSTIFICATION (signaux déterminants) : + ✓ [strong] + ✓ [medium] + ✗ [strong] (attendu pour cet archétype, absent) + +IMPLICATIONS AUTO-APPLIQUÉES : + - public : true | false + - database : required | optional | none + - audit_stack: [liste] + - plugins : [recommandations] +``` + +Si AMBIGUOUS : + +``` +⚠️ ARCHÉTYPE AMBIGU — plusieurs candidats proches : + A) score: XX (signaux: ...) + B) score: XX (signaux: ...) + C) score: XX (signaux: ...) + D) None of the above — I'll describe it manually + +Which one? (A / B / C / D) +``` + +Si UNKNOWN : + +``` +⚠️ AUCUN ARCHÉTYPE RECONNU +Je vois : +Questions manuelles : + 1. Quel type de projet ? (web / API / CLI / lib / desktop / mobile / game / firmware / autre) + 2. Public-facing (visible en recherche) ? (yes / no) + 3. Utilise une base de données ? (yes / no / depends) + 4. Stack principale ? (libre) +``` + +--- + +## Règles de robustesse + +- **Ne jamais inventer un archétype** non présent dans `~/.claude/lib/project-archetypes/`. +- **Exclure** les dossiers `node_modules`, `.git`, `vendor`, `target`, `dist`, `build`, `.next`, `__pycache__` de tous les scans. +- **Timeout** : si un grep prend > 2s, l'abandonner et marquer le signal non-testé (ne compte pas dans le score). +- **Archétype non-monorepo** : si `monorepo` est détecté par plugin-advisor, passer la détection par package (un archetype par sous-package, pas un archetype global). + +--- + +## Extension + +Ajouter un nouvel archétype : +1. Créer `~/.claude/lib/project-archetypes/.md` en respectant `_TEMPLATE.md`. +2. Tester avec `/onboard` en dry-run sur un projet connu de ce type. +3. Ajuster les weights si un signal s'avère trop discriminant/pas assez. + +Retirer un archétype : +1. Supprimer le fichier. +2. Si des projets existants s'y référaient, migrer leur `CLAUDE.md` manuellement. diff --git a/lib/project-archetypes/_TEMPLATE.md b/lib/project-archetypes/_TEMPLATE.md new file mode 100644 index 0000000..d5f26f0 --- /dev/null +++ b/lib/project-archetypes/_TEMPLATE.md @@ -0,0 +1,75 @@ +--- +name: +category: +public: # public-facing website (SEO/GEO relevant) +database: +hosting_hints: + - +audit_stack: + - analyze # dette technique (toujours) + - code-clean # style/dead code (toujours) + - seo # uniquement si public: true + - design-review # uniquement si UI présente (frontend / frontend-in-CMS) + - perf # lighthouse + bundle analyzer + - cso # sécurité — toujours recommandé si DB, auth, deps externes + - a11y # accessibilité — uniquement si UI + - doc # drift docs +plugins: + context7: # utile si fast-libs dans l'archétype + ui-ux-pro-max: # si frontend + gstack: # si site déployable navigable +--- + +# + +## Detection signals + +**Logique OR — toute combinaison ci-dessous = CANDIDAT.** +Le score final pour cet archétype = `matches / total_signals`. Plus un signal est rare/spécifique, plus il est discriminant. + +### Strong signals (score × 3) — quasi-unique à cet archétype +- `FILE: ` — description +- `STRING_IN_FILE: contient ""` +- `DEP: contient ""` + +### Medium signals (score × 2) +- `FILE: ` — description +- `DIR: /` + +### Weak signals (score × 1) — non discriminants seuls +- `EXT: N fichiers .` +- `TOOL: disponible` + +## Implications + +Liste ce que cet archétype implique automatiquement, sans questionner l'utilisateur : +- Hébergement probable : ... +- Base de données : requise / optionnelle / aucune +- SEO/GEO : critique / important / N/A +- Surface sécurité : large / moyenne / petite +- UI/UX : critique / important / aucune + +## Typical pain points + +Problèmes typiques que l'audit DOIT chercher pour cet archétype : +- ... +- ... + +## Interview questions (adaptive) + +Questions à poser EN PLUS du set minimum business (users, stade, deadlines, équipe, légal, perfs). +Chaque question a un hint `[if: ]` si elle ne s'applique que conditionnellement. + +- Question 1 ? +- Question 2 ? `[if: public=true]` +- Question 3 ? + +## Plugin recommendations + +Rationale court pour chaque plugin recommandé ou désactivé pour cet archétype. + +## Example project layout + +``` + +``` diff --git a/lib/project-archetypes/astro-static.md b/lib/project-archetypes/astro-static.md new file mode 100644 index 0000000..8f64e04 --- /dev/null +++ b/lib/project-archetypes/astro-static.md @@ -0,0 +1,102 @@ +--- +name: astro-static +category: framework +public: true +database: optional +hosting_hints: + - netlify + - cloudflare-pages + - vercel + - github-pages + - shared +audit_stack: + - analyze + - code-clean + - seo + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: optional + ui-ux-pro-max: yes + gstack: optional +--- + +# Astro (static / islands) + +Framework statique avec islands (React/Vue/Svelte). Zéro JS par défaut. Idéal portfolio, docs, blog, landing. + +## Detection signals + +### Strong signals (×3) +- FILE: `astro.config.mjs` OR `astro.config.ts` OR `astro.config.js` +- DEP: `package.json` contient "astro" + +### Medium signals (×2) +- DIR: `src/pages/` AVEC FILE `.astro` +- EXT: 3+ fichiers .astro +- DIR: `src/components/` +- DIR: `src/layouts/` + +### Weak signals (×1) +- DIR: `src/content/` (Content Collections) +- DEP: `@astrojs/*` (integrations : react, tailwind, mdx, sitemap) +- FILE: `tsconfig.json` avec "extends": "astro/tsconfigs/*" + +### Composition overlays +- Islands framework : DEP `@astrojs/react`, `@astrojs/vue`, `@astrojs/svelte` → noter +- SSR activé : `astro.config.*` contient `output: 'server'` → change implications (pas 100% static) + +## Implications +- **Hébergement** : Netlify, Cloudflare Pages, Vercel, GitHub Pages, shared (static) +- **Base de données** : OPTIONNELLE — rare en mode statique, possible via Astro DB ou backend externe +- **SEO/GEO** : EXCELLENT — HTML statique au build, parfait pour AI crawlers +- **Surface sécurité** : PETITE (pas de backend en mode static) / MOYENNE (mode SSR) +- **UI/UX** : CRITIQUE + +## Typical pain points +- `@astrojs/sitemap` non installé/configuré +- `@astrojs/mdx` mal configuré (pas de frontmatter type-safe) +- Content Collections sans schéma Zod +- Images non optimisées (pas `` d'Astro) +- `client:load` utilisé partout (défait l'intérêt des islands) +- Pas de `robots.txt` +- Pas de JSON-LD / Schema.org +- View Transitions non utilisées alors que pertinentes +- RSS feed manquant (blog) + +## Interview questions (adaptive) +En plus du set minimum business : +- Type de site : portfolio / blog / docs / landing / e-commerce / autre ? +- Islands framework si besoin d'interactivité : React / Vue / Svelte / Solid / aucun ? +- Content Collections utilisées ? (articles / projets / autre) +- Mode : static (par défaut) ou SSR (output: 'server') ? +- Déploiement : Netlify / Cloudflare / Vercel / GitHub Pages / autre ? +- i18n prévu ? (oui + quelles langues / non) `[if: public=true]` +- CMS headless couplé ? (Sanity / Contentful / Notion / aucun) + +## Plugin recommendations +- **context7** : OPTIONAL — ON si Astro version récente + integrations nombreuses +- **ui-ux-pro-max** : ON — Astro est souvent choisi pour sites "beaux" +- **gstack** : OPTIONAL — utile pour Lighthouse + +## Example project layout +``` +astro.config.mjs +src/ + pages/ + index.astro + about.astro + blog/[slug].astro + layouts/ + Base.astro + components/ + Header.astro + Card.tsx (React island) + content/ + blog/*.md +public/ + favicon.svg +``` diff --git a/lib/project-archetypes/cli-tool.md b/lib/project-archetypes/cli-tool.md new file mode 100644 index 0000000..37fc24e --- /dev/null +++ b/lib/project-archetypes/cli-tool.md @@ -0,0 +1,102 @@ +--- +name: cli-tool +category: cli +public: false +database: none +hosting_hints: + - npm-registry + - pypi + - crates-io + - homebrew + - github-releases +audit_stack: + - analyze + - code-clean + - cso + - doc +plugins: + context7: optional + ui-ux-pro-max: no + gstack: no +--- + +# CLI Tool + +Outil en ligne de commande — distribué via un registry (npm, PyPI, crates.io, Homebrew) ou binaire. + +## Detection signals + +### Strong signals (×3) +- STRING_IN_FILE: `package.json` contient "\"bin\":" (entry point CLI) +- STRING_IN_FILE: `setup.py` OR `pyproject.toml` contient "console_scripts" OR "[project.scripts]" +- STRING_IN_FILE: `Cargo.toml` contient "[[bin]]" +- FILE: `cmd/*/main.go` (convention Go CLI) + +### Medium signals (×2) +- DEP: "commander", "yargs", "clap" (Rust), "click" (Python), "typer", "cobra" (Go), "argparse" +- FILE: `bin/*` executable +- FILE: `src/cli.ts` OR `src/cli.py` OR `src/cli.rs` OR `src/main.rs` + +### Weak signals (×1) +- DEP: "chalk", "kleur", "colorama", "termcolor" (output coloré) +- DEP: "inquirer", "prompts", "questionary" (prompts interactifs) +- FILE: `README.md` AVEC STRING "Usage:" OR "Installation:" +- FILE: `CHANGELOG.md` + +### Counter-signals (exclusion) +- DEP: `react`, `next`, `vue`, `fastapi`, `express` → web, pas CLI +- FILE: `index.html` → web + +## Implications +- **Distribution** : npm / PyPI / crates.io / Homebrew / binaires GitHub Releases +- **Base de données** : aucune (sauf outil qui manipule une DB externe) +- **SEO/GEO** : N/A +- **Surface sécurité** : MOYENNE — deps externes, exécution locale, parfois privilèges élevés +- **UI/UX** : N/A (interface texte) + +## Typical pain points +- Pas de versioning semver strict (breaking changes silencieux) +- CHANGELOG absent ou pas à jour +- Tests des commandes absents (pytest-click, oclif-test, etc.) +- Pas de help text cohérent (`--help` incomplet) +- Exit codes incohérents (0 toujours, même en erreur) +- Output pas parseable (pas de `--json`) +- Pas de shell completion (bash/zsh/fish) +- Deps avec failles (npm audit / cargo audit / pip-audit non exécuté) +- Pas de cross-platform test (Win/macOS/Linux) +- Logs vers stdout au lieu de stderr (casse les pipes) +- Pas de gestion des signaux (SIGINT → cleanup ?) +- Installation instructions incomplètes dans README + +## Interview questions (adaptive) +En plus du set minimum business : +- Langage : Node.js / Python / Rust / Go / autre ? +- Framework CLI : Commander / Clap / Click / Cobra / argparse / autre ? +- Distribution : npm / PyPI / crates.io / Homebrew / binaires GitHub / multiple ? +- OS cibles : Linux / macOS / Windows / WSL ? +- Interactivité : prompts interactifs / pure arguments CLI ? +- Output : texte formaté / JSON / les deux (`--json`) ? +- Shell completion fournie ? (oui / non / souhaité) +- Tests : couverture actuelle / cible ? +- Releases : manuelles / CI (goreleaser, semantic-release, release-please) ? +- Deps externes binaires requis ? (git, docker, ffmpeg, etc.) + +## Plugin recommendations +- **context7** : OPTIONAL — ON si framework CLI récent +- **ui-ux-pro-max** : OFF (pas d'UI graphique) +- **gstack** : OFF + +## Example project layout +``` +package.json OR pyproject.toml OR Cargo.toml +src/ + cli.ts OR cli.py OR main.rs + commands/ + init.ts + build.ts +bin/ + my-tool +tests/ +README.md (Usage + Installation) +CHANGELOG.md +``` diff --git a/lib/project-archetypes/data-notebook.md b/lib/project-archetypes/data-notebook.md new file mode 100644 index 0000000..dc20d8e --- /dev/null +++ b/lib/project-archetypes/data-notebook.md @@ -0,0 +1,121 @@ +--- +name: data-notebook +category: meta +public: false +database: optional +hosting_hints: + - local + - jupyterhub + - colab + - kaggle + - databricks + - sagemaker +audit_stack: + - analyze + - code-clean + - cso + - doc +plugins: + context7: optional + ui-ux-pro-max: no + gstack: no +--- + +# Data / Jupyter Notebook + +Projet data science / ML axé sur notebooks Jupyter. Exploration, analyse, modèles. Pas d'application déployée au sens applicatif. + +## Detection signals + +### Strong signals (×3) +- EXT: 5+ fichiers `.ipynb` +- DEP: `requirements.txt` OR `pyproject.toml` OR `environment.yml` contient "jupyter" OR "jupyterlab" OR "notebook" +- FILE: `environment.yml` (Conda) + +### Medium signals (×2) +- DIR: `notebooks/` OR `nb/` avec `.ipynb` +- DIR: `data/` OR `datasets/` (souvent gitignored) +- DEP: "pandas", "numpy", "matplotlib", "seaborn", "scikit-learn", "torch", "tensorflow", "jax" +- FILE: `Makefile` avec cibles data (download-data/, preprocess/, train/) +- FILE: `dvc.yaml` (DVC pipeline) + +### Weak signals (×1) +- DIR: `models/` (trained artifacts) +- FILE: `.gitattributes` avec LFS rules +- DEP: "mlflow", "wandb", "tensorboard" +- DIR: `figures/` OR `plots/` (outputs) + +### Counter-signals (exclusion) +- DEP: "streamlit" OR "gradio" OR "dash" + main entry point → data app UI (archétype à créer) +- DEP: "fastapi" / "flask" / "django" comme dep principale → API, pas notebook +- FILE: `setup.py` OR `pyproject.toml` AVEC `[project.scripts]` → package, pas notebook + +## Implications +- **Exécution** : local / Google Colab / Kaggle / JupyterHub / Databricks / SageMaker +- **Base de données** : variable (souvent CSV/Parquet/DuckDB locaux, parfois DB externe) +- **SEO/GEO** : N/A +- **Surface sécurité** : SOUS-ESTIMÉE — notebooks souvent commités avec credentials, outputs, PII +- **UI/UX** : N/A (sauf si app Streamlit/Dash ajoutée) + +## Typical pain points +- `.ipynb` committés avec **outputs** = fuite potentielle (données clients affichées) +- Credentials en dur dans cellules (API keys AWS, tokens Kaggle, mots de passe DB) +- PII dans outputs cellules (noms clients, emails, numéros carte) +- Datasets volumineux committés (pas de LFS / DVC / gitignore) +- `requirements.txt` non pinned → résultats non reproductibles +- Pas de seed random → runs non déterministes +- Notebooks monolithiques (10000+ lignes, cells non documentées) +- Logique dupliquée entre notebooks (pas de `src/lib.py`) +- Variables d'état entre cells (exécution non idempotente) +- Modèles trainés commités dans git (bloat repo) +- Pas de versioning data (DVC / lakeFS / Pachyderm absents) +- Expériences non trackées (MLflow / W&B absent) +- Pas de tests (pytest sur fonctions extraites) +- Conversion prod : notebook → script Python sans refactor (code non modulaire) +- GPU / environnement non documenté (CUDA version, cuDNN) +- Shared secrets dans environment.yml / requirements.txt + +## Interview questions (adaptive) +En plus du set minimum business : +- Plateforme d'exécution : local / Colab / Kaggle / JupyterHub / Databricks / autre ? +- Python + libs stack principale ? +- Package manager : pip / poetry / uv / conda / mamba / pdm ? +- Datasets : taille moyenne ? où sont-ils stockés ? versionnés ? +- DVC / lakeFS / Git LFS pour data ? +- Tracking expériences : MLflow / W&B / TensorBoard / aucun ? +- Tests automatiques sur fonctions extraites ? +- Convention commit notebooks : nbstripout (outputs strippés) ou outputs inclus ? +- GPU requis ? CUDA version ? +- But final : exploration ponctuelle / modèle en prod / rapport reproductible / papier / autre ? +- Si prod : comment le modèle sort du notebook (export pickle/ONNX/API) ? +- RGPD / données sensibles dans les datasets ? + +## Plugin recommendations +- **context7** : OPTIONAL — ON pour libs modernes (Pytorch, JAX, Transformers qui évoluent) +- **ui-ux-pro-max** : OFF +- **gstack** : OFF + +## Example project layout +``` +environment.yml OR requirements.txt OR pyproject.toml +notebooks/ + 01-exploration.ipynb + 02-preprocessing.ipynb + 03-modeling.ipynb + 04-evaluation.ipynb +src/ + features.py (fonctions extraites, testables) + models.py + utils.py +data/ (GITIGNORED ou DVC-tracked) + raw/ + interim/ + processed/ +models/ (artifacts — GITIGNORED ou LFS) +figures/ +tests/ + test_features.py +dvc.yaml (optional) +.pre-commit-config.yaml (nbstripout idéal) +Makefile +``` diff --git a/lib/project-archetypes/desktop-electron.md b/lib/project-archetypes/desktop-electron.md new file mode 100644 index 0000000..cda3f4c --- /dev/null +++ b/lib/project-archetypes/desktop-electron.md @@ -0,0 +1,132 @@ +--- +name: desktop-electron +category: desktop +public: false +database: optional +hosting_hints: + - github-releases + - autoupdate-servers + - mac-app-store + - microsoft-store + - snap-store + - aur +audit_stack: + - analyze + - code-clean + - cso + - design-review + - perf + - a11y + - doc +plugins: + context7: yes + ui-ux-pro-max: yes + gstack: optional +--- + +# Desktop Electron + +Application desktop basée sur Electron (Chromium + Node.js). Distribution binaires pour macOS / Windows / Linux. + +## Detection signals + +### Strong signals (×3) +- DEP: `package.json` contient "electron" +- STRING_IN_FILE: tout .js/.ts du projet contient "app.whenReady()" OR "new BrowserWindow(" OR "require('electron')" OR "import .* from 'electron'" +- FILE: `electron-builder.json` OR `electron-builder.yml` OR `forge.config.js` OR `forge.config.ts` + +### Medium signals (×2) +- DEP: "electron-builder" OR "@electron-forge/cli" +- DIR: `src/main/` (main process) AND `src/renderer/` (renderer) +- FILE: `main.js` OR `main.ts` OR `src/main/index.ts` (main process entry) +- FILE: `preload.js` OR `src/preload/index.ts` + +### Weak signals (×1) +- DIR: `build/` avec icons (icon.icns, icon.ico, icon.png) +- DEP: "electron-updater" +- DEP: "electron-store" +- FILE: `.env.production` avec vars Electron + +### Composition overlays +- **Tauri** (NOT Electron but similar archetype) : DEP `@tauri-apps/*` ET `src-tauri/` — à traiter avec archétype `desktop-tauri` (à créer plus tard) +- **Frontend framework inside renderer** : React / Vue / Svelte detected → noter + +## Implications +- **Distribution** : GitHub Releases, autoupdate servers, Mac App Store, Microsoft Store, Snap Store, AUR +- **Base de données** : OPTIONNELLE — souvent SQLite via better-sqlite3 ou electron-store (JSON) +- **SEO/GEO** : N/A (app native desktop) +- **Surface sécurité** : **CRITIQUE** — accès file system, shell, nodeIntegration si mal config = RCE +- **UI/UX** : CRITIQUE — conventions desktop par OS + +## Typical pain points +- `nodeIntegration: true` et `contextIsolation: false` dans BrowserWindow → XSS = exécution code natif arbitraire +- `contextBridge` non utilisé (preload expose Node API brut au renderer) +- `webSecurity: false` (CORS désactivé dans renderer — risque énorme) +- Secrets / API keys dans le bundle (déchiffrable par n'importe quel user — asar non chiffré) +- URL chargée remote dans BrowserWindow → MITM sur un site compromis = RCE +- Pas de code signing (macOS Gatekeeper / Windows SmartScreen avertissements) +- Pas d'autoupdate (`electron-updater`) → users bloqués sur vieilles versions faillibles +- Electron version obsolète (updates mensuelles critiques) +- Shell IPC non validé (renderer peut exécuter commandes shell via ipcMain mal filtré) +- `navigator.userAgent` leak (app detectable, fingerprint) +- Menu context / clipboard : permissions non gérées +- Deep links (`app://`) non validés → phishing +- Accessibilité OS : ARIA ignoré, screen readers non testés +- Taille du bundle énorme (Chromium = 150-200MB) +- Performances : main process bloqué par ops synchrones (fs sync dans main) +- Memory leaks : BrowserWindows non fermés, event listeners non cleanup +- Pas de crash reporting natif (`electron-log`, Sentry Electron) +- Pas de tests E2E (Spectron déprécié, Playwright Electron recommandé) + +## Interview questions (adaptive) +En plus du set minimum business : +- Framework build : electron-builder / electron-forge / autre ? +- Frontend dans renderer : React / Vue / Svelte / vanilla / autre ? +- IPC : `ipcMain`+`ipcRenderer` directs / `contextBridge` secure / `@electron/remote` (déprécié) ? +- BrowserWindow config : nodeIntegration / contextIsolation / sandbox / webSecurity ? +- Auth : OAuth desktop / tokens locaux / SSO entreprise ? +- Stockage : electron-store / SQLite (better-sqlite3) / IndexedDB / file system direct / cloud ? +- Code signing : macOS (Developer ID + notarization) / Windows (EV Cert) / aucun ? +- Autoupdate : electron-updater / custom / aucun ? +- Distribution : GitHub Releases / Homebrew Cask / MS Store / Mac App Store / autre ? +- OS cibles : macOS min / Windows min / Linux distros ? +- Architecture : x64 / arm64 / universal2 (macOS) ? +- Electron version + cycle d'upgrade ? +- Crash reporting : Sentry Electron / electron-log / aucun ? +- Analytics : respecte RGPD (opt-in, désactivable) ? +- Tests : unit + Playwright Electron ? +- CI/CD : builds multi-OS (GitHub Actions matrix / CircleCI) ? +- Deep links / protocol handlers registered ? +- App menu + accelerators ? +- Accessibilité OS native testée ? + +## Plugin recommendations +- **context7** : ON — Electron évolue vite (mensuel), breaking changes fréquents +- **ui-ux-pro-max** : ON +- **gstack** : OPTIONAL — Playwright peut tester le renderer + +## Example project layout +``` +package.json +forge.config.ts OR electron-builder.json +src/ + main/ + index.ts (main process) + window.ts + menu.ts + ipc-handlers.ts + preload/ + index.ts (contextBridge) + renderer/ + index.html + main.tsx (React/Vue/Svelte app) + components/ +resources/ + icon.icns + icon.ico + icon.png +build/ + entitlements.mac.plist + background.png +.env.example +``` diff --git a/lib/project-archetypes/docker-compose-infra.md b/lib/project-archetypes/docker-compose-infra.md new file mode 100644 index 0000000..addaefd --- /dev/null +++ b/lib/project-archetypes/docker-compose-infra.md @@ -0,0 +1,113 @@ +--- +name: docker-compose-infra +category: meta +public: false +database: optional +hosting_hints: + - vps + - bare-metal + - homelab +audit_stack: + - analyze + - code-clean + - cso + - doc +plugins: + context7: no + ui-ux-pro-max: no + gstack: no +--- + +# Docker Compose Infrastructure + +Stack docker-compose orchestrant services externes (DB, cache, reverse proxy, monitoring, apps déployables) — pas de code applicatif au root. Exemple : stack homelab / VPS / environnement local partagé. + +## Detection signals + +### Strong signals (×3) +- FILE: `docker-compose.yml` OR `docker-compose.yaml` +- FILE: `compose.yml` OR `compose.yaml` (syntaxe moderne) +- FILE: plusieurs `docker-compose.*.yml` (override, prod, dev) + +### Medium signals (×2) +- FILE: `.env.example` avec vars de services (POSTGRES_PASSWORD, REDIS_PASSWORD, etc.) +- DIR: `configs/` OR `conf/` OR `volumes/` avec configs de services (nginx.conf, redis.conf, postgresql.conf) +- FILE: `Makefile` avec cibles docker (`up:`, `down:`, `restart:`, `logs:`) +- DIR: `traefik/` OR `nginx/` OR `caddy/` (reverse proxy configs) +- FILE: `.dockerignore` + +### Weak signals (×1) +- DIR: `scripts/` avec scripts d'init DB / backup +- FILE: `backup.sh` OR `restore.sh` +- DIR: `data/` (gitignored, volumes montés) + +### Counter-signals (exclusion) +- FILE: `package.json` AVEC deps applicatives (react/next/express/...) → c'est une app, pas de l'infra-only +- FILE: `pyproject.toml` AVEC `[project.scripts]` → app Python +- FILE: `Cargo.toml` → app Rust +- DIR: `src/` significatif avec code métier → c'est une app, pas du pur infra + +## Implications +- **Hébergement** : VPS / bare-metal / homelab (Raspberry Pi, NAS) +- **Base de données** : souvent incluse dans la stack (Postgres/MySQL/Redis/Mongo) +- **SEO/GEO** : N/A +- **Surface sécurité** : GRANDE — secrets, ports exposés, privilèges containers +- **UI/UX** : N/A + +## Typical pain points +- `.env` committé avec credentials +- Images `:latest` (pas de versions pinnées) → upgrades casse-stack +- `privileged: true` abusif +- Ports exposés sur 0.0.0.0 sans firewall (DB accessible Internet !) +- Pas de healthchecks +- Pas de restart policy +- Volumes non nommés (data perdue à la recréation) +- Pas de backup automatique (cron, restic, borg) +- Logs non centralisés ni rotés +- Reverse proxy sans TLS (Let's Encrypt absent) +- Network default bridge avec tous services (pas d'isolation) +- User `root` dans containers (privilege escalation) +- Resources limits absents (un service OOM-kill les autres) +- Secrets en environment (visibles `docker inspect`) +- Images Dockerfile non custom : `postgres:15` nu sans hardening + +## Interview questions (adaptive) +En plus du set minimum business : +- OS host : Ubuntu / Debian / CoreOS / autre ? +- Services principaux dans la stack (DB / cache / reverse proxy / monitoring / apps) ? +- Reverse proxy : Traefik / Caddy / nginx / aucun ? +- TLS : Let's Encrypt / certs custom / aucun ? +- Secrets management : .env / Docker secrets / Vault / autre ? +- Backup strategy : aucun / manuel / automatisé (quoi ?) ? +- Monitoring / logs : Portainer / Grafana / Loki / ELK / aucun ? +- Uptime monitoring externe : UptimeRobot / BetterStack / aucun ? +- Mise à jour des images : manuelle / Watchtower / Renovate / aucune ? +- Restrictions réseau (firewall, fail2ban) ? +- Multi-env : dev + prod séparés ? + +## Plugin recommendations +- **context7** : OFF (Docker/Compose stable) +- **ui-ux-pro-max** : OFF +- **gstack** : OFF + +## Example project layout +``` +docker-compose.yml +docker-compose.prod.yml (override prod) +.env.example +.dockerignore +Makefile (up:/down:/logs:/backup:) +configs/ + nginx/ + default.conf + traefik/ + traefik.yml + dynamic.yml + postgres/ + init.sql +scripts/ + backup.sh + restore.sh +volumes/ (gitignored data) +README.md +``` diff --git a/lib/project-archetypes/dotfiles-meta.md b/lib/project-archetypes/dotfiles-meta.md new file mode 100644 index 0000000..c42aae6 --- /dev/null +++ b/lib/project-archetypes/dotfiles-meta.md @@ -0,0 +1,115 @@ +--- +name: dotfiles-meta +category: meta +public: false +database: none +hosting_hints: + - git-repo-personal + - github +audit_stack: + - analyze + - code-clean + - cso + - doc +plugins: + context7: no + ui-ux-pro-max: no + gstack: no +--- + +# Dotfiles / Meta-tooling / Config framework + +Repo qui ne produit pas d'application mais du **configuration / scripts / conventions** — dotfiles personnels, framework de config partagée, collection de scripts de provisionning, hooks, templates. + +Exemple : un repo `claude-config` avec scripts shell + settings JSON + templates + agents, sans langage applicatif compilé. + +## Detection signals + +### Strong signals (×3) +- FILE: `install.sh` OR `install-*.sh` +- FILE: `Makefile` AVEC STRING "install:" OR "link:" OR "setup:" +- DIR: `hooks/` (PAS git/.git/hooks — hooks custom projet) +- DIR: `templates/` AVEC contenu de config (non-code applicatif) +- FILE: `settings.json` à la racine (hors dossier d'app type .vscode/) +- STRING_IN_FILE: `README.md` contient "dotfiles" OR "config framework" OR "provisioning" + +### Medium signals (×2) +- EXT: 5+ fichiers .sh +- EXT: 10+ fichiers .md +- FILE: `link.sh` OR `symlink.sh` OR `bootstrap.sh` +- DIR: `agents/` OR `skills/` OR `scripts/` (sans code applicatif associé) +- FILE: `plugins.lock.json` OR `plugins.json` + +### Weak signals (×1) +- FILE: `CHANGELOG.md` de releases de config (pas d'app) +- FILE: `.gitmodules` (sub-projects config) +- FILE: `doctor.sh` OR `health.sh` +- DIR: `lib/` contenant surtout du .sh ou .md (pas du code applicatif) + +### Counter-signals (exclusion — si matché, rejette) +- FILE: `package.json` AVEC DEPS applicatives (react/next/express/etc.) +- FILE: `pyproject.toml` AVEC `[project.scripts]` OR deps applicatives +- FILE: `Cargo.toml` AVEC `[[bin]]` +- FILE: `index.html` au root → web project +- FILE: `wp-config.php` → WordPress + +## Implications +- **Distribution** : git clone personnel / GitHub public / fork +- **Base de données** : aucune +- **SEO/GEO** : N/A +- **Surface sécurité** : MOYENNE — scripts exécutés sur machine utilisateur, risque élevé si compromis (exécution arbitraire en shell) +- **UI/UX** : N/A + +## Typical pain points +- Scripts shell sans `set -euo pipefail` → échecs silencieux +- Pas de `shellcheck` en CI +- Symlinks / installation non idempotents (re-run casse l'état) +- Pas de test / dry-run mode +- Pas de détection OS (cmd Linux-only qui casse sur macOS, ou inverse) +- Secrets en dur dans templates (API keys, tokens) +- `curl | sh` dans README (risque MITM, pas de checksum) +- Versioning flou (pas de CHANGELOG cohérent) +- Breaking changes non signalés aux utilisateurs +- Dépendances externes non vérifiées (brew/apt/npm auto-install sans consentement) +- Uninstall / rollback absent +- Documentation incomplète (comment étendre, comment contribuer) +- Pas de `LICENSE` + +## Interview questions (adaptive) +En plus du set minimum business : +- Audience : personnel (dotfiles privés) / équipe / public open source ? +- OS cibles : Linux / macOS / WSL / Windows natif / tous ? +- Shell cible : bash / zsh / fish / multi ? +- Idempotence : les scripts peuvent-ils être re-exécutés sans casser ? (oui / non / à vérifier) +- Mode dry-run / preview disponible ? (oui / non / souhaité) +- Tests automatiques : shellcheck / bats / aucun ? +- Distribution : git clone manuel / installer en un liner / brew tap / autre ? +- Dépendances externes auto-installées ? (brew/apt/npm/pip) — avec consentement utilisateur ? +- Uninstall prévu ? (oui / non) +- Versioning : semver / dates / aucun ? +- `CHANGELOG.md` maintenu ? (oui / non) +- Hébergement : GitHub public / privé / GitLab / autre ? + +## Plugin recommendations +- **context7** : OFF — pas de fast-libs +- **ui-ux-pro-max** : OFF +- **gstack** : OFF + +## Example project layout +``` +install.sh +link.sh +doctor.sh +Makefile +CLAUDE.md (si le repo lui-même est un contexte Claude) +README.md +CHANGELOG.md +settings.json (config globale outil) +plugins.lock.json (lockfile d'extensions) +agents/ (agents custom) +skills/ (skills custom) +hooks/ (hooks projet, pas git) +templates/ (templates config fournis) +lib/ (helpers shell) +tasks/ +``` diff --git a/lib/project-archetypes/drupal.md b/lib/project-archetypes/drupal.md new file mode 100644 index 0000000..42bbd91 --- /dev/null +++ b/lib/project-archetypes/drupal.md @@ -0,0 +1,124 @@ +--- +name: drupal +category: cms +public: true +database: required +hosting_hints: + - shared + - vps + - acquia + - pantheon + - platform-sh + - docker +audit_stack: + - analyze + - code-clean + - seo + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: no + ui-ux-pro-max: optional + gstack: optional +--- + +# Drupal + +CMS PHP/MySQL enterprise. Architecture modulaire. Thèmes custom, modules contrib + custom. Headless possible (Drupal API + frontend découplé). + +## Detection signals + +### Strong signals (×3) +- FILE: `sites/default/settings.php` +- FILE: `core/lib/Drupal.php` +- DIR: `core/` +- STRING_IN_FILE: `composer.json` contient "drupal/core" OR "drupal/core-recommended" + +### Medium signals (×2) +- DIR: `modules/contrib/` +- DIR: `modules/custom/` +- DIR: `themes/custom/` +- DIR: `web/` (Composer-based install, `composer create-project drupal/recommended-project`) +- FILE: `composer.lock` contenant deps drupal +- FILE: `.drush/` + +### Weak signals (×1) +- DIR: `vendor/` +- FILE: `.htaccess` contenant "RewriteRule .*\.php" +- FILE: `update.php` +- EXT: 20+ fichiers .php + +### Composition overlays +- **Multisite** : STRING_IN_FILE `sites/sites.php` contient "$sites[" → noter multisite +- **Headless/decoupled** : DEP JSON:API activée (`core/modules/jsonapi/`) + frontend séparé → composer avec l'archetype frontend détecté + +## Implications +- **Hébergement** : shared (rare pour Drupal), VPS, Acquia Cloud, Pantheon, platform.sh, Docker +- **Base de données** : MySQL/MariaDB/PostgreSQL REQUISE +- **SEO/GEO** : CRITIQUE +- **Surface sécurité** : TRÈS GRANDE — cœur + modules contrib + thème custom + permissions complexes +- **UI/UX** : thème-dependent + +## Typical pain points +- Drupal core obsolète (Drupal 7 EOL, migration vers 10/11 critique) +- Modules contrib obsolètes → failles sécurité +- `settings.php` committé avec credentials DB +- DB_SECRET / hash_salt en dur +- Pas d'environnement staging / CI +- Permissions roles/users mal configurées +- Cache (Redis/Memcache) absent +- Vues complexes non optimisées (queries multi-joins) +- Composer.lock obsolète (drupal deps avec vulnérabilités) +- PHP version obsolète (< 8.1) +- Entity references sans index → slow queries +- Pas de CI pour les tests (PHPUnit/Behat ignorés) +- Configuration management non utilisé (changements DB non versionnés) + +## Interview questions (adaptive) +En plus du set minimum business : +- Version Drupal ? (7 / 8 / 9 / 10 / 11) +- Hébergeur actuel ? (shared / VPS / Acquia / Pantheon / autre) +- Thème : custom ou contrib ? +- Modules custom importants (nombre + fonctionnalités) ? +- Architecture : monolithique ou headless (JSON:API / GraphQL) ? +- Configuration Management utilisé ? (yml exportés dans config/sync) +- Staging / CI pipeline existant ? +- Stratégie de backup DB ? +- Dernier audit sécurité ? +- Composer workflow (core-recommended vs legacy) ? +- Drush / Drupal Console utilisé ? +- Trafic mensuel + dimensionnement serveur ? + +## Plugin recommendations +- **ui-ux-pro-max** : OPTIONAL — ON si thème custom en dev +- **gstack** : OPTIONAL — audit Lighthouse/Axe sur staging +- **context7** : OFF — Drupal évolue lentement + +## Example project layout +``` +composer.json +composer.lock +web/ + core/ + modules/ + contrib/ + custom/ + mon_module/ + mon_module.info.yml + mon_module.module + themes/ + custom/ + mon_theme/ + mon_theme.info.yml + mon_theme.libraries.yml + sites/ + default/ + settings.php + files/ +config/ + sync/ +vendor/ +``` diff --git a/lib/project-archetypes/firmware-embedded.md b/lib/project-archetypes/firmware-embedded.md new file mode 100644 index 0000000..8cc81b5 --- /dev/null +++ b/lib/project-archetypes/firmware-embedded.md @@ -0,0 +1,132 @@ +--- +name: firmware-embedded +category: embedded +public: false +database: none +hosting_hints: + - bare-metal + - microcontroller-flash + - ota-server +audit_stack: + - analyze + - code-clean + - cso + - doc +plugins: + context7: no + ui-ux-pro-max: no + gstack: no +--- + +# Firmware / Embedded + +Projet firmware bas-niveau / microcontrôleur (STM32, ESP32, RP2040, Nordic, AVR). Pas de système d'exploitation complet (bare-metal / RTOS léger type FreeRTOS/Zephyr). + +## Detection signals + +### Strong signals (×3) +- FILE: `platformio.ini` (PlatformIO) +- FILE: `*.ld` OR `*.lds` OR `linker*.ld` (linker scripts — signature bare-metal) +- FILE: `CMakeLists.txt` contenant "arm-none-eabi" OR "riscv-none-elf" OR "xtensa-esp32" OR "ESP_PLATFORM" OR "STM32" +- FILE: `Kconfig` (Zephyr RTOS) + +### Medium signals (×2) +- FILE: `Makefile` avec variables CC / AS / LD / OBJCOPY +- DIR: `src/` avec fichiers .c / .cpp / .h ET absence de manifests langage haut-niveau (pas de package.json, Cargo.toml, go.mod, pyproject.toml) +- DIR: `drivers/` OR `hal/` OR `bsp/` OR `mcu/` +- FILE: `sdkconfig` (ESP-IDF) +- FILE: `prj.conf` (Zephyr) +- FILE: `idf_component.yml` (ESP-IDF component) + +### Weak signals (×1) +- FILE: `openocd.cfg` (debug probe config) +- FILE: `*.cfg` contenant "adapter" OR "interface" OR "transport select" +- EXT: outputs `.bin`, `.hex`, `.uf2`, `.elf` dans un `build/` ou `.pio/` +- DEP (platformio): "[env:*]" sections + +### Counter-signals (exclusion) +- FILE: `package.json` AVEC deps JavaScript → app web (pas embedded) +- FILE: `Cargo.toml` AVEC `[dependencies]` bibliothèques hautes → peut être Rust embedded (créer archetype rust-embedded plus tard) +- FILE: `.c` files AVEC `pyproject.toml` / `Cargo.toml` contenant pybind/pyo3 → FFI bindings, PAS embedded + +## Implications +- **Cible** : microcontrôleur (STM32/ESP32/RP2040/nRF/AVR/MSP430) / SoC bas-niveau / bare-metal +- **Base de données** : aucune (stockage = flash interne / EEPROM / SD card brute) +- **SEO/GEO** : N/A +- **Surface sécurité** : SPÉCIFIQUE — buffer overflows stack/heap, secure boot, OTA integrity, JTAG exposé, downgrade attacks +- **UI/UX** : N/A (sauf petits LCD/OLED) + +## Typical pain points +- Buffer overflows : `strcpy`, `strcat`, `sprintf` sans bounds check +- `malloc` dans ISR / sections critiques (hang potentiel) +- Pas de watchdog timer activé +- Optim compiler `-O0` ou `-O3` sans profil (bugs volatile manquent) +- `volatile` oublié sur MMIO / variables partagées ISR-main +- Pas de `-Wall -Wextra -Wpedantic` + `-Werror` +- Linker script maison non audité (sections overlap / alignement incorrect) +- Stack size insuffisant (crash silencieux par overflow) +- Secrets / keys en dur dans le binaire (extractibles par dump flash) +- Secure Boot / signing non activé +- OTA sans vérification signature → persistant firmware malveillant possible +- JTAG / SWD non désactivé en prod → extraction firmware / inject code +- Debug logs activés en release (`printf` via UART exposé) +- Ressources cycles hardcoded (sleeps en loops `for`) → non portable à autre horloge +- Pas d'abstraction HAL → couplage MCU-specific partout +- Timings critiques non mesurés (analyseur logique absent du workflow) +- Energy profile ignoré (wake-up patterns sous-optimaux, sleep modes inutilisés) +- Pas de tests unitaires (on-host avec mocks HAL absent) +- CI sans cross-compilation (`arm-none-eabi-gcc` non disponible) +- Documentation registres absente (cf datasheet + magic numbers dans le code) +- Flash wear leveling ignoré (écritures fréquentes sur même secteur) + +## Interview questions (adaptive) +En plus du set minimum business : +- MCU / SoC cible : famille (STM32Fxx / ESP32-S3 / RP2040 / nRF52 / autre) ? +- Toolchain : GNU ARM / ESP-IDF / Zephyr / PlatformIO / Arduino / autre ? +- Framework / RTOS : bare-metal / FreeRTOS / Zephyr / Mbed / Arduino / ESP-IDF ? +- HAL / BSP : vendor HAL / CMSIS / libopencm3 / custom ? +- Langage : C / C++ / Rust embedded / Ada ? +- Standard C version (C99 / C11 / C17) + flags GCC ? +- Secure Boot activé ? Signing firmware ? +- OTA : présent / comment (MQTT / HTTP / custom) / signature vérifiée ? +- Debug : JTAG / SWD en prod (devrait être désactivé) ? +- Watchdog actif ? reset sources tracées ? +- Power budget : ampérage / sleep modes utilisés ? +- Memory budget : flash size / RAM size / current usage ? +- Tests : on-host (Unity/CMocka/etc.) / on-target / HIL (hardware-in-loop) ? +- CI : cross-compile + tests on-host ? lint (cppcheck, clang-tidy) ? +- MISRA-C / CERT-C conformance ? +- Product certifications visées (FCC / CE / CE-RED / FIPS / IEC 62443) ? +- Bootloader : custom / vendor / MCUboot ? +- Logs prod : UART / RTT / deep-ignored ? + +## Plugin recommendations +- **context7** : OFF — docs MCU (datasheets, ref manuals) PDF, hors scope context7 +- **ui-ux-pro-max** : OFF +- **gstack** : OFF + +## Example project layout (PlatformIO STM32) +``` +platformio.ini +include/ + config.h +src/ + main.c + drivers/ + uart.c + i2c.c + gpio.c + hal/ + stm32f4xx_it.c + rtos/ + tasks.c + app/ + sensor.c + protocol.c +lib/ + external/ +test/ + test_sensor.c +docs/ + datasheets/ +``` diff --git a/lib/project-archetypes/game-engine-native.md b/lib/project-archetypes/game-engine-native.md new file mode 100644 index 0000000..adefe81 --- /dev/null +++ b/lib/project-archetypes/game-engine-native.md @@ -0,0 +1,166 @@ +--- +name: game-engine-native +category: game +public: true +database: optional +hosting_hints: + - steam + - itch-io + - gog + - epic-store + - app-stores + - console-stores +audit_stack: + - analyze + - code-clean + - perf + - design-review + - a11y + - doc +plugins: + context7: no + ui-ux-pro-max: optional + gstack: no +--- + +# Game Engine Native (Godot / Unity) + +Projet de jeu utilisant un moteur natif : Godot (GDScript / C#) ou Unity (C#). Distribution standalone desktop / mobile / console, parfois web export. + +## Detection signals + +### Strong signals (×3) +- FILE: `project.godot` (Godot) +- DIR: `ProjectSettings/` contenant `*.asset` (Unity) +- FILE: `Assets/Settings/*.asset` OR `Packages/manifest.json` (Unity) +- EXT: 5+ fichiers `.gd` (Godot GDScript) +- EXT: 5+ fichiers `.unity` (Unity scene files) + +### Medium signals (×2) +- DIR: `scenes/` AVEC `.tscn` (Godot) +- DIR: `Assets/Scripts/` AVEC `.cs` (Unity) +- DIR: `addons/` (Godot custom plugins) +- DIR: `Library/` (Unity, gitignored normalement) +- FILE: `.godot/` directory (Godot cache) +- DEP: `Packages/manifest.json` contient "com.unity.*" + +### Weak signals (×1) +- DIR: `.gitattributes` avec LFS rules pour assets binaires +- EXT: `.tres` (Godot resources), `.prefab` (Unity) +- DIR: `Builds/` OR `exports/` (builds sortie) +- FILE: `.gdignore` OR `.gitignore` avec patterns Unity/Godot + +### Composition overlays +- **Godot 4 vs 3** : détection sur `config_version=5` (Godot 4) vs `config_version=4` (Godot 3) +- **Unity URP / HDRP / Built-in** : `Assets/Settings/URP-*.asset` / `HDRenderPipelineAsset.asset` +- **C# in Godot** : FILE `*.csproj` AVEC Godot references + +## Implications +- **Distribution** : Steam, itch.io, GOG, Epic Store, App Store, Play Store, consoles (avec portage) +- **Base de données** : OPTIONNELLE — save files locaux, backends externes possibles (Unity Gaming Services, PlayFab, Firebase) +- **SEO/GEO** : N/A (sauf page produit sur Steam / site du jeu) +- **Surface sécurité** : MOYENNE — anti-cheat si multiplayer, injection via mods, DLC entitlements +- **UI/UX** : CRITIQUE — game feel + UI in-game + onboarding + accessibilité + +## Typical pain points +- Assets volumineux (textures, audio, modèles 3D) NON en LFS → repo bloat / clone lent +- Meta files (.meta Unity) non commités → references cassées en équipe +- Scene conflicts Unity (YAML non mergeable) sans SmartMerge configuré +- Pas de CI build (builds manuels depuis l'éditeur, erreurs env-specific) +- Pas de tests (Unity Test Framework / GUT Godot rarement utilisés) +- Hardcoded paths (résolution, language, keymaps) +- Input non rebindable (clavier/manette) +- Accessibilité catastrophique : pas de color-blind mode, pas de subtitles, pas d'options motion +- Pas de pause propre (main menu ok, mais in-game pause buggé) +- Performances non profilées (frame drops sans diagnostic) +- Memory leaks : particules non freed, signals non disconnect, scenes non queue_free +- Localisation absente ou hardcodée (pas de `.po` / `.csv` / Unity Localization Package) +- Save files en clair dans `%APPDATA%` / `~/Library/Application Support` — triche triviale +- Multiplayer : auth client-side, state non validé server-side +- Modding non supporté (absence d'API plugins) +- Pas d'analytics respectueux RGPD (opt-in, anonymisé) +- Build size non optimisé (toutes textures en 4K, pas de compression format GPU) +- Pas d'Over-the-air patches (cycles Steam update long) +- Audio non mixé (master bus saturé, pas de ducking, pas d'accessibilité audio) +- Shaders custom non cross-platform (Metal vs Vulkan vs DX12 vs OpenGL ES) + +## Interview questions (adaptive) +En plus du set minimum business : +- Moteur : Godot (3.x / 4.x) / Unity (version LTS / Alpha) / autre ? +- Langage : GDScript / C# (Godot Mono) / C# Unity ? +- Pipeline rendu Unity : Built-in / URP / HDRP ? +- Version control : Git LFS activé ? Unity SmartMerge configuré ? Plastic SCM ? +- Scène principale + architecture : monolithique / modulaire (additive scenes) ? +- Type de jeu : 2D / 3D / first-person / third-person / puzzle / MMO / ... ? +- Solo / coop local / multiplayer online / les deux ? +- Multiplayer : Mirror / Netcode for GameObjects / Fishnet / Godot High-Level Multiplayer / Photon / autre ? +- Analytics : Unity Analytics / custom / aucun ? +- Save system : binaire / JSON / steam cloud / server-side ? +- Localisation : Unity Localization / Godot tr() / externe ? +- Input System : Unity Input System / InputManager legacy / Godot InputMap ? +- Cibles plateformes : PC (Windows/macOS/Linux) / mobile / consoles (PS/Xbox/Switch) ? +- Distribution : Steam / itch.io / GOG / Epic / App Store / consoles ? +- Anti-cheat si multiplayer ? +- Modding prévu ? +- Accessibilité : color-blind mode / subtitles / motion options / remappable controls / haptic alternatives ? +- Audio mixing + ducking fait ? +- CI builds : GitHub Actions / CircleCI / Unity Cloud Build / Jenkins ? +- Tests : Unity Test Framework / GUT (Godot) / Gherkin ? +- Profiling : Unity Profiler / Godot Debugger / RenderDoc / autre ? +- Analytics respecte RGPD ? + +## Plugin recommendations +- **context7** : OFF — docs engines (Godot, Unity) stables, context7 peu utile +- **ui-ux-pro-max** : OPTIONAL — utile pour UI menus HUD, peu pour gameplay +- **gstack** : OFF + +## Example project layout (Godot 4) +``` +project.godot +.gitignore (exclude .godot/, export/, *.tmp) +.gitattributes (LFS for .png .wav .ogg .glb .tres binaires) +scenes/ + main.tscn + levels/ + level_01.tscn + ui/ + main_menu.tscn +scripts/ + player.gd + enemy.gd + systems/ + save_system.gd +assets/ + sprites/ + audio/ + fonts/ +addons/ + dialogue_manager/ +exports/ (gitignored) +.godot/ (cache, gitignored) +``` + +## Example project layout (Unity) +``` +Assets/ + Scripts/ + Player/ + Enemies/ + Systems/ + SaveSystem.cs + Scenes/ + MainMenu.unity + Level_01.unity + Prefabs/ + Materials/ + Settings/ + URP-Renderer.asset + InputActions.inputactions + Localization/ +ProjectSettings/ +Packages/ + manifest.json + packages-lock.json +.gitattributes (LFS for binary assets) +.gitignore (exclude Library/, Temp/, Builds/) +``` diff --git a/lib/project-archetypes/ghost.md b/lib/project-archetypes/ghost.md new file mode 100644 index 0000000..c0ac68b --- /dev/null +++ b/lib/project-archetypes/ghost.md @@ -0,0 +1,114 @@ +--- +name: ghost +category: cms +public: true +database: required +hosting_hints: + - ghost-pro + - vps + - docker + - digitalocean-marketplace +audit_stack: + - analyze + - code-clean + - seo + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: optional + ui-ux-pro-max: yes + gstack: optional +--- + +# Ghost (publishing CMS, Node.js) + +CMS de publication Node.js orienté blog / newsletter / membership. Thème Handlebars. Database MySQL (SQLite en dev). + +## Detection signals + +### Strong signals (×3) +- DEP: `package.json` contient "ghost" (au niveau du thème : engines.ghost) +- FILE: `package.json` contient `"engines": { "ghost": "..." }` (thème) +- FILE: `config.production.json` OR `config.development.json` (install Ghost) +- DIR: `content/themes/` + +### Medium signals (×2) +- DIR: `partials/` AVEC `.hbs` +- FILE: `default.hbs` OR `index.hbs` OR `post.hbs` +- DIR: `assets/css/` AVEC `source/` (stylesheets SCSS) +- FILE: `gulpfile.js` OR `rollup.config.js` (build Ghost theme) +- EXT: 5+ fichiers .hbs + +### Weak signals (×1) +- DIR: `content/images/` +- DIR: `content/data/` (SQLite dev) +- FILE: `ghost.service` (systemd) +- DEP: `@tryghost/content-api` OR `@tryghost/admin-api` (headless usage) + +### Composition overlays +- **Headless Ghost** : usage via Content API avec frontend séparé → traiter comme API producer + frontend archetype + +## Implications +- **Hébergement** : Ghost(Pro) managed, VPS (Ghost-CLI), Docker, DigitalOcean marketplace +- **Base de données** : MySQL prod REQUISE, SQLite dev +- **SEO/GEO** : CRITIQUE (blog / content) +- **Surface sécurité** : MOYENNE — admin panel, API, member auth, Stripe integration +- **UI/UX** : theme-dependent + +## Typical pain points +- Version Ghost obsolète (cycle release rapide) +- Thème incompatible avec version Ghost courante (GSCAN warnings) +- `config.production.json` committé avec DB credentials +- Mailgun API key en dur (delivery newsletter) +- Stripe secret key exposée (membership) +- Pas de backup automatique (content/images + DB) +- Members non conformes RGPD (pas de double opt-in, pas de unsubscribe) +- Pas de robots.txt / sitemap custom (Ghost génère mais pas configurable) +- Perf : images non optimisées, Handlebars non cache +- Newsletter : HTML email non testé clients (Outlook catastrophique) +- CDN absent (images/assets servis depuis serveur) +- Intégrations Zapier / custom webhooks : secrets rotation absente + +## Interview questions (adaptive) +En plus du set minimum business : +- Hébergement : Ghost(Pro) / self-hosted VPS / Docker ? +- Thème : custom (avec source .hbs) ou acheté ? +- Usage principal : blog / newsletter / membership / combinaison ? +- Members payants ? (Stripe intégration) +- Version Ghost actuelle ? +- Backup strategy (content/images + DB) ? +- Intégrations : Mailgun / SendGrid / Postmark pour emails ? +- CDN / image optimization ? +- Headless / découplé ? (Content API + frontend séparé) +- i18n prévu (Ghost n'a pas i18n natif) ? +- GSCAN check passe-t-il ? + +## Plugin recommendations +- **context7** : OPTIONAL — Ghost release cycle rapide +- **ui-ux-pro-max** : ON — theming orienté contenu +- **gstack** : OPTIONAL — audit Lighthouse sur posts clés + +## Example project layout (theme) +``` +package.json ("engines": { "ghost": "^5.0.0" }) +default.hbs +index.hbs +post.hbs +page.hbs +tag.hbs +author.hbs +partials/ + header.hbs + footer.hbs + post-card.hbs +assets/ + css/ + source/ + screen.scss + js/ + images/ +gulpfile.js +``` diff --git a/lib/project-archetypes/library.md b/lib/project-archetypes/library.md new file mode 100644 index 0000000..c4055da --- /dev/null +++ b/lib/project-archetypes/library.md @@ -0,0 +1,109 @@ +--- +name: library +category: library +public: false +database: none +hosting_hints: + - npm-registry + - pypi + - crates-io + - maven-central + - nuget + - github-packages +audit_stack: + - analyze + - code-clean + - cso + - doc +plugins: + context7: no + ui-ux-pro-max: no + gstack: no +--- + +# Library / Package + +Bibliothèque réutilisable (API publique stable), distribuée via registry. Pas d'entry point CLI, pas de serveur, pas de frontend applicatif. + +## Detection signals + +### Strong signals (×3) +- STRING_IN_FILE: `package.json` contient "\"main\":" OR "\"exports\":" SANS "\"bin\":" +- STRING_IN_FILE: `pyproject.toml` contient "[project]" SANS "[project.scripts]" +- STRING_IN_FILE: `Cargo.toml` contient "[lib]" SANS "[[bin]]" +- STRING_IN_FILE: `package.json` contient "\"private\": false" OR absent ET "\"name\":" commence par "@" + +### Medium signals (×2) +- FILE: `src/index.ts` OR `src/lib.rs` OR `src/__init__.py` +- DIR: `src/` AVEC code uniquement (pas de server.ts, pas de app.py) +- FILE: `tsconfig.json` AVEC STRING "\"declaration\": true" OR "\"emitDeclarationOnly\"" +- FILE: `rollup.config.*` OR `tsup.config.*` OR `vite.config.*` en mode lib + +### Weak signals (×1) +- FILE: `README.md` AVEC STRING "## API" OR "## Installation" +- FILE: `CHANGELOG.md` +- FILE: `LICENSE` OR `LICENSE.md` +- DIR: `examples/` OR `docs/` +- FILE: `.npmignore` + +### Counter-signals (exclusion) +- STRING_IN_FILE: `package.json` contient "\"bin\":" → CLI +- DEP: `express`, `fastapi`, `react`, `next` → app, pas lib +- FILE: `index.html` → web + +## Implications +- **Distribution** : npm / PyPI / crates.io / Maven / NuGet +- **Base de données** : aucune +- **SEO/GEO** : N/A (sauf page de doc dédiée, rare) +- **Surface sécurité** : INDIRECTE — les failles de la lib se propagent à ses consommateurs +- **UI/UX** : N/A + +## Typical pain points +- Versioning non semver-strict → breaking changes surprise les consommateurs +- CHANGELOG absent ou vague +- Docstrings / JSDoc / rustdoc incomplets +- Exports publics instables (API leakage depuis internes) +- Pas de tests de régression / snapshot +- Couverture tests faible (< 80%) +- Pas de benchmarks (si performance critique) +- TypeScript : types trop lâches (`any`), pas d'export de types +- Rust : `#[non_exhaustive]` manquant sur enums publics +- Python : pas de `py.typed` marker → typing ignoré par consommateurs +- Deps transitives avec failles (supply chain) +- Pas de fichier `SECURITY.md` +- Pas de CI qui publie automatiquement (releases manuelles) +- Tests sur une seule version de Node/Python/Rust + +## Interview questions (adaptive) +En plus du set minimum business : +- Langage + runtime cible : Node (version min) / Python (version min) / Rust (MSRV) / autre ? +- Audience : publique (open source) / privée (interne org) / mixte ? +- Stabilité actuelle : pré-1.0 / stable / LTS ? +- API : stable / en évolution / expérimentale ? +- Distribution : npm public / npm privé / PyPI / GitHub Packages / multiple ? +- Bundler si applicable : tsup / rollup / vite / esbuild ? (ESM + CJS + types ?) +- Documentation : README / docs site dédié / typedoc / Sphinx / autre ? +- Tests : coverage cible ? snapshots ? property-based ? +- CI / CD : auto-publish on tag ? semver auto (changesets / semantic-release) ? +- Politique de support : combien de versions majeures maintenues en parallèle ? +- Benchmarks requis ? (oui si lib perf-critique) + +## Plugin recommendations +- **context7** : OFF — lib stable par nature, peu de doc fast-libs +- **ui-ux-pro-max** : OFF +- **gstack** : OFF + +## Example project layout +``` +package.json OR pyproject.toml OR Cargo.toml +src/ + index.ts OR __init__.py OR lib.rs + core/ + utils/ +tests/ +docs/ +examples/ +README.md (API + Installation + Examples) +CHANGELOG.md +LICENSE +``` diff --git a/lib/project-archetypes/mobile-expo.md b/lib/project-archetypes/mobile-expo.md new file mode 100644 index 0000000..c5ba654 --- /dev/null +++ b/lib/project-archetypes/mobile-expo.md @@ -0,0 +1,136 @@ +--- +name: mobile-expo +category: mobile +public: true +database: optional +hosting_hints: + - app-store + - play-store + - expo-go + - eas-build +audit_stack: + - analyze + - code-clean + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: yes + ui-ux-pro-max: yes + gstack: no +--- + +# Mobile Expo / React Native + +Application mobile React Native gérée par Expo (managed workflow) ou bare React Native. Distribution iOS + Android via App Store / Play Store, ou Expo Go en dev. + +## Detection signals + +### Strong signals (×3) +- FILE: `app.json` OR `app.config.js` OR `app.config.ts` contenant "expo" +- DEP: `package.json` contient "expo" +- FILE: `metro.config.js` OR `metro.config.ts` +- DEP: "react-native" + +### Medium signals (×2) +- DEP: "expo-router", "@expo/vector-icons", "expo-font" +- DIR: `app/` (Expo Router file-system routing) avec `.tsx` +- DIR: `assets/` avec `icon.png`, `splash.png` +- FILE: `eas.json` (EAS Build) +- FILE: `babel.config.js` avec preset "babel-preset-expo" + +### Weak signals (×1) +- DIR: `android/`, `ios/` (bare workflow uniquement) +- DEP: "react-navigation" OR "@react-navigation/native" +- DEP: "@supabase/supabase-js" OR "firebase" OR "@tanstack/react-query" + +### Counter-signals +- DEP: "next" ET .tsx au root → c'est Next.js (web), pas Expo +- FILE: `astro.config.*` → Astro + +## Implications +- **Distribution** : App Store (iOS), Play Store (Android), Expo Go (dev), internal distribution (TestFlight/Play Console Internal) +- **Base de données** : locale (AsyncStorage / SQLite / MMKV / WatermelonDB) + backend (Supabase / Firebase / API custom) +- **SEO/GEO** : N/A (app native) +- **Surface sécurité** : GRANDE — AsyncStorage non chiffré par défaut, secrets côté app, deep links exploitables +- **UI/UX** : CRITIQUE — mobile = exigences spécifiques (gestures, haptics, safe area) + +## Typical pain points +- Secrets / API keys dans `app.json` → exposés dans le bundle +- AsyncStorage utilisé pour tokens → JWT en clair sur l'appareil +- Pas d'expo-secure-store ou react-native-keychain pour secrets +- Permissions iOS/Android demandées mal justifiées (rejet review) +- Performances : listes longues sans FlatList/FlashList (re-render entier) +- Images non optimisées / pas de `expo-image` (cache + formats) +- Pas de splash screen configuré → écran blanc au démarrage +- Icône app basse résolution +- Deep links non configurés / configurés sans validation +- Pas de crash reporting (Sentry / Bugsnag absents) +- Expo SDK obsolète (upgrade annuel obligatoire) +- Bare workflow sans CI/CD (builds manuels en local) +- Tests E2E absents (Detox / Maestro non configurés) +- i18n absent ou hardcodé +- Accessibilité : `accessibilityLabel` absent, focus order cassé, contrast insuffisant +- Dark mode pas supporté (useColorScheme non utilisé) +- Safe area non respectée (contenu sous notch / home indicator) +- Gestures conflits (swipe drawer vs swipe back iOS) +- Over-the-air updates (expo-updates) non utilisées +- app.json "version" / "buildNumber" non incrémentés + +## Interview questions (adaptive) +En plus du set minimum business : +- Workflow : Expo managed / Expo bare / pur React Native ? +- SDK Expo version ? +- Navigation : Expo Router / React Navigation / autre ? +- State : Redux / Zustand / Jotai / Context / React Query seul ? +- Backend : Supabase / Firebase / API custom / BaaS autre ? +- Auth : provider + storage (SecureStore / Keychain / AsyncStorage) ? +- Database locale : AsyncStorage / MMKV / SQLite / WatermelonDB / Realm ? +- Push notifications : Expo Push / FCM / OneSignal / aucun ? +- Crash reporting : Sentry / Bugsnag / aucun ? +- Analytics : Amplitude / Mixpanel / PostHog / Firebase / aucun ? +- Tests : unit (Jest) + E2E (Detox / Maestro) ? +- Build + distribution : EAS Build + EAS Submit / Xcode/Gradle manuels / CI custom ? +- Over-the-air updates activées ? +- Cible OS : iOS min version / Android min API level ? +- Dark mode supporté ? +- i18n : librairie + langues ? +- Accessibilité : audit VoiceOver / TalkBack effectué ? +- App Store Review : première soumission faite / rejetée / en cours ? + +## Plugin recommendations +- **context7** : ON — Expo SDK évolue vite (breaking chaque SDK) +- **ui-ux-pro-max** : ON — mobile UX spécifique +- **gstack** : OFF (pas de browser QA) + +## Example project layout (Expo Router) +``` +app.json OR app.config.ts +package.json +metro.config.js +babel.config.js +eas.json +app/ + _layout.tsx (root layout) + index.tsx (home) + (tabs)/ + _layout.tsx + home.tsx + profile.tsx + auth/ + login.tsx +components/ + Button.tsx + Card.tsx +hooks/ +lib/ + supabase.ts +assets/ + icon.png + splash.png + adaptive-icon.png + fonts/ +.env.example +``` diff --git a/lib/project-archetypes/mobile-flutter.md b/lib/project-archetypes/mobile-flutter.md new file mode 100644 index 0000000..0d4f8fc --- /dev/null +++ b/lib/project-archetypes/mobile-flutter.md @@ -0,0 +1,146 @@ +--- +name: mobile-flutter +category: mobile +public: true +database: optional +hosting_hints: + - app-store + - play-store + - huawei-appgallery + - web-hosting + - desktop-distribution +audit_stack: + - analyze + - code-clean + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: optional + ui-ux-pro-max: yes + gstack: no +--- + +# Mobile Flutter + +Application Flutter (Dart) cible iOS + Android + Web + Desktop. Widgets tree, state management variable (Provider / Riverpod / Bloc / GetX). + +## Detection signals + +### Strong signals (×3) +- FILE: `pubspec.yaml` +- FILE: `pubspec.lock` +- DIR: `lib/` AVEC fichiers `.dart` +- FILE: `lib/main.dart` + +### Medium signals (×2) +- DIR: `android/` +- DIR: `ios/` +- FILE: `analysis_options.yaml` +- DIR: `test/` AVEC `.dart` +- DEP dans pubspec.yaml: "flutter_bloc", "provider", "riverpod", "get" + +### Weak signals (×1) +- DIR: `web/`, `macos/`, `linux/`, `windows/` (multi-plateforme) +- FILE: `l10n.yaml` (i18n) +- DIR: `assets/images/`, `assets/fonts/` +- FILE: `.flutter-plugins`, `.flutter-plugins-dependencies` + +### Counter-signals (exclusion) +- DEP pubspec contient "dart_sdk" uniquement sans "flutter" → projet Dart pur (CLI / server), pas Flutter + +## Implications +- **Distribution** : App Store / Play Store / AppGallery (Huawei) / Web (Flutter Web) / Desktop (macOS/Win/Linux via Flutter desktop) +- **Base de données** : locale (sqflite / Hive / Isar / Drift) + backend (Firebase / Supabase / API custom) +- **SEO/GEO** : PARTIEL si Flutter Web — Flutter Web rend en canvas/HTML, SEO limité même en HTML renderer +- **Surface sécurité** : GRANDE — shared_preferences non chiffré, secrets dans bundle, deep links +- **UI/UX** : CRITIQUE — design system Material/Cupertino + custom + +## Typical pain points +- Secrets / API keys dans `pubspec.yaml` ou `lib/config.dart` committés +- `shared_preferences` pour tokens → pas chiffré (doit être `flutter_secure_storage`) +- State management non cohérent (mélange setState + Provider + Bloc dans même app) +- Rebuild excessif (pas de `const` widgets, pas de `Selector`, pas de keys) +- Performances listes : pas de `ListView.builder` (rend tout d'un coup) +- Images non optimisées (pas de `cached_network_image`, pas de compression) +- Pas de splash screen natif (flash blanc au démarrage) +- Permissions iOS/Android demandées sans justification → reject App Store +- Pas de crash reporting (Sentry / Firebase Crashlytics absents) +- Deep links non configurés / uni_links / go_router mal configurés +- Pas de tests unitaires / widget tests +- Pas de tests E2E (integration_test / Patrol / Maestro) +- Flutter SDK obsolète (cycle release rapide) +- `flutter pub outdated` ignoré → deps avec failles +- Accessibilité : `Semantics` widget pas utilisé, focus order incorrect +- Dark mode : `ThemeMode.system` pas supporté ou mal +- i18n : strings hardcodées au lieu de `.arb` files +- Platform channels pas testés (plugins natifs) +- Code generation (build_runner) pas dans CI → fichiers générés commités +- App bundle size énorme (pas de `--split-per-abi` Android, pas de tree shaking) + +## Interview questions (adaptive) +En plus du set minimum business : +- State management : Provider / Riverpod / Bloc / GetX / Cubit / vanilla ? +- Flutter SDK / Dart version ? +- Targets : iOS / Android / Web / macOS / Windows / Linux ? +- Navigation : Navigator 1.0 / go_router / auto_route / beamer ? +- Backend : Firebase / Supabase / API custom / GraphQL ? +- Auth : provider + storage (flutter_secure_storage obligatoire pour tokens) ? +- Database locale : sqflite / Hive / Isar / Drift / SharedPreferences ? +- Push notifications : FCM / OneSignal / Notifee / aucun ? +- Crash reporting : Firebase Crashlytics / Sentry / aucun ? +- Analytics : Firebase / Amplitude / PostHog / aucun ? +- Tests : unit / widget / integration / Patrol ? +- CI/CD : Codemagic / Bitrise / GitHub Actions / Fastlane / aucun ? +- Code generation : build_runner / freezed / json_serializable / riverpod_generator ? +- i18n : `flutter_localizations` + .arb ? +- Design system : Material 3 / Cupertino / custom tokens ? +- Dark mode supporté ? +- Accessibilité : Semantics widgets + testé VoiceOver / TalkBack ? +- App bundle size cible ? +- App Store Review : première soumission / rejet déjà eu / actif ? + +## Plugin recommendations +- **context7** : OPTIONAL — ON pour Flutter 3.x récent (Impeller, Material 3, Riverpod 2+) +- **ui-ux-pro-max** : ON +- **gstack** : OFF + +## Example project layout +``` +pubspec.yaml +pubspec.lock +analysis_options.yaml +lib/ + main.dart + app.dart + core/ + theme.dart + constants.dart + features/ + auth/ + data/ + domain/ + presentation/ + home/ + data/ + domain/ + presentation/ + shared/ + widgets/ + services/ +test/ + widget_test.dart + features/ + auth_test.dart +integration_test/ + app_test.dart +assets/ + images/ + fonts/ +android/ +ios/ +web/ +l10n.yaml +``` diff --git a/lib/project-archetypes/nextjs-app-router.md b/lib/project-archetypes/nextjs-app-router.md new file mode 100644 index 0000000..2ae1f4a --- /dev/null +++ b/lib/project-archetypes/nextjs-app-router.md @@ -0,0 +1,109 @@ +--- +name: nextjs-app-router +category: framework +public: true +database: optional +hosting_hints: + - vercel + - netlify + - cloudflare-pages + - docker + - k8s +audit_stack: + - analyze + - code-clean + - seo + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: yes + ui-ux-pro-max: yes + gstack: optional +--- + +# Next.js (App Router) + +Framework React SSR/SSG/ISR. App Router (`app/` dir) est la convention moderne depuis Next 13+. + +## Detection signals + +### Strong signals (×3) +- FILE: `next.config.js` +- FILE: `next.config.mjs` +- FILE: `next.config.ts` +- DEP: `package.json` contient "next" +- DIR: `app/` AVEC FILE `app/layout.tsx` OR `app/layout.jsx` OR `app/layout.js` + +### Medium signals (×2) +- FILE: `app/page.tsx` OR `app/page.jsx` OR `app/page.js` +- DIR: `app/api/` (route handlers) +- FILE: `middleware.ts` OR `middleware.js` +- FILE: `.env.local` + +### Weak signals (×1) +- DIR: `public/` (assets statiques) +- EXT: 5+ fichiers .tsx +- DEP: `tailwindcss` (stack fréquente) +- DEP: `@vercel/*` + +### Counter-signals (exclusion) +- DIR: `pages/` AU PREMIER NIVEAU SANS DIR `app/` → c'est Pages Router (archétype à part, à créer plus tard) + +### Composition overlays +- ORM détecté : DEP `prisma`, `drizzle-orm`, `@supabase/supabase-js`, `mongoose` → ajouter questions DB +- Auth détectée : DEP `next-auth`, `@clerk/nextjs`, `@auth0/nextjs-auth0` → ajouter questions auth + +## Implications +- **Hébergement** : Vercel (first-class), Netlify, Cloudflare Pages, Docker (standalone output) +- **Base de données** : OPTIONNELLE — souvent présente via Prisma/Drizzle/Supabase +- **SEO/GEO** : CRITIQUE (App Router permet SSR/SSG parfaitement indexable si bien configuré) +- **Surface sécurité** : MOYENNE-GRANDE (middleware, API routes, auth) +- **UI/UX** : CRITIQUE + +## Typical pain points +- Mix "use client" / Server Components mal maîtrisé (fuite d'état, hydratation) +- `revalidate` / cache ISR mal configuré (contenu obsolète ou trop de builds) +- Metadata API (`generateMetadata`) absente → pas de SEO dynamique +- Pas de `robots.txt` / `sitemap.ts` (SEO) +- Images non optimisées (`next/image` pas utilisé) +- Bundle JS trop gros (analyser avec `@next/bundle-analyzer`) +- `.env` committé / secrets exposés côté client (NEXT_PUBLIC_*) +- Pas de rate limiting sur route handlers +- Middleware lourd (latence sur chaque requête) +- API routes sans validation input (Zod/Yup absent) +- Pas de loading.tsx / error.tsx / not-found.tsx + +## Interview questions (adaptive) +En plus du set minimum business : +- Rendu cible : SSR / SSG / ISR / mix ? Stratégie par route ? +- ORM / DB : Prisma / Drizzle / Supabase / autre / aucun ? +- Auth : NextAuth / Clerk / Auth0 / custom / aucun ? +- Déploiement : Vercel / selfhost Docker / Cloudflare / autre ? +- Testing : Playwright / Vitest / Jest / aucun ? +- i18n prévu ? (oui + quelles langues / non) +- CMS headless couplé ? (Sanity / Strapi / Contentful / aucun) +- Trafic cible et budget perf (TTI, LCP) ? + +## Plugin recommendations +- **context7** : ON — Next.js évolue vite (App Router changes fréquents) +- **ui-ux-pro-max** : ON +- **gstack** : OPTIONAL — ON pour QA navigateur (Lighthouse, Axe, E2E) + +## Example project layout +``` +next.config.ts +middleware.ts +app/ + layout.tsx + page.tsx + globals.css + (marketing)/ + about/page.tsx + api/ + hello/route.ts +public/ + favicon.ico +``` diff --git a/lib/project-archetypes/react-spa.md b/lib/project-archetypes/react-spa.md new file mode 100644 index 0000000..0d2088d --- /dev/null +++ b/lib/project-archetypes/react-spa.md @@ -0,0 +1,126 @@ +--- +name: react-spa +category: framework +public: false +database: optional +hosting_hints: + - netlify + - cloudflare-pages + - vercel + - s3-cloudfront + - docker +audit_stack: + - analyze + - code-clean + - design-review + - perf + - cso + - a11y + - doc +plugins: + context7: yes + ui-ux-pro-max: yes + gstack: optional +--- + +# React SPA (admin / dashboard / internal) + +Application React pure côté client (CRA legacy / Vite / Webpack custom). PAS indexée — si public avec besoin SEO, utiliser Astro ou Next.js. + +## ⚠️ Avertissement SEO (à afficher si projet public-facing) + +**Une React SPA n'est pas indexable par les moteurs de recherche classiques (Google/Bing) ni par les moteurs IA (ChatGPT/Perplexity/Claude).** + +Raison : le HTML servi est une coquille vide (`
`). Le contenu n'apparaît qu'APRÈS exécution JavaScript côté navigateur. Les crawlers : +- Google peut *parfois* rendre le JS, mais lentement et partiellement (pas d'indexation fiable) +- Bing : rendu JS limité +- ChatGPT/Perplexity/Claude/Gemini crawlers : **ne rendent pas de JS du tout** → ils voient une page vide → contenu invisible + +**Si ce projet est public (site vitrine, blog, landing, e-commerce, docs) :** +- Migration recommandée : **Astro** (statique, SEO parfait, React islands possibles) ou **Next.js App Router** (SSR/SSG, SEO parfait) +- Coût migration : moyen (logique métier réutilisable, routing à reprendre) +- Alternative temporaire : pré-rendu (react-snap, rendertron) — fragile, déconseillé en 2026 + +**Si ce projet est interne (admin panel, dashboard, outil métier auth-gated) :** +- Aucun souci, le SEO n'est pas nécessaire +- React SPA est un choix valide dans ce cas + +→ L'orchestrateur `/onboard` DOIT poser la question "public / interne" et afficher ce bloc si réponse = public. + +## Detection signals + +### Strong signals (×3) +- DEP: `package.json` contient "react" ET "react-dom" +- FILE: `vite.config.ts` OR `vite.config.js` +- FILE: `webpack.config.js` (custom bundler) +- DEP: `react-scripts` (CRA legacy) + +### Medium signals (×2) +- FILE: `index.html` AVEC STRING "
" +- FILE: `src/main.tsx` OR `src/main.jsx` OR `src/index.tsx` OR `src/index.jsx` +- FILE: `src/App.tsx` OR `src/App.jsx` +- DEP: `react-router-dom` OR `@tanstack/react-router` + +### Weak signals (×1) +- DIR: `src/components/` +- DIR: `src/pages/` OR `src/routes/` +- DEP: `tailwindcss`, `@mui/material`, `antd`, `chakra-ui` +- DEP: `redux`, `zustand`, `jotai`, `@tanstack/react-query` + +### Counter-signals (exclusion) +- DEP: `next` → c'est Next.js (archétype nextjs-app-router) +- DEP: `astro` → c'est Astro +- FILE: `remix.config.js` → Remix (archétype à créer) +- FILE: `react-native.config.js` → mobile (archétype mobile-react-native) + +## Implications +- **Hébergement** : Netlify / Cloudflare Pages / Vercel (SPA mode) / S3+CloudFront / Docker statique +- **Base de données** : OPTIONNELLE — souvent consommée via API séparée +- **SEO/GEO** : NON (rendu client-only) — si SEO critique, c'est un mauvais choix, flag à soulever +- **Surface sécurité** : MOYENNE (état côté client, auth token storage) +- **UI/UX** : CRITIQUE + +## Typical pain points +- Bundle JS énorme (absence de code-splitting par route) +- Token JWT stocké dans localStorage (XSS → vol) +- Pas de CSP +- Pas de tests E2E (Playwright / Cypress absent) +- State management mal dimensionné (Redux pour 3 états simples, ou au contraire `useState` partout dans une app grosse) +- Suspense / Error Boundary non utilisés +- A11y : focus management, ARIA roles manquants +- Pas de skeleton / optimistic UI +- Fetch sans cache (pas de `@tanstack/react-query` ou SWR) +- "Public website" en SPA → SEO mort (signal d'alerte majeur à remonter en audit) + +## Interview questions (adaptive) +En plus du set minimum business : +- **Usage : admin panel / dashboard interne / outil métier / webapp publique / autre ?** + - **Si "publique" → afficher en PREMIER le bloc d'avertissement SEO ci-dessus** + - **Puis demander : "Sachant ça, confirmez-vous que vous voulez rester en SPA, ou préférez-vous explorer une migration Astro/Next.js ?"** + - La réponse alimente la synthèse `ONBOARD_REPORT.md` (STEP 7) en proposition d'amélioration P0 si stay=SPA+public. +- Backend : API séparée (URL) / BaaS (Supabase/Firebase) / aucune ? +- Auth : quel provider ? stockage token ? +- Routing : react-router / TanStack Router / autre ? +- State : Redux / Zustand / Jotai / context / React Query seul ? +- Tests E2E : Playwright / Cypress / aucun ? +- Bundle size cible ? +- Bundler actuel : Vite / Webpack / CRA (à migrer ?) ? + +## Plugin recommendations +- **context7** : ON — React 18+/19, TanStack, etc. évoluent vite +- **ui-ux-pro-max** : ON +- **gstack** : OPTIONAL — pour E2E / Lighthouse + +## Example project layout +``` +index.html +vite.config.ts +src/ + main.tsx + App.tsx + routes/ + components/ + hooks/ + lib/ +public/ +``` diff --git a/lib/project-archetypes/rest-api-node.md b/lib/project-archetypes/rest-api-node.md new file mode 100644 index 0000000..4968344 --- /dev/null +++ b/lib/project-archetypes/rest-api-node.md @@ -0,0 +1,106 @@ +--- +name: rest-api-node +category: api +public: false +database: optional +hosting_hints: + - vps + - docker + - k8s + - render + - railway + - fly +audit_stack: + - analyze + - code-clean + - cso + - perf + - doc +plugins: + context7: yes + ui-ux-pro-max: no + gstack: no +--- + +# REST API (Node.js) + +API backend Node.js pure (Express / Fastify / Koa / Hapi / NestJS), sans frontend inclus. + +## Detection signals + +### Strong signals (×3) +- DEP: `package.json` contient l'un de : "express", "fastify", "koa", "@hapi/hapi", "@nestjs/core" +- FILE: `src/app.ts` OR `src/server.ts` OR `src/main.ts` AVEC STRING "listen(" OR "createServer" + +### Medium signals (×2) +- FILE: `src/routes/` OR `src/controllers/` OR `src/handlers/` +- DEP: ORM — `prisma`, `typeorm`, `sequelize`, `drizzle-orm`, `mongoose`, `knex` +- DEP: Validation — `zod`, `joi`, `yup`, `class-validator` + +### Weak signals (×1) +- DEP: `jsonwebtoken`, `passport`, `bcrypt`, `argon2` +- DEP: `pino`, `winston`, `morgan` (logging) +- FILE: `Dockerfile` +- DIR: `tests/` OR `src/__tests__/` + +### Counter-signals (exclusion) +- DEP: `react`, `next`, `astro`, `vue` → frontend présent, c'est un fullstack (archetype à créer plus tard) ou SPA+API séparé (monorepo) +- DEP: `react-native` → mobile + +## Implications +- **Hébergement** : VPS, Docker (Render, Railway, Fly.io), K8s, AWS ECS/Lambda +- **Base de données** : FORTEMENT PROBABLE — la plupart des API backend ont une DB +- **SEO/GEO** : N/A (API non indexée) +- **Surface sécurité** : GRANDE — point d'entrée principal pour attaques (injections, auth, rate limit) +- **UI/UX** : N/A + +## Typical pain points +- Pas de versioning API (/api/v1/) — flag CLAUDE.md : "Web APIs always versioned" +- Validation input absente (pas de Zod/Joi/class-validator) +- SQL injections (string concat dans queries brutes) +- Auth faible (pas de hash password, ou MD5/SHA1) +- JWT secret en dur / faible / court +- CORS `*` en production +- Pas de rate limiting (`express-rate-limit`, `@fastify/rate-limit`) +- Pas de helmet / CSP +- Secrets dans le repo (.env committé) +- Logs qui fuient PII / tokens +- Pas de health check (`/healthz`) pour load balancer +- Pas d'observability (Sentry / OTel) +- Pas de tests (intégration absente) +- Deps obsolètes (npm audit non exécuté) + +## Interview questions (adaptive) +En plus du set minimum business : +- Framework : Express / Fastify / NestJS / Koa / Hapi ? +- Base de données : PostgreSQL / MySQL / MongoDB / SQLite / autre / aucune ? +- ORM : Prisma / Drizzle / TypeORM / Sequelize / Mongoose / raw SQL ? +- Auth : JWT / OAuth / session / API key / aucun ? +- Consommateurs : frontend propre / mobile / tierce partie / interne ? +- Rate limiting en place ? (oui + comment / non) +- Observability : Sentry / OpenTelemetry / logs seulement / aucun ? +- Tests : unitaires + intégration ? couverture cible ? +- Déploiement : VPS / Docker / Lambda / autre ? +- Documentation API : OpenAPI/Swagger / Postman / aucune ? + +## Plugin recommendations +- **context7** : ON — Prisma/Drizzle/Fastify évoluent vite +- **ui-ux-pro-max** : OFF +- **gstack** : OFF (API non navigable) + +## Example project layout +``` +src/ + app.ts + server.ts + routes/ + v1/ + users.ts + orders.ts + controllers/ + services/ + middlewares/ + schemas/ (Zod / Joi) +tests/ +Dockerfile +``` diff --git a/lib/project-archetypes/rest-api-python.md b/lib/project-archetypes/rest-api-python.md new file mode 100644 index 0000000..94da02d --- /dev/null +++ b/lib/project-archetypes/rest-api-python.md @@ -0,0 +1,114 @@ +--- +name: rest-api-python +category: api +public: false +database: optional +hosting_hints: + - vps + - docker + - k8s + - render + - railway + - fly + - heroku +audit_stack: + - analyze + - code-clean + - cso + - perf + - doc +plugins: + context7: optional + ui-ux-pro-max: no + gstack: no +--- + +# REST API (Python) + +API backend Python (FastAPI / Flask / Django REST / Starlette / Litestar), sans frontend inclus. + +## Detection signals + +### Strong signals (×3) +- FILE: `pyproject.toml` OR `requirements.txt` OR `Pipfile` OR `setup.py` +- DEP: l'un de : "fastapi", "flask", "django", "djangorestframework", "starlette", "litestar" +- STRING_IN_FILE: tout .py du projet contient "FastAPI(" OR "Flask(__name__)" OR "app = Starlette(" OR "from django" + +### Medium signals (×2) +- FILE: `src/main.py` OR `app/main.py` OR `app.py` OR `manage.py` +- DEP: ORM — "sqlalchemy", "tortoise-orm", "peewee", "django" (Django ORM), "pydantic" +- DEP: Validation — "pydantic" (implicite avec FastAPI), "marshmallow" + +### Weak signals (×1) +- DEP: "uvicorn", "gunicorn", "hypercorn" +- DEP: "alembic" (migrations) +- DEP: "python-jose", "passlib", "bcrypt" +- FILE: `Dockerfile` +- DIR: `tests/` +- FILE: `alembic.ini` + +### Counter-signals (exclusion) +- DEP: "streamlit", "gradio", "dash" → data app UI (archétype à créer) +- DEP: "jupyter" comme main focus → notebook project + +## Implications +- **Hébergement** : VPS, Docker (Render, Railway, Fly), K8s, AWS Lambda, Heroku +- **Base de données** : FORTEMENT PROBABLE — PostgreSQL dominant +- **SEO/GEO** : N/A +- **Surface sécurité** : GRANDE — mêmes risques que Node, plus Django admin exposé si mal config +- **UI/UX** : N/A (sauf Django admin, rarement customisé) + +## Typical pain points +- Pas de versioning API (/api/v1/) +- Pydantic mal utilisé (types trop permissifs, `Any` partout) +- SQLAlchemy : N+1 queries (pas de `selectinload`/`joinedload`) +- Django : `SECRET_KEY` committé, DEBUG=True en prod +- Secrets dans le repo +- Requirements non pinned (`fastapi` sans version) → builds instables +- CORS `*` en production +- Pas de rate limiting +- Tests : pytest fixtures non isolées (DB pollution entre tests) +- Alembic migrations conflictuelles (branches non résolues) +- Async mal maîtrisé (bloque event loop avec `requests` sync en FastAPI) +- Dependencies audit absent (`pip-audit` non exécuté) +- Couverture de types mypy / pyright absente + +## Interview questions (adaptive) +En plus du set minimum business : +- Framework : FastAPI / Flask / Django REST / Starlette / Litestar ? +- Mode : sync / async ? +- Base de données : PostgreSQL / MySQL / SQLite / MongoDB / autre / aucune ? +- ORM : SQLAlchemy / Django ORM / Tortoise / Peewee / raw SQL ? +- Migrations : Alembic / Django migrate / autre / aucune ? +- Auth : JWT / OAuth / session / API key / aucun ? +- Validation : Pydantic (v1 ou v2 ?) / Marshmallow / autre ? +- Typing : mypy / pyright / aucun ? +- Tests : pytest + fixtures ? couverture cible ? +- Linting / formatter : Ruff / Black / Flake8 / Mypy ? +- Déploiement : VPS / Docker / Lambda / Heroku / autre ? +- Package manager : pip / poetry / pdm / uv / Pipenv ? +- Documentation : OpenAPI auto (FastAPI) / Swagger manuel / aucune ? + +## Plugin recommendations +- **context7** : OPTIONAL — ON pour FastAPI récent, Pydantic v2, SQLAlchemy 2.0 +- **ui-ux-pro-max** : OFF +- **gstack** : OFF + +## Example project layout +``` +pyproject.toml +src/ + main.py + api/ + v1/ + users.py + orders.py + models/ + schemas/ + services/ + db/ +alembic/ + versions/ +tests/ +Dockerfile +``` diff --git a/lib/project-archetypes/shopify.md b/lib/project-archetypes/shopify.md new file mode 100644 index 0000000..09c0afe --- /dev/null +++ b/lib/project-archetypes/shopify.md @@ -0,0 +1,109 @@ +--- +name: shopify +category: cms +public: true +database: managed +hosting_hints: + - shopify-managed +audit_stack: + - analyze + - code-clean + - seo + - design-review + - perf + - a11y + - doc +plugins: + context7: optional + ui-ux-pro-max: yes + gstack: optional +--- + +# Shopify (theme / custom app) + +Thème Shopify custom (Liquid + JSON templates) ou custom app. DB gérée par Shopify. Déploiement via Shopify CLI. Hébergement Shopify-exclusive. + +## Detection signals + +### Strong signals (×3) +- DIR: `sections/` AVEC `.liquid` files +- DIR: `templates/` AVEC `.liquid` OR `.json` +- FILE: `config/settings_schema.json` +- DEP: `package.json` contient "@shopify/cli" OR "@shopify/cli-hydrogen" OR "@shopify/theme" + +### Medium signals (×2) +- DIR: `snippets/` AVEC `.liquid` +- DIR: `layout/` AVEC `theme.liquid` +- DIR: `locales/` AVEC `.json` (i18n Shopify) +- FILE: `.shopifyignore` +- FILE: `config/settings_data.json` + +### Weak signals (×1) +- DIR: `assets/` avec theme assets +- FILE: `package.json` avec scripts "shopify theme dev" +- EXT: 10+ fichiers .liquid + +### Composition overlays +- **Hydrogen** (headless Shopify + Remix) : DEP `@shopify/hydrogen` → archetype devient hybride (traiter comme Remix/React + Shopify API) + +## Implications +- **Hébergement** : Shopify managed (aucun serveur à gérer) +- **Base de données** : gérée par Shopify (produits, clients, commandes) +- **SEO/GEO** : CRITIQUE (e-commerce) +- **Surface sécurité** : MOYENNE — Shopify sécurise l'infra ; côté thème = XSS possible via Liquid mal échappé, secrets dans config +- **UI/UX** : CRITIQUE (conversion) + +## Typical pain points +- Liquid non échappé (`{{ product.description }}` sans `| escape` → XSS si contenu user) +- Images produits non optimisées (pas de responsive srcset) +- JS tiers accumulés (reviews, chat, upsell, tracker) → perf morte +- Sections `