Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
Β·217 lines (193 loc) Β· 5.57 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
Β·217 lines (193 loc) Β· 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#!/bin/bash
# Dev Environment Setup Script for Linux/Mac
# Run: chmod +x setup.sh && ./setup.sh
echo ""
echo "====== COMPLETE DEV ENVIRONMENT SETUP ======"
echo "This script will install VS Code extensions, Claude Code, and set up directories."
echo ""
# Detect OS
if [[ "$OSTYPE" == "darwin"* ]]; then
OS="mac"
echo "[INFO] Detected: macOS"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
OS="linux"
echo "[INFO] Detected: Linux"
else
echo "[ERROR] Unsupported OS: $OSTYPE"
exit 1
fi
# ===== VS CODE EXTENSIONS =====
echo ""
echo "[1/6] Installing VS Code Extensions..."
extensions=(
"ms-python.python"
"dbaeumer.vscode-eslint"
"esbenp.prettier-vscode"
"ms-vscode.vscode-typescript-next"
"bradlc.vscode-tailwindcss"
"prisma.prisma"
"formulahendry.auto-rename-tag"
"christian-kohler.path-intellisense"
"ritwickdey.LiveServer"
"eamodio.gitlens"
"mhutchie.git-graph"
"anthropic.claude-code"
"github.copilot"
"saoudrizwan.claude-dev"
"ms-azuretools.vscode-docker"
"ms-vscode-remote.remote-wsl"
"ms-vscode-remote.remote-ssh"
"ms-toolsai.jupyter"
"rangav.vscode-thunder-client"
"usernamehw.errorlens"
"PKief.material-icon-theme"
"aaron-bond.better-comments"
"streetsidesoftware.code-spell-checker"
"alefragnani.Bookmarks"
"wix.vscode-import-cost"
"formulahendry.code-runner"
)
# Check if VS Code is installed
if command -v code &> /dev/null; then
for ext in "${extensions[@]}"; do
echo " Installing $ext..."
code --install-extension "$ext" --force 2>/dev/null
done
echo " [OK] ${#extensions[@]} VS Code extensions installed"
else
echo " [SKIP] VS Code not found. Install from https://code.visualstudio.com/"
fi
# ===== CLAUDE CODE =====
echo ""
echo "[2/6] Installing/Updating Claude Code..."
# Check if npm is installed
if command -v npm &> /dev/null; then
npm install -g @anthropic-ai/claude-code 2>/dev/null
if command -v claude &> /dev/null; then
echo " [OK] Claude Code: $(claude --version 2>/dev/null)"
else
echo " [OK] Claude Code installed (restart terminal to use)"
fi
else
echo " [SKIP] npm not found. Install Node.js first."
fi
# ===== CLAUDE CODE DIRECTORIES =====
echo ""
echo "[3/6] Setting up Claude Code directories..."
dirs=(
"$HOME/.claude/commands"
"$HOME/.claude/skills/code-quality"
"$HOME/.claude/skills/security"
"$HOME/.claude/agents"
)
for dir in "${dirs[@]}"; do
if [ ! -d "$dir" ]; then
mkdir -p "$dir"
echo " Created: $dir"
else
echo " Exists: $dir"
fi
done
echo " [OK] Claude Code directories ready"
# ===== EXAMPLE FILES =====
echo ""
echo "[4/6] Creating example files..."
# Example command
review_cmd="$HOME/.claude/commands/review.md"
if [ ! -f "$review_cmd" ]; then
cat > "$review_cmd" << 'CMDEOF'
---
description: Review code for best practices
---
Review the code for:
1. Security vulnerabilities
2. Performance issues
3. Error handling
4. Code style consistency
5. Test coverage gaps
Provide specific suggestions with code examples.
CMDEOF
echo " Created: $review_cmd"
else
echo " Exists: $review_cmd"
fi
# Example skill
skill_file="$HOME/.claude/skills/code-quality/SKILL.md"
if [ ! -f "$skill_file" ]; then
cat > "$skill_file" << 'SKILLEOF'
---
name: code-quality
description: Enforce code quality standards
---
When writing or reviewing code:
1. Follow project style guide
2. Use meaningful variable names
3. Keep functions under 50 lines
4. Add error handling
5. Write self-documenting code
6. Avoid magic numbers
7. Use early returns
SKILLEOF
echo " Created: $skill_file"
else
echo " Exists: $skill_file"
fi
echo " [OK] Example files created"
# ===== MCP SERVERS (OPTIONAL) =====
echo ""
echo "[5/6] MCP Servers (Optional)..."
echo -n "Would you like to install recommended MCP servers? (y/n): "
read mcp
if [ "$mcp" = "y" ] || [ "$mcp" = "Y" ]; then
echo " Installing Memory MCP..."
claude mcp add memory -- npx -y @modelcontextprotocol/server-memory 2>/dev/null
echo " Installing Playwright MCP..."
claude mcp add playwright -- npx @playwright/mcp@latest 2>/dev/null
echo " [OK] MCP servers installed"
echo ""
echo " To add GitHub MCP (copy this entire line):"
echo " claude mcp add --transport http github https://api.githubcopilot.com/mcp/"
else
echo " Skipped MCP installation"
fi
# ===== VERIFICATION =====
echo ""
echo "[6/6] Verification..."
if command -v code &> /dev/null; then
ext_count=$(code --list-extensions 2>/dev/null | wc -l)
echo " VS Code Extensions: $ext_count installed"
fi
if command -v claude &> /dev/null; then
echo " Claude Code: $(claude --version 2>/dev/null)"
else
echo " Claude Code: Restart terminal to verify"
fi
echo " Directories:"
for dir in "${dirs[@]}"; do
if [ -d "$dir" ]; then
echo " [OK] $dir"
else
echo " [X] $dir"
fi
done
# ===== DONE =====
echo ""
echo "====== SETUP COMPLETE ======"
echo ""
echo "Your Claude Code structure:"
echo " ~/.claude/"
echo " commands/ <- Your slash commands (try /review)"
echo " skills/ <- Auto-invoked skills"
echo " agents/ <- Custom subagents"
echo ""
echo "Top resources to explore:"
echo " - BMAD Method: npx bmad-method install"
echo " - SuperClaude: pipx install superclaude"
echo " - See docs/claude-code-resources.md for Top 30 list"
echo ""
echo "Next steps:"
echo " 1. Restart your terminal to refresh PATH"
echo " 2. Run 'claude' to start Claude Code"
echo " 3. Use '/review' to test your new command"
echo " 4. Check docs/ folder for guides"
echo ""