[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78DKH40Y7TS9909ZGQABCMD":3,"skill-same:01M78DKH40Y7TS9909ZGQABCMD":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M78DKH40Y7TS9909ZGQABCMD","create-readonly-db-role",null,"Provision a hardened SELECT-only Postgres role so AI agents can safely read a production database. Works on Supabase and any Postgres. Use when the user wants agents to query prod data, says \"read-only role\", \"safe prod DB access for agents\", or is tired of running SQL by hand for agents. Differentiator: this skill CREATES the role and wiring; day-to-day querying belongs in a project-local skill.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fops-and-setup\u002Fcreate-readonly-db-role\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: create-readonly-db-role\ndescription: 'Provision a hardened SELECT-only Postgres role so AI agents can safely read a production database. Works on Supabase and any Postgres. Use when the user wants agents to query prod data, says \"read-only role\", \"safe prod DB access for agents\", or is tired of running SQL by hand for agents. Differentiator: this skill CREATES the role and wiring; day-to-day querying belongs in a project-local skill.'\n---\n\n# Create a Read-Only DB Role for Agents\n\nBattle-tested pattern (DeepAPI ADR 0093). A SELECT-only role kills catastrophic writes at the permission level. Residual risks (data leaks, heavy queries) are handled by a denylist and timeouts. Agents stop being blind on prod; the human stops being the SQL bottleneck.\n\n## The pattern — 3 layers\n\n1. **Hard wall — grants.** The role gets SELECT and nothing else. Writes are impossible, not just discouraged.\n2. **Denylist, not allowlist.** Grant SELECT on ALL current + future tables in `public` (via default privileges), then revoke the crown jewels (API keys, webhook payloads, secrets). Never grant the `auth` schema. Future tables are auto-readable by design; new sensitive tables need a manual revoke.\n3. **Soft guardrails.** `default_transaction_read_only = on` plus `statement_timeout = '10s'`.\n\n**RLS trap:** if prod tables have Row Level Security and no policy mentions the new role, every SELECT returns 0 rows. Fix with `alter role ... bypassrls` — safe, because bypass only skips row filtering; the SELECT-only grants and denylist still apply.\n\n## Workflow\n\n1. **State-check.** `select rolname from pg_roles where rolname = 'agents_readonly';` — if it exists, you are updating, not creating.\n2. **Pick the denylist with the human.** Ask which tables hold secrets or PII that agents must never see (API keys, webhook events, auth\u002Fuser tables).\n3. **Write the SQL to a repo file first** (e.g. `docs\u002Fdatabase\u002Fcreate-agents-readonly-role.sql`) with comments: what \u002F why \u002F how to apply \u002F how to verify \u002F how to revert. Never hand SQL only in chat.\n4. **The human applies it** — agents never run DDL on prod. Supabase: paste the whole file into the SQL editor, then DELETE the query from editor history (it contains the password). Store the password in a password manager.\n5. **Wire the connection string** as a local env var in `~\u002F.zshrc` (never committed), e.g. `MYPROJ_READONLY_DB_URL`. Supabase session pooler: username is `agents_readonly.\u003Cproject-ref>`, port 5432. `psql` comes from Homebrew `libpq` if missing.\n6. **Verify** with the loop below.\n7. **Write a project-local usage skill** so future agents know the key tables, query patterns, and hard rules (read-only forever, never paste PII into commits\u002Fdocs).\n\n## SQL template\n\n```sql\n-- 1. role + soft guardrails\ncreate role agents_readonly with login password 'REPLACE_ME';\nalter role agents_readonly set default_transaction_read_only = on;\nalter role agents_readonly set statement_timeout = '10s';\n\n-- 2. the real wall: SELECT-only grants, denylist model\ngrant usage on schema public to agents_readonly;\ngrant select on all tables in schema public to agents_readonly;\nalter default privileges for role postgres in schema public\n  grant select on tables to agents_readonly;   -- future tables auto-readable\n\n-- 3. denylist: crown jewels stay invisible (adjust per project)\nrevoke select on table public.api_keys from agents_readonly;\nrevoke select on table public.email_webhook_events from agents_readonly;\n\n-- 4. only if RLS is enabled and no policy covers this role\nalter role agents_readonly bypassrls;\n```\n\nRevert: `drop owned by agents_readonly; drop role agents_readonly;`\n\n## Verification loop (all must pass before declaring done)\n\n```bash\nURL=\"$MYPROJ_READONLY_DB_URL\"\npsql \"$URL\" -X -c \"select current_user;\"                      # -> agents_readonly\npsql \"$URL\" -X -c \"show statement_timeout;\"                   # -> 10s\npsql \"$URL\" -X -c \"select count(*) from public.\u003Cbig_table>;\"  # -> real number, NOT 0\npsql \"$URL\" -X -c \"delete from public.\u003Cany_table> where false;\"\n# -> ERROR: read-only transaction (soft guardrail)\npsql \"$URL\" -X -c \"begin; set transaction read write; delete from public.\u003Cany_table> where false; rollback;\"\n# -> ERROR: permission denied (the hard wall)\npsql \"$URL\" -X -c \"select * from public.\u003Cdenylisted> limit 1;\"    # -> ERROR: permission denied\npsql \"$URL\" -X -c \"select * from auth.users limit 1;\"             # -> ERROR: permission denied\n```\n\nWrites must be blocked **twice over**: once by the read-only guardrail, and again by `permission denied` with the guardrail off. If any check fails, fix the grants and re-run ALL checks.\n\n## Failure modes\n\n- **Every table returns 0 rows** → RLS is enabled and the role has no policy → add `bypassrls` (step 4 of template).\n- **A write succeeded during verification** → grants are wrong. Stop, revoke everything, re-run the template.\n- **Supabase auth failed** → pooler username must be `agents_readonly.\u003Cproject-ref>`, not bare `agents_readonly`.\n- **`statement timeout` on legit queries** → query too heavy; add filters\u002Flimits. Do not raise the timeout as a first resort.\n\n## Maintenance\n\n- New sensitive table → add a `revoke select` next to the denylist block.\n- Rotate password: `alter role agents_readonly with password '...'` then update the env var in `~\u002F.zshrc`.\n- Never let agents write through this role. Prod writes stay human-only.\n","# Create a Read-Only DB Role for Agents\n\nBattle-tested pattern (DeepAPI ADR 0093). A SELECT-only role kills catastrophic writes at the permission level. Residual risks (data leaks, heavy queries) are handled by a denylist and timeouts. Agents stop being blind on prod; the human stops being the SQL bottleneck.\n\n## The pattern — 3 layers\n\n1. **Hard wall — grants.** The role gets SELECT and nothing else. Writes are impossible, not just discouraged.\n2. **Denylist, not allowlist.** Grant SELECT on ALL current + future tables in `public` (via default privileges), then revoke the crown jewels (API keys, webhook payloads, secrets). Never grant the `auth` schema. Future tables are auto-readable by design; new sensitive tables need a manual revoke.\n3. **Soft guardrails.** `default_transaction_read_only = on` plus `statement_timeout = '10s'`.\n\n**RLS trap:** if prod tables have Row Level Security and no policy mentions the new role, every SELECT returns 0 rows. Fix with `alter role ... bypassrls` — safe, because bypass only skips row filtering; the SELECT-only grants and denylist still apply.\n\n## Workflow\n\n1. **State-check.** `select rolname from pg_roles where rolname = 'agents_readonly';` — if it exists, you are updating, not creating.\n2. **Pick the denylist with the human.** Ask which tables hold secrets or PII that agents must never see (API keys, webhook events, auth\u002Fuser tables).\n3. **Write the SQL to a repo file first** (e.g. `docs\u002Fdatabase\u002Fcreate-agents-readonly-role.sql`) with comments: what \u002F why \u002F how to apply \u002F how to verify \u002F how to revert. Never hand SQL only in chat.\n4. **The human applies it** — agents never run DDL on prod. Supabase: paste the whole file into the SQL editor, then DELETE the query from editor history (it contains the password). Store the password in a password manager.\n5. **Wire the connection string** as a local env var in `~\u002F.zshrc` (never committed), e.g. `MYPROJ_READONLY_DB_URL`. Supabase session pooler: username is `agents_readonly.\u003Cproject-ref>`, port 5432. `psql` comes from Homebrew `libpq` if missing.\n6. **Verify** with the loop below.\n7. **Write a project-local usage skill** so future agents know the key tables, query patterns, and hard rules (read-only forever, never paste PII into commits\u002Fdocs).\n\n## SQL template\n\n```sql\n-- 1. role + soft guardrails\ncreate role agents_readonly with login password 'REPLACE_ME';\nalter role agents_readonly set default_transaction_read_only = on;\nalter role agents_readonly set statement_timeout = '10s';\n\n-- 2. the real wall: SELECT-only grants, denylist model\ngrant usage on schema public to agents_readonly;\ngrant select on all tables in schema public to agents_readonly;\nalter default privileges for role postgres in schema public\n  grant select on tables to agents_readonly;   -- future tables auto-readable\n\n-- 3. denylist: crown jewels stay invisible (adjust per project)\nrevoke select on table public.api_keys from agents_readonly;\nrevoke select on table public.email_webhook_events from agents_readonly;\n\n-- 4. only if RLS is enabled and no policy covers this role\nalter role agents_readonly bypassrls;\n```\n\nRevert: `drop owned by agents_readonly; drop role agents_readonly;`\n\n## Verification loop (all must pass before declaring done)\n\n```bash\nURL=\"$MYPROJ_READONLY_DB_URL\"\npsql \"$URL\" -X -c \"select current_user;\"                      # -> agents_readonly\npsql \"$URL\" -X -c \"show statement_timeout;\"                   # -> 10s\npsql \"$URL\" -X -c \"select count(*) from public.\u003Cbig_table>;\"  # -> real number, NOT 0\npsql \"$URL\" -X -c \"delete from public.\u003Cany_table> where false;\"\n# -> ERROR: read-only transaction (soft guardrail)\npsql \"$URL\" -X -c \"begin; set transaction read write; delete from public.\u003Cany_table> where false; rollback;\"\n# -> ERROR: permission denied (the hard wall)\npsql \"$URL\" -X -c \"select * from public.\u003Cdenylisted> limit 1;\"    # -> ERROR: permission denied\npsql \"$URL\" -X -c \"select * from auth.users limit 1;\"             # -> ERROR: permission denied\n```\n\nWrites must be blocked **twice over**: once by the read-only guardrail, and again by `permission denied` with the guardrail off. If any check fails, fix the grants and re-run ALL checks.\n\n## Failure modes\n\n- **Every table returns 0 rows** → RLS is enabled and the role has no policy → add `bypassrls` (step 4 of template).\n- **A write succeeded during verification** → grants are wrong. Stop, revoke everything, re-run the template.\n- **Supabase auth failed** → pooler username must be `agents_readonly.\u003Cproject-ref>`, not bare `agents_readonly`.\n- **`statement timeout` on legit queries** → query too heavy; add filters\u002Flimits. Do not raise the timeout as a first resort.\n\n## Maintenance\n\n- New sensitive table → add a `revoke select` next to the denylist block.\n- Rotate password: `alter role agents_readonly with password '...'` then update the env var in `~\u002F.zshrc`.\n- Never let agents write through this role. Prod writes stay human-only.\n",{"name":5,"description":7},"main","be3de0244dc1a57e323d8160787ebb40fb64930e","skills\u002Fops-and-setup\u002Fcreate-readonly-db-role","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Solizardking\u002Fskillhub-main --skill create-readonly-db-role",{"tool":39,"command":40},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill create-readonly-db-role",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill create-readonly-db-role","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fops-and-setup\u002Fcreate-readonly-db-role\u002FSKILL.md",true,[],[48,55,62,69,76,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]