Skip to content

Commit 4112595

Browse files
committed
fix: Changed installation and updated setup script
1 parent b089e0d commit 4112595

File tree

5 files changed

+117
-41
lines changed

5 files changed

+117
-41
lines changed

.claude/commands/setup.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,93 @@ model: opus
1010

1111
## Execution Sequence
1212

13+
### Phase 0: Custom MCP Servers Configuration
14+
15+
**Purpose:** Document any custom MCP servers the user has added beyond the standard ones (claude-context, tavily, Ref).
16+
17+
1. **Ask user about custom MCP servers:**
18+
19+
Use AskUserQuestion:
20+
```
21+
Question: "Do you have custom MCP servers to add to this project?"
22+
Options:
23+
- "Yes, let me add them now" - User will edit .mcp.json
24+
- "No, skip this step" - Proceed without custom servers
25+
```
26+
27+
2. **If user selects "Yes":**
28+
29+
Display instructions:
30+
```
31+
Please add your custom MCP servers to .mcp.json now.
32+
33+
The file is located at: [project_dir]/.mcp.json
34+
35+
Example format:
36+
{
37+
"mcpServers": {
38+
"your-server-name": {
39+
"command": "npx",
40+
"args": ["-y", "your-mcp-package"]
41+
}
42+
}
43+
}
44+
45+
Note: claude-context, tavily, and Ref are already configured.
46+
```
47+
48+
Then ask for confirmation:
49+
```
50+
Question: "Have you finished adding your MCP servers?"
51+
Options:
52+
- "Yes, I've added them" - Proceed to create documentation
53+
- "Skip for now" - Continue without documenting custom servers
54+
```
55+
56+
3. **Read .mcp.json and identify custom servers:**
57+
58+
```python
59+
Read(file_path=".mcp.json")
60+
```
61+
62+
Parse the JSON and filter out standard servers:
63+
- Exclude: `claude-context`, `tavily`, `Ref`
64+
- Keep: All other servers as "custom"
65+
66+
4. **If custom servers found, create `.claude/rules/custom/mcp-tools.md`:**
67+
68+
Generate content with this structure:
69+
70+
```markdown
71+
## Custom MCP Servers
72+
73+
This project uses the following custom MCP servers in addition to the standard ones (claude-context, tavily, Ref).
74+
75+
### [Server Name]
76+
77+
**Command:** `[command from config]`
78+
**Args:** `[args from config]`
79+
80+
**When to use:**
81+
- [Brief description - ask user or infer from server name]
82+
83+
**Example usage:**
84+
```
85+
mcp__[server-name]__[tool_name](param="value")
86+
```
87+
88+
[Repeat for each custom server]
89+
```
90+
91+
5. **Write the custom MCP tools rule:**
92+
```python
93+
Write(file_path=".claude/rules/custom/mcp-tools.md", content=generated_content)
94+
```
95+
96+
If no custom servers found, skip creating this file.
97+
98+
---
99+
13100
### Phase 1: Project Discovery
14101

15102
1. **Scan Directory Structure:**
@@ -147,11 +234,16 @@ Display a summary like:
147234
├─────────────────────────────────────────────────────────────┤
148235
│ Created: │
149236
│ ✓ .claude/rules/custom/project.md │
237+
│ ✓ .claude/rules/custom/mcp-tools.md (if custom servers) │
150238
│ │
151239
│ Semantic Search: │
152240
│ ✓ Claude Context index initialized │
153241
│ ✓ Excluded: node_modules, __pycache__, .venv, cdk.out... │
154242
│ ✓ Indexed X files │
243+
│ │
244+
│ MCP Servers: │
245+
│ ✓ Standard: claude-context, tavily, Ref │
246+
│ ✓ Custom: [list custom server names or "none"] │
155247
├─────────────────────────────────────────────────────────────┤
156248
│ Next Steps: │
157249
│ 1. Run 'ccp' to reload with new rules in context │

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Start shipping systematically with Spec-Driven Development, Skills, TDD, Semanti
1212
![Spec-Driven](https://img.shields.io/badge/Spec-Driven-orange.svg)
1313
![TDD](https://img.shields.io/badge/TDD-Test--Driven--Development-green.svg)
1414

15-
#### [⭐ Star this repo](https://github.com/maxritter/claude-codepro)
15+
#### [⭐ Star this repository ](https://github.com/maxritter/claude-codepro) - [🌐 Visit the website](https://claude-code.pro)
1616

1717
</div>
1818

docs/site/src/components/WhatsInside.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
FileCode2,
44
Plug2,
55
ShieldCheck,
6-
Container
6+
Container,
7+
Sparkles
78
} from "lucide-react";
89
import { useInView } from "@/hooks/use-in-view";
910

@@ -65,6 +66,16 @@ const insideItems: InsideItem[] = [
6566
"Shell integration with ccp alias",
6667
],
6768
},
69+
{
70+
icon: Sparkles,
71+
title: "Skills System",
72+
items: [
73+
"Reusable prompts in .claude/skills/",
74+
"Backend and frontend standards skills",
75+
"Testing guidelines and anti-patterns",
76+
"Invoked automatically when relevant",
77+
],
78+
},
6879
];
6980

