[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79BQSW7XGMNGX9DRNB8BTHZ":3,"skill-same:01M79BQSW7XGMNGX9DRNB8BTHZ":50},{"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":28,"commitSha":29,"skillDirectory":30,"forksCount":14,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M79BQSW7XGMNGX9DRNB8BTHZ","invariant-extraction",null,"Extract mathematical and business invariants from code and documentation. Used during decomposition by the Decomposer agent.","sahil-kaushik1\u002FAuditing-Workflow","sahil-kaushik1","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F143880923?v=4","01M79BEEK3947RQYD3WC00K9W3","Sahil Kaushik","01M79BEEKVHPFPTNBDB0GFXBHE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Finvariant-extraction\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: invariant-extraction\ndescription: Extract mathematical and business invariants from code and documentation. Used during decomposition by the Decomposer agent.\ntrigger: During decomposition — when the Decomposer performs Dimension 9 (Invariant Decomposition).\nagents: [decomposer, threat-modeler]\n---\n\n# Invariant Extraction Skill\n\n> **Trigger**: During decomposition — Dimension 9 (Invariant Decomposition).\n> **Purpose**: Discover and formalize all properties that MUST hold across all execution paths.\n\n---\n\n## Overview\n\nInvariants are the foundation of the entire audit pipeline. Every task is built around\ntesting an invariant. If invariants are poorly extracted, the entire downstream pipeline\nproduces low-value results.\n\n---\n\n## Invariant Categories\n\n### 1. Accounting Invariants\nProperties about value conservation and balance consistency.\n\n```bash\n# Find totalSupply, totalAssets, balance tracking\ngrep -rn \"totalSupply\\|totalAssets\\|totalShares\\|totalDebt\\|totalLiabilities\" --include=\"*.sol\"\n\n# Find balance mappings\ngrep -rn \"mapping.*balance\\|mapping.*deposit\\|mapping.*shares\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- `totalSupply == sum(balances[i])` for all token holders\n- `totalAssets >= totalLiabilities` (solvency)\n- `vault.balance >= sum(userDeposits) - sum(userWithdrawals)`\n- `shares * pricePerShare == assets ± rounding`\n\n### 2. Access Control Invariants\nProperties about who can do what.\n\n```bash\ngrep -rn \"onlyOwner\\|onlyRole\\|hasRole\\|require.*msg.sender\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- \"Only owner can call `setFee()`\"\n- \"Only minter role can call `mint()`\"\n- \"Admin cannot drain user funds directly\"\n\n### 3. State Machine Invariants\nProperties about legal state transitions.\n\n```bash\ngrep -rn \"enum \\|Status\\|State\\|Phase\" --include=\"*.sol\"\ngrep -rn \"require.*status\\|require.*state\\|require.*phase\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- \"State can only move forward: Pending → Active → Completed\"\n- \"Once finalized, state cannot change\"\n- \"Cooldown period must elapse before transition\"\n\n### 4. Ordering Invariants\nProperties about temporal and causal ordering.\n\n**Common patterns**:\n- \"Initialize must be called before any other function\"\n- \"Deposit must precede withdrawal\"\n- \"Oracle update must be within N blocks of current block\"\n- \"Maturity date must be in the future at creation time\"\n\n### 5. Capacity Invariants\nProperties about bounds and limits.\n\n```bash\ngrep -rn \"MAX_\\|MIN_\\|_CAP\\|_LIMIT\\|maxDeposit\\|maxWithdraw\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- `fee \u003C= MAX_FEE` (fee cannot exceed cap)\n- `totalDeposits \u003C= depositCap`\n- `slippage \u003C= maxSlippage`\n\n### 6. Conservation Invariants\nProperties about value not being created or destroyed.\n\n**Common patterns**:\n- \"Total value in == total value out (minus explicit fees)\"\n- \"Minting shares increases totalSupply by exactly the minted amount\"\n- \"Burning shares decreases totalSupply by exactly the burned amount\"\n\n---\n\n## Extraction Protocol\n\n### Step 1: Read Documentation\n```bash\n# Check for invariant docs, specs, or natspec\nfind . -name \"*.md\" -not -path \"*\u002Fnode_modules\u002F*\" | head -20\ngrep -rn \"@notice\\|@dev\\|invariant\\|MUST\\|ALWAYS\\|NEVER\" --include=\"*.sol\" | head -50\n```\n\n### Step 2: Analyze Assert\u002FRequire Statements\n```bash\ngrep -rn \"assert(\\|require(\" --include=\"*.sol\" | grep -v \"test\\|mock\\|node_modules\"\n```\n\nEach `assert` is an explicit invariant. Each `require` is a precondition that may imply a broader invariant.\n\n### Step 3: Analyze Test Invariants\n```bash\ngrep -rn \"invariant_\\|assertEq\\|assertGe\\|assertLe\\|assertGt\\|assertLt\" --include=\"*.sol\" | grep -i \"test\"\n```\n\nExisting tests often encode invariants the developers intended to hold.\n\n### Step 4: Derive Implicit Invariants\nSome invariants are never stated but must hold:\n- If there's a `deposit()` and `withdraw()`, then `deposited - withdrawn >= 0`\n- If there's a share\u002Fasset conversion, then the conversion must be consistent\n- If there's an oracle, staleness must be bounded\n\n### Step 5: Formalize\n\nFor each invariant, produce:\n\n```markdown\n## INV-{number}: {Short Name}\n\n**Category**: [Accounting | Access | State Machine | Ordering | Capacity | Conservation]\n**Formal Statement**: `{mathematical expression or logical predicate}`\n**Source**: [Code reference, documentation, or derived]\n**Contracts Involved**: [list]\n**State Variables**: [list]\n**Entrypoints That Could Violate**: [list]\n**Confidence**: [Explicit (from code\u002Fdocs) | Implicit (derived) | Assumed]\n```\n\n---\n\n## Output\n\nSave to: `specs\u002Fdecomposition\u002Finvariant-decomposition.md`\n\n```markdown\n# Invariant Decomposition\n\n## Summary\n{N} invariants extracted across {M} categories.\n\n## Invariant Catalog\n[Full list with formal statements]\n\n## Coverage Gaps\n[Areas where invariants SHOULD exist but were not found]\n\n## Key Observations for Threat Modeling\n[Which invariants are most likely to be violated and why]\n```\n","# Invariant Extraction Skill\n\n> **Trigger**: During decomposition — Dimension 9 (Invariant Decomposition).\n> **Purpose**: Discover and formalize all properties that MUST hold across all execution paths.\n\n---\n\n## Overview\n\nInvariants are the foundation of the entire audit pipeline. Every task is built around\ntesting an invariant. If invariants are poorly extracted, the entire downstream pipeline\nproduces low-value results.\n\n---\n\n## Invariant Categories\n\n### 1. Accounting Invariants\nProperties about value conservation and balance consistency.\n\n```bash\n# Find totalSupply, totalAssets, balance tracking\ngrep -rn \"totalSupply\\|totalAssets\\|totalShares\\|totalDebt\\|totalLiabilities\" --include=\"*.sol\"\n\n# Find balance mappings\ngrep -rn \"mapping.*balance\\|mapping.*deposit\\|mapping.*shares\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- `totalSupply == sum(balances[i])` for all token holders\n- `totalAssets >= totalLiabilities` (solvency)\n- `vault.balance >= sum(userDeposits) - sum(userWithdrawals)`\n- `shares * pricePerShare == assets ± rounding`\n\n### 2. Access Control Invariants\nProperties about who can do what.\n\n```bash\ngrep -rn \"onlyOwner\\|onlyRole\\|hasRole\\|require.*msg.sender\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- \"Only owner can call `setFee()`\"\n- \"Only minter role can call `mint()`\"\n- \"Admin cannot drain user funds directly\"\n\n### 3. State Machine Invariants\nProperties about legal state transitions.\n\n```bash\ngrep -rn \"enum \\|Status\\|State\\|Phase\" --include=\"*.sol\"\ngrep -rn \"require.*status\\|require.*state\\|require.*phase\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- \"State can only move forward: Pending → Active → Completed\"\n- \"Once finalized, state cannot change\"\n- \"Cooldown period must elapse before transition\"\n\n### 4. Ordering Invariants\nProperties about temporal and causal ordering.\n\n**Common patterns**:\n- \"Initialize must be called before any other function\"\n- \"Deposit must precede withdrawal\"\n- \"Oracle update must be within N blocks of current block\"\n- \"Maturity date must be in the future at creation time\"\n\n### 5. Capacity Invariants\nProperties about bounds and limits.\n\n```bash\ngrep -rn \"MAX_\\|MIN_\\|_CAP\\|_LIMIT\\|maxDeposit\\|maxWithdraw\" --include=\"*.sol\"\n```\n\n**Common patterns**:\n- `fee \u003C= MAX_FEE` (fee cannot exceed cap)\n- `totalDeposits \u003C= depositCap`\n- `slippage \u003C= maxSlippage`\n\n### 6. Conservation Invariants\nProperties about value not being created or destroyed.\n\n**Common patterns**:\n- \"Total value in == total value out (minus explicit fees)\"\n- \"Minting shares increases totalSupply by exactly the minted amount\"\n- \"Burning shares decreases totalSupply by exactly the burned amount\"\n\n---\n\n## Extraction Protocol\n\n### Step 1: Read Documentation\n```bash\n# Check for invariant docs, specs, or natspec\nfind . -name \"*.md\" -not -path \"*\u002Fnode_modules\u002F*\" | head -20\ngrep -rn \"@notice\\|@dev\\|invariant\\|MUST\\|ALWAYS\\|NEVER\" --include=\"*.sol\" | head -50\n```\n\n### Step 2: Analyze Assert\u002FRequire Statements\n```bash\ngrep -rn \"assert(\\|require(\" --include=\"*.sol\" | grep -v \"test\\|mock\\|node_modules\"\n```\n\nEach `assert` is an explicit invariant. Each `require` is a precondition that may imply a broader invariant.\n\n### Step 3: Analyze Test Invariants\n```bash\ngrep -rn \"invariant_\\|assertEq\\|assertGe\\|assertLe\\|assertGt\\|assertLt\" --include=\"*.sol\" | grep -i \"test\"\n```\n\nExisting tests often encode invariants the developers intended to hold.\n\n### Step 4: Derive Implicit Invariants\nSome invariants are never stated but must hold:\n- If there's a `deposit()` and `withdraw()`, then `deposited - withdrawn >= 0`\n- If there's a share\u002Fasset conversion, then the conversion must be consistent\n- If there's an oracle, staleness must be bounded\n\n### Step 5: Formalize\n\nFor each invariant, produce:\n\n```markdown\n## INV-{number}: {Short Name}\n\n**Category**: [Accounting | Access | State Machine | Ordering | Capacity | Conservation]\n**Formal Statement**: `{mathematical expression or logical predicate}`\n**Source**: [Code reference, documentation, or derived]\n**Contracts Involved**: [list]\n**State Variables**: [list]\n**Entrypoints That Could Violate**: [list]\n**Confidence**: [Explicit (from code\u002Fdocs) | Implicit (derived) | Assumed]\n```\n\n---\n\n## Output\n\nSave to: `specs\u002Fdecomposition\u002Finvariant-decomposition.md`\n\n```markdown\n# Invariant Decomposition\n\n## Summary\n{N} invariants extracted across {M} categories.\n\n## Invariant Catalog\n[Full list with formal statements]\n\n## Coverage Gaps\n[Areas where invariants SHOULD exist but were not found]\n\n## Key Observations for Threat Modeling\n[Which invariants are most likely to be violated and why]\n```\n",{"name":5,"agents":24,"trigger":27,"description":7},[25,26],"decomposer","threat-modeler","During decomposition — when the Decomposer performs Dimension 9 (Invariant Decomposition).","main","39a25d63191d67efe43cdce5b7507069e2307f0f",".gemini\u002Fskills\u002Finvariant-extraction","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1","https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Te4TcrpgcN4j8DsYqVdjPl4QXVbs5XXo\u002Fview?usp=drive_link","Web3 security researcher \u002F developer","2026-10-18 15:17:21",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add sahil-kaushik1\u002FAuditing-Workflow --skill invariant-extraction",{"tool":42,"command":43},"bunx","bunx skills add sahil-kaushik1\u002FAuditing-Workflow --skill invariant-extraction",{"tool":45,"command":46},"pnpm","pnpm dlx skills add sahil-kaushik1\u002FAuditing-Workflow --skill invariant-extraction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Finvariant-extraction\u002FSKILL.md",true,[],[51,57,63,70,77,84],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M79BSEAG0SS9CC2EN1S51K2X","stripe-patterns","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsync\u002Frendertrust\u002F.claude\u002Fskills\u002Fstripe-patterns\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M79BSBAZXQBWCPKYJP38A35B","payment-patterns","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsync\u002Fkeryk-ai\u002F.claude\u002Fskills\u002Fpayment-patterns\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79BS8PKZXFGBNQBS2GHNXZW","testing-patterns","Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Ftesting-patterns\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M79BS3PR92A4QNEJAFNDKB2G","team-coordination","Agent Teams orchestration patterns for multi-agent SAFe workflows. Use when spawning agent teams, coordinating teammates, enforcing quality gates via task dependencies, or orchestrating the 11-agent SAFe pipeline. Covers team creation, messaging, shared task lists, and SAFe gate enforcement. Do NOT use for single-agent or simple subagent workflows.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fteam-coordination\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M79BRZ422QD8D5QHQMXAVPWZ","task-compilation","Compile broad audit goals into structured proof obligations with 9 mandatory fields. Used after decomposition by the Threat Modeler agent.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Ftask-compilation\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},"01M79BRV2MK2AJZBNSE2BETP28","storage-layout-analysis","Proxy patterns, slot collisions, upgrade safety. Used during decomposition to identify storage-related vulnerabilities in upgradeable contracts.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fstorage-layout-analysis\u002FSKILL.md",[],[]]