Skip to content
Merged
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
10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ Core project rules that apply to all tasks:

**Setup and Installation:**

- `/plugin marketplace add https://github.com/TechNickAI/ai-coding-config` - Add this
marketplace
- `/plugin install <name>` - Install specific plugin
- `/ai-coding-config` - Interactive setup for projects
- `curl -fsSL https://raw.githubusercontent.com/TechNickAI/ai-coding-config/main/scripts/bootstrap.sh | bash` -
Bootstrap for Cursor
One-line install (auto-detects Claude Code, Cursor, etc.)
- `/ai-coding-config` - Interactive setup for projects
- `/plugin marketplace add https://github.com/TechNickAI/ai-coding-config` - Manual
marketplace add
- `/plugin install ai-coding-config` - Manual plugin install

## Code Conventions

Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,37 @@ patterns.

## Quick Start

**Claude Code:**
### One-line install

```bash
/plugin marketplace add https://github.com/TechNickAI/ai-coding-config
/plugin install ai-coding-config skills
```

**Cursor, Windsurf, Cline, or others:**
Run this in your terminal — it auto-detects your tools (Claude Code, Cursor, etc.) and
sets everything up:

```bash
curl -fsSL https://raw.githubusercontent.com/TechNickAI/ai-coding-config/main/scripts/bootstrap.sh | bash
```

Then run the interactive setup:
Then configure for your project:

```
/ai-coding-config
```

This detects your stack and installs relevant configurations.
### Manual install (Claude Code)

If you prefer to install manually, run these in Claude Code:

```
/plugin marketplace add https://github.com/TechNickAI/ai-coding-config
```

```
/plugin install ai-coding-config
```

## Todo Persistence Across Compaction

**The problem**: Claude Code's context compaction summarizes conversation history to stay
within token limits. When this happens, your todo list vanishes - you lose track of
**The problem**: Claude Code's context compaction summarizes conversation history to
stay within token limits. When this happens, your todo list vanishes - you lose track of
what you were working on.

**The solution**: This plugin automatically saves todos to disk via hooks. After
Expand Down Expand Up @@ -157,9 +163,9 @@ installs relevant rules.

### Debugging

| Agent | Purpose |
| --------------- | ---------------------------------------------------- |
| **debugger** | Root cause analysis through systematic investigation |
| Agent | Purpose |
| ------------ | ---------------------------------------------------- |
| **debugger** | Root cause analysis through systematic investigation |

### Code Review - Correctness

Expand Down
186 changes: 117 additions & 69 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ set -e
echo "🚀 AI Coding Configuration Bootstrap"
echo ""

# Check if we're in a git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
echo "❌ Error: You're not in a git repository."
echo ""
echo "Move into a project directory first:"
echo " cd ~/your-project"
echo ""
echo "Then run this script again."
exit 1
fi

# Check OS
OS="$(uname -s)"
if [[ "$OS" != "Darwin" && "$OS" != "Linux" ]]; then
Expand All @@ -24,73 +13,132 @@ if [[ "$OS" != "Darwin" && "$OS" != "Linux" ]]; then
fi

echo "✓ Detected $OS"
echo "✓ In git repository: $(basename $(git rev-parse --show-toplevel))"
echo ""

# Clone or update ai-coding-config
if [ ! -d "$HOME/.ai_coding_config" ]; then
echo "📥 Cloning ai-coding-config to ~/.ai_coding_config..."
git clone https://github.com/TechNickAI/ai-coding-config.git ~/.ai_coding_config
echo "✓ Cloned successfully"
else
echo "📥 Updating ~/.ai_coding_config..."
echo " Running: git pull"
cd ~/.ai_coding_config
git pull
cd - > /dev/null
echo "✓ Updated to latest version"
fi
# Detect available AI coding tools
HAS_CLAUDE=false
HAS_CURSOR=false

echo ""
if command -v claude &> /dev/null; then
HAS_CLAUDE=true
echo "✓ Found Claude Code"
fi