7081
const SectionHeader = ({ title, subtitle }: { title: string; subtitle?: string }) => (

installer/steps/bootstrap.py

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
"""Bootstrap step - initial setup and upgrade detection."""
1+
"""Bootstrap step - initial setup and directory creation."""
22

33
from __future__ import annotations
44

5-
import shutil
6-
from datetime import datetime
7-
from pathlib import Path
85
from typing import TYPE_CHECKING
96

107
from installer.steps.base import BaseStep
@@ -28,32 +25,14 @@ def run(self, ctx: InstallContext) -> None:
2825
claude_dir = ctx.project_dir / ".claude"
2926

3027
is_upgrade = claude_dir.exists()
28+
ctx.config["is_upgrade"] = is_upgrade
3129

3230
if is_upgrade:
3331
if ui:
34-
ui.status(f"Detected existing installation at {claude_dir}")
35-
36-
ctx.config["is_upgrade"] = True
37-
38-
if not ctx.local_mode:
39-
backup_name = f".claude.backup.{datetime.now().strftime('%Y%m%d_%H%M%S')}"
40-
backup_path = ctx.project_dir / backup_name
41-
42-
if ui:
43-
ui.status(f"Creating backup at {backup_name}...")
44-
45-
try:
46-
shutil.copytree(claude_dir, backup_path)
47-
ctx.config["backup_path"] = str(backup_path)
48-
if ui:
49-
ui.success(f"Backup created: {backup_name}")
50-
except (OSError, shutil.Error) as e:
51-
if ui:
52-
ui.warning(f"Could not create backup: {e}")
32+
ui.status("Updating existing installation...")
5333
else:
5434
if ui:
5535
ui.status("Fresh installation detected")
56-
ctx.config["is_upgrade"] = False
5736

5837
claude_dir.mkdir(parents=True, exist_ok=True)
5938

@@ -69,16 +48,8 @@ def run(self, ctx: InstallContext) -> None:
6948
(claude_dir / subdir).mkdir(parents=True, exist_ok=True)
7049

7150
if ui:
72-
ui.success("Directory structure created")
51+
ui.success("Directory structure ready")
7352

7453
def rollback(self, ctx: InstallContext) -> None:
75-
"""Restore from backup if available."""
76-
backup_path = ctx.config.get("backup_path")
77-
if backup_path:
78-
backup = Path(backup_path)
79-
claude_dir = ctx.project_dir / ".claude"
80-
81-
if backup.exists():
82-
if claude_dir.exists():
83-
shutil.rmtree(claude_dir)
84-
shutil.move(str(backup), str(claude_dir))
54+
"""No rollback needed - files are merged, not replaced."""
55+
pass

tests/unit/installer/steps/test_bootstrap.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def test_bootstrap_run_creates_directories(self):
7070
# Should create .claude directory
7171
assert (Path(tmpdir) / ".claude").exists()
7272

73-
def test_bootstrap_creates_backup_on_upgrade(self):
74-
"""BootstrapStep creates backup when upgrading."""
73+
def test_bootstrap_sets_upgrade_flag(self):
74+
"""BootstrapStep sets is_upgrade flag when upgrading."""
7575
from installer.context import InstallContext
7676
from installer.steps.bootstrap import BootstrapStep
7777
from installer.ui import Console
@@ -89,5 +89,7 @@ def test_bootstrap_creates_backup_on_upgrade(self):
8989
)
9090
step.run(ctx)
9191

92-
# Should have created a backup
93-
assert ctx.config.get("backup_path") is not None or (Path(tmpdir) / ".claude").exists()
92+
# Should set is_upgrade flag and preserve existing content
93+
assert ctx.config.get("is_upgrade") is True
94+
assert (claude_dir / "test.txt").exists()
95+
assert (claude_dir / "test.txt").read_text() == "existing content"

0 commit comments

Comments
 (0)