create-shhs 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,500 @@
1
+ # SHHS — Guide de Mise à Jour
2
+
3
+ **Version:** 1.1.0
4
+ **Date:** 2026-02-24
5
+
6
+ ---
7
+
8
+ ## Vue d'Ensemble
9
+
10
+ SHHS intègre maintenant un **système de versioning et de mise à jour automatique** similaire à npm ou git.
11
+
12
+ ```bash
13
+ # Installer SHHS
14
+ npx create-shhs
15
+
16
+ # Mettre à jour vers la dernière version
17
+ npx create-shhs update
18
+
19
+ # Prévisualiser les changements sans appliquer
20
+ npx create-shhs update --dry-run
21
+
22
+ # Forcer la mise à jour (écraser modifications locales)
23
+ npx create-shhs update --force
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Comment Ça Marche
29
+
30
+ ### 1. Versioning
31
+
32
+ Chaque installation SHHS inclut un fichier `.ai/.shhs-version` contenant la version installée.
33
+
34
+ **Exemple:**
35
+ ```
36
+ .ai/.shhs-version
37
+ > 1.1.0
38
+ ```
39
+
40
+ ### 2. Détection Automatique
41
+
42
+ La commande `update` compare:
43
+ - **Version installée** (`.ai/.shhs-version`)
44
+ - **Version disponible** (latest npm package)
45
+
46
+ Si versions identiques → message "Already up to date"
47
+
48
+ ### 3. Mise à Jour Sélective
49
+
50
+ **Fichiers TOUJOURS mis à jour** (framework core):
51
+ - `.ai/agents/*.md` — Définitions agents (Architect, Developer, etc.)
52
+ - `.ai/governance/*.md` — Constitution, Definition of Done
53
+ - `.ai/skills/*/skill.md` — Procédures (TDD, Playwright, Context7)
54
+ - `.ai/architecture/governance/fitness/README.md` — Documentation fitness functions
55
+
56
+ **Fichiers PRÉSERVÉS** (contenu utilisateur):
57
+ - `.ai/ADR/*.md` — Vos décisions architecturales
58
+ - `.ai/contracts/*.md` — Vos contrats publics
59
+ - `.ai/features/*.feature` — Vos feature contracts
60
+ - `.ai/reports/*` — Vos rapports
61
+ - `.ai/debt/*` — Vos rapports de dette
62
+ - `ARCHITECTURE.md` — Votre architecture
63
+
64
+ **Fichiers CONDITIONNELS** (mis à jour si non modifiés):
65
+ - `CLAUDE.md` — Si vous n'avez pas modifié, mis à jour
66
+ - `.ai/memory/patterns.md` — Préservé si modifié
67
+ - `.ai/architecture/governance/fitness/config.json` — Préservé (config spécifique projet)
68
+ - `.ai/architecture/governance/fitness/exemptions.json` — Préservé (exemptions projet)
69
+
70
+ ---
71
+
72
+ ## Scénarios d'Utilisation
73
+
74
+ ### Scénario 1: Mise à Jour Simple
75
+
76
+ **Situation:** SHHS 1.0.0 installé, vous voulez passer à 1.1.0
77
+
78
+ ```bash
79
+ cd /path/to/your/project
80
+ npx create-shhs update
81
+ ```
82
+
83
+ **Résultat:**
84
+ ```
85
+ ╔════════════════════════════════════════════════════════╗
86
+ ║ Self-Healing Hybrid Swarm — Update ║
87
+ ╚════════════════════════════════════════════════════════╝
88
+
89
+ Target: /path/to/your/project
90
+ Mode: UPDATE
91
+
92
+ Current version: 1.0.0
93
+ Available version: 1.1.0
94
+
95
+ [1/3] Updating core files
96
+
97
+ ✓ Updated .ai/agents/architect.md
98
+ ✓ Updated .ai/agents/knowledge-curator.md (new)
99
+ ✓ Updated .ai/agents/fitness-enforcer.md (new)
100
+ ✓ Updated .ai/governance/constitution.md (new)
101
+ ...
102
+
103
+ [2/3] Checking user-modifiable files
104
+
105
+ → Preserving ARCHITECTURE.md (user file)
106
+ ⊙ Skipping CLAUDE.md (locally modified, use --force to overwrite)
107
+
108
+ [3/3] Updating version
109
+
110
+ ✓ Version updated: 1.0.0 → 1.1.0
111
+
112
+ ╔════════════════════════════════════════════════════════╗
113
+ ║ Update Summary ║
114
+ ╚════════════════════════════════════════════════════════╝
115
+
116
+ ✓ Updated: 15 files
117
+ ✓ Created: 5 files (new features)
118
+ → Preserved: 8 files (user content)
119
+ ⊙ Skipped: 1 file (modified locally)
120
+ ```
121
+
122
+ ### Scénario 2: Prévisualisation (Dry Run)
123
+
124
+ **Situation:** Vous voulez voir ce qui sera changé avant d'appliquer
125
+
126
+ ```bash
127
+ npx create-shhs update --dry-run
128
+ ```
129
+
130
+ **Résultat:**
131
+ ```
132
+ Mode: DRY RUN
133
+
134
+ → Would update .ai/agents/architect.md
135
+ → Would create .ai/agents/knowledge-curator.md
136
+ → Would preserve ARCHITECTURE.md (user file)
137
+ ...
138
+
139
+ This was a dry run. No files were modified.
140
+ Run without --dry-run to apply changes.
141
+ ```
142
+
143
+ ### Scénario 3: Force Update (Écraser Modifications)
144
+
145
+ **Situation:** Vous avez modifié `CLAUDE.md` mais voulez la version officielle
146
+
147
+ ```bash
148
+ npx create-shhs update --force
149
+ ```
150
+
151
+ **Résultat:**
152
+ ```
153
+ ✓ Updated CLAUDE.md (backup created, was modified)
154
+
155
+ Backups created:
156
+ • CLAUDE.md.backup-1709030400000
157
+ • .ai/agents/architect.md.backup-1709030400000
158
+
159
+ To clean up backups:
160
+ find . -name "*.backup-*" -delete
161
+ ```
162
+
163
+ **Note:** Vos modifications sont sauvegardées dans `.backup-*` files.
164
+
165
+ ### Scénario 4: Déjà à Jour
166
+
167
+ **Situation:** Version installée = version disponible
168
+
169
+ ```bash
170
+ npx create-shhs update
171
+ ```
172
+
173
+ **Résultat:**
174
+ ```
175
+ Current version: 1.1.0
176
+ Available version: 1.1.0
177
+
178
+ ✓ Already up to date!
179
+ Use --force to reinstall anyway
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Gestion des Conflits
185
+
186
+ ### Qu'est-ce qu'un Conflit?
187
+
188
+ Un conflit survient quand:
189
+ 1. Fichier a été modifié localement
190
+ 2. Nouvelle version SHHS modifie aussi ce fichier
191
+ 3. Merge automatique impossible
192
+
193
+ **Exemple:**
194
+ ```
195
+ ⚠ Conflict: .ai/architecture/governance/fitness/rules.json has local changes
196
+ Manual merge required or use --force to overwrite
197
+
198
+ Conflicts requiring manual merge:
199
+ • .ai/architecture/governance/fitness/rules.json
200
+ ```
201
+
202
+ ### Résolution Manuelle
203
+
204
+ **Option 1: Merge manuel**
205
+
206
+ ```bash
207
+ # 1. Voir la nouvelle version
208
+ cat node_modules/create-shhs/template/.ai/architecture/governance/fitness/rules.json
209
+
210
+ # 2. Comparer avec votre version
211
+ diff .ai/architecture/governance/fitness/rules.json \
212
+ node_modules/create-shhs/template/.ai/architecture/governance/fitness/rules.json
213
+
214
+ # 3. Merger manuellement (copier règles pertinentes)
215
+ vim .ai/architecture/governance/fitness/rules.json
216
+
217
+ # 4. Re-exécuter update
218
+ npx create-shhs update
219
+ ```
220
+
221
+ **Option 2: Force update + restauration sélective**
222
+
223
+ ```bash
224
+ # 1. Force update (crée backup)
225
+ npx create-shhs update --force
226
+
227
+ # 2. Restaurer vos règles custom depuis backup
228
+ cp .ai/architecture/governance/fitness/rules.json.backup-* \
229
+ .ai/architecture/governance/fitness/rules.json.old
230
+
231
+ # 3. Merge manuel
232
+ # Combiner rules.json (nouveau) + rules.json.old (vos custom rules)
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Fichiers Particuliers
238
+
239
+ ### `.ai/architecture/governance/fitness/rules.json`
240
+
241
+ **Type:** Merge Required
242
+
243
+ **Pourquoi:** Vous avez probablement ajouté vos propres fitness rules custom. La mise à jour peut ajouter de nouvelles rules framework.
244
+
245
+ **Stratégie:**
246
+ - Update ajoute nouvelles rules standard
247
+ - Préserve vos rules custom
248
+ - Si conflit détecté, merge manuel requis
249
+
250
+ **Format merge:**
251
+ ```json
252
+ {
253
+ "rules": [
254
+ // ⬇️ SHHS framework rules (updated)
255
+ { "id": "cross-domain-db-access", ... },
256
+ { "id": "max-module-dependencies", ... },
257
+
258
+ // ⬇️ Your custom rules (preserved)
259
+ { "id": "your-custom-rule-1", ... },
260
+ { "id": "your-custom-rule-2", ... }
261
+ ]
262
+ }
263
+ ```
264
+
265
+ ### `CLAUDE.md`
266
+
267
+ **Type:** Conditional Update
268
+
269
+ **Logique:**
270
+ - Si non modifié → mis à jour automatiquement
271
+ - Si modifié → skipped (use `--force` to overwrite)
272
+
273
+ **Cas d'usage:**
274
+ - **Ne touchez jamais CLAUDE.md** → toujours à jour automatiquement
275
+ - **Vous avez ajouté notes projet-specific** → préservé, merge manuel si nouvelles features SHHS
276
+
277
+ ### `.ai/memory/patterns.md` & `anti-patterns.md`
278
+
279
+ **Type:** User Content (Preserved)
280
+
281
+ **Stratégie:**
282
+ - Template fournit exemples initiaux
283
+ - Une fois installé, 100% contenu utilisateur
284
+ - Jamais mis à jour automatiquement
285
+
286
+ **Si vous voulez récupérer templates originaux:**
287
+ ```bash
288
+ # Voir template SHHS officiel
289
+ cat node_modules/create-shhs/template/.ai/memory/patterns.md
290
+
291
+ # Copier manuellement si pertinent
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Best Practices
297
+
298
+ ### 1. Commitez Avant Update
299
+
300
+ ```bash
301
+ git status # Vérifier état
302
+ git add .
303
+ git commit -m "chore: before SHHS update"
304
+
305
+ npx create-shhs update
306
+
307
+ git status # Voir ce qui a changé
308
+ git diff # Review changes
309
+ git add .
310
+ git commit -m "chore: update SHHS to v1.1.0"
311
+ ```
312
+
313
+ ### 2. Utilisez Dry Run en Premier
314
+
315
+ ```bash
316
+ # Prévisualiser
317
+ npx create-shhs update --dry-run
318
+
319
+ # Si OK, appliquer
320
+ npx create-shhs update
321
+ ```
322
+
323
+ ### 3. Backups Automatiques
324
+
325
+ L'updater crée automatiquement backups:
326
+ ```
327
+ CLAUDE.md.backup-1709030400000
328
+ .ai/agents/architect.md.backup-1709030400000
329
+ ```
330
+
331
+ **Nettoyage périodique:**
332
+ ```bash
333
+ # Lister backups
334
+ find . -name "*.backup-*"
335
+
336
+ # Supprimer backups > 30 jours
337
+ find . -name "*.backup-*" -mtime +30 -delete
338
+ ```
339
+
340
+ ### 4. Review Changelog
341
+
342
+ Avant update, consultez releases notes:
343
+ ```bash
344
+ # Voir dernières releases GitHub
345
+ open https://github.com/asaje379/shhs/releases
346
+
347
+ # Ou via npm
348
+ npm view create-shhs versions
349
+ ```
350
+
351
+ ---
352
+
353
+ ## Migration Entre Versions Majeures
354
+
355
+ ### Versioning Sémantique
356
+
357
+ SHHS suit semver:
358
+ - **1.0.0 → 1.0.1** (patch): Bug fixes, typos
359
+ - **1.0.0 → 1.1.0** (minor): Nouvelles features, backward compatible
360
+ - **1.0.0 → 2.0.0** (major): Breaking changes
361
+
362
+ ### Breaking Changes (Major Updates)
363
+
364
+ **Exemple: 1.x → 2.0**
365
+
366
+ Changements potentiels:
367
+ - Agents renommés
368
+ - Structure `.ai/` réorganisée
369
+ - Constitution modifiée (nouvelles règles obligatoires)
370
+
371
+ **Process de migration:**
372
+
373
+ ```bash
374
+ # 1. Lire migration guide
375
+ cat node_modules/create-shhs/MIGRATION-v2.md
376
+
377
+ # 2. Dry run pour voir impact
378
+ npx create-shhs update --dry-run
379
+
380
+ # 3. Créer branche migration
381
+ git checkout -b migration/shhs-v2
382
+
383
+ # 4. Appliquer update
384
+ npx create-shhs update
385
+
386
+ # 5. Résoudre conflits manuellement
387
+ # (suivre migration guide)
388
+
389
+ # 6. Tester
390
+ npm test
391
+ npm run validate:all # Si vous avez ces scripts
392
+
393
+ # 7. Merge si OK
394
+ git checkout main
395
+ git merge migration/shhs-v2
396
+ ```
397
+
398
+ ---
399
+
400
+ ## FAQ
401
+
402
+ ### Q: L'update va-t-il écraser mon ARCHITECTURE.md?
403
+
404
+ **R:** Non, jamais. `ARCHITECTURE.md` est considéré 100% contenu utilisateur.
405
+
406
+ ---
407
+
408
+ ### Q: Que faire si update échoue?
409
+
410
+ **R:** Restaurer depuis backup:
411
+
412
+ ```bash
413
+ # Trouver backup le plus récent
414
+ ls -lt | grep backup
415
+
416
+ # Restaurer
417
+ cp CLAUDE.md.backup-1709030400000 CLAUDE.md
418
+
419
+ # Re-essayer avec --dry-run
420
+ npx create-shhs update --dry-run
421
+ ```
422
+
423
+ ---
424
+
425
+ ### Q: Puis-je update seulement certains fichiers?
426
+
427
+ **R:** Pas directement, mais contournement:
428
+
429
+ ```bash
430
+ # 1. Update avec --dry-run pour voir liste
431
+ npx create-shhs update --dry-run > changes.txt
432
+
433
+ # 2. Copier manuellement fichiers voulus
434
+ cp node_modules/create-shhs/template/.ai/agents/architect.md \
435
+ .ai/agents/architect.md
436
+
437
+ # 3. Update version manuellement
438
+ echo "1.1.0" > .ai/.shhs-version
439
+ ```
440
+
441
+ ---
442
+
443
+ ### Q: Update fonctionne-t-il sans internet?
444
+
445
+ **R:** Oui, si package déjà dans cache npm:
446
+
447
+ ```bash
448
+ # Télécharger d'abord
449
+ npm pack create-shhs
450
+
451
+ # Plus tard, offline
452
+ npx create-shhs update
453
+ ```
454
+
455
+ ---
456
+
457
+ ### Q: Puis-je downgrade vers version précédente?
458
+
459
+ **R:** Oui, en spécifiant version npm:
460
+
461
+ ```bash
462
+ # Downgrade vers 1.0.0
463
+ npx create-shhs@1.0.0 update --force
464
+ ```
465
+
466
+ **Attention:** Downgrade peut perdre nouvelles features.
467
+
468
+ ---
469
+
470
+ ## Changelog (Résumé)
471
+
472
+ ### v1.1.0 (2026-02-24)
473
+
474
+ **Nouvelles Features:**
475
+ - ✅ Constitution (`.ai/governance/constitution.md`)
476
+ - ✅ Knowledge Curator agent
477
+ - ✅ Fitness Enforcer agent
478
+ - ✅ Skills (TDD, Playwright, Context7)
479
+ - ✅ Definition of Done (6 merge gates)
480
+ - ✅ Fitness functions (8 règles automatisées)
481
+
482
+ **Breaking Changes:** Aucun
483
+
484
+ **Migration Required:** Non (backward compatible)
485
+
486
+ ---
487
+
488
+ ## Support
489
+
490
+ **Documentation:**
491
+ - Installation: `INSTALLATION-GUIDE.md`
492
+ - Updates: Ce fichier (`UPDATE-GUIDE.md`)
493
+ - Complétion Analysis: `SHHS-COMPLETION-ANALYSIS.md`
494
+
495
+ **Issues:**
496
+ - GitHub: https://github.com/asaje379/shhs/issues
497
+
498
+ ---
499
+
500
+ **END OF UPDATE GUIDE**
package/bin/install.js CHANGED
@@ -18,6 +18,14 @@ const c = (color, text) => `${colors[color]}${text}${colors.reset}`;
18
18
 
19
19
  // Parse arguments
20
20
  const args = process.argv.slice(2);
21
+
22
+ // Check for update command
23
+ if (args[0] === 'update') {
24
+ // Delegate to update.js
25
+ require('./update.js');
26
+ return;
27
+ }
28
+
21
29
  const targetDir = args[0] || process.cwd();
22
30
 
23
31
  // Help flag
@@ -29,6 +37,11 @@ ${c('blue', '╚═════════════════════
29
37
 
30
38
  ${c('bold', 'Usage:')}
31
39
  npx create-shhs [directory]
40
+ npx create-shhs update [options]
41
+
42
+ ${c('bold', 'Commands:')}
43
+ (default) Install SHHS in a directory
44
+ update Update existing SHHS installation
32
45
 
33
46
  ${c('bold', 'Arguments:')}
34
47
  [directory] Target directory (default: current directory)
@@ -37,6 +50,8 @@ ${c('bold', 'Examples:')}
37
50
  npx create-shhs # Install in current directory
38
51
  npx create-shhs . # Install in current directory
39
52
  npx create-shhs /path/to/app # Install in specific directory
53
+ npx create-shhs update # Update current directory
54
+ npx create-shhs update --dry-run # Preview update changes
40
55
 
41
56
  ${c('bold', 'Options:')}
42
57
  -h, --help Show this help message
@@ -178,6 +193,11 @@ if (!isGitRepo) {
178
193
 
179
194
  console.log('');
180
195
 
196
+ // Write version file
197
+ const packageJson = require(path.join(__dirname, '..', 'package.json'));
198
+ const versionFilePath = path.join(target, '.ai', '.shhs-version');
199
+ fs.writeFileSync(versionFilePath, packageJson.version, 'utf-8');
200
+
181
201
  // Success message
182
202
  console.log(`${c('green', '╔════════════════════════════════════════════════════════╗')}`);
183
203
  console.log(`${c('green', '║ Installation Complete ║')}`);