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
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
"hooks": [
{
"type": "command",
"command": "python3 ~/.claude/hooks/sql-injection-detector.py",
"command": "python3 \"$HOME/.claude/hooks/sql-injection-detector.py\"",
"timeout": 5000
}
]
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It starts from the moment you type a request. You don't pick agents, configure w
/do debug this Go test
```

In Claude Code, the smart router command is `/do`. In Codex, use `$do`.

A router reads your intent and selects a Go specialist agent paired with a systematic debugging methodology. The agent creates a branch, gathers evidence before guessing, runs through phased diagnosis, applies a fix, executes tests, reviews its own work, and presents a PR. You describe the problem. The system handles everything else.

This works because the toolkit separates *what you know* from *what the system knows*. Agents carry domain expertise (Go idioms, Python conventions, Kubernetes patterns). Skills enforce process methodology (TDD cycles, debugging phases, review waves). Hooks automate quality gates that fire on lifecycle events. Scripts handle deterministic operations where you want predictable output, not LLM judgment. The router ties it all together, classifying requests, selecting the right combination, and dispatching.
Expand All @@ -28,21 +30,34 @@ A game built entirely by Claude Code using these agents, skills, and pipelines.

## Installation

Requires [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and working (`claude --version` should print a version number).
Requires [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and working (`claude --version` should print a version number). Codex CLI is also supported: the installer mirrors toolkit skills into `~/.codex/skills` so Codex can use the same skill library (`codex --version` should print a version number if you want Codex support too).

```bash
git clone https://github.com/notque/claude-code-toolkit.git ~/claude-code-toolkit
cd ~/claude-code-toolkit
./install.sh --symlink
```

The installer links agents, skills, hooks, commands, and scripts into `~/.claude/`, where Claude Code loads extensions from. Use `--symlink` to get updates via `git pull`, or run without it for a stable copy.
The installer links agents, skills, hooks, commands, and scripts into `~/.claude/`, where Claude Code loads extensions from. It also mirrors skills into `~/.codex/skills` for Codex. Use `--symlink` to get updates via `git pull`, or run without it for a stable copy.

Verify the install with:

```bash
python3 ~/.claude/scripts/install-doctor.py check
python3 ~/.claude/scripts/install-doctor.py inventory
```

If you update the repo later and want Codex to see newly added skills, rerun `./install.sh --symlink` from the repo root.

Command entry points:
- Claude Code: `/do`
- Codex: `$do`

**Detailed setup:** [docs/start-here.md](docs/start-here.md)

## The Core Workflow

1. **Routing.** You type a request. The `/do` router classifies intent, selects a domain agent and a workflow skill, and dispatches. No menus, no configuration.
1. **Routing.** You type a request. The router entry point is `/do` in Claude Code and `$do` in Codex. It classifies intent, selects a domain agent and a workflow skill, and dispatches. No menus, no configuration.

2. **Planning.** For non-trivial work, the system creates a plan before touching code. Plans have phases, gates, and saved artifacts at each step.

Expand Down
29 changes: 24 additions & 5 deletions docs/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ cd ~/claude-code-toolkit
./install.sh
```

Claude Code is the primary runtime. If you also use Codex CLI, the same install mirrors toolkit skills into `~/.codex/skills`.

Command entry points:
- Claude Code: `/do`
- Codex: `$do`

**Alternative (bootstrap via Claude):** Start Claude Code in the claude-code-toolkit directory. The sync hook will automatically copy agents, skills, hooks, commands, and scripts to `~/.claude/`.

