[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NWQFTGW6RQQRPQ4Z2XM2BK":3,"skill-same:01M6NWQFTGW6RQQRPQ4Z2XM2BK":66},{"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":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6NWQFTGW6RQQRPQ4Z2XM2BK","variant-analysis",null,"Find similar vulnerabilities across a codebase after discovering one instance. Uses pattern matching, AST search, Semgrep\u002FCodeQL queries, and manual tracing to propagate findings. Adapted from Trail of Bits. Use after finding a bug to check if the same pattern exists elsewhere.","rubicanjr\u002FFinCognis","rubicanjr","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F234912519?v=4","01M6NT156NND8J474G34SB3923","Rubi","01M6NT15B70RWXE1N3YV0BZY8A",0,"MIT","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvariant-analysis\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"variant","analysis","variant analysis","bug","codebase","manual","pattern matching","propagate","matching","across","pattern","queries","search","use","check","find","ast","semgrep","codeql","tracing","2026-11-10 10:12:30",false,"---\nname: variant-analysis\ndescription: Find similar vulnerabilities across a codebase after discovering one instance. Uses pattern matching, AST search, Semgrep\u002FCodeQL queries, and manual tracing to propagate findings. Adapted from Trail of Bits. Use after finding a bug to check if the same pattern exists elsewhere.\n---\n\n# Variant Analysis\n\nWhen you find a bug, the same mistake almost certainly exists elsewhere. Variant analysis systematically hunts for siblings of a known vulnerability.\n\n## Process\n\n### Step 1: Characterize the Original Bug\n\nBefore searching, understand what makes this bug a bug:\n\n```\nORIGINAL BUG:\n  File: src\u002Fapi\u002Fusers.ts:42\n  Type: Missing input validation\n  Pattern: req.params.id used directly in DB query without sanitization\n  Root cause: Developer assumed framework sanitizes params\n  Trigger: Untrusted input reaches database query\n```\n\nExtract the **abstract pattern** -- not the specific code, but the class of mistake:\n- Missing validation at a trust boundary\n- Incorrect error handling in auth path\n- Race condition between check and use\n- Hardcoded secret in source\n- SQL injection via string concatenation\n\n### Step 2: Generate Search Queries\n\nFor each bug class, create multiple search strategies:\n\n#### Grep\u002FRipgrep (Fast, broad)\n```bash\n# Example: SQL injection via concatenation\nrg \"query\\(.*\\+.*\\)\" --type ts\nrg \"execute\\(.*\\$\\{\" --type ts\nrg \"\\.raw\\(.*\\+\" --type ts\n\n# Example: Missing auth middleware\nrg \"router\\.(get|post|put|delete)\\(\" --type ts -l | \\\n  xargs rg -L \"authenticate|authorize|requireAuth\"\n\n# Example: Hardcoded secrets\nrg \"(password|secret|key|token)\\s*[=:]\\s*['\\\"][^'\\\"]{8,}\" --type ts\n```\n\n#### Semgrep (AST-aware, precise)\n```yaml\n# Example: SQL injection\nrules:\n  - id: sql-injection-concatenation\n    patterns:\n      - pattern: $DB.query($X + ...)\n      - pattern-not: $DB.query($X, [...])\n    message: \"Potential SQL injection via string concatenation\"\n    severity: ERROR\n\n# Example: Missing null check before use\nrules:\n  - id: null-deref-after-find\n    patterns:\n      - pattern: |\n          const $X = await $DB.findOne(...)\n          ...\n          $X.$PROP\n      - pattern-not: |\n          const $X = await $DB.findOne(...)\n          ...\n          if ($X) { ... }\n    message: \"Using findOne result without null check\"\n    severity: WARNING\n```\n\n#### CodeQL (Deep analysis)\n```ql\n\u002F\u002F Example: Tainted data reaching SQL\nimport javascript\n\nfrom CallExpr call, DataFlow::Node source, DataFlow::Node sink\nwhere\n  source = DataFlow::parameterNode(any(Function f).getAParameter()) and\n  sink = call.getArgument(0) and\n  call.getCalleeName() = \"query\" and\n  DataFlow::localFlow(source, sink)\nselect sink, \"Untrusted input flows to SQL query\"\n```\n\n### Step 3: Triage Results\n\nFor each match:\n\n| Status | Meaning | Action |\n|--------|---------|--------|\n| CONFIRMED | Same bug pattern, exploitable | File as finding |\n| LIKELY | Same pattern, needs deeper analysis | Investigate further |\n| MITIGATED | Pattern present but other controls prevent exploitation | Document as defense-in-depth gap |\n| FALSE POSITIVE | Pattern matches but context makes it safe | Document why it's safe |\n\n### Step 4: Report\n\n```\n## Variant Analysis Report\n\n**Original Finding**: [reference to original bug]\n**Pattern**: [abstract description of the vulnerability class]\n**Search Method**: [grep\u002Fsemgrep\u002Fcodeql\u002Fmanual]\n\n### Confirmed Variants\n\n1. **[SEVERITY]** file.ts:42 -- [description]\n2. **[SEVERITY]** other.ts:88 -- [description]\n\n### Likely Variants (Need Investigation)\n\n3. file2.ts:15 -- [why it might be vulnerable]\n\n### Mitigated Instances\n\n4. safe.ts:30 -- Same pattern but [mitigation] prevents exploitation\n\n### Statistics\n\n- Files scanned: X\n- Matches found: Y\n- Confirmed: Z\n- False positives: W\n```\n\n## Common Variant Patterns\n\n### Input Validation Variants\nIf one endpoint lacks validation, check ALL endpoints:\n```bash\n# Find all route handlers\nrg \"router\\.(get|post|put|delete|patch)\\(\" --type ts -n\n\n# Check each for validation middleware\n# Missing validation = variant\n```\n\n### Auth\u002FAuthz Variants\nIf one route lacks auth, check all routes:\n```bash\n# Find routes without auth middleware\nrg \"app\\.(get|post)\\(['\\\"]\" --type ts | grep -v \"auth\\|protect\\|require\"\n```\n\n### Error Handling Variants\nIf one catch block leaks info, check all catch blocks:\n```bash\nrg \"catch.*\\{\" -A 3 --type ts | grep -E \"res\\.(send|json).*err\"\n```\n\n### Crypto Variants\nIf one place uses weak crypto, check all crypto usage:\n```bash\nrg \"createHash\\(|createCipher\\(|randomBytes\\(\" --type ts\nrg \"MD5\\|SHA1\\|DES\\|RC4\" --type ts\n```\n\n### Race Condition Variants\nIf one TOCTOU exists, check similar check-then-act patterns:\n```bash\nrg \"if.*await.*find\" -A 5 --type ts | grep -E \"await.*(update|delete|create)\"\n```\n\n## Automation Integration\n\n### With coroner agent (post-mortem)\nAfter fixing a bug, coroner should:\n1. Call variant-analysis with the bug pattern\n2. Check all confirmed variants\n3. Create tasks for each variant fix\n\n### With security-reviewer agent\nDuring review, if a finding is discovered:\n1. Pause the linear review\n2. Run variant analysis for the finding class\n3. Include all variants in the review report\n\n### With code-reviewer agent\nWhen a fix is reviewed:\n1. Check if the fix addresses all known variants\n2. Verify the fix pattern is applied consistently\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|----------------|---------------|-----------------|\n| \"It's just one instance\" | Bugs travel in packs | Run variant analysis |\n| \"The other code is different\" | Same pattern, different syntax | Abstract the pattern |\n| \"We already fixed this area\" | Fix might be incomplete | Verify with search |\n| \"Semgrep didn't find anything\" | Rules might be too specific | Try multiple search methods |\n| \"It's too many results\" | Volume doesn't mean false positive | Triage each result |\n\nInspired by [Trail of Bits](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills) variant-analysis plugin.\n","# Variant Analysis\n\nWhen you find a bug, the same mistake almost certainly exists elsewhere. Variant analysis systematically hunts for siblings of a known vulnerability.\n\n## Process\n\n### Step 1: Characterize the Original Bug\n\nBefore searching, understand what makes this bug a bug:\n\n```\nORIGINAL BUG:\n  File: src\u002Fapi\u002Fusers.ts:42\n  Type: Missing input validation\n  Pattern: req.params.id used directly in DB query without sanitization\n  Root cause: Developer assumed framework sanitizes params\n  Trigger: Untrusted input reaches database query\n```\n\nExtract the **abstract pattern** -- not the specific code, but the class of mistake:\n- Missing validation at a trust boundary\n- Incorrect error handling in auth path\n- Race condition between check and use\n- Hardcoded secret in source\n- SQL injection via string concatenation\n\n### Step 2: Generate Search Queries\n\nFor each bug class, create multiple search strategies:\n\n#### Grep\u002FRipgrep (Fast, broad)\n```bash\n# Example: SQL injection via concatenation\nrg \"query\\(.*\\+.*\\)\" --type ts\nrg \"execute\\(.*\\$\\{\" --type ts\nrg \"\\.raw\\(.*\\+\" --type ts\n\n# Example: Missing auth middleware\nrg \"router\\.(get|post|put|delete)\\(\" --type ts -l | \\\n  xargs rg -L \"authenticate|authorize|requireAuth\"\n\n# Example: Hardcoded secrets\nrg \"(password|secret|key|token)\\s*[=:]\\s*['\\\"][^'\\\"]{8,}\" --type ts\n```\n\n#### Semgrep (AST-aware, precise)\n```yaml\n# Example: SQL injection\nrules:\n  - id: sql-injection-concatenation\n    patterns:\n      - pattern: $DB.query($X + ...)\n      - pattern-not: $DB.query($X, [...])\n    message: \"Potential SQL injection via string concatenation\"\n    severity: ERROR\n\n# Example: Missing null check before use\nrules:\n  - id: null-deref-after-find\n    patterns:\n      - pattern: |\n          const $X = await $DB.findOne(...)\n          ...\n          $X.$PROP\n      - pattern-not: |\n          const $X = await $DB.findOne(...)\n          ...\n          if ($X) { ... }\n    message: \"Using findOne result without null check\"\n    severity: WARNING\n```\n\n#### CodeQL (Deep analysis)\n```ql\n\u002F\u002F Example: Tainted data reaching SQL\nimport javascript\n\nfrom CallExpr call, DataFlow::Node source, DataFlow::Node sink\nwhere\n  source = DataFlow::parameterNode(any(Function f).getAParameter()) and\n  sink = call.getArgument(0) and\n  call.getCalleeName() = \"query\" and\n  DataFlow::localFlow(source, sink)\nselect sink, \"Untrusted input flows to SQL query\"\n```\n\n### Step 3: Triage Results\n\nFor each match:\n\n| Status | Meaning | Action |\n|--------|---------|--------|\n| CONFIRMED | Same bug pattern, exploitable | File as finding |\n| LIKELY | Same pattern, needs deeper analysis | Investigate further |\n| MITIGATED | Pattern present but other controls prevent exploitation | Document as defense-in-depth gap |\n| FALSE POSITIVE | Pattern matches but context makes it safe | Document why it's safe |\n\n### Step 4: Report\n\n```\n## Variant Analysis Report\n\n**Original Finding**: [reference to original bug]\n**Pattern**: [abstract description of the vulnerability class]\n**Search Method**: [grep\u002Fsemgrep\u002Fcodeql\u002Fmanual]\n\n### Confirmed Variants\n\n1. **[SEVERITY]** file.ts:42 -- [description]\n2. **[SEVERITY]** other.ts:88 -- [description]\n\n### Likely Variants (Need Investigation)\n\n3. file2.ts:15 -- [why it might be vulnerable]\n\n### Mitigated Instances\n\n4. safe.ts:30 -- Same pattern but [mitigation] prevents exploitation\n\n### Statistics\n\n- Files scanned: X\n- Matches found: Y\n- Confirmed: Z\n- False positives: W\n```\n\n## Common Variant Patterns\n\n### Input Validation Variants\nIf one endpoint lacks validation, check ALL endpoints:\n```bash\n# Find all route handlers\nrg \"router\\.(get|post|put|delete|patch)\\(\" --type ts -n\n\n# Check each for validation middleware\n# Missing validation = variant\n```\n\n### Auth\u002FAuthz Variants\nIf one route lacks auth, check all routes:\n```bash\n# Find routes without auth middleware\nrg \"app\\.(get|post)\\(['\\\"]\" --type ts | grep -v \"auth\\|protect\\|require\"\n```\n\n### Error Handling Variants\nIf one catch block leaks info, check all catch blocks:\n```bash\nrg \"catch.*\\{\" -A 3 --type ts | grep -E \"res\\.(send|json).*err\"\n```\n\n### Crypto Variants\nIf one place uses weak crypto, check all crypto usage:\n```bash\nrg \"createHash\\(|createCipher\\(|randomBytes\\(\" --type ts\nrg \"MD5\\|SHA1\\|DES\\|RC4\" --type ts\n```\n\n### Race Condition Variants\nIf one TOCTOU exists, check similar check-then-act patterns:\n```bash\nrg \"if.*await.*find\" -A 5 --type ts | grep -E \"await.*(update|delete|create)\"\n```\n\n## Automation Integration\n\n### With coroner agent (post-mortem)\nAfter fixing a bug, coroner should:\n1. Call variant-analysis with the bug pattern\n2. Check all confirmed variants\n3. Create tasks for each variant fix\n\n### With security-reviewer agent\nDuring review, if a finding is discovered:\n1. Pause the linear review\n2. Run variant analysis for the finding class\n3. Include all variants in the review report\n\n### With code-reviewer agent\nWhen a fix is reviewed:\n1. Check if the fix addresses all known variants\n2. Verify the fix pattern is applied consistently\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|----------------|---------------|-----------------|\n| \"It's just one instance\" | Bugs travel in packs | Run variant analysis |\n| \"The other code is different\" | Same pattern, different syntax | Abstract the pattern |\n| \"We already fixed this area\" | Fix might be incomplete | Verify with search |\n| \"Semgrep didn't find anything\" | Rules might be too specific | Try multiple search methods |\n| \"It's too many results\" | Volume doesn't mean false positive | Triage each result |\n\nInspired by [Trail of Bits](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills) variant-analysis plugin.\n",{"name":5,"description":7},"main","70e1c350500ee750987420bbae48837afa906b7e","skills\u002Fvariant-analysis","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis","https:\u002F\u002Fgithub.com\u002Frubicanjr","linktr.ee\u002Ffinanskodu","Industrial Engineer & CIO @FinansKodu. Architecting AI-driven financial agents and autonomous workflows. 🏗️ Building systems, not just prompts.","2026-06-09 13:50:15",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add rubicanjr\u002FFinCognis --skill variant-analysis",{"tool":58,"command":59},"bunx","bunx skills add rubicanjr\u002FFinCognis --skill variant-analysis",{"tool":61,"command":62},"pnpm","pnpm dlx skills add rubicanjr\u002FFinCognis --skill variant-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvariant-analysis\u002FSKILL.md",true,[],[67,88,97,117,145,164],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":78,"publishedAt":39},"01M6NWS9DAXJTADT4T5MB49X8W","workflow-router","Goal-based workflow orchestration - routes tasks to specialist agents based on user goals","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-router\u002FSKILL.md",[73],{"categoryNo":74,"categoryName":75,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[79,80,81,82,83,84,85,86,87],"workflow router","workflow","router","orchestration","goals","goal","user","workflow orchestration","tasks",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":39},"01M6NWS3RETSC0SHP16HP66E14","wiring","Wiring Verification","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwiring\u002FSKILL.md",[],[90,95,96],"verification","false",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":106,"publishedAt":39},"01M6NWS0XW9CVQZBDA1EGW0TWC","websocket-patterns","Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwebsocket-patterns\u002Fskill.md",[103],{"categoryNo":104,"categoryName":105,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000015","视觉设计",[107,108,109,110,111,112,113,114,115,116],"websocket","patterns","websocket patterns","design","protocol","management","message","strategies","binary","connection",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":127,"publishedAt":39},"01M6NWRDQDX9ZNETAWRRMQWV52","visual-verdict","Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS\u002FREVISE\u002FFAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-verdict\u002FSKILL.md",[123,126],{"categoryNo":124,"categoryName":125,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":74,"categoryName":75,"taxonomyType":76,"taxonomyTypeDesc":77},[128,129,130,131,28,132,133,134,135,136,137,138,139,110,140,141,142,143,32,144],"visual","verdict","visual verdict","ui","revise","comparison","correctness","implementing","for","fixes","dimensions","frontend","development","qa","screenshot","returns","frontend development",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":39},"01M6NWR8HSNRS7MNDK2J02QYMN","verification-loop","Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[152,153,95,154,155,156,157,158,159,160,161,162,163],"verification loop","loop","lint","review","security","pr","system","diff","build","tests","diff review","types",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":39},"01M6NWR4HHSFR0VR5EXFRWA747","vector-db-patterns","Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvector-db-patterns\u002Fskill.md",[],[171,172,173,174,108,175,31,176,177,114,178,179,180,181,182,136,183,184],"vector db patterns","vector db","db","vector","semantic search","embedding strategies","algorithms","chunking","semantic","retrieval","embedding","Hybrid Search","hybrid","rag"]