@the-bearded-bear/claude-craft 3.5.0-next.0f69fca → 3.5.0-next.1b49d4c
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.
- package/Dev/scripts/install-angular-rules.sh +203 -284
- package/Dev/scripts/install-csharp-rules.sh +193 -217
- package/Dev/scripts/install-flutter-rules.sh +206 -288
- package/Dev/scripts/install-laravel-rules.sh +209 -298
- package/Dev/scripts/install-php-rules.sh +206 -220
- package/Dev/scripts/install-python-rules.sh +200 -199
- package/Dev/scripts/install-react-rules.sh +204 -253
- package/Dev/scripts/install-reactnative-rules.sh +207 -275
- package/Dev/scripts/install-symfony-rules.sh +635 -356
- package/Dev/scripts/install-vuejs-rules.sh +300 -291
- package/README.md +4 -30
- package/package.json +1 -1
- package/Dev/i18n/en/Python/rules/08-quality-tools.md +0 -572
- package/Dev/i18n/en/Python/rules/11-security-python.md +0 -596
- package/Dev/scripts/tcl-common.sh +0 -329
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# Installation/Mise a jour des regles Claude Code pour projets Angular
|
|
3
|
-
# Version:
|
|
3
|
+
# Version: 1.0.0
|
|
4
4
|
# Usage: ./install-angular-rules.sh [OPTIONS] [PROJECT_DIR]
|
|
5
5
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
|
|
8
|
-
VERSION="3.
|
|
8
|
+
VERSION="3.4.0"
|
|
9
9
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
10
|
I18N_DIR="$(dirname "$SCRIPT_DIR")/i18n"
|
|
11
11
|
TECH_NAME="Angular"
|
|
12
|
-
TECH_DISPLAY_NAME="Angular"
|
|
13
12
|
TECH_NAMESPACE="angular"
|
|
14
|
-
DEFAULT_STACK="Angular
|
|
13
|
+
DEFAULT_STACK="Angular 18+, TypeScript 5+, Standalone Components, Signals, Vitest, Tailwind"
|
|
15
14
|
lang="en"
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
source "${SCRIPT_DIR}/tcl-common.sh"
|
|
19
|
-
|
|
20
|
-
# TCL file mappings: "old_name:new_name"
|
|
21
|
-
TECH_RULE_MAPPINGS=(
|
|
22
|
-
"02-architecture-angular.md:architecture.md"
|
|
23
|
-
"03-coding-standards.md:coding-standards.md"
|
|
24
|
-
"06-tooling.md:tooling.md"
|
|
25
|
-
"07-testing-angular.md:testing.md"
|
|
26
|
-
"08-quality-tools.md:quality-tools.md"
|
|
27
|
-
"11-security-angular.md:security.md"
|
|
28
|
-
)
|
|
16
|
+
PROJECT_SPECIFIC_FILES=("rules/00-project-context.md")
|
|
29
17
|
|
|
30
|
-
#
|
|
18
|
+
# Fichiers tech-specifiques
|
|
31
19
|
TECH_RULES=(
|
|
32
20
|
"02-architecture-angular.md"
|
|
33
21
|
"03-coding-standards.md"
|
|
@@ -37,6 +25,9 @@ TECH_RULES=(
|
|
|
37
25
|
"11-security-angular.md"
|
|
38
26
|
)
|
|
39
27
|
|
|
28
|
+
# Alias pour compatibilite
|
|
29
|
+
COMMON_RULES=("${TECH_RULES[@]}")
|
|
30
|
+
|
|
40
31
|
RED='\033[0;31m'
|
|
41
32
|
GREEN='\033[0;32m'
|
|
42
33
|
YELLOW='\033[1;33m'
|
|
@@ -49,8 +40,10 @@ NC='\033[0m'
|
|
|
49
40
|
load_messages() {
|
|
50
41
|
local lang_file="$I18N_DIR/messages/${lang}.sh"
|
|
51
42
|
if [[ -f "$lang_file" ]]; then
|
|
43
|
+
# shellcheck source=/dev/null
|
|
52
44
|
source "$lang_file"
|
|
53
45
|
elif [[ -f "$I18N_DIR/messages/en.sh" ]]; then
|
|
46
|
+
# shellcheck source=/dev/null
|
|
54
47
|
source "$I18N_DIR/messages/en.sh"
|
|
55
48
|
fi
|
|
56
49
|
}
|
|
@@ -59,30 +52,27 @@ show_help() {
|
|
|
59
52
|
cat << EOF
|
|
60
53
|
Usage: install-angular-rules.sh [OPTIONS] [PROJECT_DIR]
|
|
61
54
|
|
|
62
|
-
Installation/Mise a jour des regles Claude Code pour projets Angular.
|
|
63
|
-
Utilise l'architecture TCL (Tiered Context Loading) pour optimiser les tokens.
|
|
55
|
+
Installation/Mise a jour des regles Claude Code pour projets Angular TypeScript.
|
|
64
56
|
|
|
65
57
|
Options:
|
|
66
58
|
--install Installation complete
|
|
67
59
|
--update Mise a jour des regles communes uniquement
|
|
68
60
|
--force Ecraser tous les fichiers (backup automatique)
|
|
69
|
-
--preserve-config Preserver CLAUDE.md et
|
|
61
|
+
--preserve-config Preserver CLAUDE.md et 00-project-context.md avec --force
|
|
70
62
|
--dry-run Afficher les actions sans les executer
|
|
71
63
|
--backup Creer un backup avant modifications
|
|
72
64
|
--interactive Demander les valeurs du projet
|
|
73
|
-
--lang=XX
|
|
65
|
+
--lang=XX Langue (en, fr, es, de, pt) - default: en
|
|
74
66
|
--version Afficher la version
|
|
75
67
|
--help Afficher cette aide
|
|
76
68
|
|
|
77
69
|
Description:
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
Reduction tokens: ~95% (de ~70K a ~3.5K)
|
|
70
|
+
Regles couvrant :
|
|
71
|
+
- Standalone Components, Signals, OnPush
|
|
72
|
+
- Domain-Driven Architecture
|
|
73
|
+
- TypeScript strict, ESLint, Prettier
|
|
74
|
+
- Vitest/Jest, Cypress
|
|
75
|
+
- State Management, Performance, Security
|
|
86
76
|
EOF
|
|
87
77
|
}
|
|
88
78
|
|
|
@@ -92,6 +82,7 @@ log_warning() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
|
92
82
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
93
83
|
log_dry_run() { echo -e "${YELLOW}[DRY-RUN]${NC} $1"; }
|
|
94
84
|
|
|
85
|
+
# Get source directory (i18n or local fallback)
|
|
95
86
|
get_source_dir() {
|
|
96
87
|
local i18n_src="$I18N_DIR/$lang/$TECH_NAME"
|
|
97
88
|
if [[ -d "$i18n_src" ]]; then
|
|
@@ -106,14 +97,14 @@ verify_source_files() {
|
|
|
106
97
|
local src_dir
|
|
107
98
|
src_dir=$(get_source_dir)
|
|
108
99
|
|
|
109
|
-
for rule in "${
|
|
100
|
+
for rule in "${COMMON_RULES[@]}"; do
|
|
110
101
|
if [ ! -f "${src_dir}/rules/${rule}" ]; then
|
|
111
102
|
log_error "Fichier source manquant: rules/${rule}"
|
|
112
103
|
missing=1
|
|
113
104
|
fi
|
|
114
105
|
done
|
|
115
|
-
if [ ! -f "${src_dir}/
|
|
116
|
-
log_error "Fichier source manquant:
|
|
106
|
+
if [ ! -f "${src_dir}/CLAUDE.md.template" ]; then
|
|
107
|
+
log_error "Fichier source manquant: CLAUDE.md.template"
|
|
117
108
|
missing=1
|
|
118
109
|
fi
|
|
119
110
|
if [ $missing -eq 1 ]; then exit 1; fi
|
|
@@ -122,12 +113,8 @@ verify_source_files() {
|
|
|
122
113
|
detect_installation() {
|
|
123
114
|
local target_dir="$1"
|
|
124
115
|
if [ -d "${target_dir}/.claude" ]; then
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
echo "tcl"
|
|
128
|
-
# Check for legacy structure
|
|
129
|
-
elif [ -f "${target_dir}/.claude/rules/00-project-context.md" ]; then
|
|
130
|
-
echo "legacy"
|
|
116
|
+
if [ -f "${target_dir}/.claude/rules/00-project-context.md" ]; then
|
|
117
|
+
echo "existing"
|
|
131
118
|
else
|
|
132
119
|
echo "partial"
|
|
133
120
|
fi
|
|
@@ -150,6 +137,19 @@ create_backup() {
|
|
|
150
137
|
fi
|
|
151
138
|
}
|
|
152
139
|
|
|
140
|
+
create_directory_structure() {
|
|
141
|
+
local target_dir="$1"
|
|
142
|
+
local dry_run="$2"
|
|
143
|
+
local dirs=(".claude" ".claude/rules" ".claude/templates" ".claude/checklists" ".claude/examples" ".claude/commands/${TECH_NAMESPACE}" ".claude/agents")
|
|
144
|
+
for dir in "${dirs[@]}"; do
|
|
145
|
+
if [ "$dry_run" = "true" ]; then
|
|
146
|
+
log_dry_run "Creer repertoire: ${target_dir}/${dir}"
|
|
147
|
+
else
|
|
148
|
+
mkdir -p "${target_dir}/${dir}"
|
|
149
|
+
fi
|
|
150
|
+
done
|
|
151
|
+
}
|
|
152
|
+
|
|
153
153
|
# Copie des skills generiques depuis Common/
|
|
154
154
|
copy_generic_skills() {
|
|
155
155
|
local target_dir="$1"
|
|
@@ -179,6 +179,38 @@ copy_generic_skills() {
|
|
|
179
179
|
fi
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
# Copie des regles generiques depuis Common/
|
|
183
|
+
copy_generic_rules() {
|
|
184
|
+
local target_dir="$1"
|
|
185
|
+
local dry_run="$2"
|
|
186
|
+
|
|
187
|
+
# First install skills (new format)
|
|
188
|
+
copy_generic_skills "$target_dir" "$dry_run"
|
|
189
|
+
|
|
190
|
+
# Then install legacy rules
|
|
191
|
+
local common_rules_dir="$I18N_DIR/$lang/Common/rules"
|
|
192
|
+
|
|
193
|
+
if [[ ! -d "$common_rules_dir" ]]; then
|
|
194
|
+
return 0
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
local count=0
|
|
198
|
+
for file in "$common_rules_dir"/*.md "$common_rules_dir"/*.md.template; do
|
|
199
|
+
[[ -f "$file" ]] || continue
|
|
200
|
+
local filename=$(basename "$file")
|
|
201
|
+
if [ "$dry_run" = "true" ]; then
|
|
202
|
+
log_dry_run "Copy generic: rules/$filename"
|
|
203
|
+
else
|
|
204
|
+
cp "$file" "${target_dir}/.claude/rules/$filename"
|
|
205
|
+
fi
|
|
206
|
+
((count++)) || true
|
|
207
|
+
done
|
|
208
|
+
|
|
209
|
+
if [ "$dry_run" = "false" ] && [ $count -gt 0 ]; then
|
|
210
|
+
log_success "$count generic rules copied from Common/"
|
|
211
|
+
fi
|
|
212
|
+
}
|
|
213
|
+
|
|
182
214
|
# Copie des skills tech-specifiques
|
|
183
215
|
copy_tech_skills() {
|
|
184
216
|
local target_dir="$1"
|
|
@@ -210,6 +242,42 @@ copy_tech_skills() {
|
|
|
210
242
|
fi
|
|
211
243
|
}
|
|
212
244
|
|
|
245
|
+
copy_common_rules() {
|
|
246
|
+
local target_dir="$1"
|
|
247
|
+
local dry_run="$2"
|
|
248
|
+
local src_dir
|
|
249
|
+
src_dir=$(get_source_dir)
|
|
250
|
+
|
|
251
|
+
# D'abord, installer les regles et skills generiques
|
|
252
|
+
copy_generic_rules "$target_dir" "$dry_run"
|
|
253
|
+
|
|
254
|
+
# Installer les skills tech-specifiques
|
|
255
|
+
copy_tech_skills "$target_dir" "$dry_run"
|
|
256
|
+
|
|
257
|
+
# Ensuite, installer les regles tech-specifiques
|
|
258
|
+
local count=0
|
|
259
|
+
for rule in "${TECH_RULES[@]}"; do
|
|
260
|
+
local src_file="${src_dir}/rules/${rule}"
|
|
261
|
+
# Fallback to local if i18n not available
|
|
262
|
+
if [ ! -f "$src_file" ]; then
|
|
263
|
+
src_file="${SCRIPT_DIR}/rules/${rule}"
|
|
264
|
+
fi
|
|
265
|
+
if [ ! -f "$src_file" ]; then
|
|
266
|
+
log_warning "Rule not found: $rule"
|
|
267
|
+
continue
|
|
268
|
+
fi
|
|
269
|
+
if [ "$dry_run" = "true" ]; then
|
|
270
|
+
log_dry_run "Copier: rules/${rule}"
|
|
271
|
+
else
|
|
272
|
+
cp "$src_file" "${target_dir}/.claude/rules/${rule}"
|
|
273
|
+
fi
|
|
274
|
+
((count++)) || true
|
|
275
|
+
done
|
|
276
|
+
if [ "$dry_run" = "false" ] && [ $count -gt 0 ]; then
|
|
277
|
+
log_success "$count Angular-specific rules copied"
|
|
278
|
+
fi
|
|
279
|
+
}
|
|
280
|
+
|
|
213
281
|
copy_templates() {
|
|
214
282
|
local target_dir="$1"
|
|
215
283
|
local dry_run="$2"
|
|
@@ -222,9 +290,9 @@ copy_templates() {
|
|
|
222
290
|
|
|
223
291
|
if [ -d "$tmpl_dir" ]; then
|
|
224
292
|
if [ "$dry_run" = "true" ]; then
|
|
225
|
-
log_dry_run "Copier: templates
|
|
293
|
+
log_dry_run "Copier: templates/*"
|
|
226
294
|
else
|
|
227
|
-
cp "${tmpl_dir}/"
|
|
295
|
+
cp "${tmpl_dir}/"* "${target_dir}/.claude/templates/" 2>/dev/null || true
|
|
228
296
|
log_success "Templates copies"
|
|
229
297
|
fi
|
|
230
298
|
fi
|
|
@@ -286,7 +354,8 @@ copy_agents() {
|
|
|
286
354
|
log_dry_run "Copier: agents/*.md"
|
|
287
355
|
else
|
|
288
356
|
cp "${agt_dir}/"*.md "${target_dir}/.claude/agents/" 2>/dev/null || true
|
|
289
|
-
|
|
357
|
+
local count=$(ls -1 "${agt_dir}/"*.md 2>/dev/null | wc -l)
|
|
358
|
+
log_success "${count} agents copies"
|
|
290
359
|
fi
|
|
291
360
|
fi
|
|
292
361
|
}
|
|
@@ -307,249 +376,75 @@ prompt_project_info() {
|
|
|
307
376
|
fi
|
|
308
377
|
}
|
|
309
378
|
|
|
310
|
-
|
|
311
|
-
# TCL INSTALLATION
|
|
312
|
-
# ============================================================================
|
|
313
|
-
install_tcl() {
|
|
379
|
+
process_templates() {
|
|
314
380
|
local target_dir="$1"
|
|
315
381
|
local project_name="$2"
|
|
316
382
|
local tech_stack="$3"
|
|
317
383
|
local dry_run="$4"
|
|
318
384
|
local preserve_config="${5:-false}"
|
|
319
|
-
local
|
|
385
|
+
local generation_date=$(date +%Y-%m-%d)
|
|
320
386
|
local src_dir
|
|
321
387
|
src_dir=$(get_source_dir)
|
|
322
388
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
# 2. Copy base references (universal principles)
|
|
327
|
-
if [ "$skip_common" = "false" ]; then
|
|
328
|
-
copy_base_references "$target_dir" "$I18N_DIR" "$lang" "$dry_run"
|
|
329
|
-
fi
|
|
330
|
-
|
|
331
|
-
# 3. Copy tech-specific references
|
|
332
|
-
copy_tech_references "$target_dir" "$src_dir" "$TECH_NAMESPACE" "$dry_run" "${TECH_RULE_MAPPINGS[@]}"
|
|
389
|
+
local claude_md="${target_dir}/.claude/CLAUDE.md"
|
|
390
|
+
local project_context="${target_dir}/.claude/rules/00-project-context.md"
|
|
333
391
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if [ -f "$
|
|
392
|
+
if [ "$dry_run" = "true" ]; then
|
|
393
|
+
log_dry_run "Generer CLAUDE.md et 00-project-context.md"
|
|
394
|
+
else
|
|
395
|
+
if [ -f "$claude_md" ] && [ "$preserve_config" = "true" ]; then
|
|
396
|
+
log_info "Preserved: CLAUDE.md (--preserve-config)"
|
|
397
|
+
else
|
|
338
398
|
sed -e "s/{{PROJECT_NAME}}/${project_name}/g" \
|
|
339
399
|
-e "s/{{TECH_STACK}}/${tech_stack}/g" \
|
|
340
|
-
|
|
341
|
-
|
|
400
|
+
-e "s/{{GENERATION_DATE}}/${generation_date}/g" \
|
|
401
|
+
-e "s/{{ANGULAR_VERSION}}/18+/g" \
|
|
402
|
+
"${src_dir}/CLAUDE.md.template" > "$claude_md"
|
|
403
|
+
log_success "CLAUDE.md genere"
|
|
342
404
|
fi
|
|
343
|
-
fi
|
|
344
405
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
406
|
+
if [ -f "$project_context" ] && [ "$preserve_config" = "true" ]; then
|
|
407
|
+
log_info "Preserved: 00-project-context.md (--preserve-config)"
|
|
408
|
+
else
|
|
409
|
+
sed -e "s/{{PROJECT_NAME}}/${project_name}/g" \
|
|
410
|
+
-e "s/{{TECH_STACK}}/${tech_stack}/g" \
|
|
411
|
+
-e "s/{{ANGULAR_VERSION}}/18+/g" \
|
|
412
|
+
"${src_dir}/rules/00-project-context.md.template" > "$project_context"
|
|
413
|
+
log_success "00-project-context.md genere"
|
|
414
|
+
fi
|
|
348
415
|
fi
|
|
349
|
-
|
|
416
|
+
}
|
|
350
417
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
│ ├── components/
|
|
382
|
-
│ ├── services/
|
|
383
|
-
│ ├── models/
|
|
384
|
-
│ └── feature-name.module.ts
|
|
385
|
-
├── app.module.ts # Root module
|
|
386
|
-
└── app-routing.module.ts
|
|
387
|
-
\`\`\`
|
|
388
|
-
|
|
389
|
-
**Dependency Rule**: features -> shared -> core (NO circular dependencies)"
|
|
390
|
-
|
|
391
|
-
local coding_standards_summary="| Element | Convention | Example |
|
|
392
|
-
|---------|-----------|---------|
|
|
393
|
-
| Components | PascalCase + Suffix | \`UserProfileComponent\` |
|
|
394
|
-
| Services | PascalCase + Suffix | \`AuthService\` |
|
|
395
|
-
| Pipes | camelCase | \`dateFormat\` |
|
|
396
|
-
| Directives | camelCase | \`highlight\` |
|
|
397
|
-
| Files | kebab-case | \`user-profile.component.ts\` |
|
|
398
|
-
|
|
399
|
-
**Always**: Strict TypeScript, OnPush change detection, trackBy for ngFor."
|
|
400
|
-
|
|
401
|
-
local testing_stack="**Angular Stack**: Jasmine + Karma + Angular Testing Library + Cypress (E2E)"
|
|
402
|
-
|
|
403
|
-
local tech_references="- \`${TECH_NAMESPACE}/architecture.md\` - Module-based architecture
|
|
404
|
-
- \`${TECH_NAMESPACE}/coding-standards.md\` - TypeScript & Angular style guide
|
|
405
|
-
- \`${TECH_NAMESPACE}/testing.md\` - Jasmine/Karma patterns
|
|
406
|
-
- \`${TECH_NAMESPACE}/tooling.md\` - Angular CLI, ESLint, Prettier
|
|
407
|
-
- \`${TECH_NAMESPACE}/quality-tools.md\` - Linting & formatting
|
|
408
|
-
- \`${TECH_NAMESPACE}/security.md\` - Angular security best practices"
|
|
409
|
-
|
|
410
|
-
generate_index_md "$target_dir" "$TECH_DISPLAY_NAME" "$tech_stack" "$TECH_NAMESPACE" \
|
|
411
|
-
"$architecture_summary" "$coding_standards_summary" "$testing_stack" \
|
|
412
|
-
"$tech_references" "$dry_run" "$preserve_config"
|
|
413
|
-
|
|
414
|
-
# 9. Generate context.yaml
|
|
415
|
-
local file_contexts=" # Angular components
|
|
416
|
-
\"*.component.ts\":
|
|
417
|
-
suggest_skills:
|
|
418
|
-
- solid-principles
|
|
419
|
-
- kiss-dry-yagni
|
|
420
|
-
auto_load: false
|
|
421
|
-
quick_tips: |
|
|
422
|
-
Use OnPush change detection strategy.
|
|
423
|
-
Keep components small and focused.
|
|
424
|
-
Use trackBy for ngFor loops.
|
|
425
|
-
|
|
426
|
-
# Angular services
|
|
427
|
-
\"*.service.ts\":
|
|
428
|
-
suggest_skills:
|
|
429
|
-
- solid-principles
|
|
430
|
-
auto_load: false
|
|
431
|
-
quick_tips: |
|
|
432
|
-
Use providedIn: 'root' for singletons.
|
|
433
|
-
Return Observables, not Promises.
|
|
434
|
-
Use dependency injection properly.
|
|
435
|
-
|
|
436
|
-
# Angular modules
|
|
437
|
-
\"*.module.ts\":
|
|
438
|
-
suggest_skills:
|
|
439
|
-
- solid-principles
|
|
440
|
-
auto_load: false
|
|
441
|
-
quick_tips: |
|
|
442
|
-
Keep modules focused (feature modules).
|
|
443
|
-
Use lazy loading for feature modules.
|
|
444
|
-
Export only what's needed.
|
|
445
|
-
|
|
446
|
-
# Angular pipes
|
|
447
|
-
\"*.pipe.ts\":
|
|
448
|
-
suggest_skills:
|
|
449
|
-
- kiss-dry-yagni
|
|
450
|
-
auto_load: false
|
|
451
|
-
quick_tips: |
|
|
452
|
-
Make pipes pure when possible.
|
|
453
|
-
Keep transformation logic simple.
|
|
454
|
-
|
|
455
|
-
# Angular directives
|
|
456
|
-
\"*.directive.ts\":
|
|
457
|
-
suggest_skills:
|
|
458
|
-
- solid-principles
|
|
459
|
-
auto_load: false
|
|
460
|
-
quick_tips: |
|
|
461
|
-
Use HostBinding and HostListener.
|
|
462
|
-
Keep directives single-purpose.
|
|
463
|
-
|
|
464
|
-
# Angular guards
|
|
465
|
-
\"*.guard.ts\":
|
|
466
|
-
suggest_skills:
|
|
467
|
-
- security
|
|
468
|
-
auto_load: false
|
|
469
|
-
quick_tips: |
|
|
470
|
-
Return Observable<boolean> or UrlTree.
|
|
471
|
-
Handle authentication and authorization.
|
|
472
|
-
|
|
473
|
-
# Angular interceptors
|
|
474
|
-
\"*.interceptor.ts\":
|
|
475
|
-
suggest_skills:
|
|
476
|
-
- security
|
|
477
|
-
auto_load: false
|
|
478
|
-
quick_tips: |
|
|
479
|
-
Handle errors globally.
|
|
480
|
-
Add auth tokens consistently.
|
|
481
|
-
Implement retry logic.
|
|
482
|
-
|
|
483
|
-
# Angular resolvers
|
|
484
|
-
\"*.resolver.ts\":
|
|
485
|
-
suggest_skills:
|
|
486
|
-
- solid-principles
|
|
487
|
-
auto_load: false
|
|
488
|
-
quick_tips: |
|
|
489
|
-
Pre-fetch data before route activation.
|
|
490
|
-
Handle loading states properly.
|
|
491
|
-
|
|
492
|
-
# Test files
|
|
493
|
-
\"*.spec.ts\":
|
|
494
|
-
suggest_skills:
|
|
495
|
-
- testing
|
|
496
|
-
auto_load: false
|
|
497
|
-
quick_tips: |
|
|
498
|
-
TDD: RED -> GREEN -> REFACTOR
|
|
499
|
-
Use TestBed for Angular testing.
|
|
500
|
-
Mock services and HTTP calls.
|
|
501
|
-
|
|
502
|
-
# E2E test files
|
|
503
|
-
\"*.cy.ts\":
|
|
504
|
-
suggest_skills:
|
|
505
|
-
- testing
|
|
506
|
-
auto_load: false
|
|
507
|
-
quick_tips: |
|
|
508
|
-
Test user flows end-to-end.
|
|
509
|
-
Use data-testid attributes.
|
|
510
|
-
Avoid flaky selectors.
|
|
511
|
-
|
|
512
|
-
\"**/*.e2e-spec.ts\":
|
|
513
|
-
suggest_skills:
|
|
514
|
-
- testing
|
|
515
|
-
auto_load: false
|
|
516
|
-
|
|
517
|
-
# TypeScript files (general)
|
|
518
|
-
\"*.ts\":
|
|
519
|
-
suggest_skills:
|
|
520
|
-
- solid-principles
|
|
521
|
-
- kiss-dry-yagni
|
|
522
|
-
auto_load: false
|
|
523
|
-
quick_tips: |
|
|
524
|
-
Strict TypeScript mode required.
|
|
525
|
-
Use interfaces for contracts.
|
|
526
|
-
Avoid 'any' type.
|
|
527
|
-
|
|
528
|
-
# HTML templates
|
|
529
|
-
\"*.component.html\":
|
|
530
|
-
suggest_skills:
|
|
531
|
-
- security
|
|
532
|
-
auto_load: false
|
|
533
|
-
quick_tips: |
|
|
534
|
-
Avoid complex logic in templates.
|
|
535
|
-
Use async pipe for observables.
|
|
536
|
-
Sanitize user input.
|
|
537
|
-
|
|
538
|
-
# Styles
|
|
539
|
-
\"*.component.scss\":
|
|
540
|
-
auto_load: false
|
|
541
|
-
quick_tips: |
|
|
542
|
-
Use BEM naming convention.
|
|
543
|
-
Leverage Angular Material theming.
|
|
544
|
-
Keep component styles scoped.
|
|
545
|
-
|
|
546
|
-
# Documentation
|
|
547
|
-
\"*.md\":
|
|
548
|
-
suggest_skills:
|
|
549
|
-
- documentation
|
|
550
|
-
auto_load: false"
|
|
551
|
-
|
|
552
|
-
generate_context_yaml "$target_dir" "$file_contexts" "$dry_run" "$preserve_config"
|
|
418
|
+
show_summary() {
|
|
419
|
+
local target_dir="$1"
|
|
420
|
+
local src_dir
|
|
421
|
+
src_dir=$(get_source_dir)
|
|
422
|
+
local cmd_count=$(ls -1 "${src_dir}/commands/"*.md 2>/dev/null | wc -l)
|
|
423
|
+
echo ""
|
|
424
|
+
echo "=========================================="
|
|
425
|
+
echo "Installation ${TECH_NAME} terminee!"
|
|
426
|
+
echo "=========================================="
|
|
427
|
+
echo ""
|
|
428
|
+
echo "Structure creee: ${target_dir}/.claude/"
|
|
429
|
+
echo " - rules/ (${#COMMON_RULES[@]} fichiers)"
|
|
430
|
+
echo " - templates/"
|
|
431
|
+
echo " - checklists/"
|
|
432
|
+
echo " - commands/${TECH_NAMESPACE}/ (${cmd_count} commandes)"
|
|
433
|
+
echo " - agents/"
|
|
434
|
+
echo ""
|
|
435
|
+
echo "Commandes disponibles:"
|
|
436
|
+
echo " /${TECH_NAMESPACE}:check-compliance Audit complet (score /100)"
|
|
437
|
+
echo " /${TECH_NAMESPACE}:check-architecture Architecture seule"
|
|
438
|
+
echo " /${TECH_NAMESPACE}:check-code-quality Qualite code"
|
|
439
|
+
echo " /${TECH_NAMESPACE}:check-testing Tests"
|
|
440
|
+
echo " /${TECH_NAMESPACE}:check-security Securite"
|
|
441
|
+
echo " /${TECH_NAMESPACE}:generate-component Generer composant"
|
|
442
|
+
echo ""
|
|
443
|
+
echo "Prochaines etapes:"
|
|
444
|
+
echo " 1. Editer .claude/rules/00-project-context.md"
|
|
445
|
+
echo " 2. Personnaliser .claude/CLAUDE.md"
|
|
446
|
+
echo " 3. Redemarrer Claude Code pour charger les commandes"
|
|
447
|
+
echo ""
|
|
553
448
|
}
|
|
554
449
|
|
|
555
450
|
main() {
|
|
@@ -573,12 +468,13 @@ main() {
|
|
|
573
468
|
esac
|
|
574
469
|
done
|
|
575
470
|
|
|
471
|
+
# Load i18n messages after lang is set
|
|
576
472
|
load_messages
|
|
577
473
|
|
|
578
474
|
[ "$target_dir" != "." ] && [ -d "$target_dir" ] && target_dir="$(cd "${target_dir}" && pwd)" || target_dir="$(pwd)"
|
|
579
475
|
|
|
580
476
|
echo ""
|
|
581
|
-
echo "Installation des regles Claude Code - ${TECH_NAME}
|
|
477
|
+
echo "Installation des regles Claude Code - ${TECH_NAME}"
|
|
582
478
|
echo "=========================================="
|
|
583
479
|
echo "Version: ${VERSION}"
|
|
584
480
|
echo "Repertoire: ${target_dir}"
|
|
@@ -587,9 +483,8 @@ main() {
|
|
|
587
483
|
|
|
588
484
|
if [ -z "$mode" ]; then
|
|
589
485
|
case $(detect_installation "$target_dir") in
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
*) log_info "Nouvelle installation TCL"; mode="install" ;;
|
|
486
|
+
existing) log_info "Installation existante -> mode update"; mode="update" ;;
|
|
487
|
+
*) log_info "Nouvelle installation"; mode="install" ;;
|
|
593
488
|
esac
|
|
594
489
|
fi
|
|
595
490
|
|
|
@@ -598,27 +493,51 @@ main() {
|
|
|
598
493
|
case $mode in
|
|
599
494
|
install)
|
|
600
495
|
[ "$interactive" = "true" ] && prompt_project_info || { PROJECT_NAME="${PROJECT_NAME:-MonProjet}"; TECH_STACK="${TECH_STACK:-${DEFAULT_STACK}}"; }
|
|
601
|
-
|
|
496
|
+
create_directory_structure "$target_dir" "$dry_run"
|
|
497
|
+
if [ "$skip_common" = "false" ]; then
|
|
498
|
+
copy_common_rules "$target_dir" "$dry_run"
|
|
499
|
+
else
|
|
500
|
+
log_info "Skipping common rules (multi-tech mode)"
|
|
501
|
+
fi
|
|
502
|
+
copy_templates "$target_dir" "$dry_run"
|
|
503
|
+
copy_checklists "$target_dir" "$dry_run"
|
|
504
|
+
copy_commands "$target_dir" "$dry_run"
|
|
505
|
+
copy_agents "$target_dir" "$dry_run"
|
|
506
|
+
process_templates "$target_dir" "$PROJECT_NAME" "$TECH_STACK" "$dry_run" "$preserve_config"
|
|
602
507
|
;;
|
|
603
508
|
update)
|
|
604
509
|
if [ "$force" = "true" ]; then
|
|
605
510
|
log_warning "Mode force: TOUS les fichiers seront ecrases"
|
|
606
511
|
[ "$interactive" = "true" ] && prompt_project_info || { PROJECT_NAME="${PROJECT_NAME:-MonProjet}"; TECH_STACK="${TECH_STACK:-${DEFAULT_STACK}}"; }
|
|
607
|
-
|
|
512
|
+
create_directory_structure "$target_dir" "$dry_run"
|
|
513
|
+
if [ "$skip_common" = "false" ]; then
|
|
514
|
+
copy_common_rules "$target_dir" "$dry_run"
|
|
515
|
+
else
|
|
516
|
+
log_info "Skipping common rules (multi-tech mode)"
|
|
517
|
+
fi
|
|
518
|
+
copy_templates "$target_dir" "$dry_run"
|
|
519
|
+
copy_checklists "$target_dir" "$dry_run"
|
|
520
|
+
copy_commands "$target_dir" "$dry_run"
|
|
521
|
+
copy_agents "$target_dir" "$dry_run"
|
|
522
|
+
process_templates "$target_dir" "$PROJECT_NAME" "$TECH_STACK" "$dry_run" "$preserve_config"
|
|
608
523
|
else
|
|
609
|
-
log_info "Mise a jour des
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
524
|
+
log_info "Mise a jour des regles communes..."
|
|
525
|
+
create_directory_structure "$target_dir" "$dry_run"
|
|
526
|
+
if [ "$skip_common" = "false" ]; then
|
|
527
|
+
copy_common_rules "$target_dir" "$dry_run"
|
|
528
|
+
else
|
|
529
|
+
log_info "Skipping common rules (multi-tech mode)"
|
|
530
|
+
fi
|
|
531
|
+
copy_templates "$target_dir" "$dry_run"
|
|
532
|
+
copy_checklists "$target_dir" "$dry_run"
|
|
533
|
+
copy_commands "$target_dir" "$dry_run"
|
|
534
|
+
copy_agents "$target_dir" "$dry_run"
|
|
535
|
+
log_info "Fichiers preserves: 00-project-context.md, CLAUDE.md"
|
|
613
536
|
fi
|
|
614
537
|
;;
|
|
615
538
|
esac
|
|
616
539
|
|
|
617
|
-
if [ "$dry_run" = "false" ]; then
|
|
618
|
-
show_tcl_summary "$target_dir" "$TECH_NAME" "$TECH_NAMESPACE"
|
|
619
|
-
else
|
|
620
|
-
log_dry_run "Fin de la simulation"
|
|
621
|
-
fi
|
|
540
|
+
if [ "$dry_run" = "false" ]; then show_summary "$target_dir"; else log_dry_run "Fin de la simulation"; fi
|
|
622
541
|
}
|
|
623
542
|
|
|
624
543
|
main "$@"
|