```bash
Expand All @@ -22,6 +28,15 @@ claude

> **Note:** The initial sync must run from the claude-code-toolkit directory. After that, hooks work globally from any directory.

Verify the install:

```bash
python3 ~/.claude/scripts/install-doctor.py check
python3 ~/.claude/scripts/install-doctor.py inventory
```

If Codex should pick up newly added skills after a `git pull`, rerun `./install.sh --symlink`.

---

## The Simple Version
Expand All @@ -46,24 +61,28 @@ That's it. You can stop reading here.

## Want More Control?

### Option A: Use `/do` (Smart Router)
### Option A: Use the Smart Router

```
/do [what you want in plain language]
$do [what you want in plain language]
```

Examples:
- `/do Debug why authentication is broken`
- `/do Extract coding patterns from this repo`
- `/do Make this status update professional`
- `$do Debug why authentication is broken`

Use `/do` in Claude Code and `$do` in Codex.

The system figures out which tools to use and tells you what it selected.

---

### Option B: Use `/do` for Specific Workflows
### Option B: Use the Router for Specific Workflows

The `/do` command routes your request to the right agent and skill automatically:
The router command routes your request to the right agent and skill automatically. Use `/do` in Claude Code and `$do` in Codex:

| Want This? | Try This |
|------------|----------|
Expand Down Expand Up @@ -113,8 +132,8 @@ These phrases automatically activate the right tools:
┌─────────────────────────────────────────────────────────┐
/do Smart Router
│ (or Claude's natural understanding)
│ /do in Claude | $do in Codex
│ (or natural-language routing)
└─────────────────────────────────────────────────────────┘
┌───────────────┼───────────────┐
Expand Down
21 changes: 19 additions & 2 deletions docs/start-here.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ claude --version

If that prints a version number, you're good. If not, install Claude Code first and come back.

Optional: if you also use Codex CLI, run `codex --version`. The toolkit mirrors its skills into `~/.codex/skills`, but Claude Code is still the full runtime for hooks, agents, commands, and scripts.

Command entry points:
- Claude Code: `/do`
- Codex: `$do`

## Install

Three commands. Copy-paste them.
Expand All @@ -30,7 +36,18 @@ cd claude-code-toolkit

The installer asks one question -- symlink or copy -- then sets everything up. Pick symlink if you want updates via `git pull`, copy if you want a stable snapshot. Either works fine.

What just happened: the installer linked agents, skills, hooks, commands, and scripts into `~/.claude/`, which is where Claude Code looks for extensions. It also configured hooks in your settings so they activate automatically.
What just happened: the installer linked agents, skills, hooks, commands, and scripts into `~/.claude/`, which is where Claude Code looks for extensions. It also mirrored skills into `~/.codex/skills` for Codex and configured hooks in your settings so they activate automatically.

## Verify It

Run:

```bash
python3 ~/.claude/scripts/install-doctor.py check
python3 ~/.claude/scripts/install-doctor.py inventory
```

`check` verifies the install layout, settings, hook paths, learning DB access, and Codex skill mirror. `inventory` shows what Claude and Codex can currently see. If you pull new toolkit changes later and want Codex to pick up new skills, rerun `./install.sh`.

## Your First Commands

Expand All @@ -48,7 +65,7 @@ Now try these.
/do what can you do?
```

The `/do` command is the front door. It reads your request, picks the right agent and skill, and runs it. This one shows you the full routing system -- every domain it handles, every workflow it knows.
The router command is the front door. Use `/do` in Claude Code and `$do` in Codex. It reads your request, picks the right agent and skill, and runs it. This one shows you the full routing system -- every domain it handles, every workflow it knows.

### Explore a codebase

Expand Down
138 changes: 135 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ NC='\033[0m' # No Color
# Get the directory where this script lives
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLAUDE_DIR="${HOME}/.claude"
CODEX_DIR="${HOME}/.codex"
CODEX_SKILLS_DIR="${CODEX_DIR}/skills"

echo -e "${BLUE}╔════════════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ Claude Code Toolkit - Installation Script ║${NC}"
Expand Down Expand Up @@ -224,6 +226,62 @@ os.rename(tmp, dst)
echo " No settings.json found. Nothing to clean."
fi

# Phase 3.5: Clean toolkit-owned Codex mirror entries
echo ""
echo -e "${YELLOW}Cleaning Codex skills mirror...${NC}"
if [ -d "$CODEX_SKILLS_DIR" ]; then
for item in "${SCRIPT_DIR}/skills/"*; do
[ -e "$item" ] || continue
target="${CODEX_SKILLS_DIR}/$(basename "$item")"
if [ -L "$target" ] || [ -e "$target" ]; then
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would remove Codex entry: ${target}${NC}"
else
rm -rf "$target"
echo -e "${GREEN} ✓ Removed Codex entry: ${target}${NC}"
fi
REMOVED+=("Codex skill $(basename "$item")")
fi
done

if [ -d "${SCRIPT_DIR}/private-voices" ]; then
for voice_dir in "${SCRIPT_DIR}/private-voices/"*; do
[ -d "$voice_dir" ] || continue
skill_src="${voice_dir}/skill"
[ -d "$skill_src" ] || continue
voice_name=$(basename "$voice_dir")
target="${CODEX_SKILLS_DIR}/voice-${voice_name}"
if [ -L "$target" ] || [ -e "$target" ]; then
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would remove Codex entry: ${target}${NC}"
else
rm -rf "$target"
echo -e "${GREEN} ✓ Removed Codex entry: ${target}${NC}"
fi
REMOVED+=("Codex skill voice-${voice_name}")
fi
done
fi

if [ -d "${SCRIPT_DIR}/private-skills" ]; then
for item in "${SCRIPT_DIR}/private-skills/"*; do
[ -e "$item" ] || continue
target="${CODEX_SKILLS_DIR}/$(basename "$item")"
if [ -L "$target" ] || [ -e "$target" ]; then
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would remove Codex entry: ${target}${NC}"
else
rm -rf "$target"
echo -e "${GREEN} ✓ Removed Codex entry: ${target}${NC}"
fi
REMOVED+=("Codex skill $(basename "$item")")
fi
done
fi
else
echo " No ~/.codex/skills mirror found. Nothing to clean."
fi

