[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CYXQP683FJ8EBV70M604YR":3,"skill-same:01M6CYXQP683FJ8EBV70M604YR":73},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6CYXQP683FJ8EBV70M604YR","aptos-gas-optimization",null,"Aptos gas optimization expert for Move smart contracts. Covers storage costs, execution efficiency, inline functions, aggregators for parallel execution, Table vs SmartTable vs vector tradeoffs, event optimization, struct packing, and gas profiling tools.","eric861129\u002FSKILLS_All-in-one","eric861129","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F74950944?v=4","01M6CXHDYEYRPFGGV4EFXCSYCF","ChiYu-Huang","01M6CXHE2J5CN1EBTY0FKV3ZKW",52,"MIT","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWeb3 & Blockchain\u002Fgas-optimization\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"aptos gas optimization","Optimization","gas","read","efficiency","contracts","expert","functions","parallel execution","edit","write","storage","profiling","parallel","table","Bash","execution","Tools","packing","vector","2026-11-10 10:12:30",false,"---\nname: aptos-gas-optimization\ndescription: Aptos gas optimization expert for Move smart contracts. Covers storage costs, execution efficiency, inline functions, aggregators for parallel execution, Table vs SmartTable vs vector tradeoffs, event optimization, struct packing, and gas profiling tools.\nallowed-tools: Read, Write, Edit, Grep, Glob, Bash\nmodel: sonnet\nlicense: MIT\nmetadata:\n  author: raintree\n  version: \"1.0\"\n---\n\n# Aptos Gas & Performance Optimization Expert\n\nExpert on optimizing gas costs and performance for Aptos Move smart contracts.\n\n## Triggers\n\n- gas optimization, gas cost, gas fees\n- performance tuning, execution efficiency\n- storage fees, storage optimization\n- inline functions, aggregator\n- parallel execution, throughput\n- Table vs vector, SmartTable\n- gas profiling, benchmarking\n\n## Gas Model Overview\n\n```\nTotal Gas Cost = Execution Gas + Storage Gas + IO Gas\n\nGas Fee (APT) = Gas Units x Gas Unit Price\n1 APT = 100,000,000 octas\n```\n\n## Data Structure Costs\n\n| Structure | Read | Write | Best For |\n|-----------|------|-------|----------|\n| vector | O(n) | O(n) | Small lists (\u003C1000) |\n| SimpleMap | O(n) | O(n) | Small maps (\u003C1000) |\n| Table | O(1) | O(1) | Large maps |\n| SmartTable | O(1) | O(1) | Very large maps (100k+) |\n| Aggregator | O(1) | O(1) | **Parallel counters** |\n\n## Key Optimizations\n\n### 1. Use Aggregators for Global Counters\n\n```move\nuse aptos_framework::aggregator_v2::{Self, Aggregator};\n\nstruct Stats has key {\n    total_users: Aggregator\u003Cu64>  \u002F\u002F Concurrent-safe!\n}\n\npublic fun increment() acquires Stats {\n    let stats = borrow_global_mut\u003CStats>(@protocol);\n    aggregator_v2::add(&mut stats.total_users, 1);\n    \u002F\u002F Multiple txns can do this in parallel!\n}\n```\n\n### 2. Inline Small Functions\n\n```move\ninline fun min(a: u64, b: u64): u64 {\n    if (a \u003C b) a else b\n}\n```\n\n### 3. Cache Loop Lengths\n\n```move\n\u002F\u002F Bad: calls length() every iteration\nwhile (i \u003C vector::length(v)) { ... }\n\n\u002F\u002F Good: cache length\nlet len = vector::length(v);\nwhile (i \u003C len) { ... }\n```\n\n### 4. Use Event V2 (Cheaper)\n\n```move\n#[event]\nstruct TransferEvent has drop, store {\n    from: address,\n    to: address,\n    amount: u64,\n}\n\nevent::emit(TransferEvent { from, to, amount });\n```\n\n### 5. Pack Struct Fields\n\n```move\n\u002F\u002F Bad: 8 bytes wasted on padding\nstruct Data { flag1: bool, value1: u64, flag2: bool, value2: u64 }\n\n\u002F\u002F Good: group bools together\nstruct Data { flag1: bool, flag2: bool, value1: u64, value2: u64 }\n\n\u002F\u002F Best: pack into bitmap\nstruct Data { flags: u8, value1: u64, value2: u64 }\n```\n\n### 6. Use Table\u002FSmartTable for Large Data\n\n```move\n\u002F\u002F Bad for large datasets\nstruct Registry { users: vector\u003CUser> }\n\n\u002F\u002F Good for large datasets\nstruct Registry { users: Table\u003Caddress, User> }\n\n\u002F\u002F Best for very large datasets (100k+)\nstruct Registry { users: SmartTable\u003Caddress, User> }\n```\n\n### 7. Batch Operations\n\n```move\n\u002F\u002F Single transaction for multiple transfers\npublic entry fun batch_transfer(\n    sender: &signer,\n    recipients: vector\u003Caddress>,\n    amounts: vector\u003Cu64>\n) { ... }\n```\n\n### 8. Early Returns\n\n```move\n\u002F\u002F Check cheapest conditions first\nif (amount == 0) return;\nif (amount >= MAX) return;\nif (!is_valid(user)) return;\n\u002F\u002F Then do expensive work\n```\n\n## Gas Profiling\n\n```bash\n# Run tests with gas profiling\naptos move test --gas\n\n# Simulate transaction\naptos move run --function-id 0x1::module::func --profile gas\n```\n\n## Checklist Before Mainnet\n\n- [ ] Use aggregators for global counters\n- [ ] Inline small helper functions\n- [ ] Use Event V2 for all events\n- [ ] Use Table\u002FSmartTable for large datasets\n- [ ] Pack struct fields efficiently\n- [ ] Cache loop lengths\n- [ ] Batch operations where possible\n- [ ] Early returns for validation\n- [ ] Profile with --gas flag\n","# Aptos Gas & Performance Optimization Expert\n\nExpert on optimizing gas costs and performance for Aptos Move smart contracts.\n\n## Triggers\n\n- gas optimization, gas cost, gas fees\n- performance tuning, execution efficiency\n- storage fees, storage optimization\n- inline functions, aggregator\n- parallel execution, throughput\n- Table vs vector, SmartTable\n- gas profiling, benchmarking\n\n## Gas Model Overview\n\n```\nTotal Gas Cost = Execution Gas + Storage Gas + IO Gas\n\nGas Fee (APT) = Gas Units x Gas Unit Price\n1 APT = 100,000,000 octas\n```\n\n## Data Structure Costs\n\n| Structure | Read | Write | Best For |\n|-----------|------|-------|----------|\n| vector | O(n) | O(n) | Small lists (\u003C1000) |\n| SimpleMap | O(n) | O(n) | Small maps (\u003C1000) |\n| Table | O(1) | O(1) | Large maps |\n| SmartTable | O(1) | O(1) | Very large maps (100k+) |\n| Aggregator | O(1) | O(1) | **Parallel counters** |\n\n## Key Optimizations\n\n### 1. Use Aggregators for Global Counters\n\n```move\nuse aptos_framework::aggregator_v2::{Self, Aggregator};\n\nstruct Stats has key {\n    total_users: Aggregator\u003Cu64>  \u002F\u002F Concurrent-safe!\n}\n\npublic fun increment() acquires Stats {\n    let stats = borrow_global_mut\u003CStats>(@protocol);\n    aggregator_v2::add(&mut stats.total_users, 1);\n    \u002F\u002F Multiple txns can do this in parallel!\n}\n```\n\n### 2. Inline Small Functions\n\n```move\ninline fun min(a: u64, b: u64): u64 {\n    if (a \u003C b) a else b\n}\n```\n\n### 3. Cache Loop Lengths\n\n```move\n\u002F\u002F Bad: calls length() every iteration\nwhile (i \u003C vector::length(v)) { ... }\n\n\u002F\u002F Good: cache length\nlet len = vector::length(v);\nwhile (i \u003C len) { ... }\n```\n\n### 4. Use Event V2 (Cheaper)\n\n```move\n#[event]\nstruct TransferEvent has drop, store {\n    from: address,\n    to: address,\n    amount: u64,\n}\n\nevent::emit(TransferEvent { from, to, amount });\n```\n\n### 5. Pack Struct Fields\n\n```move\n\u002F\u002F Bad: 8 bytes wasted on padding\nstruct Data { flag1: bool, value1: u64, flag2: bool, value2: u64 }\n\n\u002F\u002F Good: group bools together\nstruct Data { flag1: bool, flag2: bool, value1: u64, value2: u64 }\n\n\u002F\u002F Best: pack into bitmap\nstruct Data { flags: u8, value1: u64, value2: u64 }\n```\n\n### 6. Use Table\u002FSmartTable for Large Data\n\n```move\n\u002F\u002F Bad for large datasets\nstruct Registry { users: vector\u003CUser> }\n\n\u002F\u002F Good for large datasets\nstruct Registry { users: Table\u003Caddress, User> }\n\n\u002F\u002F Best for very large datasets (100k+)\nstruct Registry { users: SmartTable\u003Caddress, User> }\n```\n\n### 7. Batch Operations\n\n```move\n\u002F\u002F Single transaction for multiple transfers\npublic entry fun batch_transfer(\n    sender: &signer,\n    recipients: vector\u003Caddress>,\n    amounts: vector\u003Cu64>\n) { ... }\n```\n\n### 8. Early Returns\n\n```move\n\u002F\u002F Check cheapest conditions first\nif (amount == 0) return;\nif (amount >= MAX) return;\nif (!is_valid(user)) return;\n\u002F\u002F Then do expensive work\n```\n\n## Gas Profiling\n\n```bash\n# Run tests with gas profiling\naptos move test --gas\n\n# Simulate transaction\naptos move run --function-id 0x1::module::func --profile gas\n```\n\n## Checklist Before Mainnet\n\n- [ ] Use aggregators for global counters\n- [ ] Inline small helper functions\n- [ ] Use Event V2 for all events\n- [ ] Use Table\u002FSmartTable for large datasets\n- [ ] Pack struct fields efficiently\n- [ ] Cache loop lengths\n- [ ] Batch operations where possible\n- [ ] Early returns for validation\n- [ ] Profile with --gas flag\n",{"name":5,"model":44,"license":15,"metadata":45,"description":7,"allowed-tools":48},"sonnet",{"author":46,"version":47},"raintree","1.0","Read, Write, Edit, Grep, Glob, Bash","main","cbdd44aae21131521c09e42762e36178c790eacf","public\u002FSKILLS\u002FWeb3 & Blockchain\u002Fgas-optimization",13,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one","http:\u002F\u002Fhuangchiyu.com\u002FSKILLS_All-in-one\u002F","https:\u002F\u002Fgithub.com\u002Feric861129","https:\u002F\u002Fhuangchiyu.com\u002FChiYu-Blog\u002F","開發工程師，專注於 C#／.NET 系統現代化、AI-assisted engineering、開源工具與技術寫作。","2026-04-16 14:28:14",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add eric861129\u002FSKILLS_All-in-one --skill aptos-gas-optimization",{"tool":65,"command":66},"bunx","bunx skills add eric861129\u002FSKILLS_All-in-one --skill aptos-gas-optimization",{"tool":68,"command":69},"pnpm","pnpm dlx skills add eric861129\u002FSKILLS_All-in-one --skill aptos-gas-optimization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWeb3 & Blockchain\u002Fgas-optimization\u002FSKILL.md",true,[],[74,104,135,162,187,207],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":85,"publishedAt":39},"01M6CZ1WR3KNVTKSWH4GNWT646","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fwhat-if-oracle\u002FSKILL.md",[80],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[86,87,88,89,90,91,92,93,94,95,96,97,98,22,29,99,100,101,102,103],"oracle","what if oracle","go","run","planning","ux","futures","risk","analysis","explore","decision","branch","question","idea","exploration","options","stress-test","strategies",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":122,"publishedAt":39},"01M6CZ1QHGJE91A95MSN5EK5Q9","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fvenue-templates\u002FSKILL.md",[110,113,116,117],{"categoryNo":111,"categoryName":112,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":114,"categoryName":115,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[123,124,125,126,127,128,129,130,34,131,22,29,28,132,133,134],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","proposals","Academic","requirements",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":145,"publishedAt":39},"01M6CZ1KBQD2E5RTFB3BGVX7CD","the-fool","Use when challenging ideas, plans, decisions, or proposals using structured critical reasoning. Invoke to play devil's advocate, run a pre-mortem, red team, or audit evidence and assumptions.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fthe-fool\u002FSKILL.md",[141,142],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":143,"categoryName":144,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000030","开发工程师",[146,147,88,148,149,89,150,151,152,153,154,155,156,157,132,158,159,25,160,161],"the fool","review","workflow","architecture","code","audit","forge","devil","team","designer","reviewer","challenge","stress test","evidence","poke","ideas",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":171,"publishedAt":39},"01M6CZ1ES826S7P1X3333E40TA","scientific-writing","Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA\u002FAMA\u002FVancouver), figures\u002Ftables, reporting guidelines (CONSORT\u002FSTROBE\u002FPRISMA), for research papers and journal submissions.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fscientific-writing\u002FSKILL.md",[168,169,170],{"categoryNo":111,"categoryName":112,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},[172,173,126,174,175,176,177,178,34,179,22,29,28,180,181,182,183,184,185,186],"writing","scientific writing","core","reporting","deep research","Citations","Outlines","tool","use","never","structure","deep","full","stage","prisma",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":194,"publishedAt":39},"01M6CZ1B2JGJTB9FRD0TW4RXXE","scientific-brainstorming","Creative research ideation and exploration. Use for open-ended brainstorming sessions, exploring interdisciplinary connections, challenging assumptions, or identifying research gaps. Best for early-stage research planning when you do not have specific observations yet. For formulating testable hypotheses from data use hypothesis-generation.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fscientific-brainstorming\u002FSKILL.md",[193],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[195,196,125,197,90,198,199,200,180,201,202,203,100,204,205,185,206],"brainstorming","scientific brainstorming","sessions","data","hypothesis","open","ideation","creative","do","connections","research ideation","generation",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":211,"categories":212,"keywords":219,"publishedAt":39},"01M6CZ16JG8N7A2ZX04BGE8J2Y","research-lookup","Look up current research information using the Parallel Chat API (primary) or Perplexity sonar-pro-search (academic paper searches). Automatically routes queries to the best backend. Use for finding papers, gathering research data, and verifying scientific information.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fresearch-lookup\u002FSKILL.md",[213,216,217,218],{"categoryNo":214,"categoryName":215,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":114,"categoryName":115,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":143,"categoryName":144,"taxonomyType":120,"taxonomyTypeDesc":121},[125,220,221,222,198,223,224,34,32,225,22,29,28,180,226,227,228,229,230,133],"lookup","research lookup","search","perplexity","api","openrouter","backend","up","look","queries","chat"]