# code-review

Adopt this skill: https://proskills.md/skills/other/mfielding92-clawedback-claude-skills-code-review

Page: https://proskills.md/skills/other/mfielding92-clawedback-claude-skills-code-review
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: .claude/skills/code-review/SKILL.md
size: 3081
upstream: https://github.com/mfielding92/clawedback/blob/main/.claude/skills/code-review/SKILL.md

```text
---
name: code-review
description: Review code changes for quality, security, and correctness. Use when the user says "review this PR", "review these changes", "check my code", "look at what I changed", or after implementing a feature. Produces a severity-organized report.
argument-hint: "[file path, branch, or PR number]"
context: fork
agent: Explore
allowed-tools: Read, Grep, Glob, Bash(git *)
---

# Code Review

Produce a severity-organized review report covering security, correctness, and quality for code changes.

## Goal
Identify issues in code changes, organized by severity (Critical > Warnings > Suggestions), with specific file:line references and fix suggestions for every finding. Done when the report is presented to the user.

## Context
Before reviewing, read CLAUDE.md and any linter/formatter config files (.eslintrc, pyproject.toml, .prettierrc, etc.) to understand project conventions. Do not flag style issues already handled by configured tooling.

## Process

### Step 1: Identify Changes
- If `$ARGUMENTS` specifies a file, branch, or PR: use that scope
- If `$ARGUMENTS` is empty: run `git diff main...HEAD`. If that returns nothing, ask: "What should I review — a branch, specific files, or uncommitted changes?"
- Identify all modified files and understand the scope

**CHECKPOINT:** Present the identified files and diff scope. Confirm this is the correct review target before proceeding.

### Step 2: Understand Context
- Read the modified files fully (not just the diff)
- Understand what the code is supposed to do
- Check for related test files

### Step 3: Review Checklist

**Critical (must fix before merge):**
- Security vulnerabilities (injection, XSS, exposed secrets, missing auth checks)
- Data loss risks (destructive operations without confirmation, missing transactions)
- Race conditions or concurrency issues
- Breaking changes to public APIs without migration path

**Warnings (should fix):**
- Missing error handling for external calls (network, file I/O, DB)
- Missing input validation at system boundaries
- Duplicated logic that should be shared
- Performance issues (N+1 queries, unnecessary allocations in loops)
- Missing or inadequate test coverage for new behavior

**Suggestions (nice to have):**
- Naming improvements for clarity
- Simplification opportunities
- Better patterns available in the framework

### Step 4: Report
For each finding:
1. **File and line reference**: `path/to/file.ts:42`
2. **What's wrong**: One sentence
3. **Why it matters**: Impact if not fixed
4. **How to fix**: Specific suggestion with code example

Organize findings by severity: Critical first, then Warnings, then Suggestions.

## Output
Report is presented inline in the conversation, organized by severity. Offer to save to `.claude/memory/review-YYYY-MM-DD.md` if the user wants a record.

## What NOT to Flag
- Style issues handled by linters/formatters
- Opinions about code organization without concrete benefit
- "I would have done it differently" without a clear improvement
- Missing documentation on self-explanatory code
```

## File: README.md
upstream: https://github.com/mfielding92/clawedback/blob/main/README.md

````text
<div align="center">

# 🦀 ClawedBack 🦀

### Your Personal AI Assistant — Runs in [Claude Code](https://claude.ai/code)