# Phase 4: Remove install manifest
echo ""
echo -e "${YELLOW}Cleaning up manifest...${NC}"
Expand Down Expand Up @@ -341,6 +399,15 @@ else
fi
echo -e "${GREEN}✓ ${CLAUDE_DIR} ready${NC}"

echo ""
echo -e "${YELLOW}Setting up ~/.codex skills directory...${NC}"
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would create: ${CODEX_SKILLS_DIR}${NC}"
else
mkdir -p "${CODEX_SKILLS_DIR}"
fi
echo -e "${GREEN}✓ ${CODEX_SKILLS_DIR} ready${NC}"

# Install components
echo ""
echo -e "${YELLOW}Installing components (mode: ${MODE})...${NC}"
Expand Down Expand Up @@ -394,6 +461,41 @@ install_component() {
fi
}

sync_codex_entry() {
local source=$1
local target=$2
local name
name=$(basename "$source")

if [ -e "$target" ] || [ -L "$target" ]; then
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would replace Codex entry: ${target}${NC}"
else
rm -rf "$target"
fi
fi

if [ "$MODE" = "symlink" ]; then
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would symlink Codex entry: ${source} -> ${target}${NC}"
else
ln -s "$source" "$target"
echo -e "${GREEN} ✓ Codex symlinked ${name}${NC}"
fi
else
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would copy Codex entry: ${source} -> ${target}${NC}"
else
if [ -d "$source" ]; then
cp -r "$source" "$target"
else
cp "$source" "$target"
fi
echo -e "${GREEN} ✓ Codex copied ${name}${NC}"
fi
fi
}

# Install main components
for component in agents skills hooks commands scripts; do
if [ -d "${SCRIPT_DIR}/${component}" ]; then
Expand Down Expand Up @@ -439,6 +541,37 @@ for private_dir in private-agents private-skills private-hooks; do
fi
done

echo ""
echo -e "${YELLOW}Syncing Codex skills mirror...${NC}"
CODEX_ENTRY_COUNT=0
for item in "${SCRIPT_DIR}/skills/"*; do
[ -e "$item" ] || continue
target="${CODEX_SKILLS_DIR}/$(basename "$item")"
sync_codex_entry "$item" "$target"
CODEX_ENTRY_COUNT=$((CODEX_ENTRY_COUNT + 1))
done

if [ -d "${SCRIPT_DIR}/private-voices" ]; then
for voice_dir in "${SCRIPT_DIR}/private-voices/"*; do
[ -d "$voice_dir" ] || continue
skill_src="${voice_dir}/skill"
[ -d "$skill_src" ] || continue
voice_name=$(basename "$voice_dir")
target="${CODEX_SKILLS_DIR}/voice-${voice_name}"
sync_codex_entry "$skill_src" "$target"
CODEX_ENTRY_COUNT=$((CODEX_ENTRY_COUNT + 1))
done
fi

if [ -d "${SCRIPT_DIR}/private-skills" ]; then
for item in "${SCRIPT_DIR}/private-skills/"*; do
[ -e "$item" ] || continue
target="${CODEX_SKILLS_DIR}/$(basename "$item")"
sync_codex_entry "$item" "$target"
CODEX_ENTRY_COUNT=$((CODEX_ENTRY_COUNT + 1))
done
fi

# Set up local overlay
echo ""
echo -e "${YELLOW}Setting up local overlay...${NC}"
Expand Down Expand Up @@ -577,8 +710,6 @@ fi
if [ "$DRY_RUN" = true ]; then
echo -e "${BLUE} Would write: ${CLAUDE_DIR}/.install-manifest.json${NC}"
else
SYMLINK_MODE="false"
[ "$MODE" = "symlink" ] && SYMLINK_MODE="true"
$PYTHON_CMD -c "
import json, datetime, subprocess, sys
try:
Expand All @@ -589,7 +720,7 @@ manifest = {
'installed_at': datetime.datetime.utcnow().isoformat() + 'Z',
'toolkit_commit': commit,
'toolkit_path': '${SCRIPT_DIR}',
'mode': 'symlink' if ${SYMLINK_MODE} else 'copy',
'mode': '${MODE}',
'components': ['agents', 'skills', 'hooks', 'commands', 'scripts'],
}
json.dump(manifest, open('${CLAUDE_DIR}/.install-manifest.json', 'w'), indent=2)
Expand Down Expand Up @@ -619,6 +750,7 @@ echo ""
echo "Installed components:"
echo " • Agents: ${AGENT_COUNT} specialized domain experts"
echo " • Skills: ${SKILL_COUNT} workflow methodologies (${INVOCABLE_COUNT} user-invocable)"
echo " • Codex skills: ${CODEX_ENTRY_COUNT} mirrored entries in ~/.codex/skills"
echo " • Hooks: ${HOOK_COUNT} automation hooks"
echo " • Commands: ${COMMAND_COUNT} slash commands"
echo " • Scripts: ${SCRIPT_COUNT} utility scripts"
Expand Down
Loading
Loading