Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,33 @@ Boris Cherny is the creator of Claude Code. This repo synthesizes his recommenda

## Quick Start

### 1. Copy Project Files
### One-Line Install

Install all personal skills and subagents with a single command:

```bash
curl -fsSL https://raw.githubusercontent.com/meleantonio/ChernyCode/main/install.sh | bash
```

This installs:
- Claude Code personal skills to `~/.claude/skills/`
- Claude Code subagents to `~/.claude/agents/`
- Cursor personal skills to `~/.cursor/skills-cursor/`
- Cursor subagents to `~/.cursor/agents/`
- Personal CLAUDE.md to `~/.claude/CLAUDE.md`

### Manual Installation

If you prefer to install manually, follow the steps below.

#### 1. Copy Project Files

Copy these files to your project root:
- `CLAUDE.md` - Edit for your project's context
- `AGENTS.md` - Edit for your project's context
- `.cursor/skills/` - Copy the skills directory

### 2. Install Personal Files
#### 2. Install Personal Files

Copy these from this repo to your home directory for use across all projects:

Expand All @@ -46,7 +65,7 @@ cp -r cursor_personal_skills/* ~/.cursor/skills-cursor/
cp -r cursor_subagents/* ~/.cursor/agents/
```

### 3. (Optional) Install Personal CLAUDE.md
#### 3. (Optional) Install Personal CLAUDE.md

Create a personal memory file for all projects:

Expand Down
164 changes: 164 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#!/bin/bash
#
# ChernyCode Installer
# Installs personal skills and subagents for Claude Code and Cursor
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/meleantonio/ChernyCode/main/install.sh | bash
#
# Or clone the repo and run:
# ./install.sh
#

set -e

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

info() { echo -e "${BLUE}[INFO]${NC} $1"; }
success() { echo -e "${GREEN}[OK]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }

# Determine source directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-}")" 2>/dev/null && pwd)"

# Check if running from repo or via curl
if [[ -n "${BASH_SOURCE[0]:-}" && -d "$SCRIPT_DIR/claude_personal_skills" ]]; then
SOURCE_DIR="$SCRIPT_DIR"
info "Running from local repository: $SOURCE_DIR"
else
# Running via curl - clone to temp directory
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR"' EXIT
info "Cloning ChernyCode repository..."
git clone --depth 1 https://github.com/meleantonio/ChernyCode.git "$TEMP_DIR" 2>/dev/null || \
error "Failed to clone repository. Check your internet connection."
SOURCE_DIR="$TEMP_DIR"
success "Repository cloned"
Comment on lines +34 to +42
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing git prerequisite check and suppressed clone diagnostics.

When run via curl | bash, git might not be installed. The 2>/dev/null on git clone swallows all diagnostic output, so the user only sees "Check your internet connection" even if the real problem is a missing git binary, an auth error, or a DNS issue.

Proposed fix
     # Running via curl - clone to temp directory
+    command -v git >/dev/null 2>&1 || error "git is not installed. Please install git first."
     TEMP_DIR=$(mktemp -d)
     trap 'rm -rf "$TEMP_DIR"' EXIT
     info "Cloning ChernyCode repository..."
-    git clone --depth 1 https://github.com/meleantonio/ChernyCode.git "$TEMP_DIR" 2>/dev/null || \
+    git clone --depth 1 https://github.com/meleantonio/ChernyCode.git "$TEMP_DIR" || \
         error "Failed to clone repository. Check your internet connection."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
else
# Running via curl - clone to temp directory
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR"' EXIT
info "Cloning ChernyCode repository..."
git clone --depth 1 https://github.com/meleantonio/ChernyCode.git "$TEMP_DIR" 2>/dev/null || \
error "Failed to clone repository. Check your internet connection."
SOURCE_DIR="$TEMP_DIR"
success "Repository cloned"
else
# Running via curl - clone to temp directory
command -v git >/dev/null 2>&1 || error "git is not installed. Please install git first."
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR"' EXIT
info "Cloning ChernyCode repository..."
git clone --depth 1 https://github.com/meleantonio/ChernyCode.git "$TEMP_DIR" || \
error "Failed to clone repository. Check your internet connection."
SOURCE_DIR="$TEMP_DIR"
success "Repository cloned"
🤖 Prompt for AI Agents
In `@install.sh` around lines 34 - 42, Add a pre-check for the git binary and stop
suppressing git clone diagnostics: before using TEMP_DIR and running git clone,
verify git is available (e.g. check command -v git or which git) and call error
with a clear message like "git is required, please install git" if missing;
remove the redirection "2>/dev/null" from the git clone invocation so clone
failures surface real diagnostics (authentication/DNS/permission errors) and
keep the existing fallback that calls error "Failed to clone repository. Check
your internet connection." to preserve behavior when clone actually fails.

fi

echo ""
echo "============================================"
echo " ChernyCode Installer"
echo "============================================"
echo ""

# Step 1: Create directories
info "Creating directories..."

mkdir -p ~/.claude/skills
mkdir -p ~/.claude/agents
mkdir -p ~/.cursor/skills-cursor
mkdir -p ~/.cursor/agents

success "Directories created"

# Step 2: Install Claude Code personal skills
info "Installing Claude Code personal skills..."

if [[ -d "$SOURCE_DIR/claude_personal_skills" ]]; then
for skill_dir in "$SOURCE_DIR"/claude_personal_skills/*/; do
if [[ -d "$skill_dir" ]]; then
skill_name=$(basename "$skill_dir")
cp -r "${skill_dir%/}" ~/.claude/skills/
success " Installed skill: $skill_name"
fi
done
else
warn " No Claude personal skills found"
fi