[![Runs in Claude Code](https://img.shields.io/badge/Runs%20in-Claude%20Code-blueviolet?style=for-the-badge)](https://claude.ai/code)
[![Port of OpenClaw](https://img.shields.io/badge/Port%20of-OpenClaw-ff6b35?style=for-the-badge)](https://github.com/openclaw/openclaw)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue?style=for-the-badge)](LICENSE)

[![Skills](https://img.shields.io/badge/Skills-17%20custom-0078D4?style=flat-square)](.claude/skills)
[![Tool Compat](https://img.shields.io/badge/OpenClaw%20Tools-19%2F23%20matched-2ea44f?style=flat-square)](.claude/skills/oc-hub/references/tool-mapping.md)
[![ClawHub](https://img.shields.io/badge/ClawHub-Compatible-E86C00?style=flat-square)](https://clawhub.ai)
[![Security Scan](https://img.shields.io/badge/Imports-Security%20Scanned-critical?style=flat-square)](.claude/skills/oc-hub)
[![Install Modes](https://img.shields.io/badge/Install-3%20Modes-ff69b4?style=flat-square)](#-setup)

**A clean-room port of [OpenClaw](https://github.com/openclaw/openclaw) that runs inside [Claude Code](https://claude.ai/code)**
**17 skills · 5 agents · 3 install modes · ClawHub compatible**

Multi-channel AI assistant with web chat, file sharing, voice messages, scheduled tasks,<br>
webhook ingestion, approval workflows, and a skill marketplace — all running inside Claude Code.<br>
**Clone, setup, chat.** 🦀

</div>

---

## 🦀 What Is This?

ClawedBack is a **clean-room reimplementation** of the [OpenClaw](https://github.com/openclaw/openclaw) personal AI assistant platform, rebuilt from the ground up to run **inside [Claude Code](https://claude.ai/code)**.

> **Important:** ClawedBack is a **port**, not a fork. It resembles OpenClaw in spirit and functionality — a multi-channel, self-hosted AI assistant with tool execution, automation, and approval workflows — but is an entirely separate codebase with a different architecture. No OpenClaw code was used. 🦀

Where OpenClaw is a TypeScript monolith with a WebSocket gateway, ClawedBack flips the script: **Claude Code IS the agent runtime.** It's [Claude Code skills](https://docs.anthropic.com/en/docs/claude-code/skills).

## 🦀 Setup

Use of this project is subject to [Anthropic's Terms of Service](https://www.anthropic.com/legal/consumer-terms).

### Prerequisites
- Python 3.11+
- tmux (`sudo apt install tmux`)

### Step 1: Install Claude Code

```bash
curl -fsSL https://claude.ai/install.sh | bash
```

### Step 2: Clone and enter the project

```bash
git clone https://github.com/reedmayhew18/ClawedBack.git
cd ClawedBack
```

### Step 3: Start in tmux

```bash
tmux new -s clawedback
```

### Step 4: Choose your install mode and launch Claude

<details>
<summary><strong>🦀 Mode A: Portable — User (Recommended)</strong></summary>

Best for trying it out, development, or personal use. Safest option.

```bash
claude
# then: /oc-setup → choose Mode A
```

- Python venv inside the project folder
- Runs as your normal user
- Claude asks permission before risky operations (add `--dangerously-skip-permissions` to allow autonomous functionality)

</details>

<details>
<summary><strong>🦀 Mode B: Portable — Root</strong></summary>

Best for a dedicated server or VM where the assistant needs elevated access.

```bash
sudo -E "$(command -v claude || echo ~/.local/bin/claude)"
# then: /oc-setup → choose Mode B
```

- Python venv inside the project folder (same as A)
- Runs as root for full system access
- Commands for the regular user: `sudo -u <username> <command>`
- Still asks permission before destructive operations (add `--dangerously-skip-permissions` for autonomous mode — run the `IS_SANDBOX=1` lines from Mode C first if using this flag)

</details>

<details>
<summary><strong>🦀 Mode C: System Install — Full Root, No Guardrails</strong></summary>

Best for **sandboxes, VMs, or containers designated for ClawedBack**. Not for machines with important data. 🦀

```bash
# Set sandbox flag (both user and root)
echo 'export IS_SANDBOX=1' >> ~/.bashrc && source ~/.bashrc
sudo bash -c 'echo "export IS_SANDBOX=1" >> /root/.bashrc'

# Start Claude as root with no permission prompts
sudo -E "$(command -v claude || echo ~/.local/bin/claude)" --dangerously-skip-permissions
# then: /oc-setup → choose Mode C
```

- System Python directly (`--break-system-packages`), no venv
- Root with `--dangerously-skip-permissions` — Claude can do **anything** without asking
- Maximum capability, zero guardrails

> **WARNING**: Only use Mode C on a system that is fully backed up, sandboxed, or designated for this purpose. Claude will have unrestricted root access with no confirmation prompts.

</details>

### Step 5: Run the setup wizard

```
/oc-setup
```

The wizard handles everything: installs dependencies, starts the server, generates your auth token, offers voice (Whisper) setup, and begins polling. Open the URL it gives you, paste the token, and start chatting. 🦀

**To detach tmux** (keeps ClawedBack running): `Ctrl+B`, then `D`
**To reattach later**: `tmux attach -t clawedback`

<details>
<summary><strong>Restarting After a Reboot</strong></summary>

If the tmux session died (reboot, crash, etc.), start a new one and resume:

```bash
tmux new -s clawedback
cd /path/to/ClawedBack
claude    # (or sudo -E ... for root modes)
```

Then run:
```
/start
```

This ensures the server is up, creates the polling cron job, and runs one poll cycle. Run `/start` whenever you restart Claude Code. 🦀

If the config file is missing (deleted or corrupted), use `/oc-resume` instead — it auto-detects and rebuilds the config.

</details>

<details>
<summary><strong>Updating ClawedBack</strong></summary>

To pull the latest updates from GitHub:
```
/oc-update
```

This fetches upstream changes, shows what's new, and applies them — preserving your `data/`, auth token, config, and any custom skills you've installed. If server files changed, it automatically restarts the server. 🦀

</details>

---

## 🦀 Features

### ✅ Implemented
- 🌐 **Web chat interface** — dark theme, mobile-responsive, full markdown rendering
- 📎 **File uploads** — drag-and-drop, analyze any file type
- 📁 **Organized file system** — date-based storage with temporary share links
- 🎤 **Voice messages** — recorded in-browser, transcribed with Whisper (CPU or GPU)
- 🔐 **Token auth** — auto-generated or custom, single-user security
- 🗄️ **Message queue** — SQLite with WAL mode, CLI interface for skills
- 📡 **SSE streaming** — fetch-based with auth header, cross-device sync
- ✅ **Read receipts** — green checkmark when Claude reads your message
- 🔒 **SSL/HTTPS** — `--ssl` flag, custom cert paths, or free Let's Encrypt via `/oc-ssl`
- 🤖 **17 custom skills** — routing, sessions, approvals, automation, webhooks, file sharing, updates
- ⏰ **Scheduled tasks** — reminders, recurring jobs, cron expressions
- 🔗 **Webhook ingestion** — receive events from GitHub, CI, custom services
- ✋ **Approval gates** — single gates and multi-step workflow chains with crash recovery
- 🧩 **Skill marketplace** — browse ClawHub, import with security scanning
- 🔍 **Security scanning** — mandatory audit of imported skills (subagent-isolated, 5-category scan)
- 📺 **Channel registry** — extensible adapter system for future platforms
- 🔄 **Self-updating** — `/oc-update` pulls latest while preserving config/data
- 🩺 **Self-healing resume** — `/oc-resume` auto-detects setup if config is missing
- 🖥️ **Three install modes** — user, root, or full root with no guardrails

### 🔮 Planned
- 🦀 Browser automation (Playwright)
- 🦀 Device nodes (remote command execution)
- 🦀 TTS voice responses

---

## 🦀 Tool Compatibility (19/23 Matched)

OpenClaw has 23 built-in tools. Claude Code matches **19 of them** out of the box — and the 4 missing are all API wrappers that can be built as skills. Full mapping in [`.claude/skills/oc-hub/references/tool-mapping.md`](.claude/s
````
