[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EZWGXNETW1008X0E3EQCNN":3,"skill-same:01M7EZWGXNETW1008X0E3EQCNN":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":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EZWGXNETW1008X0E3EQCNN","defi-amm-security",null,"Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, CEI ordering, donation or inflation attacks, oracle manipulation, slippage, admin controls, and integer math. Use when auditing or writing Solidity AMM, liquidity pool, or swap code.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Fdefi-amm-security\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: defi-amm-security\ndescription: Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, CEI ordering, donation or inflation attacks, oracle manipulation, slippage, admin controls, and integer math. Use when auditing or writing Solidity AMM, liquidity pool, or swap code.\nmetadata:\n  version: \"1.0.0\"\n  origin: ECC direct-port adaptation\n---\n\n# DeFi AMM Security\n\nCritical vulnerability patterns and hardened implementations for Solidity AMM contracts, LP vaults, and swap functions.\n\n## When to Use\n\n- Writing or auditing a Solidity AMM or liquidity-pool contract\n- Implementing swap, deposit, withdraw, mint, or burn flows that hold token balances\n- Reviewing any contract that uses `token.balanceOf(address(this))` in share or reserve math\n- Adding fee setters, pausers, oracle updates, or other admin functions to a DeFi protocol\n\n## How It Works\n\nUse this as a checklist-plus-pattern library. Review every user entrypoint against the categories below and prefer the hardened examples over hand-rolled variants.\n\n## Execution Safety\n\nThe shell commands in this skill are local audit examples. Run them only in a trusted checkout or disposable sandbox, and do not splice untrusted contract names, paths, RPC URLs, private keys, or user-supplied flags into shell commands. Ask before installing tools or running long fuzzing\u002Fstatic-analysis jobs that may consume significant local or paid resources.\n\nNever include secrets, private keys, seed phrases, API tokens, or mainnet signing credentials in command examples, logs, or reports.\n\n## Examples\n\n### Reentrancy: enforce CEI order\n\nVulnerable:\n\n```solidity\nfunction withdraw(uint256 amount) external {\n    require(balances[msg.sender] >= amount);\n    token.transfer(msg.sender, amount);\n    balances[msg.sender] -= amount;\n}\n```\n\nSafe:\n\n```solidity\nimport {ReentrancyGuard} from \"@openzeppelin\u002Fcontracts\u002Futils\u002FReentrancyGuard.sol\";\nimport {SafeERC20} from \"@openzeppelin\u002Fcontracts\u002Ftoken\u002FERC20\u002Futils\u002FSafeERC20.sol\";\n\nusing SafeERC20 for IERC20;\n\nfunction withdraw(uint256 amount) external nonReentrant {\n    require(balances[msg.sender] >= amount, \"Insufficient\");\n    balances[msg.sender] -= amount;\n    token.safeTransfer(msg.sender, amount);\n}\n```\n\nDo not write your own guard when a hardened library exists.\n\n### Donation or inflation attacks\n\nUsing `token.balanceOf(address(this))` directly for share math lets attackers manipulate the denominator by sending tokens to the contract outside the intended path.\n\n```solidity\n\u002F\u002F Vulnerable\nfunction deposit(uint256 assets) external returns (uint256 shares) {\n    shares = (assets * totalShares) \u002F token.balanceOf(address(this));\n}\n```\n\n```solidity\n\u002F\u002F Safe\nuint256 private _totalAssets;\n\nfunction deposit(uint256 assets) external nonReentrant returns (uint256 shares) {\n    uint256 balBefore = token.balanceOf(address(this));\n    token.safeTransferFrom(msg.sender, address(this), assets);\n    uint256 received = token.balanceOf(address(this)) - balBefore;\n\n    shares = totalShares == 0 ? received : (received * totalShares) \u002F _totalAssets;\n    _totalAssets += received;\n    totalShares += shares;\n}\n```\n\nTrack internal accounting and measure actual tokens received.\n\n### Oracle manipulation\n\nSpot prices are flash-loan manipulable. Prefer TWAP.\n\n```solidity\nuint32[] memory secondsAgos = new uint32[](2);\nsecondsAgos[0] = 1800;\nsecondsAgos[1] = 0;\n(int56[] memory tickCumulatives,) = IUniswapV3Pool(pool).observe(secondsAgos);\nint24 twapTick = int24(\n    (tickCumulatives[1] - tickCumulatives[0]) \u002F int56(uint56(30 minutes))\n);\nuint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(twapTick);\n```\n\n### Slippage protection\n\nEvery swap path needs caller-provided slippage and a deadline.\n\n```solidity\nfunction swap(\n    uint256 amountIn,\n    uint256 amountOutMin,\n    uint256 deadline\n) external returns (uint256 amountOut) {\n    require(block.timestamp \u003C= deadline, \"Expired\");\n    amountOut = _calculateOut(amountIn);\n    require(amountOut >= amountOutMin, \"Slippage exceeded\");\n    _executeSwap(amountIn, amountOut);\n}\n```\n\n### Safe reserve math\n\n```solidity\nimport {FullMath} from \"@uniswap\u002Fv3-core\u002Fcontracts\u002Flibraries\u002FFullMath.sol\";\n\nuint256 result = FullMath.mulDiv(a, b, c);\n```\n\nFor large reserve math, avoid naive `a * b \u002F c` when overflow risk exists.\n\n### Admin controls\n\n```solidity\nimport {Ownable2Step} from \"@openzeppelin\u002Fcontracts\u002Faccess\u002FOwnable2Step.sol\";\n\ncontract MyAMM is Ownable2Step {\n    function setFee(uint256 fee) external onlyOwner { ... }\n    function pause() external onlyOwner { ... }\n}\n```\n\nPrefer explicit acceptance for ownership transfer and gate every privileged path.\n\n## Security Checklist\n\n- Reentrancy-exposed entrypoints use `nonReentrant`\n- CEI ordering is respected\n- Share math does not depend on raw `balanceOf(address(this))`\n- ERC-20 transfers use `SafeERC20`\n- Deposits measure actual tokens received\n- Oracle reads use TWAP or another manipulation-resistant source\n- Swaps require `amountOutMin` and `deadline`\n- Overflow-sensitive reserve math uses safe primitives like `mulDiv`\n- Admin functions are access-controlled\n- Emergency pause exists and is tested\n- Static analysis and fuzzing are run before production\n\n## Audit Tools\n\n```bash\npip install slither-analyzer\nslither . --exclude-dependencies\n\nechidna-test . --contract YourAMM --config echidna.yaml\n\nforge test --fuzz-runs 10000\n```\n","# DeFi AMM Security\n\nCritical vulnerability patterns and hardened implementations for Solidity AMM contracts, LP vaults, and swap functions.\n\n## When to Use\n\n- Writing or auditing a Solidity AMM or liquidity-pool contract\n- Implementing swap, deposit, withdraw, mint, or burn flows that hold token balances\n- Reviewing any contract that uses `token.balanceOf(address(this))` in share or reserve math\n- Adding fee setters, pausers, oracle updates, or other admin functions to a DeFi protocol\n\n## How It Works\n\nUse this as a checklist-plus-pattern library. Review every user entrypoint against the categories below and prefer the hardened examples over hand-rolled variants.\n\n## Execution Safety\n\nThe shell commands in this skill are local audit examples. Run them only in a trusted checkout or disposable sandbox, and do not splice untrusted contract names, paths, RPC URLs, private keys, or user-supplied flags into shell commands. Ask before installing tools or running long fuzzing\u002Fstatic-analysis jobs that may consume significant local or paid resources.\n\nNever include secrets, private keys, seed phrases, API tokens, or mainnet signing credentials in command examples, logs, or reports.\n\n## Examples\n\n### Reentrancy: enforce CEI order\n\nVulnerable:\n\n```solidity\nfunction withdraw(uint256 amount) external {\n    require(balances[msg.sender] >= amount);\n    token.transfer(msg.sender, amount);\n    balances[msg.sender] -= amount;\n}\n```\n\nSafe:\n\n```solidity\nimport {ReentrancyGuard} from \"@openzeppelin\u002Fcontracts\u002Futils\u002FReentrancyGuard.sol\";\nimport {SafeERC20} from \"@openzeppelin\u002Fcontracts\u002Ftoken\u002FERC20\u002Futils\u002FSafeERC20.sol\";\n\nusing SafeERC20 for IERC20;\n\nfunction withdraw(uint256 amount) external nonReentrant {\n    require(balances[msg.sender] >= amount, \"Insufficient\");\n    balances[msg.sender] -= amount;\n    token.safeTransfer(msg.sender, amount);\n}\n```\n\nDo not write your own guard when a hardened library exists.\n\n### Donation or inflation attacks\n\nUsing `token.balanceOf(address(this))` directly for share math lets attackers manipulate the denominator by sending tokens to the contract outside the intended path.\n\n```solidity\n\u002F\u002F Vulnerable\nfunction deposit(uint256 assets) external returns (uint256 shares) {\n    shares = (assets * totalShares) \u002F token.balanceOf(address(this));\n}\n```\n\n```solidity\n\u002F\u002F Safe\nuint256 private _totalAssets;\n\nfunction deposit(uint256 assets) external nonReentrant returns (uint256 shares) {\n    uint256 balBefore = token.balanceOf(address(this));\n    token.safeTransferFrom(msg.sender, address(this), assets);\n    uint256 received = token.balanceOf(address(this)) - balBefore;\n\n    shares = totalShares == 0 ? received : (received * totalShares) \u002F _totalAssets;\n    _totalAssets += received;\n    totalShares += shares;\n}\n```\n\nTrack internal accounting and measure actual tokens received.\n\n### Oracle manipulation\n\nSpot prices are flash-loan manipulable. Prefer TWAP.\n\n```solidity\nuint32[] memory secondsAgos = new uint32[](2);\nsecondsAgos[0] = 1800;\nsecondsAgos[1] = 0;\n(int56[] memory tickCumulatives,) = IUniswapV3Pool(pool).observe(secondsAgos);\nint24 twapTick = int24(\n    (tickCumulatives[1] - tickCumulatives[0]) \u002F int56(uint56(30 minutes))\n);\nuint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(twapTick);\n```\n\n### Slippage protection\n\nEvery swap path needs caller-provided slippage and a deadline.\n\n```solidity\nfunction swap(\n    uint256 amountIn,\n    uint256 amountOutMin,\n    uint256 deadline\n) external returns (uint256 amountOut) {\n    require(block.timestamp \u003C= deadline, \"Expired\");\n    amountOut = _calculateOut(amountIn);\n    require(amountOut >= amountOutMin, \"Slippage exceeded\");\n    _executeSwap(amountIn, amountOut);\n}\n```\n\n### Safe reserve math\n\n```solidity\nimport {FullMath} from \"@uniswap\u002Fv3-core\u002Fcontracts\u002Flibraries\u002FFullMath.sol\";\n\nuint256 result = FullMath.mulDiv(a, b, c);\n```\n\nFor large reserve math, avoid naive `a * b \u002F c` when overflow risk exists.\n\n### Admin controls\n\n```solidity\nimport {Ownable2Step} from \"@openzeppelin\u002Fcontracts\u002Faccess\u002FOwnable2Step.sol\";\n\ncontract MyAMM is Ownable2Step {\n    function setFee(uint256 fee) external onlyOwner { ... }\n    function pause() external onlyOwner { ... }\n}\n```\n\nPrefer explicit acceptance for ownership transfer and gate every privileged path.\n\n## Security Checklist\n\n- Reentrancy-exposed entrypoints use `nonReentrant`\n- CEI ordering is respected\n- Share math does not depend on raw `balanceOf(address(this))`\n- ERC-20 transfers use `SafeERC20`\n- Deposits measure actual tokens received\n- Oracle reads use TWAP or another manipulation-resistant source\n- Swaps require `amountOutMin` and `deadline`\n- Overflow-sensitive reserve math uses safe primitives like `mulDiv`\n- Admin functions are access-controlled\n- Emergency pause exists and is tested\n- Static analysis and fuzzing are run before production\n\n## Audit Tools\n\n```bash\npip install slither-analyzer\nslither . --exclude-dependencies\n\nechidna-test . --contract YourAMM --config echidna.yaml\n\nforge test --fuzz-runs 10000\n```\n",{"name":5,"metadata":24,"description":7},{"origin":25,"version":26},"ECC direct-port adaptation","1.0.0","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fecc\u002Fdefi-amm-security","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill defi-amm-security",{"tool":39,"command":40},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill defi-amm-security",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill defi-amm-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Fdefi-amm-security\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"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},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\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},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\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},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\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},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\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":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]