diff --git a/.claude/memory/blockers.md b/.claude/memory/blockers.md index 8dfcb50..81a05c3 100644 --- a/.claude/memory/blockers.md +++ b/.claude/memory/blockers.md @@ -21,27 +21,27 @@ rules: | ID | Date | Friction | Status | |----|------|---------|--------| | BLK-001 | 2026-04-22 | `rtk curl` breaks JSON pipelines | upstream | -| BLK-002 | 2026-04-23 | `rmdir` refusé en sandbox sur dossier vide | resolved (manual user step) | +| BLK-002 | 2026-04-23 | `rmdir` denied in sandbox on empty directory | resolved | --- ## BLK-001 — `rtk curl` returns compressed schema in pipes -- **Date** : 2026-04-22 -- **Friction** : toute pipeline `rtk curl ... | python -c "json.load(sys.stdin)"` (ou `jq`, `awk`) échoue sans message clair. -- **Cause réelle** : `rtk curl` auto-compresse stdout indépendamment du TTY — documenté dans `.claude/tasks/rtk-upstream-issue.md`. -- **Solution** : - - Workaround court terme : `exclude_commands=["curl"]` dans `~/.config/rtk/config.toml`. - - Workaround alternatif : utiliser `rtk proxy`. - - Fix upstream : issue reportée, voir `.claude/tasks/rtk-upstream-issue.md`. -- **Statut** : upstream (bug chez `rtk`, workaround appliqué). +- **Date**: 2026-04-22 +- **Friction**: any pipeline like `rtk curl ... | python -c "json.load(sys.stdin)"` (or `jq`, `awk`) fails without a clear error message. +- **Real cause**: `rtk curl` auto-compresses stdout regardless of TTY — documented in `.claude/tasks/rtk-upstream-issue.md`. +- **Solution**: + - Short-term workaround: `exclude_commands=["curl"]` in `~/.config/rtk/config.toml`. + - Alternative workaround: use `rtk proxy`. + - Upstream fix: issue reported, see `.claude/tasks/rtk-upstream-issue.md`. +- **Status**: upstream (`rtk` bug, workaround applied). -## BLK-002 — `rmdir` refusé en sandbox sur dossier vide +## BLK-002 — `rmdir` denied in sandbox on empty directory -- **Date** : 2026-04-23 -- **Friction** : impossible de supprimer le dossier `./tasks/` une fois vidé (après migration vers `.claude/tasks/`). Commands `rmdir tasks` et `rm -r tasks` retournent "Permission denied" même si le dir est vide et que l'intent est non-destructif. -- **Cause réelle** : la sandbox Claude Code bloque les commandes destructives (`rm`, `rmdir`, `rm -rf`) par défaut via le harness permission gate, indépendamment de la sémantique réelle. Le `git rm` via `git` lui passait (commit `c721a36`) — git est traité comme tool non-destructif. -- **Solution** : - - Cette session : `git rm tasks/*.md` a traité les fichiers individuellement (via `git rm`, passé par le gate). Ensuite git a auto-détecté les renames vers `.claude/tasks/`, donc le dir `tasks/` a été supprimé implicitement au commit. - - Si le dir persiste vide après `git rm` : demander à l'user de lancer `rmdir tasks` manuellement. -- **Statut** : resolved (résolu par `git rm` + auto-detect rename, pas de `rmdir` requis en pratique). +- **Date**: 2026-04-23 +- **Friction**: couldn't delete `./tasks/` after emptying it (post-migration to `.claude/tasks/`). `rmdir tasks` and `rm -r tasks` returned "Permission denied" even with an empty dir and non-destructive intent. +- **Real cause**: the Claude Code sandbox blocks destructive commands (`rm`, `rmdir`, `rm -rf`) by default via the harness permission gate, regardless of actual semantics. `git rm` through `git` passed (commit `c721a36`) — git is treated as a non-destructive tool. +- **Solution**: + - This session: `git rm tasks/*.md` handled files individually (via `git rm`, which cleared the gate). Git then auto-detected renames to `.claude/tasks/`, so the `tasks/` directory was removed implicitly at commit time. + - If the dir persists empty after `git rm`: ask the user to run `rmdir tasks` manually. +- **Status**: resolved (fixed via `git rm` + rename auto-detection; no `rmdir` needed in practice). diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index 5007d2f..963307f 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -22,43 +22,43 @@ rules: | ID | Date | Title | Status | |----|------|-------|--------| -| BDR-001 | 2026-04-22 | --help helper uniforme via hook post-start (option C) | accepted | -| BDR-002 | 2026-04-23 | Restructurer tasks/ + memory + audits sous .claude/ | accepted | -| BDR-003 | 2026-04-23 | Gitignore pattern wildcard + négations pour .claude/ | accepted | +| BDR-001 | 2026-04-22 | Uniform --help helper via session-start hook (option C) | accepted | +| BDR-002 | 2026-04-23 | Move tasks/ + introduce memory + audits under .claude/ | accepted | +| BDR-003 | 2026-04-23 | Gitignore wildcard + negations pattern for .claude/ | accepted | --- -## BDR-001 — --help helper uniforme via hook post-start (option C) +## BDR-001 — Uniform --help helper via session-start hook (option C) -- **Date** : 2026-04-22 -- **Statut** : accepted -- **Décision** : tous les skills exposent `--help` via un snippet partagé injecté par le session-start hook, plutôt que dupliquer le helper dans chaque SKILL.md. -- **Pourquoi** : 25+ skills, maintenir le même helper dans chaque fichier = drift garanti. Un point d'injection = une seule source de vérité. -- **Alternatives rejetées** : - - Option A (copier le helper dans chaque SKILL.md) — refusée : entropie de maintenance. - - Option B (wrapper externe `/help `) — refusée : casse l'expérience "une commande = un skill". -- **Référence** : commit 3968a29. +- **Date**: 2026-04-22 +- **Status**: accepted +- **Decision**: every skill exposes `--help` via a shared snippet injected by the session-start hook, rather than duplicating the helper in each SKILL.md. +- **Why**: 25+ skills — keeping the same helper synced across every file guarantees drift. A single injection point = single source of truth. +- **Alternatives rejected**: + - Option A (copy the helper into each SKILL.md) — rejected: maintenance entropy. + - Option B (external wrapper `/help `) — rejected: breaks the "one command = one skill" experience. +- **Reference**: commit 3968a29. -## BDR-002 — Restructurer tasks/ + memory + audits sous .claude/ +## BDR-002 — Move tasks/ + introduce memory + audits under .claude/ -- **Date** : 2026-04-23 -- **Statut** : accepted -- **Décision** : migrer `./tasks/` vers `.claude/tasks/`, créer `.claude/memory/` (5 registres BDR/LRN/BLK/journal/EVAL) et `.claude/audits/` pour les fichiers AUDIT_*. Adapter skills/agents/CLAUDE.md. Intégrer un rituel de capitalisation dans les skills de complétion (ship-feature, feat, bugfix, hotfix, commit-change) + créer un skill `/close` pour le rituel de fin de session. -- **Pourquoi** : regrouper tout le méta-projet (config IA + tâches + mémoire + audits) sous `.claude/` isole la gouvernance Claude du code réel. Alignement sur la doc officielle Claude Code memory. Sans intégration dans les skills, les registres resteraient vides (aspirational text). -- **Alternatives rejetées** : - - Laisser `./tasks/` à la racine — refusée : encombre le repo, mélange signal code / signal gouvernance. - - Utiliser `.claude/agent-memory/` pour tout — refusée : `agent-memory/` a un rôle distinct (déjà utilisé par d'autres outils). - - Rituel uniquement en texte aspirationnel dans CLAUDE.md — refusée : zéro garantie d'exécution, les registres resteraient vides. - - Hook `Stop` pour poser les 3 questions à chaque tour — refusée : trop bruyant. +- **Date**: 2026-04-23 +- **Status**: accepted +- **Decision**: migrate `./tasks/` to `.claude/tasks/`, create `.claude/memory/` (5 registries BDR/LRN/BLK/journal/EVAL) and `.claude/audits/` for AUDIT_* files. Adapt skills/agents/CLAUDE.md. Integrate a CAPITALIZE step into completion skills (ship-feature, feat, bugfix, hotfix, commit-change) and add a `/close` skill for the session-end ritual. +- **Why**: grouping all meta-project state (AI config + tasks + memory + audits) under `.claude/` isolates Claude governance from real code. Aligned with the official Claude Code memory docs. Without integration in completion skills, the registries would stay empty (aspirational text). +- **Alternatives rejected**: + - Keep `./tasks/` at root — rejected: clutters the repo, mixes code signal with governance signal. + - Use `.claude/agent-memory/` for everything — rejected: `agent-memory/` has a distinct role (already used by other tools). + - Ritual as aspirational text only in CLAUDE.md — rejected: zero execution guarantee, registries would stay empty. + - `Stop` hook to ask the 3 questions every turn — rejected: too noisy. -## BDR-003 — Gitignore pattern wildcard + négations pour `.claude/` +## BDR-003 — Gitignore wildcard + negations pattern for `.claude/` -- **Date** : 2026-04-23 -- **Statut** : accepted -- **Décision** : utiliser `.claude/*` (wildcard match des enfants immédiats) + négations `!.claude/tasks/`, `!.claude/memory/`, etc., plutôt que `.claude/` (ignore récursif). -- **Pourquoi** : quand un parent est ignoré via `.claude/`, git n'entre pas dans le dossier (pour la perf) et les négations sur les enfants sont **ignorées** — c'est documenté dans `gitignore(5)`. Avec `.claude/*`, git match chaque enfant individuellement, ce qui rend les négations actives. -- **Alternatives rejetées** : - - `.claude/` + `!.claude/tasks/` (naïf) — refusée : les négations n'ont aucun effet, tout reste ignoré. - - Retirer `.claude/` du gitignore entièrement — refusée : `.claude/settings.local.json` et `.claude/agent-memory/` doivent rester ignorés (per-machine). - - Ajouter les paths à tracker dans `.gitattributes` ou un outil externe — refusée : over-engineering, git gère nativement. -- **Référence** : commit `499cd07`, `git check-ignore -v` vérifié sur 4 paths (2 trackés, 2 ignorés). +- **Date**: 2026-04-23 +- **Status**: accepted +- **Decision**: use `.claude/*` (wildcard match of immediate children) + negations `!.claude/tasks/`, `!.claude/memory/`, etc., rather than `.claude/` (recursive ignore). +- **Why**: when a parent is ignored via `.claude/`, git does not descend into it (performance optimization) and negations on children are **ignored** — documented in `gitignore(5)`. With `.claude/*`, git matches each child individually, making negations active. +- **Alternatives rejected**: + - `.claude/` + `!.claude/tasks/` (naive) — rejected: negations have no effect, everything stays ignored. + - Drop `.claude/` from gitignore entirely — rejected: `.claude/settings.local.json` and `.claude/agent-memory/` must stay ignored (per-machine). + - Track paths via `.gitattributes` or an external tool — rejected: over-engineering, git handles this natively. +- **Reference**: commit `499cd07`, `git check-ignore -v` verified on 4 paths (2 tracked, 2 ignored). diff --git a/.claude/memory/evals.md b/.claude/memory/evals.md index 28aaf43..64a4f8c 100644 --- a/.claude/memory/evals.md +++ b/.claude/memory/evals.md @@ -21,14 +21,14 @@ rules: | ID | Date | Output | Action | |----|------|--------|--------| -| EVAL-001 | 2026-04-23 | Plan de restructuration .claude/ (STEP 2 de ship-feature) | keep | +| EVAL-001 | 2026-04-23 | `.claude/` restructure plan (ship-feature STEP 2) | keep | --- -## EVAL-001 — Plan de restructuration `.claude/` +## EVAL-001 — `.claude/` restructure plan -- **Date** : 2026-04-23 -- **Output** : plan 21 tâches pour migrer `tasks/` vers `.claude/tasks/` + créer `.claude/memory/` + `.claude/audits/` + intégrer CAPITALIZE dans 5 skills + créer `/close`. -- **Méthode** : relecture manuelle des 5 skills/agents impactés, vérification que rtk est path-agnostic, symlink `~/.claude/CLAUDE.md` → projet confirmé (un seul fichier à éditer). Radical-honesty check sur le ritual "session-close" : confirmé comme aspirationnel sans intégration dans les skills → scope élargi à Option D. -- **Anomalies** : aucune bloquante. Note : `tasks/LESSONS.md` était vide (101B, juste un header) — migration vers `learnings.md` symbolique. -- **Action** : keep — plan validé, prêt pour exécution. +- **Date**: 2026-04-23 +- **Output**: 21-task plan to migrate `tasks/` to `.claude/tasks/` + create `.claude/memory/` + `.claude/audits/` + integrate CAPITALIZE across 5 skills + add `/close` skill. +- **Method**: manual review of the 5 impacted skills/agents; verified `rtk` is path-agnostic; confirmed `~/.claude/CLAUDE.md` symlinks to the project (single file to edit). Radical-honesty check on the session-close ritual: confirmed aspirational without skill integration → scope expanded to Option D. +- **Anomalies**: none blocking. Note: `tasks/LESSONS.md` was empty (101B, header only) — migration to `learnings.md` is symbolic. +- **Action**: keep — plan validated, ready for execution. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index cce35b1..359f625 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -13,10 +13,11 @@ rules: ## 2026-04-23 -- Restructuré l'arborescence : `tasks/` → `.claude/tasks/`, créé `.claude/memory/` (5 registres) + `.claude/audits/`. -- Adapté CLAUDE.md + skills `onboard`, `init-project` + agent `onboarder` + `lib/project-archetypes/dotfiles-meta.md`. -- Ajouté un step CAPITALIZE dans `ship-feature`, `bugfix`, `hotfix`, `feat`, `commit-change` + créé skill `/close` pour rituel de fin de session. -- 2e verify-gate user → bugs catchés : `.gitignore` cassait le tracking (fixé BDR-003), dispatchers bash harden/validate cassés après le move audit (LRN-002). -- Audits routés vers `.claude/audits/` (seo/geo/harden/validate/code-clean) + `MIGRATION.md` écrit pour projets existants. -- 9 commits atomiques (`c721a36..a9606aa`) via `/commit-change` — première exécution réelle de la Phase 4 CAPITALIZE. -- Décisions actées : BDR-002, BDR-003. Learnings : LRN-002. Blockers : BLK-002. +- Restructured tree: `tasks/` → `.claude/tasks/`, created `.claude/memory/` (5 registries) + `.claude/audits/`. +- Adapted CLAUDE.md + skills `onboard`, `init-project` + agent `onboarder` + `lib/project-archetypes/dotfiles-meta.md`. +- Added CAPITALIZE step in `ship-feature`, `bugfix`, `hotfix`, `feat`, `commit-change` + created `/close` skill for the session-end ritual. +- 2nd user verify-gate caught bugs: `.gitignore` was breaking tracking (fixed in BDR-003); harden/validate dispatcher bash was broken after the audit move (LRN-002). +- Audits routed to `.claude/audits/` (seo/geo/harden/validate/code-clean) + `MIGRATION.md` written for existing projects. +- 9 atomic commits (`c721a36..a9606aa`) via `/commit-change` — first real execution of Phase 4 CAPITALIZE. +- Decisions logged: BDR-002, BDR-003. Learnings: LRN-002. Blockers: BLK-002. +- English-only rule enforced in all CAPITALIZE specs (commit `bfcca72`); 9 existing entries retrofitted to English in follow-up commit. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 47e8e95..ac5a35e 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -25,19 +25,19 @@ rules: --- -## LRN-001 — `rtk` shape-compression breaks downstream parsers +## LRN-001 — `rtk` shape-compression silently breaks downstream parsers -- **Date** : 2026-04-22 -- **Pattern** : quand un outil de tracking (`rtk`) intercepte stdout et retourne une représentation schématisée/compressée au lieu du payload brut, tout parseur en aval casse silencieusement — parce que l'utilisateur (ou le LLM) ne voit jamais la sortie `rtk`, seulement l'erreur du parseur. -- **Contexte** : `rtk curl` remplace la sortie JSON brute par une version tokenisée, indépendamment du TTY vs pipe. Les hooks Claude Code réécrivent `curl` → `rtk curl` automatiquement, donc impossible à prévoir sans connaître le hook. -- **Application future** : pour tout outil qui auto-réécrit des commandes standard, vérifier explicitement le comportement en pipe. Workaround documenté : `exclude_commands=["curl"]` dans `~/.config/rtk/config.toml`, ou `rtk proxy`. Voir `BLK-001`. +- **Date**: 2026-04-22 +- **Pattern**: when a tracking tool (`rtk`) intercepts stdout and returns a schematized/compressed representation instead of the raw payload, every downstream parser breaks silently — because the user (or the LLM) never sees `rtk`'s output, only the parser error. +- **Context**: `rtk curl` replaces raw JSON output with a tokenized version, regardless of TTY vs pipe. Claude Code hooks auto-rewrite `curl` → `rtk curl`, so the behavior is impossible to anticipate without knowing the hook. +- **Future application**: for any tool that auto-rewrites standard commands, explicitly verify pipe behavior. Documented workaround: `exclude_commands=["curl"]` in `~/.config/rtk/config.toml`, or `rtk proxy`. See `BLK-001`. ## LRN-002 — Moving report-file paths requires grepping bash READS, not just WRITES -- **Date** : 2026-04-23 -- **Pattern** : quand on déplace le chemin d'écriture d'un fichier généré (rapport, artefact, cache), il faut aussi grepper les endroits qui LISENT ce fichier — pas seulement ceux qui l'écrivent. Les dispatchers (skills orchestrateurs qui dispatchent à un agent puis parsent le résultat) contiennent typiquement des commandes bash `test -s X.md`, `grep ... X.md`, `wc -l X.md` — ces refs sont invisibles si on ne grep que pour la chaîne "write" ou "output path". -- **Contexte** : refactor `.claude/audits/` (commit `5c5e82c`). 1er pass : j'ai mis à jour les write paths dans 5 skills (seo/geo/harden/validate/code-clean) et 3 agents. Le user a demandé une verify-gate. Lui a re-grep, trouvé 10+ refs bash bare (ex: `test -s HARDEN.md`, `grep -oE ... VALIDATE.md`) que j'avais manquées — les dispatchers étaient cassés (ils cherchaient à la racine, agent écrivait dans `.claude/audits/`). Corrigé au commit `5c5e82c` (inclus dans le même commit). -- **Application future** : - - Avant de déclarer "migration complète" d'un chemin de fichier, grep le **basename** (`grep -rn "HARDEN\.md"`) en plus du chemin complet — pour catcher les usages bash bare. - - Si le fichier est utilisé dans des pipelines (`test`, `grep`, `wc`, `cat`, `head`), chercher ces verbes explicitement. - - **Verify-gates sauvent** : un tour de plus demandé par l'user m'a fait re-grep de façon exhaustive. Sans ça, deux dispatchers auraient été cassés en prod. +- **Date**: 2026-04-23 +- **Pattern**: when moving the write path of a generated file (report, artifact, cache), you must also grep the places that READ that file — not only those that write it. Dispatchers (orchestrator skills that dispatch to an agent and then parse the result) typically contain bash commands like `test -s X.md`, `grep ... X.md`, `wc -l X.md` — these refs are invisible if you only grep for "write" or "output path". +- **Context**: `.claude/audits/` refactor (commit `5c5e82c`). First pass: I updated write paths across 5 skills (seo/geo/harden/validate/code-clean) and 3 agents. The user asked for a verify-gate. They re-grepped and found 10+ bare bash refs (e.g. `test -s HARDEN.md`, `grep -oE ... VALIDATE.md`) I had missed — the dispatchers were broken (looking at project root while the agent was writing to `.claude/audits/`). Fixed in commit `5c5e82c` (bundled with the same commit). +- **Future application**: + - Before declaring a file-path migration "complete", grep the **basename** (`grep -rn "HARDEN\.md"`) in addition to the full path — to catch bare bash usages. + - If the file is used in pipelines (`test`, `grep`, `wc`, `cat`, `head`), search for those verbs explicitly. + - **Verify-gates save work**: one extra round asked by the user forced exhaustive re-grepping. Without it, two dispatchers would have shipped broken.