# Step 3: Install Claude Code subagents
info "Installing Claude Code subagents..."

if [[ -d "$SOURCE_DIR/claude_subagents" ]]; then
for agent_file in "$SOURCE_DIR"/claude_subagents/*.md; do
if [[ -f "$agent_file" ]]; then
agent_name=$(basename "$agent_file")
cp "$agent_file" ~/.claude/agents/
success " Installed agent: $agent_name"
fi
done
else
warn " No Claude subagents found"
fi

# Step 4: Install Cursor personal skills
info "Installing Cursor personal skills..."

if [[ -d "$SOURCE_DIR/cursor_personal_skills" ]]; then
for skill_dir in "$SOURCE_DIR"/cursor_personal_skills/*/; do
if [[ -d "$skill_dir" ]]; then
skill_name=$(basename "$skill_dir")
cp -r "${skill_dir%/}" ~/.cursor/skills-cursor/
success " Installed skill: $skill_name"
fi
done
else
warn " No Cursor personal skills found"
fi

# Step 5: Install Cursor subagents
info "Installing Cursor subagents..."

if [[ -d "$SOURCE_DIR/cursor_subagents" ]]; then
for agent_file in "$SOURCE_DIR"/cursor_subagents/*.md; do
if [[ -f "$agent_file" ]]; then
agent_name=$(basename "$agent_file")
cp "$agent_file" ~/.cursor/agents/
success " Installed agent: $agent_name"
fi
done
else
warn " No Cursor subagents found"
fi

# Step 6: Install personal CLAUDE.md
info "Installing personal CLAUDE.md..."

if [[ ! -f ~/.claude/CLAUDE.md ]]; then
cp "$SOURCE_DIR/CLAUDE.md" ~/.claude/CLAUDE.md
Comment on lines +124 to +125
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

No guard that CLAUDE.md exists in the source before copying.

If SOURCE_DIR/CLAUDE.md is absent (e.g., the file was renamed or the shallow clone was partial), cp fails and set -e aborts with an unhelpful message. A pre-check would improve the experience.

Proposed fix
 if [[ ! -f ~/.claude/CLAUDE.md ]]; then
-    cp "$SOURCE_DIR/CLAUDE.md" ~/.claude/CLAUDE.md
-    success "Personal CLAUDE.md installed"
-    info "Edit ~/.claude/CLAUDE.md to customize your preferences"
+    if [[ -f "$SOURCE_DIR/CLAUDE.md" ]]; then
+        cp "$SOURCE_DIR/CLAUDE.md" ~/.claude/CLAUDE.md
+        success "Personal CLAUDE.md installed"
+        info "Edit ~/.claude/CLAUDE.md to customize your preferences"
+    else
+        warn "CLAUDE.md not found in source, skipping"
+    fi
 else
🤖 Prompt for AI Agents
In `@install.sh` around lines 124 - 125, Before calling cp, ensure the source file
exists: add a test for [[ -f "$SOURCE_DIR/CLAUDE.md" ]] and only run cp
"$SOURCE_DIR/CLAUDE.md" ~/.claude/CLAUDE.md when that check passes; if the file
is missing, emit a clear message (using echo or logger) indicating
SOURCE_DIR/CLAUDE.md was not found and either skip the copy or exit with a
helpful error. Reference the variables/commands SOURCE_DIR, CLAUDE.md, and cp to
locate the exact spot to change.

success "Personal CLAUDE.md installed"
info "Edit ~/.claude/CLAUDE.md to customize your preferences"
else
# File exists - ask user what to do
if [[ -t 0 ]]; then
# Interactive mode - prompt user
warn "~/.claude/CLAUDE.md already exists"
read -p "Overwrite with new version? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
cp "$SOURCE_DIR/CLAUDE.md" ~/.claude/CLAUDE.md
success "Personal CLAUDE.md updated"
else
info "Kept existing CLAUDE.md"
fi
else
# Non-interactive - don't overwrite existing file
warn "~/.claude/CLAUDE.md already exists, skipping (run interactively to overwrite)"
fi
fi

echo ""
echo "============================================"
echo -e "${GREEN}Installation complete!${NC}"
echo "============================================"
echo ""
echo "Installed to:"
echo " ~/.claude/skills/ - Claude Code personal skills"
echo " ~/.claude/agents/ - Claude Code subagents"
echo " ~/.cursor/skills-cursor/ - Cursor personal skills"
echo " ~/.cursor/agents/ - Cursor subagents"
echo ""
echo "Next steps:"
echo " 1. Copy CLAUDE.md and AGENTS.md to your project root"
echo " 2. Copy .cursor/skills/ to your project's .cursor/ directory"
echo " 3. Customize the files for your project"
echo ""
echo "For more info, visit: https://github.com/meleantonio/ChernyCode"
echo ""