@the-bearded-bear/claude-craft 7.2.0 → 7.3.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.
- package/Dev/scripts/check-prerequisites.sh +28 -33
- package/Dev/scripts/install-from-config.sh +9 -23
- package/Dev/scripts/tcl-common.sh +7 -0
- package/Infra/install-infra-rules.sh +8 -27
- package/Project/install-project-commands.sh +19 -17
- package/README.md +7 -7
- package/cli/index.js +6 -0
- package/cli/lib/check.js +143 -0
- package/cli/lib/help.js +2 -0
- package/package.json +1 -1
|
@@ -16,12 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
set -e
|
|
18
18
|
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
YELLOW='\033[1;33m'
|
|
23
|
-
CYAN='\033[0;36m'
|
|
24
|
-
NC='\033[0m'
|
|
19
|
+
# Shared UI library
|
|
20
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
21
|
+
source "${SCRIPT_DIR}/lib/shell-ui.sh"
|
|
25
22
|
|
|
26
23
|
# Options
|
|
27
24
|
VERBOSE=false
|
|
@@ -34,9 +31,7 @@ for arg in "$@"; do
|
|
|
34
31
|
esac
|
|
35
32
|
done
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
echo -e "${CYAN}║${NC} Claude Craft Prerequisites Check ${CYAN}║${NC}"
|
|
39
|
-
echo -e "${CYAN}╚════════════════════════════════════════════════════════════╝${NC}"
|
|
34
|
+
ui_box "Claude Craft Prerequisites Check"
|
|
40
35
|
echo ""
|
|
41
36
|
|
|
42
37
|
ERRORS=0
|
|
@@ -69,30 +64,30 @@ check() {
|
|
|
69
64
|
if command -v "$cmd" &> /dev/null; then
|
|
70
65
|
if $VERBOSE; then
|
|
71
66
|
local version=$($cmd --version 2>&1 | head -n1)
|
|
72
|
-
|
|
67
|
+
ui_check_ok "$cmd: $version"
|
|
73
68
|
else
|
|
74
|
-
|
|
69
|
+
ui_check_ok "$cmd"
|
|
75
70
|
fi
|
|
76
71
|
return 0
|
|
77
72
|
else
|
|
78
73
|
if [[ "$required" == "required" ]]; then
|
|
79
|
-
|
|
74
|
+
ui_check_fail "$cmd - $description"
|
|
80
75
|
((ERRORS++))
|
|
81
76
|
if $FIX; then
|
|
82
77
|
case $OS in
|
|
83
|
-
macos)
|
|
84
|
-
debian)
|
|
85
|
-
arch)
|
|
86
|
-
*)
|
|
78
|
+
macos) ui_check_info "Fix: $install_macos" ;;
|
|
79
|
+
debian) ui_check_info "Fix: $install_debian" ;;
|
|
80
|
+
arch) ui_check_info "Fix: Check Arch Wiki for $cmd" ;;
|
|
81
|
+
*) ui_check_info "Fix: Install $cmd manually" ;;
|
|
87
82
|
esac
|
|
88
83
|
fi
|
|
89
84
|
else
|
|
90
|
-
|
|
85
|
+
ui_check_warn "$cmd - $description"
|
|
91
86
|
if $FIX; then
|
|
92
87
|
case $OS in
|
|
93
|
-
macos)
|
|
94
|
-
debian)
|
|
95
|
-
*)
|
|
88
|
+
macos) ui_check_info "Install: $install_macos" ;;
|
|
89
|
+
debian) ui_check_info "Install: $install_debian" ;;
|
|
90
|
+
*) ui_check_info "Install: See documentation for $cmd" ;;
|
|
96
91
|
esac
|
|
97
92
|
fi
|
|
98
93
|
fi
|
|
@@ -107,10 +102,10 @@ check_yq_version() {
|
|
|
107
102
|
if echo "$version_output" | grep -q "mikefarah"; then
|
|
108
103
|
return 0
|
|
109
104
|
else
|
|
110
|
-
|
|
105
|
+
ui_check_fail "yq - You have the Python version, need Mike Farah's yq v4"
|
|
111
106
|
if $FIX; then
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
ui_check_info "Fix (macOS): brew install yq"
|
|
108
|
+
ui_check_info "Fix (Linux): sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq"
|
|
114
109
|
fi
|
|
115
110
|
((ERRORS++))
|
|
116
111
|
return 1
|
|
@@ -126,9 +121,9 @@ check_node_version() {
|
|
|
126
121
|
if [[ $version -ge 18 ]]; then
|
|
127
122
|
return 0
|
|
128
123
|
else
|
|
129
|
-
|
|
124
|
+
ui_check_fail "node - Found v$version, need v18+"
|
|
130
125
|
if $FIX; then
|
|
131
|
-
|
|
126
|
+
ui_check_info "Fix: Use nvm to install Node.js 20: nvm install 20 && nvm use 20"
|
|
132
127
|
fi
|
|
133
128
|
((ERRORS++))
|
|
134
129
|
return 1
|
|
@@ -137,7 +132,7 @@ check_node_version() {
|
|
|
137
132
|
return 1
|
|
138
133
|
}
|
|
139
134
|
|
|
140
|
-
echo -e "${
|
|
135
|
+
echo -e "${BOLD}Required Dependencies:${NC}"
|
|
141
136
|
echo ""
|
|
142
137
|
|
|
143
138
|
check "node" "Node.js 18+ for NPX and CLI" \
|
|
@@ -168,7 +163,7 @@ check "git" "Version control" \
|
|
|
168
163
|
"required"
|
|
169
164
|
|
|
170
165
|
echo ""
|
|
171
|
-
echo -e "${
|
|
166
|
+
echo -e "${BOLD}Recommended Dependencies:${NC}"
|
|
172
167
|
echo ""
|
|
173
168
|
|
|
174
169
|
check "docker" "Container runtime" \
|
|
@@ -191,27 +186,27 @@ echo ""
|
|
|
191
186
|
# Check Docker running (if installed)
|
|
192
187
|
if command -v docker &> /dev/null; then
|
|
193
188
|
if docker info &> /dev/null; then
|
|
194
|
-
|
|
189
|
+
ui_check_ok "Docker daemon is running"
|
|
195
190
|
else
|
|
196
|
-
|
|
191
|
+
ui_check_warn "Docker is installed but not running"
|
|
197
192
|
if $FIX; then
|
|
198
|
-
|
|
193
|
+
ui_check_info "Fix: Start Docker Desktop or run: sudo systemctl start docker"
|
|
199
194
|
fi
|
|
200
195
|
fi
|
|
201
196
|
fi
|
|
202
197
|
|
|
203
198
|
echo ""
|
|
204
|
-
|
|
199
|
+
ui_separator
|
|
205
200
|
|
|
206
201
|
if [[ $ERRORS -eq 0 ]]; then
|
|
207
|
-
|
|
202
|
+
ui_success "All required prerequisites are installed!"
|
|
208
203
|
echo ""
|
|
209
204
|
echo "You can now install Claude Craft:"
|
|
210
205
|
echo " npx @the-bearded-bear/claude-craft install ~/my-project --tech=symfony"
|
|
211
206
|
echo ""
|
|
212
207
|
exit 0
|
|
213
208
|
else
|
|
214
|
-
|
|
209
|
+
ui_error "Missing $ERRORS required prerequisite(s)."
|
|
215
210
|
echo ""
|
|
216
211
|
if ! $FIX; then
|
|
217
212
|
echo "Run with --fix to see installation commands:"
|
|
@@ -34,14 +34,8 @@ DEFAULT_CONFIG="${SCRIPT_DIR}/../../claude-projects.yaml"
|
|
|
34
34
|
VALID_TECHS=("symfony" "flutter" "python" "react" "reactnative" "angular" "csharp" "laravel" "vuejs" "docker" "project")
|
|
35
35
|
VALID_LANGS=("en" "fr" "es" "de" "pt")
|
|
36
36
|
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
GREEN='\033[0;32m'
|
|
40
|
-
YELLOW='\033[1;33m'
|
|
41
|
-
BLUE='\033[0;34m'
|
|
42
|
-
CYAN='\033[0;36m'
|
|
43
|
-
BOLD='\033[1m'
|
|
44
|
-
NC='\033[0m'
|
|
37
|
+
# Shared UI library
|
|
38
|
+
source "${SCRIPT_DIR}/lib/shell-ui.sh"
|
|
45
39
|
|
|
46
40
|
# Variables globales
|
|
47
41
|
config_file=""
|
|
@@ -60,22 +54,14 @@ total_commands=0
|
|
|
60
54
|
total_modules=0
|
|
61
55
|
|
|
62
56
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
63
|
-
#
|
|
57
|
+
# Backward-compat aliases (delegate to shell-ui.sh)
|
|
64
58
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
65
|
-
log_info() {
|
|
66
|
-
log_success() {
|
|
67
|
-
log_warning() {
|
|
68
|
-
log_error() {
|
|
69
|
-
log_step() {
|
|
70
|
-
|
|
71
|
-
print_header() {
|
|
72
|
-
echo ""
|
|
73
|
-
echo -e "${BOLD}╔════════════════════════════════════════════════════════════╗${NC}"
|
|
74
|
-
echo -e "${BOLD}║${NC} $1"
|
|
75
|
-
echo -e "${BOLD}╚════════════════════════════════════════════════════════════╝${NC}"
|
|
76
|
-
echo ""
|
|
77
|
-
}
|
|
78
|
-
|
|
59
|
+
log_info() { ui_info "$@"; }
|
|
60
|
+
log_success() { ui_success "$@"; }
|
|
61
|
+
log_warning() { ui_warning "$@"; }
|
|
62
|
+
log_error() { ui_error "$@"; }
|
|
63
|
+
log_step() { ui_info "→ $*"; }
|
|
64
|
+
print_header() { ui_header "$@"; }
|
|
79
65
|
print_section() {
|
|
80
66
|
echo ""
|
|
81
67
|
echo -e "${BOLD}──────────────────────────────────────────────────────────────${NC}"
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
# Version: 3.5.0
|
|
4
4
|
# Shared by all install-*-rules.sh scripts
|
|
5
5
|
|
|
6
|
+
# ============================================================================
|
|
7
|
+
# SHELL-UI GUARD — ensure ui_* functions are available
|
|
8
|
+
# ============================================================================
|
|
9
|
+
if ! type ui_info &>/dev/null; then
|
|
10
|
+
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/lib/shell-ui.sh"
|
|
11
|
+
fi
|
|
12
|
+
|
|
6
13
|
# ============================================================================
|
|
7
14
|
# VERSION
|
|
8
15
|
# ============================================================================
|
|
@@ -17,14 +17,8 @@ TECH_NAME="Docker"
|
|
|
17
17
|
TECH_NAMESPACE="docker"
|
|
18
18
|
lang="en"
|
|
19
19
|
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
# ============================================================================
|
|
23
|
-
RED='\033[0;31m'
|
|
24
|
-
GREEN='\033[0;32m'
|
|
25
|
-
YELLOW='\033[1;33m'
|
|
26
|
-
BLUE='\033[0;34m'
|
|
27
|
-
NC='\033[0m' # No Color
|
|
20
|
+
# Shared UI library
|
|
21
|
+
source "${SCRIPT_DIR}/../Dev/scripts/lib/shell-ui.sh"
|
|
28
22
|
|
|
29
23
|
# ============================================================================
|
|
30
24
|
# FUNCTIONS
|
|
@@ -78,25 +72,12 @@ show_version() {
|
|
|
78
72
|
echo "Docker agents and commands for Claude Code"
|
|
79
73
|
}
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
log_warning() {
|
|
90
|
-
echo -e "${YELLOW}[WARN]${NC} $1"
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
log_error() {
|
|
94
|
-
echo -e "${RED}[ERROR]${NC} $1"
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
log_dry_run() {
|
|
98
|
-
echo -e "${YELLOW}[DRY-RUN]${NC} $1"
|
|
99
|
-
}
|
|
75
|
+
# Backward-compat aliases (delegate to shell-ui.sh)
|
|
76
|
+
log_info() { ui_info "$@"; }
|
|
77
|
+
log_success() { ui_success "$@"; }
|
|
78
|
+
log_warning() { ui_warning "$@"; }
|
|
79
|
+
log_error() { ui_error "$@"; }
|
|
80
|
+
log_dry_run() { ui_dry_run "$@"; }
|
|
100
81
|
|
|
101
82
|
# Get source directory (i18n)
|
|
102
83
|
get_source_dir() {
|
|
@@ -10,6 +10,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
10
10
|
I18N_DIR="$SCRIPT_DIR/i18n"
|
|
11
11
|
lang="en"
|
|
12
12
|
|
|
13
|
+
# Shared UI library
|
|
14
|
+
source "${SCRIPT_DIR}/../Dev/scripts/lib/shell-ui.sh"
|
|
15
|
+
|
|
13
16
|
# Parse arguments
|
|
14
17
|
PROJECT_DIR="."
|
|
15
18
|
skip_common=false
|
|
@@ -48,12 +51,11 @@ get_source_dir() {
|
|
|
48
51
|
|
|
49
52
|
SRC_DIR=$(get_source_dir)
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
echo "
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
echo "Source: $SRC_DIR"
|
|
54
|
+
ui_box "🚀 Project Commands - v${VERSION}"
|
|
55
|
+
echo ""
|
|
56
|
+
ui_info "Language: $lang"
|
|
57
|
+
ui_info "Project directory: $PROJECT_DIR"
|
|
58
|
+
ui_info "Source: $SRC_DIR"
|
|
57
59
|
echo ""
|
|
58
60
|
|
|
59
61
|
# Créer la structure .claude
|
|
@@ -70,13 +72,13 @@ mkdir -p "$PROJECT_DIR/project-management/backlog/tasks"
|
|
|
70
72
|
mkdir -p "$PROJECT_DIR/project-management/sprints"
|
|
71
73
|
mkdir -p "$PROJECT_DIR/project-management/metrics"
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
ui_info "Création de la structure..."
|
|
74
76
|
|
|
75
77
|
# Migration : déplacer les anciens fichiers de commands/ vers commands/project/
|
|
76
78
|
if ls "$CLAUDE_DIR/commands/"*.md 1>/dev/null 2>&1; then
|
|
77
|
-
|
|
79
|
+
ui_info "Migration des anciennes commandes vers commands/project/..."
|
|
78
80
|
mv "$CLAUDE_DIR/commands/"*.md "$CLAUDE_DIR/commands/project/" 2>/dev/null || true
|
|
79
|
-
|
|
81
|
+
ui_success "Migration effectuée"
|
|
80
82
|
fi
|
|
81
83
|
|
|
82
84
|
# Copy project commands from i18n source
|
|
@@ -87,7 +89,7 @@ fi
|
|
|
87
89
|
if [ -d "$CMD_SRC" ]; then
|
|
88
90
|
cp "$CMD_SRC/"*.md "$CLAUDE_DIR/commands/project/" 2>/dev/null || true
|
|
89
91
|
COMMANDS_COUNT=$(ls -1 "$CMD_SRC/"*.md 2>/dev/null | wc -l)
|
|
90
|
-
|
|
92
|
+
ui_success "$COMMANDS_COUNT project commands copied"
|
|
91
93
|
fi
|
|
92
94
|
|
|
93
95
|
# Copy sprint commands from i18n source
|
|
@@ -95,7 +97,7 @@ SPRINT_CMD_SRC="$SRC_DIR/Sprint/commands"
|
|
|
95
97
|
if [ -d "$SPRINT_CMD_SRC" ]; then
|
|
96
98
|
cp "$SPRINT_CMD_SRC/"*.md "$CLAUDE_DIR/commands/sprint/" 2>/dev/null || true
|
|
97
99
|
SPRINT_COUNT=$(ls -1 "$SPRINT_CMD_SRC/"*.md 2>/dev/null | wc -l)
|
|
98
|
-
|
|
100
|
+
ui_success "$SPRINT_COUNT sprint commands copied"
|
|
99
101
|
fi
|
|
100
102
|
|
|
101
103
|
# Copy gate commands from i18n source
|
|
@@ -103,7 +105,7 @@ GATE_CMD_SRC="$SRC_DIR/Gate/commands"
|
|
|
103
105
|
if [ -d "$GATE_CMD_SRC" ]; then
|
|
104
106
|
cp "$GATE_CMD_SRC/"*.md "$CLAUDE_DIR/commands/gate/" 2>/dev/null || true
|
|
105
107
|
GATE_COUNT=$(ls -1 "$GATE_CMD_SRC/"*.md 2>/dev/null | wc -l)
|
|
106
|
-
|
|
108
|
+
ui_success "$GATE_COUNT gate commands copied"
|
|
107
109
|
fi
|
|
108
110
|
|
|
109
111
|
# Copy agents from i18n source
|
|
@@ -114,7 +116,7 @@ fi
|
|
|
114
116
|
if [ -d "$AGT_SRC" ]; then
|
|
115
117
|
cp "$AGT_SRC/"*.md "$CLAUDE_DIR/agents/" 2>/dev/null || true
|
|
116
118
|
AGENTS_COUNT=$(ls -1 "$AGT_SRC/"*.md 2>/dev/null | wc -l)
|
|
117
|
-
|
|
119
|
+
ui_success "$AGENTS_COUNT agents copied"
|
|
118
120
|
fi
|
|
119
121
|
|
|
120
122
|
# Copy templates from i18n source
|
|
@@ -125,7 +127,7 @@ fi
|
|
|
125
127
|
if [ -d "$TPL_SRC" ]; then
|
|
126
128
|
cp "$TPL_SRC/"*.md "$CLAUDE_DIR/templates/project/" 2>/dev/null || true
|
|
127
129
|
TEMPLATES_COUNT=$(ls -1 "$TPL_SRC/"*.md 2>/dev/null | wc -l)
|
|
128
|
-
|
|
130
|
+
ui_success "$TEMPLATES_COUNT templates copied"
|
|
129
131
|
fi
|
|
130
132
|
|
|
131
133
|
# Créer l'index initial du backlog
|
|
@@ -189,7 +191,7 @@ _Aucun sprint actif_
|
|
|
189
191
|
🟡 In Progress
|
|
190
192
|
```
|
|
191
193
|
INDEXMD
|
|
192
|
-
|
|
194
|
+
ui_success "Index backlog créé"
|
|
193
195
|
|
|
194
196
|
# Créer CLAUDE.md
|
|
195
197
|
cat > "$PROJECT_DIR/CLAUDE.md" << 'CLAUDEMD'
|
|
@@ -403,7 +405,7 @@ project-management/
|
|
|
403
405
|
- Security voters
|
|
404
406
|
CLAUDEMD
|
|
405
407
|
|
|
406
|
-
|
|
408
|
+
ui_success "CLAUDE.md créé"
|
|
407
409
|
|
|
408
410
|
# Créer un fichier README dans project-management
|
|
409
411
|
cat > "$PROJECT_DIR/project-management/README.md" << 'READMEMD'
|
|
@@ -448,7 +450,7 @@ project-management/
|
|
|
448
450
|
| ⏸️ | Blocked | Bloqué |
|
|
449
451
|
| 🟢 | Done | Terminé |
|
|
450
452
|
READMEMD
|
|
451
|
-
|
|
453
|
+
ui_success "README project-management créé"
|
|
452
454
|
|
|
453
455
|
echo ""
|
|
454
456
|
echo "=================================================="
|
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
A comprehensive framework for AI-assisted development with [Claude Code](https://claude.ai/code). Install standardized rules, agents, and commands for your projects across multiple technology stacks.
|
|
8
8
|
|
|
9
|
-
## What's New in v7.
|
|
9
|
+
## What's New in v7.3
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- See [
|
|
11
|
+
- **shell-ui.sh** adopted across all install scripts — zero duplicate color/logging definitions
|
|
12
|
+
- **CLI `check` command** — verify claude-craft installation: `npx @the-bearded-bear/claude-craft check`
|
|
13
|
+
- **Documentation accuracy** — fixed stale version refs and paths in README, FAQ, help output
|
|
14
|
+
- See [CHANGELOG](CHANGELOG.md) for full details
|
|
15
15
|
|
|
16
16
|
> See [CHANGELOG.md](CHANGELOG.md) for previous versions.
|
|
17
17
|
|
|
@@ -405,7 +405,7 @@ projects:
|
|
|
405
405
|
make config-install PROJECT=my-monorepo
|
|
406
406
|
```
|
|
407
407
|
|
|
408
|
-
#### Multi-Technology Modules
|
|
408
|
+
#### Multi-Technology Modules
|
|
409
409
|
|
|
410
410
|
You can specify multiple technologies for a single module. This is useful for fullstack folders or projects using multiple frameworks:
|
|
411
411
|
|
|
@@ -573,7 +573,7 @@ Complete step-by-step tutorials for getting started, developing features, and fi
|
|
|
573
573
|
- [Agents Reference](docs/AGENTS.md)
|
|
574
574
|
- [Commands Reference](docs/COMMANDS.md)
|
|
575
575
|
- [Technologies Guide](docs/TECHNOLOGIES.md)
|
|
576
|
-
- [Migration Guide](docs/MIGRATION.md) - Upgrade existing projects to
|
|
576
|
+
- [Migration Guide](docs/MIGRATION-v7.md) - Upgrade existing projects to v7.0
|
|
577
577
|
- [Hooks Guide](docs/HOOKS.md) - Pre/Post tool execution automation
|
|
578
578
|
- [MCP Guide](docs/MCP.md) - Model Context Protocol integration
|
|
579
579
|
|
package/cli/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import { printBanner } from './lib/banner.js';
|
|
|
34
34
|
import { printHelp } from './lib/help.js';
|
|
35
35
|
import { interactiveInstall, runInstallation } from './lib/installer.js';
|
|
36
36
|
import { runRalph } from './lib/ralph.js';
|
|
37
|
+
import { runCheck } from './lib/check.js';
|
|
37
38
|
|
|
38
39
|
// Flattener module
|
|
39
40
|
import { flatten as flattenCodebaseFn } from './flattener.js';
|
|
@@ -166,6 +167,11 @@ class ClaudeCraftCLI {
|
|
|
166
167
|
}
|
|
167
168
|
break;
|
|
168
169
|
|
|
170
|
+
case 'check':
|
|
171
|
+
printBanner(VERSION);
|
|
172
|
+
runCheck(this.config.targetPath);
|
|
173
|
+
break;
|
|
174
|
+
|
|
169
175
|
case 'init':
|
|
170
176
|
printBanner(VERSION);
|
|
171
177
|
console.log(`${c.cyan}Workflow initialization is available after installation.${c.reset}`);
|
package/cli/lib/check.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI `check` command — verify claude-craft installation in a project directory.
|
|
3
|
+
* @module cli/lib/check
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import fs from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import c from './colors.js';
|
|
9
|
+
import { detectProject } from './detect-project.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Count files matching a glob pattern in a directory (non-recursive).
|
|
13
|
+
* @param {string} dir - Directory path
|
|
14
|
+
* @param {string} ext - File extension (e.g. '.md')
|
|
15
|
+
* @returns {number}
|
|
16
|
+
*/
|
|
17
|
+
function countFiles(dir, ext) {
|
|
18
|
+
try {
|
|
19
|
+
return fs.readdirSync(dir).filter((f) => f.endsWith(ext)).length;
|
|
20
|
+
} catch {
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List subdirectories of a directory.
|
|
27
|
+
* @param {string} dir - Directory path
|
|
28
|
+
* @returns {string[]}
|
|
29
|
+
*/
|
|
30
|
+
function listDirs(dir) {
|
|
31
|
+
try {
|
|
32
|
+
return fs
|
|
33
|
+
.readdirSync(dir, { withFileTypes: true })
|
|
34
|
+
.filter((d) => d.isDirectory())
|
|
35
|
+
.map((d) => d.name);
|
|
36
|
+
} catch {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Run the check command against a target directory.
|
|
43
|
+
* @param {string} targetPath - Absolute path to the project directory
|
|
44
|
+
*/
|
|
45
|
+
function runCheck(targetPath) {
|
|
46
|
+
const claudeDir = path.join(targetPath, '.claude');
|
|
47
|
+
let warnings = 0;
|
|
48
|
+
|
|
49
|
+
console.log(`\n${c.bold}Claude Craft Installation Check${c.reset}`);
|
|
50
|
+
console.log(`${c.dim}Directory: ${targetPath}${c.reset}\n`);
|
|
51
|
+
|
|
52
|
+
// 1. .claude/ directory
|
|
53
|
+
if (fs.existsSync(claudeDir)) {
|
|
54
|
+
console.log(` ${c.green}[OK]${c.reset} .claude/ directory exists`);
|
|
55
|
+
} else {
|
|
56
|
+
console.log(` ${c.red}[MISSING]${c.reset} .claude/ directory not found`);
|
|
57
|
+
console.log(`\n${c.red}No claude-craft installation detected.${c.reset}`);
|
|
58
|
+
console.log(`Run: npx @the-bearded-bear/claude-craft install ${targetPath}\n`);
|
|
59
|
+
process.exitCode = 1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 2. CLAUDE.md
|
|
64
|
+
const claudeMd = path.join(claudeDir, 'CLAUDE.md');
|
|
65
|
+
if (fs.existsSync(claudeMd)) {
|
|
66
|
+
console.log(` ${c.green}[OK]${c.reset} .claude/CLAUDE.md exists`);
|
|
67
|
+
} else {
|
|
68
|
+
console.log(` ${c.yellow}[WARN]${c.reset} .claude/CLAUDE.md not found`);
|
|
69
|
+
warnings++;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 3. Commands — count namespace dirs and files
|
|
73
|
+
const commandsDir = path.join(claudeDir, 'commands');
|
|
74
|
+
const namespaces = listDirs(commandsDir);
|
|
75
|
+
let totalCommands = 0;
|
|
76
|
+
if (namespaces.length > 0) {
|
|
77
|
+
for (const ns of namespaces) {
|
|
78
|
+
totalCommands += countFiles(path.join(commandsDir, ns), '.md');
|
|
79
|
+
}
|
|
80
|
+
console.log(
|
|
81
|
+
` ${c.green}[OK]${c.reset} commands/ — ${totalCommands} commands in ${namespaces.length} namespace(s): ${c.cyan}${namespaces.join(', ')}${c.reset}`
|
|
82
|
+
);
|
|
83
|
+
} else {
|
|
84
|
+
console.log(` ${c.yellow}[WARN]${c.reset} commands/ — no namespaces found`);
|
|
85
|
+
warnings++;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// 4. Agents
|
|
89
|
+
const agentsDir = path.join(claudeDir, 'agents');
|
|
90
|
+
const agentCount = countFiles(agentsDir, '.md');
|
|
91
|
+
if (agentCount > 0) {
|
|
92
|
+
console.log(` ${c.green}[OK]${c.reset} agents/ — ${agentCount} agent(s)`);
|
|
93
|
+
} else {
|
|
94
|
+
console.log(` ${c.yellow}[WARN]${c.reset} agents/ — no agents found`);
|
|
95
|
+
warnings++;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 5. References
|
|
99
|
+
const refsDir = path.join(claudeDir, 'references');
|
|
100
|
+
const refDirs = listDirs(refsDir);
|
|
101
|
+
if (refDirs.length > 0) {
|
|
102
|
+
console.log(` ${c.green}[OK]${c.reset} references/ — ${c.cyan}${refDirs.join(', ')}${c.reset}`);
|
|
103
|
+
} else {
|
|
104
|
+
console.log(` ${c.yellow}[WARN]${c.reset} references/ — no tech references found`);
|
|
105
|
+
warnings++;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// 6. Skills
|
|
109
|
+
const skillsDir = path.join(claudeDir, 'skills');
|
|
110
|
+
const skillDirs = listDirs(skillsDir);
|
|
111
|
+
let totalSkills = 0;
|
|
112
|
+
for (const sd of skillDirs) {
|
|
113
|
+
totalSkills += countFiles(path.join(skillsDir, sd), '.md');
|
|
114
|
+
}
|
|
115
|
+
// Also count top-level skill files
|
|
116
|
+
totalSkills += countFiles(skillsDir, '.md');
|
|
117
|
+
if (totalSkills > 0) {
|
|
118
|
+
console.log(` ${c.green}[OK]${c.reset} skills/ — ${totalSkills} skill(s)`);
|
|
119
|
+
} else {
|
|
120
|
+
console.log(` ${c.yellow}[WARN]${c.reset} skills/ — no skills found`);
|
|
121
|
+
warnings++;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 7. Tech detection
|
|
125
|
+
const detected = detectProject(targetPath);
|
|
126
|
+
if (detected.suggestedTechs.length > 0) {
|
|
127
|
+
console.log(
|
|
128
|
+
` ${c.green}[OK]${c.reset} Detected tech: ${c.cyan}${detected.suggestedTechs.join(', ')}${c.reset} (complexity: ${detected.complexity})`
|
|
129
|
+
);
|
|
130
|
+
} else {
|
|
131
|
+
console.log(` ${c.dim}[--]${c.reset} No technology detected from project files`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Summary
|
|
135
|
+
console.log('');
|
|
136
|
+
if (warnings === 0) {
|
|
137
|
+
console.log(`${c.green}Installation looks good!${c.reset}\n`);
|
|
138
|
+
} else {
|
|
139
|
+
console.log(`${c.yellow}${warnings} warning(s) — some components may be missing.${c.reset}\n`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { runCheck };
|
package/cli/lib/help.js
CHANGED
|
@@ -37,11 +37,13 @@ ${c.bold}Commands:${c.reset}
|
|
|
37
37
|
${c.green}install${c.reset} Interactive installation wizard
|
|
38
38
|
${c.green}install <path>${c.reset} Install to specific directory
|
|
39
39
|
${c.green}init${c.reset} Initialize workflow in current project
|
|
40
|
+
${c.green}check${c.reset} Verify claude-craft installation
|
|
40
41
|
${c.green}flatten${c.reset} Generate flattened codebase summary
|
|
41
42
|
${c.green}ralph${c.reset} Run Ralph Wiggum continuous loop
|
|
42
43
|
${c.green}help${c.reset} Show this help message
|
|
43
44
|
|
|
44
45
|
${c.bold}Options:${c.reset}
|
|
46
|
+
${c.yellow}--version, -v${c.reset} Show version
|
|
45
47
|
${c.yellow}--lang=XX${c.reset} Language (en, fr, es, de, pt)
|
|
46
48
|
${c.yellow}--tech=NAME${c.reset} Technology (${Object.keys(TECHNOLOGIES).join(', ')})
|
|
47
49
|
${c.yellow}--force${c.reset} Overwrite existing files
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-bearded-bear/claude-craft",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "A comprehensive framework for AI-assisted development with Claude Code. Install standardized rules, agents, and commands for your projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "cli/index.js",
|