crew-update · diff

git:20261106.220fb37 to git:20261106.6976e1c

142 added, 149 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

---
name: crew-update
- description: Met à jour les fichiers moteur d'un projet bootstrapé vers la dernière version du scaffold, sans toucher aux données ni écraser un fichier personnalisé. Trigger — "/crew-update", "mets à jour le scaffold".
+ description: Updates the engine files of a bootstrapped project to the latest scaffold version, without touching data or overwriting a customized file. Also triggers on — "/crew-update", "mets à jour le scaffold", "update the scaffold".
---
- Ce skill exécute `crew/crew_update.py` (ou `scripts/crew_update.py` en mode
- plugin — même module, deux copies comme les autres fichiers moteur de ce
- repo). Il ne remplace jamais un fichier sans confirmation explicite.
+ This skill runs `crew/crew_update.py` (or `scripts/crew_update.py` in plugin
+ mode — same module, two copies like the other engine files of this repo). It
+ never replaces a file without explicit confirmation.
- ## Détection du mode d'installation
+ ## Install-mode detection
- 1. `detect_mode(project_root)` (dans le module, pas seulement en prose ici —
- une seule source de vérité) cherche `.claude/skills/crew-init/SKILL.md`
- dans le projet cible :
- - **Présent** → `"legacy"` (Option C / clone manuel, pré-plugin) :
+ 1. `detect_mode(project_root)` (in the module, not just in prose here — a single
+ source of truth) looks for `.claude/skills/crew-init/SKILL.md` in the target
+ project:
+ - **Present** → `"legacy"` (Option C / manual clone, pre-plugin):
`ENGINE_FILES_LEGACY` (`crew_hook.py`, `spec_to_task_hook.py`,
- `.claude/skills/crew-*/SKILL.md`, `.claude/agents/*.md`) est inclus
- automatiquement dans la mise à jour, en plus des fichiers communs. Le
- flag CLI `--legacy` force cette inclusion si la détection se trompe.
- - **Absent** → `"plugin"` : ne PAS tenter de synchroniser skills/agents/
- hooks (ils tournent déjà depuis le plugin installé et se mettent à jour
- via `/plugin update crew-mates` — le dire explicitement à
- l'utilisateur). Seuls les fichiers `ENGINE_FILES_COMMON` sont vérifiés.
- - `plan()`/`--project` fonctionnent dans les deux cas sans intervention
- manuelle ; n'interroger l'utilisateur que si le rapport final montre un
- résultat inattendu (ex. `removed` sur tout `ENGINE_FILES_LEGACY` alors
- que le projet semblait legacy).
+ `.claude/skills/crew-*/SKILL.md`, `.claude/agents/*.md`) is included in the
+ update automatically, on top of the common files. The `--legacy` CLI flag
+ forces this inclusion if detection is wrong.
+ - **Absent** → `"plugin"`: do NOT try to sync skills/agents/hooks (they
+ already run from the installed plugin and update through
+ `/plugin update crew-mates` — say so explicitly to the user). Only the
+ `ENGINE_FILES_COMMON` files are checked.
+ - `plan()`/`--project` work in both cases with no manual intervention; only
+ ask the user if the final report shows an unexpected result (e.g.
+ `removed` on all of `ENGINE_FILES_LEGACY` while the project looked legacy).
- ## Amorçage (projet legacy sans historique)
+ ## Seeding (legacy project with no history)
- 2. Si `crew/CLAUDE_CONTEXT/SCAFFOLD_VERSION.json` n'existe pas encore côté
- projet cible (premier `/crew-update` d'un projet bootstrapé avant
- l'existence de ce mécanisme), tout fichier divergent de la source sortira
- en `conflict` faute de hash enregistré pour prouver l'absence de
- personnalisation — donc rien ne sera appliqué automatiquement au premier
- run. Proposer via `AskUserQuestion` d'amorcer d'abord la baseline :
- "Accepter le contenu local actuel comme non personnalisé depuis notre
- dernière écriture ?" (`seed(project_root, whitelist, version)`, ou
+ 2. If `crew/CLAUDE_CONTEXT/SCAFFOLD_VERSION.json` does not exist yet in the target
+ project (first `/crew-update` of a project bootstrapped before this mechanism
+ existed), every file that differs from the source comes out as `conflict` for
+ lack of a recorded hash proving it is uncustomized — so nothing will be
+ applied automatically on the first run. Offer via `AskUserQuestion` to seed
+ the baseline first: "Accept the current local content as uncustomized since
+ our last write?" (`seed(project_root, whitelist, version)`, or
`python crew_update.py --project <dir> --seed --source-version <version>
- [--legacy]`). C'est un choix de confiance explicite — si l'utilisateur
- refuse, traiter chaque fichier divergent comme un `conflict` normal
- (résolution manuelle un par un, cf. section Confirmation ci-dessous) sans
- amorçage. `seed()` refuse par construction d'écraser un
- `SCAFFOLD_VERSION.json` déjà enregistré (lève une erreur) — ne passer
- `force=True` / `--force` que si l'utilisateur demande explicitement de
- réamorcer volontairement la baseline (ex. après une résolution manuelle
- massive de conflits qu'on veut geler comme nouveau point de départ).
+ [--legacy]`). This is an explicit trust choice — if the user declines, treat
+ each differing file as a normal `conflict` (manual resolution one by one, see
+ the Confirmation section below) without seeding. `seed()` by construction
+ refuses to overwrite an already recorded `SCAFFOLD_VERSION.json` (raises an
+ error) — only pass `force=True` / `--force` if the user explicitly asks to
+ re-seed the baseline on purpose (e.g. after a massive manual conflict
+ resolution to be frozen as the new starting point).
- ## Résolution de la source
+ ## Source resolution
- 3. Version source du scaffold = champ `version` de
- `.claude-plugin/plugin.json` si accessible (plugin installé ou clone du
- repo scaffold) ; sinon demander à l'utilisateur le chemin de la source
- (clone local du scaffold, ou chemin `${CLAUDE_PLUGIN_ROOT}`) — ne jamais
- deviner un numéro de version.
+ 3. Scaffold source version = the `version` field of `.claude-plugin/plugin.json`
+ if reachable (installed plugin or clone of the scaffold repo); otherwise ask
+ the user for the source path (local clone of the scaffold, or the
+ `${CLAUDE_PLUGIN_ROOT}` path) — never guess a version number.
- ## Plan (dry-run, jamais d'écriture à ce stade)
+ ## Plan (dry-run, never write at this stage)
- 4. Appeler `plan(project_root, source_root, whitelist)` (import direct du
- module `crew_update`, ou `python crew_update.py --project <dir> --source
- <dir> [--legacy]` en CLI). Afficher le résultat groupé par statut :
- - `up_to_date` — rien à faire, ne pas lister en détail (juste un compte).
- - `new` — fichier ajouté côté source, absent localement → sera créé.
- - `apply` — fichier inchangé depuis la dernière écriture connue, source a
- évolué → sera mis à jour sans risque de perte.
- - `conflict` — fichier modifié localement depuis la dernière écriture
- connue → **ne sera jamais écrasé silencieusement**. Afficher un diff
- (ou au minimum les deux hashs + les premières lignes différentes) pour
- chacun.
- - `removed` — encore présent localement mais disparu côté source (déplacé
- ou supprimé en amont) → **jamais appliqué automatiquement** (rien à
- copier). Signaler à l'utilisateur pour décision manuelle : vérifier si
- le fichier a été déplacé ailleurs dans la source avant de le supprimer
- soi-même, ne jamais le supprimer silencieusement.
+ 4. Call `plan(project_root, source_root, whitelist)` (direct import of the
+ `crew_update` module, or `python crew_update.py --project <dir> --source <dir>
+ [--legacy]` from the CLI). Show the result grouped by status:
+ - `up_to_date` — nothing to do, do not list in detail (just a count).
+ - `new` — file added on the source side, missing locally → will be created.
+ - `apply` — file unchanged since the last known write, source has evolved →
+ will be updated with no risk of loss.
+ - `conflict` — file modified locally since the last known write → **will
+ never be silently overwritten**. Show a diff (or at minimum both hashes +
+ the first differing lines) for each.
+ - `removed` — still present locally but gone from the source (moved or
+ deleted upstream) → **never applied automatically** (nothing to copy). Flag
+ it to the user for a manual decision: check whether the file was moved
+ elsewhere in the source before deleting it yourself, never delete it
+ silently.
- ### Cas particulier : `CLAUDE.md` allégé (opt-in)
+ ### Special case: slimmed `CLAUDE.md` (opt-in)
- Depuis le slimming du template, un `CLAUDE.md` d'ancienne génération reste **valide** :
- les skills renvoient à `crew/CLAUDE_CONTEXT/CYCLE_DE_VIE.md` (`§ Batching`, `§ Gestion des tâches`,
- `§ Guides AGENTS.md segmentés`, `§ 2bis`), fichier moteur ajouté par `/crew-update` ; l'ancien `CLAUDE.md`
- long reste valide (ces sections y sont aussi).
+ Since the template slimming, an older-generation `CLAUDE.md` remains **valid**:
+ the skills point to `crew/CLAUDE_CONTEXT/CYCLE_DE_VIE.md` (`§ Batching`, `§ Task management`,
+ `§ Segmented AGENTS.md guides`, `§ 2bis`), an engine file added by `/crew-update`; the old
+ long `CLAUDE.md` stays valid (those sections are in it too).
- - `apply` → sans risque ; `conflict` (personnalisé) → **jamais touché par défaut**, le
- rapport signale seulement « version allégée disponible ». Migration **sur demande
- explicite** uniquement.
- - Si migration demandée (flux **manuel**, `crew_update.py` n'a pas de mode dédié) :
- écrire `CLAUDE.md.new`, garder `CLAUDE.md.bak`, montrer le diff, lister les sections
- locales absentes du template (règles projet à réinjecter à la main). Rien n'est
- appliqué sans confirmation.
- - Vérifier que les ancres obligatoires sont présentes dans le résultat : anti-collision,
- clause personas 1 %, règle des 100 lignes, seuils 150k/100k, `crew/` ancré racine.
- - Ne jamais retirer un renvoi `§` des skills tant que des projets dérivés peuvent
- porter l'ancienne version.
+ - `apply` → no risk; `conflict` (customized) → **never touched by default**, the
+ report only flags "slimmed version available". Migration **only on explicit
+ request**.
+ - If migration is requested (**manual** flow, `crew_update.py` has no dedicated
+ mode): write `CLAUDE.md.new`, keep `CLAUDE.md.bak`, show the diff, list the
+ local sections absent from the template (project rules to re-inject by hand).
+ Nothing is applied without confirmation.
+ - Check that the mandatory anchors are present in the result: anti-collision,
+ 1% personas clause, the 100-line rule, 150k/100k thresholds, root-anchored
+ `crew/`.
+ - Never remove a `§` pointer from the skills while derived projects may carry the
+ old version.
- ## Confirmation obligatoire
+ ## Mandatory confirmation
- 5. **Ne jamais appeler `apply()` sans confirmation explicite.** Utiliser
- `AskUserQuestion` : présenter le résumé (compte par statut + liste des
- fichiers `apply`/`new`/`conflict`), proposer au minimum "Appliquer
- `apply`/`new`, garder les `conflict` tels quels" / "Annuler". Pour chaque
- fichier en `conflict`, l'utilisateur peut choisir "garder ma version"
- (skip, comportement par défaut) — un merge manuel guidé (montrer le diff,
- laisser l'utilisateur éditer) reste possible mais jamais automatique.
+ 5. **Never call `apply()` without explicit confirmation.** Use `AskUserQuestion`:
+ present the summary (count per status + list of `apply`/`new`/`conflict`
+ files), offer at minimum "Apply `apply`/`new`, keep the `conflict` files as
+ they are" / "Cancel". For each `conflict` file, the user can choose "keep my
+ version" (skip, default behavior) — a guided manual merge (show the diff, let
+ the user edit) remains possible but is never automatic.
- ## Application
+ ## Apply
- 6. Sur confirmation : appeler `apply(project_root, source_root, decisions)`
- puis `record_version(project_root, source_version, decisions)` — bump la
- version enregistrée dans `crew/CLAUDE_CONTEXT/SCAFFOLD_VERSION.json`
- uniquement pour les fichiers réellement appliqués (les `conflict` gardent
- leur hash enregistré précédent, donc resteront proposés au prochain
- `/crew-update` tant que l'utilisateur ne les a pas résolus).
- 7. Si seule une partie des fichiers a été appliquée (des `conflict`
- subsistent), le dire explicitement dans le rapport final : la version
- enregistrée avance quand même (elle reflète "ce qu'on a pu synchroniser"),
- mais certains fichiers restent en attente de résolution manuelle.
+ 6. On confirmation: call `apply(project_root, source_root, decisions)` then
+ `record_version(project_root, source_version, decisions)` — bumps the version
+ recorded in `crew/CLAUDE_CONTEXT/SCAFFOLD_VERSION.json` only for the files
+ actually applied (`conflict` files keep their previously recorded hash, so
+ they will be offered again at the next `/crew-update` until the user resolves
+ them).
+ 7. If only part of the files were applied (some `conflict` files remain), say so
+ explicitly in the final report: the recorded version advances anyway (it
+ reflects "what we could sync"), but some files are still waiting for manual
+ resolution.
- ## Double hook (plugin + copie locale)
+ ## Double hook (plugin + local copy)
- 8. `detect_double_hook(project_root)` (appelé en tête de `_main()`, lecture
- seule) signale un projet où le plugin `crew-mates` est actif
- (`enabledPlugins` du projet ou de `~/.claude/settings.json`) ET dont
- `.claude/settings.json`/`settings.local.json` appellent aussi la copie
- locale `crew/crew_hook.py` : deux hooks sur le même `crew_lock.json`,
- logiques potentiellement divergentes. Un projet legacy **sans** plugin
- actif est normal, pas signalé.
- - Par défaut : avertissement (événements + commandes en double) et
- proposition de retrait, **aucune modification**.
- - Retrait seulement sur confirmation explicite de l'utilisateur : relancer
- avec `--remove-double-hook` (ne retire que ces entrées hook, le reste
- du settings est conservé, mais le fichier est reformaté en JSON indenté).
+ 8. `detect_double_hook(project_root)` (called at the top of `_main()`, read-only)
+ flags a project where the `crew-mates` plugin is active (`enabledPlugins` of
+ the project or of `~/.claude/settings.json`) AND whose
+ `.claude/settings.json`/`settings.local.json` also call the local copy
+ `crew/crew_hook.py`: two hooks on the same `crew_lock.json`, potentially
+ diverging logic. A legacy project **without** an active plugin is normal, not
+ flagged.
+ - By default: warning (duplicated events + commands) and an offer to remove,
+ **no modification**.
+ - Removal only on explicit user confirmation: rerun with
+ `--remove-double-hook` (removes only those hook entries, the rest of the
+ settings is kept, but the file is reformatted as indented JSON).
- ## Politique de tests (projets existants)
+ ## Test policy (existing projects)
- 8bis. Si `crew/CLAUDE_CONTEXT/TESTS_POLICY.md` est **absent**, proposer de le
- créer — jamais en silence — via un `AskUserQuestion` dédié, distinct de la
- confirmation de l'étape 5. Contenu : le modèle
- `${CLAUDE_PLUGIN_ROOT}/template/crew/CLAUDE_CONTEXT/TESTS_POLICY.md`
- (clone manuel : `<source>/template/...`), avec niveau et zones risquées
- déduits de `CLAUDE.md`, `README`, des manifestes et de `grep` ciblés dans
- `HISTORIQUE.md` (jamais lu en entier). Le fichier n'est **pas** dans
- `ENGINE_FILES_*` : une fois créé il appartient à l'utilisateur. Refus →
- rien n'est créé ; les skills gardent le comportement historique (`full`).
+ 8bis. If `crew/CLAUDE_CONTEXT/TESTS_POLICY.md` is **missing**, offer to create it
+ — never silently — through a dedicated `AskUserQuestion`, separate from the
+ step 5 confirmation. Content: the template
+ `${CLAUDE_PLUGIN_ROOT}/template/crew/CLAUDE_CONTEXT/TESTS_POLICY.md` (manual
+ clone: `<source>/template/...`), with level and risky zones inferred from
+ `CLAUDE.md`, `README`, the manifests and targeted `grep`s in `HISTORIQUE.md`
+ (never read in full). The file is **not** in `ENGINE_FILES_*`: once created
+ it belongs to the user. Declined → nothing is created; the skills keep the
+ historical behavior (`full`).
- ## Claims distants (projets existants)
+ ## Remote claims (existing projects)
- 8ter. Si `crew/CLAUDE_CONTEXT/CREW_CONFIG.md` est **absent**, le créer depuis
- `${CLAUDE_PLUGIN_ROOT}/template/crew/CLAUDE_CONTEXT/CREW_CONFIG.md` (clone
- manuel : `<source>/template/...`), avec `remote_claims : false` : le projet
- solo garde exactement son comportement, rien n'est synchronisé tant que le
- dev ne passe pas la ligne à `true`. Sans question (le défaut est inerte). Un
- fichier existant n'est **jamais** modifié ; il n'est pas dans `ENGINE_FILES_*`.
+ 8ter. If `crew/CLAUDE_CONTEXT/CREW_CONFIG.md` is **missing**, create it from
+ `${CLAUDE_PLUGIN_ROOT}/template/crew/CLAUDE_CONTEXT/CREW_CONFIG.md` (manual
+ clone: `<source>/template/...`), with `remote_claims : false`: a solo project
+ keeps exactly its behavior, nothing is synced until the dev flips the line to
+ `true`. No question asked (the default is inert). An existing file is
+ **never** modified; it is not in `ENGINE_FILES_*`.
- ## Rapporter
+ ## Report
- 9. Résumé final : fichiers créés, fichiers mis à jour, fichiers laissés en
- conflit ou en `removed` (avec rappel qu'ils seront re-proposés au
- prochain `/crew-update` tant qu'ils ne sont pas résolus), nouvelle
- version enregistrée, et si la politique de tests a été créée (niveau +
- zones, modifiable dans `TESTS_POLICY.md`).
+ 9. Final summary: files created, files updated, files left in conflict or
+ `removed` (reminding that they will be offered again at the next
+ `/crew-update` until resolved), newly recorded version, and whether the test
+ policy was created (level + zones, editable in `TESTS_POLICY.md`).
- ## Ce que ce skill ne fait pas
+ ## What this skill does not do
- - N'écrit jamais dans `crew/TODO/`, `crew/CURRENT_TASKS/`, `crew/PROBLEMS/`,
+ - Never writes into `crew/TODO/`, `crew/CURRENT_TASKS/`, `crew/PROBLEMS/`,
`crew/ICEBOX/`, `crew/TESTS/`, `crew/CLAUDE_CONTEXT/HISTORIQUE.md`,
- `crew/CLAUDE_CONTEXT/TESTS_DONE/`, ni `crew/CLAUDE_BATCH.md` (devient
- donnée live dès le premier batch réel, jamais dans la liste blanche même
- si livré comme squelette au départ).
- - Ne modifie jamais un `crew/CLAUDE_CONTEXT/TESTS_POLICY.md` existant (créé
- une seule fois, sur confirmation, s'il est absent).
- - Ne modifie jamais un `crew/CLAUDE_CONTEXT/CREW_CONFIG.md` existant (créé une
- seule fois, désactivé par défaut, s'il est absent).
- - N'écrase jamais un fichier `conflict` sans confirmation explicite —
- préfère laisser un fichier périmé plutôt que perdre une personnalisation
- utilisateur.
- - Ne bump jamais silencieusement la version sur une application partielle
- sans le signaler dans le rapport.
- - Ne tente pas de synchroniser skills/agents/hooks sur un projet en mode
- plugin — redirige vers `/plugin update crew-mates`.
- - Ne retire jamais un hook local en double sans `--remove-double-hook`
- confirmé par l'utilisateur.
+ `crew/CLAUDE_CONTEXT/TESTS_DONE/`, nor `crew/CLAUDE_BATCH.md` (becomes live
+ data from the first real batch, never in the whitelist even if shipped as a
+ skeleton at the start).
+ - Never modifies an existing `crew/CLAUDE_CONTEXT/TESTS_POLICY.md` (created once,
+ on confirmation, if missing).
+ - Never modifies an existing `crew/CLAUDE_CONTEXT/CREW_CONFIG.md` (created once,
+ disabled by default, if missing).
+ - Never overwrites a `conflict` file without explicit confirmation — prefers
+ leaving a stale file over losing a user customization.
+ - Never silently bumps the version on a partial apply without flagging it in the
+ report.
+ - Does not try to sync skills/agents/hooks on a plugin-mode project — redirects
+ to `/plugin update crew-mates`.
+ - Never removes a duplicate local hook without `--remove-double-hook` confirmed
+ by the user.