# Copy the ai-coding-config command to current repo
echo "📋 Setting up /ai-coding-config command in this project..."
if command -v cursor &> /dev/null || [ -d "/Applications/Cursor.app" ]; then
HAS_CURSOR=true
echo "✓ Found Cursor"
fi

mkdir -p .claude/commands
cp ~/.ai_coding_config/.claude/commands/ai-coding-config.md .claude/commands/
if [ "$HAS_CLAUDE" = false ] && [ "$HAS_CURSOR" = false ]; then
echo "ℹ️ No AI coding tools detected on PATH."
echo " Proceeding with file-based setup that works with any tool."
fi

echo "✓ Copied ai-coding-config command"
echo ""

# Set up Cursor directory structure
echo "📁 Setting up Cursor directory structure..."

# Create .cursor directory structure
mkdir -p .cursor/commands

# For fresh installs without existing rules, create .cursor/rules
if [ ! -d ".cursor/rules" ]; then
mkdir -p .cursor/rules
echo "✓ Created .cursor/rules/"
elif [ -d ".cursor/rules" ] && [ ! -L ".cursor/rules" ]; then
echo "✓ .cursor/rules/ already exists"
elif [ -L ".cursor/rules" ]; then
# Legacy v2 architecture with rules/ at root - suggest migration
echo "⚠️ Detected legacy v2 architecture (rules/ symlink)"
echo " Run /ai-coding-config update to migrate to standard architecture"
fi
# ─── Claude Code Setup ───────────────────────────────────────────────
if [ "$HAS_CLAUDE" = true ]; then
echo "📦 Setting up Claude Code plugin..."

# Add marketplace (claude plugin commands use terminal UI that suppresses output)
echo " Adding marketplace..."
if ! claude plugin marketplace add https://github.com/TechNickAI/ai-coding-config > /dev/null 2>&1; then
Copy link

Choose a reason for hiding this comment

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

Missing stdin redirect breaks curl-pipe execution

Medium Severity

The claude plugin marketplace add and claude plugin install commands redirect stdout/stderr but not stdin. The primary install method is curl | bash, where bash reads the script from stdin (the pipe). These claude commands inherit that stdin, and if they attempt to read from it (the comment on line 42 notes they "use terminal UI"), they'd consume bytes from the pipe, corrupting the rest of the script execution. Adding < /dev/null to both invocations prevents this.

Additional Locations (1)

Fix in Cursor Fix in Web

echo "⚠️ Marketplace add may have failed. If /ai-coding-config doesn't work, run manually:"
echo " /plugin marketplace add https://github.com/TechNickAI/ai-coding-config"
else
echo "✓ Marketplace configured"
fi

# Install the plugin
echo " Installing plugin..."
if ! claude plugin install ai-coding-config > /dev/null 2>&1; then
echo "⚠️ Plugin install may have failed. Try manually in Claude Code:"
echo " /plugin install ai-coding-config"
Comment on lines +53 to +55

Choose a reason for hiding this comment

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

P2 Badge Propagate Claude install failures as script errors

When claude plugin install ai-coding-config fails (for example, unauthenticated Claude CLI or transient CLI/network errors), this branch only prints a warning and continues, so the script can still report completion and exit with status 0. In the Claude-only path (HAS_CLAUDE=true, HAS_CURSOR=false), that leaves users without a working install signal and without the file-based fallback setup, which can silently break bootstrap automation.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The claude plugin CLI uses a terminal UI renderer that makes exit codes unreliable when run non-interactively. Hard-failing the script on an uncertain exit code would be worse UX — users would see an error even on success. The warning with fallback manual instructions is intentional: it tells users what to do if setup didn't work, without falsely blocking on an unreliable signal.

else
echo "✓ Plugin installed"
fi

