DOC
2026 04 14 apfel integration
Apfel Integration Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Implémenter apfel dans tous les agents ulk applicables avec un rapport inline et un log cumulatif docs/apfel-report.md.
Architecture: Protocole partagé mis à jour (_shared/apfel-protocol.md) comme référence unique pour le standard. Chaque agent reçoit un check conditionnel réel (pas juste un commentaire) et ajoute une section 🍏 Apfel à son rapport final. Un log cumulatif markdown + JSON stats est maintenu dans docs/apfel-report.md.
Tech Stack: Bash (check conditionnel), apfel CLI v1.0.1, markdown agents ulk.
Fichiers modifiés / créés
| Fichier | Action | Rôle |
|---|---|---|
agents/_shared/apfel-protocol.md | Modifier | Ajouter pattern standard + format rapport + format log |
docs/apfel-report.md | Créer | Log cumulatif markdown + stats JSON |
agents/session/00-godspeed.md | Modifier | Phases 1.1, 1.2 + rapport |
agents/session/08-2b3.md | Modifier | Phases 1.4, 1.5, 5.2 + rapport |
agents/audit/05-vision.md | Modifier | Phase audit + rapport |
agents/session/11-robocop.md | Modifier | Phase 1 + rapport |
agents/docs/01-shuri.md | Modifier | Phase 1 stack detection + rapport |
agents/docs/09-friday.md | Modifier | Phase C1 + rapport |
agents/docs/16-strange.md | Modifier | Phase 1 + rapport |
agents/orchestrators/47-lovecraft.md | Modifier | Phase 1 + rapport |
agents/audit/45-sargeras.md | Modifier | Phase 1 + rapport |
agents/audit/52-ed209.md | Modifier | Phase 1 + rapport |
Task 1 : Mise à jour _shared/apfel-protocol.md
Fichiers :
-
Modifier :
agents/_shared/apfel-protocol.md -
Step 1 : Lire le fichier existant
cat agents/_shared/apfel-protocol.md
- Step 2 : Ajouter la section “Pattern Standard” après la section “Detection”
Insérer après le bloc ## Detection existant :
## Pattern Standard d'intégration
### Détection (Phase 0 ou Phase 1 de chaque agent)
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
Déclarer APFEL une seule fois au début de l’agent. Toutes les phases suivantes lisent cette variable.
Invocation conditionnelle
if [ "$APFEL" = "yes" ]; then
result=$(apfel -q -f "$file" "prompt...")
# Ajouter à la liste des invocations pour le rapport
else
# Lire et analyser avec Claude directement (comportement actuel)
fi
Règle : $file peut être omis pour les prompts sans fichier (ex: commit message depuis git diff).
Règle : Toujours vérifier que le fichier < 200 lignes avant d’invoquer apfel (voir section Contraintes).
Rapport inline (fin de chaque agent)
Ajouter cette section au rapport final de l’agent. Si aucune invocation → ne pas afficher la section.
🍏 Apfel — N invocations (~N tokens économisés)
• tâche 1 (fichier ou "—")
• tâche 2 (fichier ou "—")
→ Log : docs/apfel-report.md
Si apfel non disponible → afficher une seule fois en début de session (pas dans chaque phase) :
ℹ️ Apfel non disponible — analyses effectuées par Claude (macOS 26+ requis pour activer)
Log cumulatif docs/apfel-report.md
Après chaque session où apfel a été invoqué, appender au log :
# 1. Créer le fichier si absent
# 2. Chercher/créer la section ## YYYY-MM-DD
# 3. Appender le bloc agent
# 4. Mettre à jour le JSON stats en tête
Format du bloc agent à appender :
### agent-name (NN) — HH:MM
| Tâche | Fichier | Tokens économisés |
|-------|---------|-------------------|
| résumé spec | docs/spec.md | ~200 |
| classification stack | package.json | ~500 |
**Total session : ~700 tokens**
Format complet du fichier docs/apfel-report.md (créer si absent) :
# Apfel Usage Report
<!-- apfel:stats
{
"total_calls": 0,
"total_tokens_saved": 0,
"by_agent": {}
}
-->
## YYYY-MM-DD
### agent-name (NN) — HH:MM
| Tâche | Fichier | Tokens économisés |
|-------|---------|-------------------|
| résumé spec | docs/spec.md | ~200 |
**Total session : ~200 tokens**
Règles du log :
- Append uniquement — jamais de réécriture complète
- Section
## YYYY-MM-DDcréée si absente, réutilisée si présente - Stats JSON mises à jour à chaque écriture (incrémenter
total_calls,total_tokens_saved,by_agent[agent-name]) - Si apfel non invoqué dans la session → ne rien écrire dans le log
- [ ] **Step 3 : Vérifier l'ajout**
```bash
grep -n "Pattern Standard" agents/_shared/apfel-protocol.md
grep -n "docs/apfel-report.md" agents/_shared/apfel-protocol.md
Attendu : 2 lignes trouvées.
- Step 4 : Commit
git add agents/_shared/apfel-protocol.md
git commit -m "feat(apfel): pattern standard + format log dans apfel-protocol"
Task 2 : Créer docs/apfel-report.md
Fichiers :
-
Créer :
docs/apfel-report.md -
Step 1 : Créer le fichier avec la structure initiale
# Apfel Usage Report
> Log cumulatif des invocations Apple Intelligence via `apfel` CLI.
> Mis à jour automatiquement par les agents ulk.
<!-- apfel:stats
{
"total_calls": 0,
"total_tokens_saved": 0,
"by_agent": {}
}
-->
---
_Premier log apparaîtra ici lors de la prochaine session avec apfel disponible._
- Step 2 : Vérifier
grep "apfel:stats" docs/apfel-report.md
Attendu : 1 ligne trouvée.
- Step 3 : Commit
git add docs/apfel-report.md
git commit -m "feat(apfel): créer docs/apfel-report.md (log cumulatif)"
Task 3 : Patcher agents/session/00-godspeed.md
Fichiers :
- Modifier :
agents/session/00-godspeed.md
Contexte : godspeed a déjà un commentaire > Optimisation apfel en Phase 1.2. Il faut transformer ce commentaire en implémentation réelle + ajouter détection en Phase 1.1 + rapport dans Phase 3.
- Step 1 : Lire les sections concernées
grep -n "apfel\|Phase 1\|Rapport\|resume_projet" agents/session/00-godspeed.md
- Step 2 : Ajouter la détection APFEL en début de Phase 1
Après la ligne ## Phase 1 : Scan Rapide, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Remplacer le commentaire Phase 1.2 par une implémentation réelle**
Remplacer le bloc `> **Optimisation apfel** : Si...` par :
```markdown
### 1.2 - Analyse du contenu
**Résumé spec.md** : Si `docs/spec.md` existe et < 200 lignes et `APFEL=yes` :
```bash
apfel -q -f docs/spec.md "project name, stack, status in 3 lines"
Sinon : lire les premières lignes directement.
Description structure : Si APFEL=yes :
apfel -q "describe this project structure: $(ls -la | head -20)"
Sinon : analyser la sortie ls directement.
- [ ] **Step 4 : Ajouter la section 🍏 Apfel dans le format de rapport (Phase 3)**
Après le champ `resume_projet:` dans le format de rapport, ajouter :
```markdown
apfel: (omis si APFEL=no ou aucune invocation)
invocations: N
taches: [résumé spec, description structure]
tokens_economies: ~N
log: docs/apfel-report.md
- Step 5 : Ajouter l’écriture du log à la fin de Phase 3
Après le bloc rapport, ajouter :
### 3.1 — Log apfel (si invocations > 0)
Si `APFEL=yes` et au moins une invocation effectuée, appender à `docs/apfel-report.md` :
```bash
# Créer docs/apfel-report.md si absent
# Appender section ## YYYY-MM-DD si absente
# Appender : ### godspeed (00) — HH:MM + tableau des invocations
# Mettre à jour JSON stats : by_agent.godspeed.calls += N, total_calls += N
- [ ] **Step 6 : Vérifier**
```bash
grep -n "APFEL=" agents/session/00-godspeed.md
grep -n "🍏" agents/session/00-godspeed.md
grep -n "apfel-report" agents/session/00-godspeed.md
Attendu : 3 lignes trouvées (une par grep).
- Step 7 : Commit
git add agents/session/00-godspeed.md
git commit -m "feat(apfel): intégration réelle dans godspeed (phases 1.0, 1.2, 3)"
Task 4 : Patcher agents/session/08-2b3.md
Fichiers :
- Modifier :
agents/session/08-2b3.md
Contexte : 2b3 a déjà des commentaires apfel en Phases 1.4 et 5.2 (fallback). Transformer en implémentation réelle + ajouter Phase 1.5 (naming) + rapport final.
- Step 1 : Localiser les sections
grep -n "apfel\|Phase 0\|Rapport Final\|Bonne continuation" agents/session/08-2b3.md
- Step 2 : Ajouter détection APFEL en Phase 0.1
Après la ligne ## Phase 0 : Reconnaissance, ajouter avant ### 0.1 :
### 0.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
[ "$APFEL" = "no" ] && echo "ℹ️ Apfel non disponible — analyses effectuées par Claude"
- [ ] **Step 3 : Remplacer le commentaire Phase 1.4 par une implémentation réelle**
Remplacer le bloc `> **Optimisation apfel** : Si \`command -v apfel\`...` par :
```markdown
Pour chaque fichier modifié (scope Phase 0) :
**Si `APFEL=yes` et fichier < 200 lignes :**
```bash
result=$(apfel -q -f "$file" "list TODO, FIXME, hardcoded passwords, API keys, tokens. Format: LINE:TYPE:TEXT")
# Ajouter à APFEL_LOG : "TODOs/secrets|$file|~400"
Sinon : lire le fichier avec Read et scanner les patterns directement.
- [ ] **Step 4 : Ajouter apfel en Phase 1.5 (vérification nommage)**
Dans Phase 1.5.3, après la liste des vérifications, ajouter :
```markdown
**Vérification nommage via apfel** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "$file" "do function and variable names follow camelCase? List violations. Format: LINE:NAME:ISSUE"
# Ajouter à APFEL_LOG : "nommage|$file|~300"
- [ ] **Step 5 : Promouvoir apfel au rang de méthode primaire en Phase 5.2**
Dans Phase 5.2, remplacer la section `**Fallback apfel**` par `**Alternative apfel**` et la déplacer avant le fallback manuel :
```markdown
**Via `/commit`** (méthode recommandée si plugin disponible) :
/commit
**Via apfel** (si plugin absent et `APFEL=yes`) :
```bash
msg=$(apfel -q "conventional commit message for: $(git diff --stat HEAD)")
git commit -m "$msg"
# Ajouter à APFEL_LOG : "commit message|—|~500"
Manuellement (si ni plugin ni apfel) : […tableau existant…]
- [ ] **Step 6 : Ajouter la section 🍏 Apfel dans le Rapport Final**
Dans le bloc `═══ 2b3 — Session terminée ✅ ═══`, après la ligne `Phase 5 (Commit)`, ajouter :
```markdown
🍏 Apfel : [N invocations (~N tokens) | non disponible]
Et après le bloc rapport, ajouter l’écriture du log :
### Log apfel (si invocations > 0)
Si `APFEL=yes` et APFEL_LOG non vide, appender à `docs/apfel-report.md` :
```bash
# Section ## YYYY-MM-DD si absente
# ### 2b3 (08) — HH:MM + tableau tâche/fichier/tokens
# Mettre à jour JSON stats : by_agent["2b3"] += invocations
- [ ] **Step 7 : Vérifier**
```bash
grep -n "APFEL=" agents/session/08-2b3.md
grep -n "🍏" agents/session/08-2b3.md
grep -n "APFEL_LOG" agents/session/08-2b3.md
Attendu : au moins 2 lignes par grep.
- Step 8 : Commit
git add agents/session/08-2b3.md
git commit -m "feat(apfel): intégration réelle dans 2b3 (phases 0.0, 1.4, 1.5, 5.2)"
Task 5 : Patcher agents/audit/05-vision.md
Fichiers :
- Modifier :
agents/audit/05-vision.md
Contexte : vision n’a pas de commentaire apfel. Ajouter détection + délégation extraction TODOs + rapport.
- Step 1 : Lire la structure de vision
grep -n "^## Phase\|^### \|rapport\|Rapport\|TODO\|FIXME" agents/audit/05-vision.md | head -40
- Step 2 : Ajouter détection APFEL en début de Phase 1
Après la première ligne ## Phase 1, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Ajouter délégation extraction TODOs lors de la lecture des fichiers**
Dans la phase de lecture des fichiers à auditer, ajouter :
```markdown
**Extraction TODOs/FIXMEs** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "$file" "list all TODO, FIXME, HACK, XXX comments with line numbers. Format: LINE:TYPE:TEXT"
# Ajouter à APFEL_LOG : "extract TODOs|$file|~400"
Sinon : scanner le fichier directement.
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport final**
Dans le rapport de sortie de vision, ajouter après le score :
```markdown
🍏 Apfel — N invocations (~N tokens économisés)
• extract TODOs (fichier1, fichier2)
→ Log : docs/apfel-report.md
Et l’écriture dans le log après le rapport.
- Step 5 : Vérifier
grep -n "APFEL=" agents/audit/05-vision.md
grep -n "🍏" agents/audit/05-vision.md
Attendu : lignes présentes.
- Step 6 : Commit
git add agents/audit/05-vision.md
git commit -m "feat(apfel): intégration dans vision (extraction TODOs)"
Task 6 : Patcher agents/session/11-robocop.md
Fichiers :
- Modifier :
agents/session/11-robocop.md
Contexte : robocop lit des fichiers pour comprendre le contexte d’erreur. Apfel peut résumer ces fichiers avant investigation.
- Step 1 : Lire la structure de robocop
grep -n "^## Phase\|^### \|lire\|Lire\|fichier\|Read" agents/session/11-robocop.md | head -30
- Step 2 : Ajouter détection APFEL en Phase 1
Après la première ligne ## Phase 1, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Ajouter délégation résumé contexte erreur**
Dans la phase de lecture du fichier source de l'erreur, ajouter :
```markdown
**Résumé contexte** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "$file" "summarize the purpose of this file and identify any obvious errors or issues. 5 lines max."
# Ajouter à APFEL_LOG : "résumé contexte erreur|$file|~300"
Sinon : lire et analyser directement.
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport final**
Ajouter dans le rapport de clôture de robocop :
```markdown
🍏 Apfel — N invocations (~N tokens économisés)
• résumé contexte (fichier)
→ Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/session/11-robocop.md
grep -n "🍏" agents/session/11-robocop.md
- Step 6 : Commit
git add agents/session/11-robocop.md
git commit -m "feat(apfel): intégration dans robocop (résumé contexte erreur)"
Task 7 : Patcher agents/docs/01-shuri.md
Fichiers :
- Modifier :
agents/docs/01-shuri.md
Contexte : shuri lit beaucoup de fichiers de config pour détecter la stack. Apfel peut classifier et extraire le frontmatter.
- Step 1 : Lire la structure de shuri
grep -n "^## Phase\|^### \|stack\|config\|frontmatter\|Rapport\|rapport" agents/docs/01-shuri.md | head -40
- Step 2 : Ajouter détection APFEL en début de Phase 1
Après la première ligne ## Phase 1, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Ajouter délégation classification stack**
Dans la phase de lecture des fichiers config (`package.json`, `pyproject.toml`, etc.), ajouter :
```markdown
**Classification stack** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "package.json" "what framework and language? main scripts? key dependencies? 3 lines."
# Ajouter à APFEL_LOG : "classification stack|package.json|~500"
Sinon : lire et analyser directement.
Extraction frontmatter YAML (fichiers .md) : Si APFEL=yes :
apfel -q -f "$file" "extract YAML frontmatter as JSON"
# Ajouter à APFEL_LOG : "frontmatter|$file|~200"
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport final**
Ajouter dans le rapport de shuri :
```markdown
🍏 Apfel — N invocations (~N tokens économisés)
• classification stack (package.json)
• frontmatter (N fichiers)
→ Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/docs/01-shuri.md
grep -n "🍏" agents/docs/01-shuri.md
- Step 6 : Commit
git add agents/docs/01-shuri.md
git commit -m "feat(apfel): intégration dans shuri (classification stack + frontmatter)"
Task 8 : Patcher agents/docs/09-friday.md
Fichiers :
- Modifier :
agents/docs/09-friday.md
Contexte : friday a déjà un commentaire > Optimisation apfel en Phase C1. Transformer en implémentation réelle.
- Step 1 : Localiser le commentaire existant
grep -n "apfel\|Optimisation\|C1\|Rapport\|rapport" agents/docs/09-friday.md | head -20
- Step 2 : Ajouter détection APFEL avant Phase C1
Avant ## Phase C1 : Exploration des sources, ajouter :
### Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Remplacer le commentaire Phase C1 par une implémentation réelle**
Remplacer le bloc `> **Optimisation apfel** : Si \`command -v apfel\`...` par :
```markdown
**Résumé des sources via apfel** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
# README.md
apfel -q -f README.md "extract: project purpose, install steps, usage. Max 5 lines."
# Ajouter à APFEL_LOG : "résumé README|README.md|~300"
# package.json
apfel -q -f package.json "name, version, main scripts, key dependencies. Max 5 lines."
# Ajouter à APFEL_LOG : "résumé package.json|package.json|~300"
Sinon : lire les fichiers complets et extraire manuellement.
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport final**
Ajouter à la fin du rapport de friday (mode context) :
```markdown
🍏 Apfel — N invocations (~N tokens économisés)
• résumé README.md
• résumé package.json
→ Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/docs/09-friday.md
grep -n "🍏" agents/docs/09-friday.md
grep -n "apfel-report" agents/docs/09-friday.md
- Step 6 : Commit
git add agents/docs/09-friday.md
git commit -m "feat(apfel): intégration réelle dans friday (phase C1)"
Task 9 : Patcher agents/docs/16-strange.md
Fichiers :
- Modifier :
agents/docs/16-strange.md
Contexte : strange lit de nombreux fichiers source pour reconstruire la documentation. Apfel peut résumer chaque fichier avant analyse.
- Step 1 : Lire la structure de strange
grep -n "^## Phase\|^### \|lire\|Lire\|fichier\|Rapport\|rapport\|résumé" agents/docs/16-strange.md | head -40
- Step 2 : Ajouter détection APFEL en début de Phase 1
Après la première ligne ## Phase 1, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Ajouter délégation résumé fichiers source**
Dans la phase de lecture des fichiers source, ajouter :
```markdown
**Résumé fichiers** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "$file" "summarize in 3 bullets: purpose, inputs, outputs, key functions"
# Ajouter à APFEL_LOG : "résumé source|$file|~400"
Sinon : lire et analyser directement.
Résumé docs existantes : Si APFEL=yes et fichier .md < 200 lignes :
apfel -q -f "$doc" "title, status (complete/draft/stub), 1-line summary"
# Ajouter à APFEL_LOG : "résumé doc|$doc|~150"
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport final**
Ajouter dans le rapport de strange :
```markdown
🍏 Apfel — N invocations (~N tokens économisés)
• résumé source (N fichiers)
• résumé docs (N fichiers)
→ Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/docs/16-strange.md
grep -n "🍏" agents/docs/16-strange.md
- Step 6 : Commit
git add agents/docs/16-strange.md
git commit -m "feat(apfel): intégration dans strange (résumé fichiers source + docs)"
Task 10 : Patcher agents/orchestrators/47-lovecraft.md
Fichiers :
- Modifier :
agents/orchestrators/47-lovecraft.md
Contexte : lovecraft a déjà un commentaire > Optimisation apfel en Phase 1. Transformer en implémentation réelle.
- Step 1 : Localiser le commentaire existant
grep -n "apfel\|Optimisation\|Phase 1\|Rapport\|rapport" agents/orchestrators/47-lovecraft.md | head -20
- Step 2 : Ajouter détection APFEL avant Phase 1
Avant ## Phase 1 : Audit de l'Existant, ajouter :
### Détection apfel (Phase 0)
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Remplacer le commentaire Phase 1 par une implémentation réelle**
Remplacer le bloc `> **Optimisation apfel** : Si \`command -v apfel\`...` par :
```markdown
**Inventaire docs via apfel** : Si `APFEL=yes` :
```bash
for f in docs/*.md; do
[ $(wc -l < "$f") -lt 200 ] && \
echo "=== $f ===" && \
apfel -q -f "$f" "title, status (complete/draft/stub), word count, 1-line summary"
# Ajouter à APFEL_LOG : "inventaire doc|$f|~50"
done
Résultat : inventaire léger (~50 tokens/fichier) au lieu de lire les contenus complets (~500 tokens/fichier).
Sinon : lire chaque fichier et extraire titre + résumé directement.
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport final**
Ajouter dans le rapport de lovecraft :
```markdown
🍏 Apfel — N invocations (~N tokens économisés)
• inventaire docs (N fichiers résumés)
→ Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/orchestrators/47-lovecraft.md
grep -n "🍏" agents/orchestrators/47-lovecraft.md
grep -n "apfel-report" agents/orchestrators/47-lovecraft.md
- Step 6 : Commit
git add agents/orchestrators/47-lovecraft.md
git commit -m "feat(apfel): intégration réelle dans lovecraft (inventaire docs phase 1)"
Task 11 : Patcher agents/audit/45-sargeras.md
Fichiers :
- Modifier :
agents/audit/45-sargeras.md
Contexte : sargeras analyse de nombreux fichiers pour son audit 10-axes. Apfel peut résumer chaque fichier avant analyse approfondie.
- Step 1 : Lire la structure de sargeras
grep -n "^## Phase\|^### \|fichier\|Lire\|lire\|Rapport\|rapport\|score" agents/audit/45-sargeras.md | head -40
- Step 2 : Ajouter détection APFEL en Phase 1
Après la première ligne ## Phase 1, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Ajouter délégation résumé fichiers**
Dans la phase de lecture des fichiers source, ajouter :
```markdown
**Résumé fichiers audit** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "$file" "what framework/language, main responsibility, obvious issues? 3 lines."
# Ajouter à APFEL_LOG : "résumé audit|$file|~300"
Sinon : lire et analyser directement.
Détection dette technique : Si APFEL=yes :
apfel -q -f "$file" "list TODO, FIXME, HACK, deprecated calls, obvious code smells. Format: LINE:TYPE:TEXT"
# Ajouter à APFEL_LOG : "dette technique|$file|~400"
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport de sargeras**
Ajouter dans le rapport `docs/audits/sargeras-YYYY-MM-DD.md` une section :
```markdown
## Apfel
- Invocations : N
- Tokens économisés : ~N
- Fichiers résumés : N
- Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/audit/45-sargeras.md
grep -n "🍏\|## Apfel" agents/audit/45-sargeras.md
- Step 6 : Commit
git add agents/audit/45-sargeras.md
git commit -m "feat(apfel): intégration dans sargeras (résumé fichiers + dette technique)"
Task 12 : Patcher agents/audit/52-ed209.md
Fichiers :
- Modifier :
agents/audit/52-ed209.md
Contexte : ed209 fait un audit de sécurité et scanne les fichiers pour des secrets/tokens. Apfel est particulièrement adapté pour cette tâche.
- Step 1 : Lire la structure d’ed209
grep -n "^## Phase\|^### \|secret\|token\|API key\|Rapport\|rapport\|scan" agents/audit/52-ed209.md | head -40
- Step 2 : Ajouter détection APFEL en Phase 1
Après la première ligne ## Phase 1, ajouter :
### 1.0 — Détection apfel
```bash
APFEL=$(command -v apfel >/dev/null 2>&1 && echo "yes" || echo "no")
- [ ] **Step 3 : Ajouter délégation détection secrets**
Dans la phase de scan des secrets, ajouter :
```markdown
**Détection secrets via apfel** : Si `APFEL=yes` et fichier < 200 lignes :
```bash
apfel -q -f "$file" "any hardcoded passwords, API keys, tokens, private keys, connection strings? List with line numbers. Format: LINE:TYPE:VALUE_REDACTED"
# Ajouter à APFEL_LOG : "détection secrets|$file|~500"
Sinon : lire et scanner directement les patterns regex.
Classification sécurité fichier : Si APFEL=yes :
apfel -q -f "$file" "security-relevant? rate 1-5 (1=config/doc, 5=auth/crypto/secrets). One word + reason."
# Ajouter à APFEL_LOG : "classification sécurité|$file|~200"
- [ ] **Step 4 : Ajouter section 🍏 dans le rapport ed209**
Ajouter dans le rapport `docs/audits/ed209-YYYY-MM-DD.md` :
```markdown
## Apfel
- Invocations : N
- Tokens économisés : ~N
- Fichiers scannés pour secrets : N
- Log : docs/apfel-report.md
- Step 5 : Vérifier
grep -n "APFEL=" agents/audit/52-ed209.md
grep -n "🍏\|## Apfel" agents/audit/52-ed209.md
- Step 6 : Commit
git add agents/audit/52-ed209.md
git commit -m "feat(apfel): intégration dans ed209 (détection secrets + classification sécurité)"
Task 13 : Vérification finale
- Step 1 : Vérifier que tous les agents ont APFEL= et 🍏
for f in \
agents/session/00-godspeed.md \
agents/session/08-2b3.md \
agents/audit/05-vision.md \
agents/session/11-robocop.md \
agents/docs/01-shuri.md \
agents/docs/09-friday.md \
agents/docs/16-strange.md \
agents/orchestrators/47-lovecraft.md \
agents/audit/45-sargeras.md \
agents/audit/52-ed209.md; do
echo "=== $f ==="
grep -c "APFEL=" "$f" && grep -c "🍏\|apfel-report" "$f"
done
Attendu : chaque fichier a au moins 1 ligne APFEL= et 1 ligne 🍏 ou apfel-report.
- Step 2 : Vérifier docs/apfel-report.md
grep "apfel:stats" docs/apfel-report.md
grep "total_calls" docs/apfel-report.md
Attendu : 2 lignes trouvées.
- Step 3 : Vérifier apfel-protocol.md
grep -c "Pattern Standard\|apfel-report\|APFEL=" agents/_shared/apfel-protocol.md
Attendu : 3+ lignes.
- Step 4 : Commit final
git add -p # vérifier qu'il n'y a rien de non voulu
git commit -m "feat(apfel): intégration complète — 10 agents + protocol + log"
Récapitulatif
| Task | Fichier | Statut |
|---|---|---|
| 1 | _shared/apfel-protocol.md | [ ] |
| 2 | docs/apfel-report.md | [ ] |
| 3 | session/00-godspeed.md | [ ] |
| 4 | session/08-2b3.md | [ ] |
| 5 | audit/05-vision.md | [ ] |
| 6 | session/11-robocop.md | [ ] |
| 7 | docs/01-shuri.md | [ ] |
| 8 | docs/09-friday.md | [ ] |
| 9 | docs/16-strange.md | [ ] |
| 10 | orchestrators/47-lovecraft.md | [ ] |
| 11 | audit/45-sargeras.md | [ ] |
| 12 | audit/52-ed209.md | [ ] |
| 13 | Vérification finale | [ ] |