[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M748NA7H15VC9AMHD278XDVF":3,"skill-same:01M748NA7H15VC9AMHD278XDVF":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M748NA7H15VC9AMHD278XDVF","safe-mode",null,"Prevent destructive operations using Claude Code hooks. Three modes — cautious (warn on dangerous commands), lockdown (restrict edits to one directory), and clear (remove restrictions). Uses PreToolUse matchers for Bash, Edit, and Write.","surfingalien\u002FFinSurfing","surfingalien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F138259559?v=4","01M71XACCFHNXK70BHYFHFT657","01M71XACDJSV4YA5NZ191F1C8C",1,"MIT","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsafe-mode\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: safe-mode\ndescription: Prevent destructive operations using Claude Code hooks. Three modes — cautious (warn on dangerous commands), lockdown (restrict edits to one directory), and clear (remove restrictions). Uses PreToolUse matchers for Bash, Edit, and Write.\nhooks:\n  PreToolUse:\n    - matcher: \"tool == \\\"Bash\\\"\"\n      description: \"Intercept shell commands and check for destructive operations\"\n    - matcher: \"tool == \\\"Edit\\\" || tool == \\\"Write\\\"\"\n      description: \"Enforce directory lockdown when active\"\n---\n\n# Safe Mode\n\nThree levels of protection against destructive operations during AI coding sessions.\n\n> **Note:** These hooks are skill-scoped — they only activate when you invoke `\u002Fsafe-mode`. The global `permission-request.js` hook in hooks.json provides always-on alerting for dangerous commands. Safe-mode adds opt-in blocking and directory restrictions on top of that.\n\n## Modes\n\n### Cautious Mode\n\n```text\n\u002Fsafe-mode cautious\n```\n\nIntercepts Bash commands before execution. Warns on dangerous patterns but does not block — the user decides.\n\n**Flagged patterns:**\n\n| Pattern | Risk |\n|---------|------|\n| `rm -rf` \u002F `rm -r` | Recursive deletion |\n| `DROP TABLE` \u002F `DROP DATABASE` | SQL data loss |\n| `TRUNCATE` | SQL data destruction |\n| `git push --force` \u002F `git push -f` | Remote history rewrite |\n| `git reset --hard` | Local history loss |\n| `git clean -f` | Untracked file deletion |\n| `git checkout .` \u002F `git restore .` | Discard all changes |\n| `chmod 777` | World-writable permissions |\n| `curl` or `wget` piped to a shell | Piped remote execution |\n| `> \u002Fdev\u002Fsda` \u002F `dd if=` | Disk-level operations |\n| `:(){ :\\|:& };:` | Fork bombs |\n| `sudo rm` | Elevated deletion |\n\n**What happens:**\n\n```text\nWARNING: Destructive operation detected\n  Command: rm -rf .\u002Fbuild\n  Pattern: rm -rf (recursive forced deletion)\n  Risk: Permanently deletes .\u002Fbuild and all contents\n\n  Proceed? The command will execute as-is if you continue.\n```\n\nThe warning goes to stderr. Claude sees it and asks for confirmation before proceeding.\n\n### Lockdown Mode\n\n```text\n\u002Fsafe-mode lockdown \u003Cpath>\n```\n\nRestricts Edit and Write operations to a single directory tree. Prevents accidental changes to unrelated code.\n\n**How it works:**\n\n1. Set the allowed path (absolute or relative to repo root)\n2. Every Edit\u002FWrite call checks if the target file is inside the allowed path\n3. Operations outside the path are blocked with an explanation\n\n```text\nLOCKDOWN ACTIVE: Edits restricted to src\u002Fapi\u002F\n\n  Blocked: Edit to src\u002Futils\u002Fhelpers.ts\n  Reason: File is outside the lockdown path (src\u002Fapi\u002F)\n\n  To edit files outside the lockdown, run: \u002Fsafe-mode clear\n```\n\n**Use cases:**\n\n- Focused refactoring of one module without touching others\n- Bug fix in a specific directory while tests run elsewhere\n- Junior developer guardrail — scope the blast radius\n- Code review session — only edit the files under review\n\n**Scope:** Session-scoped. Resets when the session ends.\n\n### Clear\n\n```text\n\u002Fsafe-mode clear\n```\n\nRemoves all restrictions for the current session. Both cautious warnings and lockdown restrictions are disabled.\n\n```text\nSAFE MODE: All restrictions cleared for this session.\n```\n\n## Implementation\n\n### PreToolUse Hook — Bash (Cautious Mode)\n\nThe hook inspects `tool_input.command` before every Bash execution:\n\n```javascript\nconst DANGEROUS_PATTERNS = [\n  { pattern: \u002F\\brm\\s+(-[a-zA-Z]*[rf][a-zA-Z]*\\s|--recursive|--force)\u002F, label: \"rm with -rf flags\" },\n  { pattern: \u002F\\bDROP\\s+(TABLE|DATABASE|INDEX|VIEW)\\b\u002Fi, label: \"DROP SQL statement\" },\n  { pattern: \u002F\\bTRUNCATE\\b\u002Fi, label: \"TRUNCATE SQL statement\" },\n  { pattern: \u002F\\bgit\\s+push\\s+(-[a-zA-Z]*f|--force)\u002F, label: \"git force-push\" },\n  { pattern: \u002F\\bgit\\s+reset\\s+--hard\\b\u002F, label: \"git hard reset\" },\n  { pattern: \u002F\\bgit\\s+clean\\s+-[a-zA-Z]*f\u002F, label: \"git clean -f\" },\n  { pattern: \u002F\\bgit\\s+(checkout|restore)\\s+\\.\u002F, label: \"git discard all changes\" },\n  { pattern: \u002F\\bchmod\\s+777\\b\u002F, label: \"chmod 777\" },\n  { pattern: \u002F\\bcurl\\b.*\\|\\s*(sh|bash)\\b\u002F, label: \"piped remote execution\" },\n  { pattern: \u002F\\bwget\\b.*\\|\\s*(sh|bash)\\b\u002F, label: \"piped remote execution\" },\n  { pattern: \u002F\\bsudo\\s+rm\\b\u002F, label: \"elevated deletion\" },\n];\n```\n\nMatch found → emit warning to stderr. No match → pass through silently.\n\n### PreToolUse Hook — Edit\u002FWrite (Lockdown Mode)\n\nThe hook checks `tool_input.file_path` against the lockdown path:\n\n```javascript\nfunction isInsideLockdown(filePath, lockdownPath) {\n  const resolved = fs.realpathSync(path.resolve(filePath));\n  const allowed = fs.realpathSync(path.resolve(lockdownPath));\n  const rel = path.relative(allowed, resolved);\n  return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));\n}\n```\n\nInside lockdown path → pass through. Outside → block with explanation.\n\n### State\n\nMode state lives in a session-scoped temp file (keyed by session ID to avoid cross-session leaks):\n\n```text\n$TMPDIR\u002Fpro-workflow\u002Fsafe-mode-\u003CsessionId>.json\n{\n  \"mode\": \"lockdown\",\n  \"lockdownPath\": \"\u002FUsers\u002Fdev\u002Fproject\u002Fsrc\u002Fapi\",\n  \"sessionId\": \"abc123\",\n  \"activatedAt\": \"2026-03-28T10:00:00Z\"\n}\n```\n\nCleared by `\u002Fsafe-mode clear`. State persists until explicitly cleared or the temp file is manually removed. Each session has its own state file.\n\n## Combining Modes\n\nCautious and lockdown can run simultaneously:\n\n```text\n\u002Fsafe-mode cautious\n\u002Fsafe-mode lockdown src\u002Fapi\u002F\n```\n\nNow you get:\n- Bash command warnings for destructive operations\n- Edit\u002FWrite restrictions to `src\u002Fapi\u002F` only\n\nClear removes both.\n\n## When to Use\n\n| Situation | Mode |\n|-----------|------|\n| Working on production-adjacent code | Cautious |\n| Focused refactoring of one module | Lockdown |\n| Unfamiliar codebase, feeling cautious | Cautious |\n| Pair programming, limiting AI scope | Lockdown |\n| Done with restrictions | Clear |\n\n## Anti-Patterns\n\n- Leaving lockdown on when you need to edit tests (update the path or clear it)\n- Using safe-mode as a substitute for git branches (branches protect history, safe-mode protects the session)\n- Ignoring cautious warnings repeatedly (if you always proceed, turn it off — false confidence is worse)\n","# Safe Mode\n\nThree levels of protection against destructive operations during AI coding sessions.\n\n> **Note:** These hooks are skill-scoped — they only activate when you invoke `\u002Fsafe-mode`. The global `permission-request.js` hook in hooks.json provides always-on alerting for dangerous commands. Safe-mode adds opt-in blocking and directory restrictions on top of that.\n\n## Modes\n\n### Cautious Mode\n\n```text\n\u002Fsafe-mode cautious\n```\n\nIntercepts Bash commands before execution. Warns on dangerous patterns but does not block — the user decides.\n\n**Flagged patterns:**\n\n| Pattern | Risk |\n|---------|------|\n| `rm -rf` \u002F `rm -r` | Recursive deletion |\n| `DROP TABLE` \u002F `DROP DATABASE` | SQL data loss |\n| `TRUNCATE` | SQL data destruction |\n| `git push --force` \u002F `git push -f` | Remote history rewrite |\n| `git reset --hard` | Local history loss |\n| `git clean -f` | Untracked file deletion |\n| `git checkout .` \u002F `git restore .` | Discard all changes |\n| `chmod 777` | World-writable permissions |\n| `curl` or `wget` piped to a shell | Piped remote execution |\n| `> \u002Fdev\u002Fsda` \u002F `dd if=` | Disk-level operations |\n| `:(){ :\\|:& };:` | Fork bombs |\n| `sudo rm` | Elevated deletion |\n\n**What happens:**\n\n```text\nWARNING: Destructive operation detected\n  Command: rm -rf .\u002Fbuild\n  Pattern: rm -rf (recursive forced deletion)\n  Risk: Permanently deletes .\u002Fbuild and all contents\n\n  Proceed? The command will execute as-is if you continue.\n```\n\nThe warning goes to stderr. Claude sees it and asks for confirmation before proceeding.\n\n### Lockdown Mode\n\n```text\n\u002Fsafe-mode lockdown \u003Cpath>\n```\n\nRestricts Edit and Write operations to a single directory tree. Prevents accidental changes to unrelated code.\n\n**How it works:**\n\n1. Set the allowed path (absolute or relative to repo root)\n2. Every Edit\u002FWrite call checks if the target file is inside the allowed path\n3. Operations outside the path are blocked with an explanation\n\n```text\nLOCKDOWN ACTIVE: Edits restricted to src\u002Fapi\u002F\n\n  Blocked: Edit to src\u002Futils\u002Fhelpers.ts\n  Reason: File is outside the lockdown path (src\u002Fapi\u002F)\n\n  To edit files outside the lockdown, run: \u002Fsafe-mode clear\n```\n\n**Use cases:**\n\n- Focused refactoring of one module without touching others\n- Bug fix in a specific directory while tests run elsewhere\n- Junior developer guardrail — scope the blast radius\n- Code review session — only edit the files under review\n\n**Scope:** Session-scoped. Resets when the session ends.\n\n### Clear\n\n```text\n\u002Fsafe-mode clear\n```\n\nRemoves all restrictions for the current session. Both cautious warnings and lockdown restrictions are disabled.\n\n```text\nSAFE MODE: All restrictions cleared for this session.\n```\n\n## Implementation\n\n### PreToolUse Hook — Bash (Cautious Mode)\n\nThe hook inspects `tool_input.command` before every Bash execution:\n\n```javascript\nconst DANGEROUS_PATTERNS = [\n  { pattern: \u002F\\brm\\s+(-[a-zA-Z]*[rf][a-zA-Z]*\\s|--recursive|--force)\u002F, label: \"rm with -rf flags\" },\n  { pattern: \u002F\\bDROP\\s+(TABLE|DATABASE|INDEX|VIEW)\\b\u002Fi, label: \"DROP SQL statement\" },\n  { pattern: \u002F\\bTRUNCATE\\b\u002Fi, label: \"TRUNCATE SQL statement\" },\n  { pattern: \u002F\\bgit\\s+push\\s+(-[a-zA-Z]*f|--force)\u002F, label: \"git force-push\" },\n  { pattern: \u002F\\bgit\\s+reset\\s+--hard\\b\u002F, label: \"git hard reset\" },\n  { pattern: \u002F\\bgit\\s+clean\\s+-[a-zA-Z]*f\u002F, label: \"git clean -f\" },\n  { pattern: \u002F\\bgit\\s+(checkout|restore)\\s+\\.\u002F, label: \"git discard all changes\" },\n  { pattern: \u002F\\bchmod\\s+777\\b\u002F, label: \"chmod 777\" },\n  { pattern: \u002F\\bcurl\\b.*\\|\\s*(sh|bash)\\b\u002F, label: \"piped remote execution\" },\n  { pattern: \u002F\\bwget\\b.*\\|\\s*(sh|bash)\\b\u002F, label: \"piped remote execution\" },\n  { pattern: \u002F\\bsudo\\s+rm\\b\u002F, label: \"elevated deletion\" },\n];\n```\n\nMatch found → emit warning to stderr. No match → pass through silently.\n\n### PreToolUse Hook — Edit\u002FWrite (Lockdown Mode)\n\nThe hook checks `tool_input.file_path` against the lockdown path:\n\n```javascript\nfunction isInsideLockdown(filePath, lockdownPath) {\n  const resolved = fs.realpathSync(path.resolve(filePath));\n  const allowed = fs.realpathSync(path.resolve(lockdownPath));\n  const rel = path.relative(allowed, resolved);\n  return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));\n}\n```\n\nInside lockdown path → pass through. Outside → block with explanation.\n\n### State\n\nMode state lives in a session-scoped temp file (keyed by session ID to avoid cross-session leaks):\n\n```text\n$TMPDIR\u002Fpro-workflow\u002Fsafe-mode-\u003CsessionId>.json\n{\n  \"mode\": \"lockdown\",\n  \"lockdownPath\": \"\u002FUsers\u002Fdev\u002Fproject\u002Fsrc\u002Fapi\",\n  \"sessionId\": \"abc123\",\n  \"activatedAt\": \"2026-03-28T10:00:00Z\"\n}\n```\n\nCleared by `\u002Fsafe-mode clear`. State persists until explicitly cleared or the temp file is manually removed. Each session has its own state file.\n\n## Combining Modes\n\nCautious and lockdown can run simultaneously:\n\n```text\n\u002Fsafe-mode cautious\n\u002Fsafe-mode lockdown src\u002Fapi\u002F\n```\n\nNow you get:\n- Bash command warnings for destructive operations\n- Edit\u002FWrite restrictions to `src\u002Fapi\u002F` only\n\nClear removes both.\n\n## When to Use\n\n| Situation | Mode |\n|-----------|------|\n| Working on production-adjacent code | Cautious |\n| Focused refactoring of one module | Lockdown |\n| Unfamiliar codebase, feeling cautious | Cautious |\n| Pair programming, limiting AI scope | Lockdown |\n| Done with restrictions | Clear |\n\n## Anti-Patterns\n\n- Leaving lockdown on when you need to edit tests (update the path or clear it)\n- Using safe-mode as a substitute for git branches (branches protect history, safe-mode protects the session)\n- Ignoring cautious warnings repeatedly (if you always proceed, turn it off — false confidence is worse)\n",{"name":5,"hooks":23,"description":7},{"PreToolUse":24},[25,28],{"matcher":26,"description":27},"tool == \"Bash\"","Intercept shell commands and check for destructive operations",{"matcher":29,"description":30},"tool == \"Edit\" || tool == \"Write\"","Enforce directory lockdown when active","main","351d6f0a5dac78be33208c688fdbb820b9053685",".claude\u002Fskills\u002Fsafe-mode",0,"https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing","https:\u002F\u002Fgithub.com\u002Fsurfingalien","2026-11-14 00:29:40",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add surfingalien\u002FFinSurfing --skill safe-mode",{"tool":44,"command":45},"bunx","bunx skills add surfingalien\u002FFinSurfing --skill safe-mode",{"tool":47,"command":48},"pnpm","pnpm dlx skills add surfingalien\u002FFinSurfing --skill safe-mode","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsafe-mode\u002FSKILL.md",true,[],[53,59,65,72,79,86],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7490VYNX3NCT8R0PPSYHTXP","portfolio-management","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002Fskills\u002Fportfolio-management\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7490SNSG32QP06X1P1EVK7N","financial-analysis","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002Fskills\u002Ffinancial-analysis\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7490MKJ5QCVWWXC8HK57EVQ","tradingview-mcp","AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, Reddit sentiment, news, and multi-market screener. Supports stocks, crypto, ETFs, indices, Turkish (BIST), and Egyptian (EGX) markets.","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002Fopenclaw\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7490FHXRPVEPQMZ4KHFD161","sales-engineer","Analyzes RFP\u002FRFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win\u002Floss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002Fbusiness-growth\u002Fskills\u002Fsales-engineer\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7490C91D8F7CM7AXFZK8SQE","revenue-operations","Analyzes sales pipeline health, revenue forecasting accuracy, and go-to-market efficiency metrics for SaaS revenue optimization. Use when analyzing sales pipeline coverage, forecasting revenue, evaluating go-to-market performance, reviewing sales metrics, assessing pipeline analysis, tracking forecast accuracy with MAPE, calculating GTM efficiency, or measuring sales efficiency and unit economics for SaaS teams.","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002Fbusiness-growth\u002Fskills\u002Frevenue-operations\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M74907FEV2YRKSYPNG649HGF","customer-success-manager","Monitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success. Use when analyzing customer accounts, reviewing retention metrics, scoring at-risk customers, or when the user mentions churn, customer health scores, upsell opportunities, expansion revenue, retention analysis, or customer analytics. Runs three Python CLI tools to produce deterministic health scores, churn risk tiers, and prioritized expansion recommendations across Enterprise, Mid-Market, and SMB segments.","https:\u002F\u002Fgithub.com\u002Fsurfingalien\u002FFinSurfing\u002Fblob\u002Fmain\u002Fbusiness-growth\u002Fskills\u002Fcustomer-success-manager\u002FSKILL.md",[],[]]