# Check for legacy rules/ directory
if [ -d "rules" ] && [ ! -L "rules" ]; then
echo "⚠️ Found legacy rules/ directory"
echo " Run /ai-coding-config update to migrate to .cursor/rules/"
echo ""
echo "✨ Claude Code setup complete!"
echo ""
echo "Next step — run this in Claude Code:"
echo " /ai-coding-config"
echo ""
fi

echo ""
# ─── Cursor / Other Tools Setup ──────────────────────────────────────
if [ "$HAS_CURSOR" = true ] || [ "$HAS_CLAUDE" = false ]; then

# Check if we're in a git repository (needed for file-copy approach)
if ! git rev-parse --git-dir > /dev/null 2>&1; then
if [ "$HAS_CLAUDE" = true ]; then
# Claude plugin setup succeeded above. Cursor file-copy setup requires a git
# repo, but we don't need it — exit cleanly rather than erroring.
exit 0
fi
echo "❌ Error: You're not in a git repository."
echo ""
echo "Move into a project directory first:"
echo " cd ~/your-project"
echo ""
echo "Then run this script again."
exit 1
fi

echo "📁 Setting up for Cursor / other AI tools..."
echo "✓ In git repository: $(basename "$(git rev-parse --show-toplevel)")"
echo ""

echo "✨ Bootstrap complete!"
echo ""
echo "Next steps:"
echo ""
echo "From Claude Code:"
echo " /ai-coding-config"
echo ""
echo "From Cursor:"
echo " @ai-coding-config set up this project"
echo ""
echo "The command will guide you through:"
echo "- Choosing an AI personality"
echo "- Selecting relevant rules for your project"
echo "- Copying configurations"
echo ""
# Clone or update ai-coding-config
if [ ! -d "$HOME/.ai_coding_config" ]; then
echo "📥 Cloning ai-coding-config to ~/.ai_coding_config..."
if ! git clone https://github.com/TechNickAI/ai-coding-config.git ~/.ai_coding_config; then
echo "❌ Failed to clone. Check your internet connection and try again."
exit 1
fi
echo "✓ Cloned successfully"
else
echo "📥 Updating ~/.ai_coding_config..."
(cd ~/.ai_coding_config && git pull) || echo "⚠️ Update failed. Continuing with existing version."
echo "✓ Updated to latest version"
Copy link

Choose a reason for hiding this comment

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

Success message prints even when git pull fails

Low Severity

When git pull fails on line 100, the || branch prints the warning, but execution unconditionally continues to line 101, which prints "✓ Updated to latest version". The user sees both the failure warning and the success checkmark, which is contradictory and misleading. The success echo needs to be conditional on the pull actually succeeding.

Fix in Cursor Fix in Web

fi

echo ""

# Copy the ai-coding-config command to current repo
echo "📋 Setting up /ai-coding-config command..."
mkdir -p .claude/commands
cp ~/.ai_coding_config/.claude/commands/ai-coding-config.md .claude/commands/
echo "✓ Copied ai-coding-config command"

# Set up Cursor directory structure
mkdir -p .cursor/commands

if [ ! -d ".cursor/rules" ]; then
mkdir -p .cursor/rules
echo "✓ Created .cursor/rules/"
elif [ -L ".cursor/rules" ]; then
echo "⚠️ Detected legacy v2 architecture (rules/ symlink)"
echo " Run /ai-coding-config update to migrate to standard architecture"
else
echo "✓ .cursor/rules/ already exists"
fi

if [ -d "rules" ] && [ ! -L "rules" ]; then
echo "⚠️ Found legacy rules/ directory"
echo " Run /ai-coding-config update to migrate to .cursor/rules/"
fi

echo ""
echo "✨ Setup complete!"
echo ""
echo "Next steps:"
echo ""
echo " Claude Code: /ai-coding-config"
echo " Cursor: @ai-coding-config set up this project"
echo ""
echo "The command will guide you through:"
echo " - Choosing an AI personality"
echo " - Selecting relevant rules for your project"
echo " - Copying configurations"
echo ""
fi