Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.
Shell agent-teamsai-agentai-automationanthropicautonomous-agentawsbusiness-operationsclaudeclaude-codeclaude-code-plugindevopsecommerceinbox-zeroklaviyomarketingmcpmorning-briefingpr-automationshopifyterminal
chore(security): scrub hardcoded PII to env/config + add PII pre-commit guard (#392)
Aurora Capital3f3f08afa493
diff --git a/claude-ops/.githooks/pre-commit b/claude-ops/.githooks/pre-commitnew file mode 100755index 00000000..3b513c9f--- /dev/null+++ b/claude-ops/.githooks/pre-commit@@ -0,0 +1,107 @@+#!/usr/bin/env bash+# .githooks/pre-commit — PII guard+#+# Blocks commits that add real email addresses or absolute home-dir paths with+# usernames. Also reads optional local denylist from .githooks/pii-denylist.local+# (one ERE regex per line; that file is gitignored so you can add your exact+# name/handle without committing it to the public repo).+#+# Activation (run once per clone):+# git config core.hooksPath .githooks+#+# To override for a deliberate exception:+# git commit --no-verify++set -euo pipefail++REPO_ROOT="$(git rev-parse --show-toplevel)"+LOCAL_DENYLIST="$REPO_ROOT/.githooks/pii-denylist.local"++# --- patterns checked against ADDED lines only ---++# (a) Real email addresses — anything not on the safe-domain allowlist.+# Allowlist: example.com, example.org, noreply, users.noreply.github.com, anthropic.com+EMAIL_REGEX='[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}'+SAFE_EMAIL_REGEX='@(example\.com|example\.org|.*noreply.*|anthropic\.com)$'++# (b) Absolute home paths with a literal username component.+# Allow: $HOME, $HOME, ~, /Users/<user>, /home/<user> (literal placeholder text)+HOME_PATH_REGEX='/(Users|home)/[A-Za-z0-9._-]+'+SAFE_HOME_REGEX='/(Users|home)/(ec2-user|<user>|<[A-Za-z_-]+>)\b'++found=0++check_line() {+ local file="$1" linenum="$2" content="$3"++ # (a) email check+ while IFS= read -r match; do+ [[ -z "$match" ]] && continue+ if ! echo "$match" | grep -qiE "$SAFE_EMAIL_REGEX"; then+ echo "PII guard: $file:$linenum — email address: $match"+ found=1+ fi+ done < <(echo "$content" | grep -oE "$EMAIL_REGEX" || true)++ # (b) home-path check+ while IFS= read -r match; do+ [[ -z "$match" ]] && continue+ if ! echo "$match" | grep -qE "$SAFE_HOME_REGEX"; then+ echo "PII guard: $file:$linenum — home path: $match"+ found=1+ fi+ done < <(echo "$content" | grep -oE "$HOME_PATH_REGEX" || true)++ # (c) local denylist (gitignored, not committed)+ if [[ -f "$LOCAL_DENYLIST" ]]; then+ while IFS= read -r pattern; do+ [[ -z "$pattern" || "$pattern" == \#* ]] && continue+ if echo "$content" | grep -qE "$pattern" 2>/dev/null; then+ echo "PII guard: $file:$linenum — matched local denylist pattern: $pattern"+ found=1+ fi+ done < "$LOCAL_DENYLIST"+ fi+}++# Parse git diff --cached: only look at added lines (+) in tracked files+current_file=""+linenum=0++while IFS= read -r raw; do+ # diff --git a/... b/...+ if [[ "$raw" =~ ^diff\ --git\ a/.+\ b/(.+)$ ]]; then+ current_file="${BASH_REMATCH[1]}"+ linenum=0+ continue+ fi+ # @@ -old +new,count @@+ if [[ "$raw" =~ ^\+\+\+\ b/(.+)$ ]]; then+ current_file="${BASH_REMATCH[1]}"+ linenum=0+ continue+ fi+ if [[ "$raw" =~ ^@@.*\+([0-9]+) ]]; then+ linenum=$(( ${BASH_REMATCH[1]} - 1 ))+ continue+ fi+ # Added line+ if [[ "$raw" == +* && "$raw" != "+++"* ]]; then+ linenum=$(( linenum + 1 ))+ content="${raw:1}" # strip leading ++ [[ -n "$current_file" ]] && check_line "$current_file" "$linenum" "$content"+ continue+ fi+ # Context or removed line — still advance line counter for + side+ if [[ "$raw" == " "* ]]; then+ linenum=$(( linenum + 1 ))+ fi+done < <(git diff --cached --unified=0 2>/dev/null)++if [[ "$found" -ne 0 ]]; then+ echo ""+ echo "PII guard: commit blocked. Use placeholders/env vars, or \`git commit --no-verify\` to override."+ exit 1+fi++exit 0diff --git a/claude-ops/.gitignore b/claude-ops/.gitignoreindex bce90666..86d3d4cd 100644--- a/claude-ops/.gitignore+++ b/claude-ops/.gitignore@@ -62,3 +62,6 @@ __pycache__/# GCP / Google ADC credentials — never committed; live in ~/.gcp/*.json.bak-ga4-*++# Local PII denylist — gitignored so users can add personal handles without committing them+.githooks/pii-denylist.localdiff --git a/claude-ops/bin/ops-post-update-migrate b/claude-ops/bin/ops-post-update-migrateindex 29584aa2..d0f8c8c1 100755--- a/claude-ops/bin/ops-post-update-migrate+++ b/claude-ops/bin/ops-post-update-migrate@@ -54,7 +54,7 @@ run_migrations() {if [[ -f "$legacy_user_plist" && "$legacy_user_plist" != "$plist_dst" ]]; thenlaunchctl unload "$legacy_user_plist" 2>/dev/null || truerm -f "$legacy_user_plist" 2>/dev/null || true- log " ok: removed legacy com.user whatsapp-bridge LaunchAgent"+ log " ok: removed legacy com.<user> whatsapp-bridge LaunchAgent"filocal plist_src="$PLUGIN_ROOT/assets/launchagents/com.claude-ops.whatsapp-bridge.plist"if [[ -f "$plist_src" ]] && [[ ! -f "$plist_dst" || "$plist_src" -nt "$plist_dst" ]]; thendiff --git a/claude-ops/skills/ops-inbox/SKILL.md b/claude-ops/skills/ops-inbox/SKILL.mdindex 4cdd075b..aff1d47f 100644--- a/claude-ops/skills/ops-inbox/SKILL.md+++ b/claude-ops/skills/ops-inbox/SKILL.md@@ -721,8 +721,8 @@ The two main read commands return DIFFERENT envelopes — agents have repeatedly**Canonical thread-classification recipe** (copy-paste-safe, handles empty/error threads gracefully):```python-import json, subprocess-USER_ADDRS = ['user', '[email protected]', '[email protected]'] # adapt per user+import json, os, subprocess+USER_ADDRS = [a for a in os.environ.get('OPS_USER_ADDRS', '').split(',') if a] # set [email protected],[email protected]def classify_thread(thread_id):r = subprocess.run(['gog','gmail','thread','get',thread_id,'-j'],